In order to achieve the efficient use of energy, improve power supply reliability and energy saving and environmental benefits, this paper based on the randomness and volatility of the new energy generation in the grid-connected microgrid, establishes the annual average cost and self-balancing ability as the objective multi-objective function with the opportunity constraint theory as the tool, considering the constraints of microgrid in operation, the NSGA-II algorithm based on Monte Carlo simulation is used to obtain the annual average cost under different self balance rate,and then use the utility theory to find three typical different weights under the configuration program, select one of its simulation of this, to study the average annual comprehensive cost under different confidence levels, and provide effective guidance for microgrid research.