Surface discharge is one of the reasons of insulation failure. Polyimide(PI) is used in gas-solid insulation of high frequency electric power equipment. Therefore, based on density functional theory, the effects of PI and affected by polar group OH- which their single molecular chain structure, energy level and density of states, electrostatic potential, excited state and other micro parameters under external electric field on trap formation and surface discharge are discussed from the atomic and molecular level. The results show that the structure of PI is crimped and the dipole moment increases under external electric field, which is easy to accumulate charge to form space charge center, especially after the introduction of polar group OH-. In the PI molecules, hole traps are formed in the benzene ring region, and electron traps are formed in the imide ring region. The number of electron trap energy levels is large, in which the space charge trap depth gradually deepens with the increase of external electric field. After the introduction of polar group OH-, the excitation energy of PI molecules decreases, which makes the electrons inside the molecules become easily excited. The spatial separation of electrons and holes decreases with the increase of electric field, which is conducive to the recombination of holes and electrons to emit photons.