## 1 Introduction
In order to reduce operation cost, improve renewable energy consumption and enhance system reliability, many optimal schemes for energy management [15] of interconnected MGs have been proposed by some researchers, which can be classified into centralized and decentralized schemes [26]. The centralized scheme would be to solve the optimization problem by means of a coordinating entity (CE) with global operational data. In this context, [27] proposes a centralized scheme for energy management of multiple MGs by taking the cost minimization as the objective. However, a centralized scheme presents a number of weak points since MGs may belong to different economic entities. Moreover, it is difficult to meet the huge data communication requirements. In contrast, the decentralized method not only can protect the critical information of MGs, but it also would reduce the optimization complexity for CE. A distributed robust energy management scheme for an MMG system in the real-time energy market is proposed in [28]. For optimal operation of the MMG system, a coordinator is necessary to facilitate the arrangement of energy sharing; thus, we propose an energy sharing provider (ESP) to minimize system power loss cost. The relationship between ESP and multiple MGs is a bidirectional interactive process. In this regard, distributed optimization can be achieved with bidirectional interaction between ESP and MGs by using the alternating direction method of multipliers (ADMM). However, other distributed optimal schemes may solve the problem differently without the interaction process, which also means that the energy sharing management may be difficult for applications. The objective of energy sharing management of the MMG system can be regarded as having two parts, that is the cost of MGs and the cost of ESP, which are convex functions and in accordance with the condition of using ADMM. In particular, the alternating iteration of variables in the ADMM algorithm can describe the bidirectional interaction between ESP and MGs. Therefore, it is suitable to model the energy sharing management of the MMG system by using ADMM. To this end, the energy sharing framework of multiple MGs based on ADMM has been highlighted in this paper, which can reduce power loss and operation cost. Based on the energy sharingframework, optimal scheduling can be achieved through the bidirectional interaction between MGs and ESP. First, considering the local operation cost, each MG decides the expected exchange power and submits it to ESP. Combined with the data from MGs, the ESP decides the adjusted expected exchange power taking into account its objective. The optimal scheduling can be realized until the expected exchange power decided by the MGs is equal to the adjusted expected exchange power decided by the ESP. Only the expected exchange power is required during iterations, which safeguards the local information of MGs. Motivated by the above facts, we propose a distributed optimal dispatching method of interconnected MGs with BESS and RESs based on ADMM. The main contributions of this paper are as follows. 1. An energy sharing structure is proposed to integrate the neighboring MGs into an energy sharing zone. Besides, a virtual entity called ESP, which acts as an agent for multiple MGs, is introduced to minimize power loss cost. 2. Based on the framework of ADMM, a distributed optimal scheduling model and a two-level iterative algorithm for the MGs and ESP in coalition are proposed, which minimize the total operation cost including purchasing electricity cost, energy storage cost and power loss cost in coalition. The power loss cost can be decreased by the proposed method effectively. 3. An energy sharing framework at the distribution network level is proposed. Through bidirectional interaction between MGs and ESP, the optimal scheduling can be achieved until the expected exchange power decided by MGs is equal to the adjusted expected exchange power decided by ESP.