Phase-locked loop (PLL) technique is a critical control module applied in photovoltaic (PV) grid-connected control system to synchronize with grid voltage. The PLL error directly affects the response characteristic of PV grid-connected inverter under faults, leading to a mass of harmonic components in the output current of the PV inverter. Especially in the scenario of short-circuit fault with deep voltage sag, the PLL detection error is too significant to be ignored, posing challenges to transformer differential protection. This paper proposes an improved scheme that utilizes a digital computer algorithm to record and store pre-fault voltage, aiming to address the complexity and implementation challenges for phase-lock error in practical engineering applications. By utilizing the memory voltage, the PLL detection error is eliminated, mitigating harmonic distortion in the PV output current and ensuring the reliability of the transformer differential protection. However, introducing memory voltage may increase the short-circuit current of the PV output. Therefore, it is recommended to reduce the amplitude of the short-circuit current by multiplying the inverter port voltage reference value by an appropriate limiting coefficient k and outputting it to the physical system. Finally, the effectiveness of the proposed scheme is verified through MATLAB/Simulink simulation.