With the development of microgrid, the study of inter-connection of microgrids is getting more attention. In order to ensure the power quality and operational stability of interconnected microgrids, energy storage systems play an important role. At the same time, in order to achieve the optimal operation of the interconnected microgrids, the sizes of energy storage units should be coordinated. In his paper, the model of interconnected microgrids is built via MATLAB. In addition, considering power flow between inter-microgrids, as well as between traditional power grid and micro-grid, based on lowest transmission power loss and time-sharing purchase/sale price ,the objective equation and its constrains are established, and the improved particle swarm optimization is used to solve this problem to get the configuration parameters of energy storage system. The results indicate that the method could get better economic performance under the premise of satisfying the system stability requirement.