Faced with energy depletion and increasingly serious environmental pollution, photovoltaic power generation has gradually become an effective way of power supply and energy development, and short-term photovoltaic power prediction has gradually attracted attention. This paper proposes a short-term photovoltaic power prediction method based on the PSO-GRU model. After the PSO joins the adaptive mutation operation, the key hyperparameters in the GRU are optimized to reduce the training cost. Subsequently, GRU is used for power prediction, and compared with other algorithms to evaluate the performance of the PSO-GRU model. The results show that the PSO-GRU model is more suitable for short-term power prediction under photovoltaic environment, and the prediction effect is better.