The prevalence of extreme weather events gives rise to a significant degree of prediction bias in the forecasting of photovoltaic (PV) power. In order to enhance the precision of forecasting outcomes, this study examines the interrelationships between China’s 24 conventional solar terms and extreme meteorological events. Additionally, it proposes a methodology for estimating the short-term generation of PV power based on the division of solar term time series. Firstly, given that the meteorological data from the same festival is more representative of the climate state at the current prediction moment, the sample data are grouped according to the 24 festival time nodes. Secondly, a convolutional neural network–long short-term memory (CNN-LSTM) PV power prediction model based on an Attention mechanism is proposed. This model extracts temporal change information from nonlinear sample data through LSTM, and a CNN link is added at the front end of LSTM to address the issue of LSTM being unable to obtain the spatial linkage of multiple features. Additionally, an Attention mechanism is incorporated at the back end of the CNN to obtain the feature information of crucial time steps, further reducing the multi-step prediction error. Concurrently, a PV power error prediction model is constructed to rectify the outcomes of the aforementioned prediction model. The examination of the measured data from PV power stations and the comparison and analysis with other prediction models demonstrate that the model presented in this paper can effectively enhance the accuracy of PV power predictions.