Wind turbine, photovoltaic and other power supply connected to the grid operation brings new critical problems to traditional reactive power optimization. Considering the safety and stability of operation, a reactive power optimization model with two objectives of minimum voltage offset and minimum network loss is established. In MATLAB, the reactive power optimization simulation analysis of the IEEE33 system connected with a wind turbine and photovoltaic is carried out, and the MOPSO algorithm is used to solve the reactive power optimization model. The multi-objective MOPSO algorithm is optimized to improve the stability of power grid operation and reduce the fluctuation of power flow. The network loss is reduced, and the effectiveness of the strategy is verified.