Distribution network is located in the terminal of the power system, directly facing the power consumers, so the power quality problems caused by different electricity demand will directly affect the safe operation of the distribution network. In order to solve the problem of power quality, this paper puts forward a combined device of D-STATCOM and superconducting magnetic energy storage system (SMES). The control strategy and the optimization strategy of the combined device are also proposed. The D-STATCOM with SMES can compensate the active power and reactive power in the distribution network, so that the frequency of the system and voltage of the bus can be effectively controlled. Based on the optimized configuration of the D-STATCOM with SMES by the improved particle swarm optimization algorithm(IPSO), the voltage and power fluctuations of the bus and the equipment costs are minimized. The simulation results show that, SMES as an energy storage device combined with D-STATCOM can get better power quality in the distribution network than the conventional D-STATCOM.