Power generation and transmission infrastructure is vulnerable to the interaction of various Distributed Generations (DG), which leads to the imbalance of power system operation, frequent voltage drops or spikes, and even power outages. This phenomenon not only wastes energy, but also affects grid security. The main reason is a delayed feedback of circuit failure and load changes, and the optimization of energy management system and path is an effective way to solve the above problems. In this paper, a method of multi-objective optimization based on ANFIS algorithm is proposed which can help to improve the demand response, energy storage and management of smart power grid, reduce the volatility of DGs, reducing electricity costs and improving energy efficiency. Firstly, based on the ANFIS algorithm, the distributed power generation control mode, inverter control, real-time electricity price calculation method, energy transfer and storage scheme are improved, and the optimization path of the energy management system is defined. Secondly, the advantages of ANFIS algorithm in response speed and running stability are verified by comparing with other algorithms. Finally, a distributed energy microgrid is constructed for simulation verification. The results show that :(1) ANFIS optimization algorithm has good adaptability in smart grid, and has advantages in large amount of data processing and information transmission; (2) The verification model based on ANFIS has strong elasticity and efficient response speed. The research results will help solve various problems in the smart grid, including establishing a clear energy management system path, maintaining the stable operation of the power system, providing users with more reasonable power plans and the lowest cost of electricity.