Based on the Z-source inverter (ZSI), a unified control strategy of grid-connected photovoltaic (PV) system is investigated. It can both compensate the reactive power and restrain the current harmonics. At first, the principle of the proposed unified control is analysed. Then, the space vector pulse width modulation (SVPWM) is improved for inserting the shoot-through time into the modulation period. Simulation results show that the proposed unified control strategy is feasible and effective. Besides, a hardware controller is designed based on the digital signal processor (DSP). The corresponding approach for applying the improved SVPWM with the DSP and the driver circuit is illustrated in detail. Eventually, an experiment apparatus is implemented. Experiment results reveal that the proposed unified control strategy can effectively regulate active and reactive power generated by the grid-connected PV system. Besides, the fifth current harmonic of grid can be restrained effectively, the total harmonic distortion of the grid current decreases from 20.9 to 8.1%, which indicates that the restraint of the current harmonics is feasible for the proposed unified control strategy.