Due to the double frequency pulsation of the output power of the grid-connected inverter, a secondary voltage ripple appears in the voltage of the decoupling capacitor at the front stage of the non-isolated single-phase photovoltaic grid-connected inverter system, which further controls the voltage outer loop and the current inner loop. The third harmonic of the inverter"s grid-connected current reference exists. In order to effectively suppress the third harmonic of the grid-connected current, the collected voltage values are processed from the bus voltage point of view. This paper presents a method to compensate the secondary ripple voltage of DC bus. This method can significantly improve the quality of grid-connected current, and it can effectively suppress the third harmonic of grid-connected current. Finally, the effectiveness of the proposed compensation method is proved by simulation and experimental results.