In recent years, with the large-scale access of distributed generation (DG), the line voltage of the distribution network will be offset, which will adversely affect users. This paper aims at the voltage adjustment of the distribution network. Firstly, the reactive power control methods of distributed static synchronous compensator (DSTATCOM) and electric spring (ES) are studied separately, and then a layered cooperative control strategy based on them is proposed, which combines centralized compensation and distributed compensation to stabilize the entire line voltage. The upper layer aims at optimizing the comprehensive factors including voltage offset, user comfort and cost, and applies the dynamic adaptive particle swarm optimization (DAPSO) algorithm to study the optimal scheme of voltage adjustment. The lower layer designs the control loops of the compensation devices in response to the reactive power instruction. Finally, simulation results show that the voltage of the distribution network is effectively controlled.