For the energy storage system participating in the grid voltage sag compensation service, a location and capacity determination method based on the joint compensation strategy of distributed energy storage systems and dynamic voltage restorer is proposed. Firstly, a two-layer siting and determining capacity model for distributed energy storage systems is established, with the upper layer aiming to minimize the installation cost of distributed energy storage systems and the voltage crossing cost of sensitive loads, and determine the optimal access point for energy storage system. The lower layer determines the optimal configuration capacity of the energy storage system by targeting the compensation cost of the energy storage system, the dynamic voltage restorer, and the voltage satisfaction of sensitive loads. Then, the arithmetic simulation with IEEE33 bus system shows that the proposed method can select a reasonable access point for energy storage system and reduce the configuration capacity.