The present invention relates to a method for realizing single-phase phase-locked loop by adopting software, comprising the following steps of: constituting an input signal in an alpha-beta coordinate system with a standard signal as a reference (1); carrying out PI adjustment through the output of dq0 conversion q axle component based on the instantaneous reactive power theory, carrying out frequency correction through the output of the PI adjustment step, using an output signal of the frequency correction step as a reference, and carrying out phase correction through using the integration step (2); designing a low pass filter and ensuring the speed and the accuracy of the tracking of the phase-locked loop (3); speeding up the calculation by adopting 16 bit fixed point TMS320C2812DSP programming (4). The method adopts closed-loop control, which is high in stability and quick in tracking speed, with the transient response time less than 0.04s and wide frequency range of the locked phase between about 45 and 55Hz, is not interfered by the harmonic waves and the twinkling fluctuation of the system voltage or current, can accurately and quickly track the fundamental wave frequency and the phase information of the voltage and current in an electric power system, and provides system synchronous frequency signals for active filters and dynamic voltage adjustors, etc.