With the increasing penetration of distributed photovoltaic power stations in the power system, a hybrid optimization method, PSO-CNN-GRU, is proposed to ensure the secure and stable operation of the power grid. Utilizing CNN feature extraction and GRU model modeling, this method enhances the accuracy and robustness of photovoltaic power prediction. The improved PSO algorithm exhibits global optimization capability, facilitating the faster and more accurate determination of optimal hyperparameters for CNN-GRU. Finally, simulations are conducted using data from the He 19- 46 power station in the Changqing Oilfield. Experimental results indicate that the proposed method outperforms various other models in terms of predictive accuracy. The results validate the effectiveness and superiority of the proposed approach in enhancing predictive accuracy. This research is crucial for accurate photovoltaic power prediction, offering valuable insights for the sustainable development of power systems.