When the power grid impedance mutates, the output power of the grid-connected photovoltaic power generation system controlled by drooping will become very unstable. To solve this problem, an improved droop control algorithm based on network impedance detection is proposed. Taking photovoltaic grid-connected power generation system as the research object, the influence of power grid impedance on traditional droop control is firstly expounded by introducing power grid impedance value into traditional droop control. Then the method of real-time network impedance extraction is introduced. Furthermore, according to the bandwidth and phase angle constraints of the equivalent output impedance phase frequency characteristics of the photovoltaic grid-connected inverter, the controller parameters are updated in real time to achieve the purpose of adaptive network impedance mutation. Finally, the proposed method is tested and verified by real-time simulation in the loop respectively. The results show that the proposed method is correct.