Dipole approximation is a common simplified method in magnetic field research, which is widely used in magnetic anomaly detection, control of magnetic device and magnetic field experiment. The accuracy of magnetic dipole approximation will determine the upper limit of related applications. Previous studies have shown that the dipole approximation of a typical magnetic dipole simulator (e.g., a solenoid coil) can lead to a positioning error of up to 50% in localization of magnetic object in near field. In order to solve this problem, this paper aims to design a coil structure that fits well with the standard magnetic dipole. Firstly, the structure of cylindrical solenoid with planar symmetry and rotational symmetry is optimized and analyzed. On this basis, a multi-layer solenoid structure with rotational symmetry and plane symmetry is proposed. Then, the coil structure is optimized by gradient descent method, taking the inner and outer radius, height, layer spacing and quantity of the solenoid as variables. Compared with the traditional coil, this coil structure can greatly reduce the error of dipole approximation, and has the advantages of large magnetic moment and small geometric size. Simulation results show that the positioning error percentage can be reduced to less than 0.2% when the new-type coil is tested in the same area.