Ptychography can reconstruct the complex amplitude distribution of the transmission object from the overlapped diffraction patterns. The extended ptychographical iterative engine (ePIE) algorithm is considered as one of the most popular phase retrieval algorithms of present time which has strong robustness and high image quality. However, no constraint is added in the iteration process, which results in slow convergence and makes the real-time imaging difficult. To overcome this problem, an efficient phase retrieval algorithm is proposed based on the constraint of positive absorption in the object plane where the absorption coefficient and phase distribution of the object are constrained by the positive absorption of the object. The simulation demonstrated that the proposed algorithm has greatly improve the convergence rate and imaging quality of traditional ePIE algorithm and is expected to be applied in real-time imaging.