The content of dissolved gas in transformer oil is an important characteristic to reflect the operating condition of transformers. To overcome the problems that the traditional transformer oil chromatography gas prediction model cannot effectively use the older transformer oil chromatography data and it is difficult to track the transformer oil chromatography data under abnormal conditions and it can only rely on experience to adjust the model parameters, we introduce Gated Recurrent Unit (GRU), Attention Mechanism (APM) and Particle Swarm Optimization (PSO) to construct the Attention-PSO-GRU prediction model. The experimental results show that the Attention-PSO-GRU model can reach 97.9% accuracy in predicting the normal transformer oil chromatography data and has a better tracking ability for the abnormal transformer oil chromatography data. Therefore, the Attention-PSO-GRU model proposed in this paper can effectively improve the accuracy of transformer oil chromatography gas prediction, which has practical significance for preventing transformer faults and ensuring the safe and stable operation of power systems.