A two-stage optimization model for the location of distribution grid energy storage (ES) configuration and its capacity determination is proposed for different operating conditions of the distribution grid, consider the impact of microgrid cluster operation strategies and sub-microgrid cooperation on the distribution network (DN). In the first stage, location, number of ES devices, the charging/discharging strategy were solved for using GAMS software, the minimum operating cost of the distribution system is used as the target for the daily operating timescale. In the second stage, the minimum annual operating cost is taken as the target for a one-year time scale, consisting of investment, ES equipment’s operation and maintenance in the DN, and is solved using a particle swarm optimisation algorithm with nested ES lifetime calculations in MATLAB software. The calculations show that the optimal allocation method of ES equipment in DN can effectively reduce the operating costs of DN as well as the investment and maintenance costs of ES under different operating conditions, taking into account the economic operation of microgrid clusters and distribution systems. As a result, the economy of the DN can be substantially improved.