This paper considers the economy and stability of the microgrid cluster system, and proposes a two-level energy optimization dispatching strategy for the microgrid cluster, which aims to coordinate the economic benefits and operational risks of the microgrid while reducing the interactive power and fluctuations between the microgrid cluster and the distribution network, and reduce line loss. The first level takes the microgrid as the research object, takes the highest economic benefit and the lowest operational risk as the optimization goals, uses the improved PSO algorithm to solve the problem, and builds the unit risk-economic benefit ratio screening solution set, and then formulates the internal dispatching candidate strategy of the microgrid. The second level is based on the premise that the interactive power between the microgrid cluster and the distribution network is minimized, and the optimal internal dispatching strategy of each microgrid is determined. Then the line loss of the microgrid cluster system is considered, and the microgrid cluster energy complementary scheme is formulated. Finally, a practical example verifies the feasibility and effectiveness of the two-level dispatching strategy and the improved algorithm.INDEX TERMS microgrid, microgrid cluster, multi-objective, improved particle swarm optimization algorithm, two-level optimization model