Some distributed power generation in microgrid has intermittent and random characteristics, which has a negative impact on the power supply stability and reliability of the system. Therefore, it is necessary to carry out the energy management of microgrid system. The traditional particle swarm optimization algorithm is easy to fall into local optimum in solving the energy problem of management, in order to solve this problem, this paper introduces a hybrid particle swarm optimization algorithm, considering the micro grid economy, environmental protection and reliability requirements, established the minimum cost of the micro grid energy management optimization model to run the lowest cost, pollutant treatment. When the power balance and the output power of the distributed power supply are satisfied, the model is solved. At the same time, the change of the load demand in the system is predicted to determine the energy management strategy of microgrid. Simulation results show the effectiveness of the proposed algorithm and its strategy.