Micro grid using clean and efficient micro power generation ,not only improves the power supply reliability of power grid ,but also improves the utilization ratio of energy ,reduce the pollution of the environment .In this paper , from two aspects of the economic cost and environment benefits the economic performance of the micro grid is analyzed ,mathematical model was established based on power generation costs and environmental costs ,to solve the problem by using immune algorithm .The results showed: the algorithm combined model can improve the power generation efficiency of various distributed power, coordinated the complex relationship between them, the reasonable arrangement of power output, to achieve the overall efficiency of the optimal.