In western China, photovoltaic and energy storage microgrid systems are often used to solve local clean energy supply problems. This paper studies the energy management strategy of a typical photovoltaic energy storage microgrid in western China. Propose a novel optimization method of operation strategy based on particle swarm optimization, get the optimal setting scheme of important parameters of the energy management strategy. The historical data of the actual demonstration system is used to simulate and verify the optimized energy management strategy. The simulation results prove that the proposed method can improve the operating effect of the photovoltaic and energy storage microgrid, we can better results in many aspects such as photovoltaic power generation utilization rate, load loss rate, and economy.