Photovoltaic power station short-term output prediction method and system based on LightGBM-Attention GRU combination model
By combining the prediction results of LightGBM and AttentionGRU models, the problem of difficulty in scene migration of a single model in the short-term output prediction of photovoltaic power stations is solved, and the accuracy and stability of the prediction are improved.
Patent Information
- Application Number
- CN202411448190.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-10-17
AI Technical Summary
Among the existing short-term output prediction methods for photovoltaic power plants, it is difficult for a single model to migrate scenes, resulting in low prediction accuracy and stability.
Using the prediction method based on the LightGBM-AttentionGRU combination model, multiple features are constructed and corrected by obtaining and preprocessing the multi-source numerical meteorological forecast data and historical actual output data, and combining the prediction results of LightGBM and AttentionGRU models for inverse error weighting. and, obtain the final short-term output prediction results.
It improves the limitations of the difficulty in scenario migration of a single model, and significantly improves the accuracy and stability of short-term output prediction of photovoltaic power plants.
Smart Images

Figure CN119514754A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of short-term output prediction of photovoltaic power stations, and in particular to a method, system, storage medium and electronic device for short-term output prediction of photovoltaic power stations based on a LightGBM-AttentionGRU combined model. Background Art
[0002] The short-term output forecast of photovoltaic power stations plays a vital role in the power system. It helps the power system dispatching department to adjust the operation mode in time and ensure the safe and stable operation of the power grid by accurately predicting the power generation capacity of photovoltaic power stations. This process not only improves the economy and reliability of the power system, but also promotes the effective consumption of renewable energy and reduces the adverse effects caused by fluctuations in photovoltaic power generation. In addition, photovoltaic output forecasting also provides decision-making support for power market participants, optimizes power buying and selling strategies, and promotes the optimization and transformation of energy structure. It is one of the key technologies for realizing smart grids and sustainable development.
[0003] In the relevant technologies, the short-term output forecasting methods of photovoltaic power stations are mainly divided into three categories: physical methods, statistical methods and machine learning methods. Among them, the machine learning methods mainly include decision trees, long short-term memory neural networks (LSTM), etc., which can directly mine the change rules from the historical photovoltaic output data and NWP data for forecasting, and are the main methods and research hotspots for photovoltaic output forecasting.
[0004] However, decision tree models are overly sensitive to noise in data, prone to overfitting, and have limited ability to capture nonlinear relationships. The prediction results of a single decision tree model may fluctuate greatly due to slight changes in the data set, resulting in reduced model stability and reliability. LSTM (Long Short-Term Memory) is a type of recurrent neural network (RNN) that can learn and memorize long-term dependencies, but it also has problems such as high computational complexity, long training time, gradient vanishing, and high consumption of computing resources.
[0005] In view of this, it is necessary to provide a machine learning solution based on a combined model to improve the limitation of a single model that is difficult to migrate scenarios and improve the accuracy of model predictions. Summary of the invention
[0006] 1. Technical issues to be solved
[0007] In view of the shortcomings of the prior art, the present invention provides a method, system, storage medium and electronic device for short-term output prediction of photovoltaic power stations based on the LightGBM-AttentionGRU combined model, which solves the technical problem that a single model is difficult to migrate scenes.
[0008] (II) Technical solution
[0009] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0010] A method for short-term output prediction of photovoltaic power stations based on the LightGBM-AttentionGRU combined model, including:
[0011] Acquire and preprocess multi-source numerical meteorological forecast data and the first historical actual output data of the photovoltaic power station to be predicted;
[0012] Based on the preprocessed multi-source numerical meteorological forecast data and the first historical actual output data, a plurality of features are constructed; wherein the features at least include irradiance features, statistical features, polynomial features, sliding window features and hysteresis features;
[0013] Based on the correlation coefficient between each of the features and the target output, modify each of the features;
[0014] Use the corrected features as the input of the pre-trained LightGBM model to obtain the first prediction result;
[0015] The corrected features and the first prediction result are used as inputs of the pre-trained AttentionGRU model to obtain the second prediction result;
[0016] The first prediction result and the second prediction result are weightedly summed using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted.
[0017] Preferably, the irradiance characteristics include the peak irradiance of the day and the difference between the irradiance at each moment and the peak irradiance;
[0018] The statistical characteristics include one or a combination of any of the following: mean value, standard deviation, coefficient of variation, skewness, kurtosis, range and total added value;
[0019] The polynomial features refer to multiple new combined features obtained by performing addition, subtraction, multiplication and division operations on irradiance features or statistical features;
[0020] The sliding window feature refers to using the historical actual output data from 2 to 8 days before the target date;
[0021] The lagging feature refers to the historical actual output data of the target day one week before and after the historical period.
[0022] Preferably, the multi-source numerical meteorological forecast data includes EC and GFS forecast data, and the characteristics specifically include:
[0023] EC / GFS shortwave downward irradiance, EC / GFS peak irradiance for the day, the difference between EC / GFS irradiance and peak irradiance, GFS cloud cover, EC / GFS surface wind speed, EC humidity, EC air pressure, EC temperature, whether GFS has rain, whether GFS has snow, 0.8*EC irradiance+0.2*GFS irradiance, the square of EC irradiance, the sliding window characteristics of the actual output on date D-1 / D-2 / D-3 and the lag characteristics of the week before and after the same date D+1 of the previous year; where D represents the day.
[0024] Preferably, the training process of the LightGBM model includes:
[0025] Obtain and preprocess historical EC and GFS forecast data and second historical actual output data;
[0026] Based on the preprocessed historical EC and GFS forecast data, the irradiance features are constructed, and based on the preprocessed historical EC and GFS meteorological fields, the statistical features and polynomial features are constructed respectively;
[0027] Based on the preprocessed second historical actual output data, sliding window features and hysteresis features are constructed respectively;
[0028] The Boruta algorithm is used for feature selection to obtain multiple input features;
[0029] Calculating the correlation coefficient between each of the input mold features and the target output, modifying each of the input mold features, and obtaining feature data with preset weights;
[0030] A piece of preprocessed historical actual output data and corresponding feature data are spliced together as a piece of sample data;
[0031] Each of the sample data is used as the input of the LightGBM model, and Optuna is used to optimize the parameters until the model converges.
[0032] Preferably, the training process of the AttentionGRU model includes:
[0033] Each of the sample data and the corresponding third prediction result is used as the input of the AttentionGRU model, and optuna is used to optimize the parameters until the model converges; wherein the third prediction result is the prediction result obtained after the sample data is used as the input of the converged LightGBM model.
[0034] Preferably, the first prediction result and the second prediction result are weighted summed by using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted; expressed as:
[0035] f PV =ω L f L +ω G f G
[0036]
[0037]
[0038] Among them, f PV Indicates the final short-term output forecast result;
[0039] ω L 、f L Respectively represent the weight coefficient and the first prediction result of the LightGBM model;
[0040] ω G 、f G Represent the weight coefficient of the AttentionGRU model and the second prediction result respectively;
[0041] e L 、e G Represent the errors of the LightGBM model and the AttentionGRU model respectively.
[0042] A photovoltaic power station short-term output prediction system based on the LightGBM-AttentionGRU combined model, including:
[0043] A data acquisition module, used for acquiring and preprocessing multi-source numerical meteorological forecast data and first historical actual output data of the photovoltaic power station to be predicted;
[0044] A feature construction module, for constructing a plurality of features based on the preprocessed multi-source numerical meteorological forecast data and the first historical actual output data; wherein the features at least include irradiance features, statistical features, polynomial features, sliding window features and hysteresis features;
[0045] A feature correction module, used for correcting each of the features based on a correlation coefficient between each of the features and the target output;
[0046] The first output prediction module is used to use the corrected feature data as the input of the pre-trained LightGBM model to obtain a first prediction result;
[0047] A second output prediction module is used to use the corrected feature data and the first prediction result as inputs of a pre-trained AttentionGRU model to obtain a second prediction result;
[0048] The result fusion module is used to perform weighted summation on the first prediction result and the second prediction result by using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted.
[0049] A storage medium stores a computer program for short-term output prediction of a photovoltaic power station based on a LightGBM-AttentionGRU combined model, wherein the computer program enables a computer to execute the short-term output prediction method of a photovoltaic power station as described above.
[0050] An electronic device, comprising:
[0051] One or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a method for executing the photovoltaic power plant short-term output prediction method as described above.
[0052] (III) Beneficial effects
[0053] The present invention provides a method, system, storage medium and electronic device for short-term output prediction of photovoltaic power stations based on the LightGBM-AttentionGRU combined model. Compared with the prior art, it has the following beneficial effects:
[0054] In the present invention, multiple features are constructed based on preprocessed multi-source numerical meteorological forecast data and historical actual output data, and each feature is corrected based on the correlation coefficient between each feature and the target output; then the corrected features are used as inputs of the LightGBM model to obtain the first prediction result, and the corrected features and the first prediction result are used as inputs of the AttentionGRU model to obtain the second prediction result; finally, the inverse error method is used for weighted summation to obtain the final short-term output prediction result of the photovoltaic power station to be predicted. The combined model of the LightGBM model and the AttentionGRU model based on different underlying principles improves the limitation of a single model that is difficult to perform scene migration, and greatly improves the accuracy of short-term output prediction of photovoltaic power stations. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1A block diagram of a photovoltaic power station short-term output prediction method based on the LightGBM-AttentionGRU combined model provided in an embodiment of the present invention;
[0057] Figure 2 A comparison curve chart of the average accuracy of photovoltaic output prediction provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] The embodiments of the present application solve the technical problem of the limitation that a single model is difficult to perform scene migration by providing a method, system, storage medium and electronic device for short-term output prediction of a photovoltaic power station based on a LightGBM-AttentionGRU combined model.
[0060] The technical solution in the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
[0061] It should be noted that the difficulty in predicting photovoltaic output lies in its inherent intermittent and volatile nature, which makes predictions face many challenges. Photovoltaic power output is affected by a variety of meteorological factors such as solar radiation, temperature, cloud cover, rainfall and wind speed. The uncertainty and variability of these factors increase the complexity of prediction. In addition, differences in static information such as the geographic information, installation angle, and conversion efficiency of photovoltaic systems, as well as the accuracy of dynamic information such as real-time meteorological data, all have a significant impact on the prediction results. Existing prediction methods, whether based on physics-based models, time series methods, machine learning or deep learning prediction technologies, all need to process large amounts of data and establish accurate mapping relationships, which may be limited in actual operations due to factors such as data quality, computing resources, and model generalization capabilities.
[0062] In order to improve the accuracy and stability of short-term output prediction of photovoltaic power stations, this embodiment of the scheme targets the defects of decision tree model and LSTM model, comprehensively considers the problem that a single model is prone to overfitting and low prediction accuracy, and proposes a short-term output prediction method for photovoltaic power stations based on multi-source meteorological forecast and LightGBM-AttentionGRU combined model. This method constructs a gradient boosting tree (LightGBM) model and a gated recurrent network (AttentionGRU) model with a self-attention mechanism, uses the inverse error method to perform model fusion and outputs the final optimized prediction result.
[0063] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0064] Embodiment 1:
[0065] like Figure 1 As shown, the embodiment of the present invention provides a method for short-term output prediction of a photovoltaic power station based on a LightGBM-AttentionGRU combined model, including:
[0066] S1. Acquire and preprocess multi-source numerical meteorological forecast data and first historical actual output data of the photovoltaic power station to be predicted;
[0067] S2. constructing a plurality of features based on the preprocessed multi-source numerical meteorological forecast data and the first historical actual output data; wherein the features at least include irradiance features, statistical features, polynomial features, sliding window features and hysteresis features;
[0068] S3, based on the correlation coefficient between each of the features and the target output, modifying each of the features;
[0069] S4, using the corrected feature data as the input of the pre-trained LightGBM model to obtain the first prediction result;
[0070] S5. Using the corrected feature data and the first prediction result as input of a pre-trained AttentionGRU model to obtain a second prediction result;
[0071] S6. For the first prediction result and the second prediction result, a weighted sum is performed using the inverse error method to obtain a final short-term output prediction result of the photovoltaic power station to be predicted.
[0072] The embodiment of the present invention is based on a combination model of the LightGBM model and the AttentionGRU model with different underlying principles, which improves the limitation of a single model that is difficult to perform scene migration and greatly improves the accuracy of short-term output prediction of photovoltaic power stations.
[0073] Next, we will introduce the steps of the above scheme in detail:
[0074] In step S1, multi-source numerical meteorological forecast data and first historical actual output data of the photovoltaic power station to be predicted are acquired and preprocessed.
[0075] First of all, Numerical Weather Prediction (NWP) is a scientific method that uses mathematical models and computer technology to predict future weather conditions. The NWP model is based on the basic equations of atmospheric dynamics, thermodynamics, and fluid mechanics, which describe the conservation of mass, momentum, and energy in the atmosphere and the change of state. The forecast products generated by NWP include forecasts of meteorological elements such as temperature, humidity, wind speed, wind direction, air pressure, precipitation, cloud cover, and irradiance.
[0076] The embodiment of the present invention takes into account the problem of false alarms and deviations in a single weather forecast source, and integrates multiple weather forecast sources to improve the accuracy of weather forecast products.
[0077] Therefore, in this step, multi-source numerical weather forecasts are used, which are high-precision numerical weather forecasts provided by the European Centre for Medium-Range Weather Forecasts (ECMWF, hereinafter referred to as EC) and the Global Forecast System (GFS, hereinafter referred to as GFS) of the US Global Forecast Center. Among them, ECMWF is one of the world's leading institutions in the field of numerical weather forecasting, famous for its high-quality medium-range weather forecasts, and GFS is an important provider of global numerical weather forecast services.
[0078] Specifically, in this step, according to the longitude and latitude coordinates of the photovoltaic power station to be predicted, the meteorological forecast data corresponding to the longitude and latitude grid points closest to the coordinates of the photovoltaic power station are extracted from EC and GFS respectively as the multi-source numerical meteorological forecast corresponding to the photovoltaic power station.
[0079] For example, the Euclidean distance is used here to approximate the distance between the longitude and latitude coordinates, and the calculation formula is as follows:
[0080]
[0081] Among them, (x1, y1) and (x2, y2) represent the coordinates of any two points, and d represents the distance between the two points.
[0082] In addition, the first historical actual output data obtained in this step includes at least the historical actual output data of 2 to 8 days before the target date, and the historical actual output data of the target date in the same period of the past week before and after.
[0083] Furthermore, in this step, the multi-source numerical weather forecast data and the first historical actual output data are preprocessed, and the preprocessing process includes operations such as elimination, cleaning and data standardization, as described below:
[0084] Due to the large fluctuation of photovoltaic power output and the difference in time distribution with electricity load, the power system is difficult to adapt to the access of large-scale fluctuating new energy sources, and the photovoltaic power generation cannot be fully received and used by the power grid, resulting in difficulty in absorption and abandonment. However, the historical actual output data of photovoltaic power stations is the actual grid output, which cannot reflect the actual power generation capacity of photovoltaic power stations when the abandonment phenomenon occurs. Therefore, it is necessary to exclude the actual output data corresponding to this part of the abandonment and power restriction period.
[0085] Subsequently, data cleaning was performed on the eliminated multi-source numerical weather forecast data and historical actual output data. Data cleaning includes deleting redundant data, conflicting data and abnormal data in the original data, checking data consistency, and processing invalid values and missing values.
[0086] Finally, since the EC and GFS meteorological fields represent different meteorological factors and have different orders of magnitude, this step also performs data standardization on the meteorological fields.
[0087] In step S2, a plurality of features are constructed based on the preprocessed multi-source numerical meteorological forecast data and the first historical actual output data; wherein the features include at least irradiance features, statistical features, polynomial features, sliding window features and hysteresis features.
[0088] In this step, based on the preset feature engineering (including feature construction and feature screening), the following features are obtained:
[0089] (1) The irradiance characteristics include the peak irradiance of the day and the difference between the irradiance at each moment and the peak irradiance.
[0090] (2) The statistical characteristics include one or a combination of any of the following: mean, standard deviation, coefficient of variation, skewness, kurtosis, range and total added value.
[0091] (3) The polynomial features refer to multiple new combined features obtained by performing addition, subtraction, multiplication and division operations on irradiance features or statistical features.
[0092] (4) The sliding window feature refers to the use of historical actual output data from 2 to 8 days before the target date (i.e., D-1 to D-7 days).
[0093] (5) The lag feature refers to the historical actual output data of the target date D+1 for one week before and after the historical period.
[0094] Exemplarily, the features set in this step specifically include:
[0095] EC / GFS shortwave downward irradiance, EC / GFS peak irradiance for the day, the difference between EC / GFS irradiance and peak irradiance, GFS cloud cover, EC / GFS surface wind speed, EC humidity, EC air pressure, EC temperature, whether GFS has rain, whether GFS has snow, 0.8*EC irradiance+0.2*GFS irradiance, the square of EC irradiance, the sliding window characteristics of the actual output on date D-1 / D-2 / D-3 and the lag characteristics of the week before and after the same date D+1 of the previous year; where D represents the day.
[0096] In step S3, each of the features is corrected based on the correlation coefficient between each of the features and the target output.
[0097] In this step, the pre-calculated correlation coefficient between each feature and the target output is used as the weight of the feature to correct each feature.
[0098] In step S4, the corrected feature data is used as the input of the pre-trained LightGBM model to obtain the first prediction result.
[0099] First, let’s introduce the training process of the LightGBM model:
[0100] Step 10: Obtain and preprocess historical EC and GFS forecast data and second historical actual output data.
[0101] Step 20: Based on the preprocessed historical EC and GFS forecast data, construct irradiance features, and based on the preprocessed historical EC and GFS meteorological fields, construct statistical features and polynomial features respectively.
[0102] It can be understood that the solar radiation reaching the ground includes direct radiation and scattered radiation, and the sum of the two is called total radiation. Direct radiation refers to the solar radiation that reaches the ground directly without being scattered by any substance; scattered radiation refers to the solar radiation that reaches the ground after being scattered by the atmosphere and clouds. The radiation per unit area is called irradiance. And from the principle of photovoltaic power generation, it can be seen that the actual solar irradiance is positively correlated with the actual output of the photovoltaic power station. The actual size of photovoltaic power generation is largely determined by the actual irradiance.
[0103] Since irradiance has a strong periodicity, two features are constructed in this step to represent this periodicity, namely ① the peak irradiance of the day, and ② the difference between the irradiance at each moment and the peak irradiance. The former represents the highest level of irradiance on the day, and the latter represents the difference from the peak irradiance.
[0104] In addition, in order to make the model prediction more accurate, more influencing factors and the relationship between various meteorological factors need to be considered. Therefore, during the training process, statistical features and polynomial features are constructed based on the EC and GFS meteorological fields, respectively, so that the model can better learn the relationship between each feature and the actual photovoltaic output.
[0105] Step 30: Based on the preprocessed second historical actual output data, construct sliding window features and hysteresis features respectively.
[0106] In this step, a sliding window feature is constructed based on the second historical actual output data, and specifically, the actual output data 2 to 8 days before the target date is used as the sliding window feature.
[0107] And constructing a lag feature based on the second historical actual output data, specifically using the historical actual output data of one week before and after the target date as the lag feature.
[0108] Step 40: Use the Boruta algorithm to perform feature selection and obtain multiple input features.
[0109] The commonly used feature selection method based on correlation coefficient has a fast calculation speed and mainly measures the linear relationship between two variables. This method is suitable for identifying linearly correlated features, but may not capture nonlinear relationships or complex interactions between variables.
[0110] This step uses the Boruta algorithm for feature selection to obtain multiple input features as model input.
[0111] It should be noted that the Boruta algorithm is a feature selection method based on random forests. Its core idea is to identify features related to the dependent variable by comparing the importance of original features (real features) and randomly generated features (shadow features). The Boruta algorithm creates random copies of the original features, which are called shadow features, and uses them together with the original features to train the model. The algorithm determines which features are important by iteratively comparing the importance score of each feature with the importance score of the shadow feature. The goal of the Boruta algorithm is to identify all feature sets that are related to the dependent variable, not just to optimize the performance of a specific model.
[0112] Step 50: Calculate the correlation coefficient between each of the input features and the target output, modify each of the input features, and obtain feature data with preset weights.
[0113] Since the contribution rates of different features to the actual photovoltaic output vary greatly, the correlation coefficient between each feature and the target output is calculated as the weight of the feature. Each feature is multiplied by its corresponding weight to obtain the input feature with the preset weight, which is used as the input feature data of the subsequent prediction model.
[0114] For example, assume that there are n input features, represented by f = (f1, f2, ..., f n ), and its correlation coefficient with the target actual output is w=(w1,w2,…,w n ), then the feature data of each preset weight is expressed as x i =w i ·f i .
[0115] Step 60: splice a piece of preprocessed historical actual output data and corresponding feature data as a piece of sample data.
[0116] Step 70: Use each of the sample data as the input of the LightGBM model, and use Optuna to optimize the parameters until the model converges.
[0117] The LightGBM proposed in the embodiment of the present invention belongs to the Gradient Boosting Decision Tree (GBDT) category of machine learning model, which optimizes GBDT based on gradient unilateral sampling and mutually exclusive feature binding. GBDT contains multiple weak classifiers, and uses an additive model to continuously optimize and reduce the training residual of the previous weak classifier to achieve the goals of classification and regression. The LightGBM model adopts a histogram-based decision tree algorithm and a leaf node growth strategy with depth restrictions, which has a faster training speed and supports parallel learning.
[0118] During the LightGBM training process, each of the sample data is used as input, and Optuna is used for parameter optimization. The core parameters to be optimized include: ① the number of decision trees n_estimators; ② the decision tree depth max_depth; ③ the learning rate learning_rate; ④ the regularization terms reg_alpha and reg_lambda.
[0119] After training and optimization are completed, save the model.
[0120] On this basis, this step uses the corrected feature data as the input of the trained LightGBM model to obtain the first prediction result fL.
[0121] In step S5, the corrected feature data and the first prediction result are used as inputs of a pre-trained AttentionGRU model to obtain a second prediction result.
[0122] First, let’s introduce the training process of the AttentionGRU model:
[0123] S100, execute steps S10 to S70, and use each of the sample data as the input of the converged LightGBM model to obtain the corresponding third prediction result.
[0124] S200, taking each of the sample data and the corresponding third prediction result as the input of the AttentionGRU model, and using optuna to perform parameter optimization until the model converges.
[0125] The attention mechanism based on feature mining and the Attention-Gated Recurrent Unit (AttentionGRU) proposed in the embodiment of the present invention are short-term photovoltaic power generation prediction models. Among them, the Gated Recurrent Unit (GRU) is a variant based on the Long Shot Term Memory (LSTM) model, which merges the forget gate and input gate of the LSTM into an update gate, which can simplify the model and make the calculation process faster and simpler. Although GRU performs well in time series, it cannot express the importance of hidden layer output.
[0126] Therefore, an attention mechanism is added to GRU to reflect the importance of each output. Its function is to force the neural network to review the hidden vector corresponding to each instantaneous quantity of the source sequence at each step of the sequence decoding process, and retain useful information to enhance the currently used hidden vector.
[0127] Specifically, the Attention mechanism and the GRU model are combined to form the AttentionGRU model.
[0128] During the AttentionGRU model training process, each of the sample data and the corresponding third prediction result are used as input, and optuna is used for parameter optimization. The core parameters to be optimized include: ① hidden layer feature number hidden_size; ② number of network layers num_layer; ③ zeroing ratio dropout; ④ learning rate lr; ⑤ optimizer (Adam, RMSprop and SGD).
[0129] After training and optimization are completed, save the model.
[0130] On this basis, this step combines the corrected feature data and the first prediction result f L As the input of the pre-trained AttentionGRU model, the second prediction result fG is obtained.
[0131] In step S6, the first prediction result and the second prediction result are weightedly summed using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted.
[0132] It is worth noting that since the LightGBM model is a boosted tree model and the AttentionGRU model is a recurrent neural network model, the two models have different principles and their prediction results are not highly correlated. Both have achieved good results in the prediction field. Therefore, the embodiment of the present invention combines the two to predict the final short-term output value of the photovoltaic power station.
[0133] Specifically, in this step, the prediction results of the two models are weighted and summed using the inverse error method to obtain the final short-term output prediction result. The inverse error method is as follows:
[0134] f PV =ω L f L +ω G f G
[0135]
[0136]
[0137] Among them, f PV Represents the final short-term output forecast result; ω L Represents the weight coefficient of the LightGBM model; ω G Represents the weight coefficient of the AttentionGRU model; e L 、e G Represent the errors of the LightGBM model and the AttentionGRU model respectively.
[0138] Through the inverse error method, the two models can be combined to reduce the overall error and thus improve the prediction accuracy.
[0139] So far, the embodiment of the present invention has completed the entire process of the photovoltaic power station short-term output prediction method based on the LightGBM-AttentionGRU combined model.
[0140] In order to help understand the superiority of the method provided by the embodiment of the present invention, the following specific verification process is given:
[0141] In actual application scenarios, the photovoltaic output forecast value is generally carried out from 05:45 to 19:45 on D+1 day, a total of 57 time points, around 09:30 on the morning of D day (during the night period, the photovoltaic output is 0 and has no prediction significance).
[0142] Taking a photovoltaic power station in Shanxi as an example, the specific process is as follows:
[0143] 1. Training phase:
[0144] First, obtain data, including: ① The historical actual output data of the photovoltaic power station in 2023, the actual output data obtained is timed at 15 minutes, 57 time points per day, of which 05:45 is the first time point of the day and 19:45 is the last time point of the day. ② The EC weather forecast data and GFS weather forecast data for the whole year of 2023. Some data can be found in Table 1.
[0145] Then, for the historical actual output data, the samples of historical power-limiting moments are removed. For the NWP forecast data, according to the geographical coordinates of the photovoltaic power station, the nearest longitude and latitude grid coordinate meteorological forecast values are extracted from the NWP as the meteorological forecast features corresponding to the photovoltaic power station, and the extracted meteorological forecast data are converted to a time resolution of 15 minutes using the linear interpolation upsampling method to keep the time interval consistent with the actual output sample data. Then, the outliers and missing values of the historical actual output and NWP meteorological forecast data are corrected, and the NWP meteorological forecast data are standardized.
[0146] Next, the processed historical actual output data is concatenated with the feature data of the preset weights to form processed sample data.
[0147] Subsequently, the processed sample data is sent to the LightGBM model constructed above for model training. Optuna is used for parameter optimization during the training process. After the training is completed, the model is saved. The trained model is used to predict the predicted value of the corresponding date in 2023.
[0148] Finally, the processed sample data and the predicted value of LightGBM are sent to the AttentionGRU model constructed above. Optuna is used for parameter optimization during the training process. After the training is completed, the model is saved.
[0149] So far, two trained photovoltaic output prediction models have been obtained, namely LightGBM and AttentionGRU.
[0150] 2. Prediction stage:
[0151] According to the above method, on the morning of D-day, the NWP data for the corresponding period of D+1 day are obtained and preprocessed, and sent to the above-mentioned trained models to obtain two prediction values. Subsequently, the model fusion is performed according to the above-mentioned model fusion method to obtain the final photovoltaic output prediction value for D+1 day.
[0152] For the period from May 12, 2024 to May 23, 2024, some of the prediction results corresponding to this section can be found in Table 1. The complete prediction results are as follows: Figure 2 shown.
[0153] Table 1
[0154]
[0155]
[0156] It should be noted that the new method in Table 1 refers to the method provided in the embodiment of the present invention, and the original method refers to using a separate LightGBM model for prediction.
[0157] based on Figure 2 , we can get the accuracy comparison results in Table 2.
[0158] Table 2
[0159] date The accuracy of the new method The accuracy of the original method 2024 / 5 / 12 98.34% 97.03% 2024 / 5 / 13 96.39% 93.67% 2024 / 5 / 14 95.53% 88.41% 2024 / 5 / 15 85.54% 86.99% 2024 / 5 / 16 86.67% 76.58% 2024 / 5 / 17 97.24% 91.41% 2024 / 5 / 18 85.89% 80.57% 2024 / 5 / 19 64.51% 71.06% 2024 / 5 / 20 78.05% 72.08% 2024 / 5 / 21 88.62% 85.86% 2024 / 5 / 22 71.32% 71.71% 2024 / 5 / 23 96.28% 94.35% Mean 87.03% 84.14%
[0160] As shown in Table 2, by adopting the method provided by the embodiment of the present invention, the average accuracy of the photovoltaic output prediction of the photovoltaic power station on day D+1 reaches 87.03%, which is 2.89% higher than that of the original method.
[0161] Embodiment 2:
[0162] The embodiment of the present invention provides a photovoltaic power station short-term output prediction system based on the LightGBM-AttentionGRU combined model, including:
[0163] A data acquisition module, used for acquiring and preprocessing multi-source numerical meteorological forecast data and first historical actual output data of the photovoltaic power station to be predicted;
[0164] A feature construction module, for constructing a plurality of features based on the preprocessed multi-source numerical meteorological forecast data and the first historical actual output data; wherein the features at least include irradiance features, statistical features, polynomial features, sliding window features and hysteresis features;
[0165] A feature correction module, used for correcting each of the features based on a correlation coefficient between each of the features and the target output;
[0166] The first output prediction module is used to use the corrected feature data as the input of the pre-trained LightGBM model to obtain a first prediction result;
[0167] A second output prediction module is used to use the corrected feature data and the first prediction result as inputs of a pre-trained AttentionGRU model to obtain a second prediction result;
[0168] The result fusion module is used to perform weighted summation on the first prediction result and the second prediction result by using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted.
[0169] Embodiment 3:
[0170] An embodiment of the present invention provides a storage medium storing a computer program for short-term output prediction of a photovoltaic power station based on a LightGBM-AttentionGRU combination model, wherein the computer program enables a computer to execute the short-term output prediction method of a photovoltaic power station as described in Example 1.
[0171] Embodiment 4:
[0172] An embodiment of the present invention provides an electronic device, including:
[0173] One or more processors; a memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a method for executing the photovoltaic power station short-term output prediction method as described in Example 1.
[0174] It can be understood that the photovoltaic power station short-term output prediction system, storage medium and electronic device based on the LightGBM-AttentionGRU combination model provided in the embodiments of the present invention correspond to the photovoltaic power station short-term output prediction method based on the LightGBM-AttentionGRU combination model provided in the embodiments of the present invention, and the explanations, examples and beneficial effects of the relevant contents can refer to the corresponding parts in the photovoltaic power station short-term output prediction method, which will not be repeated here.
[0175] In summary, compared with the prior art, the present invention has the following beneficial effects:
[0176] 1. The embodiment of the present invention is based on a combination model of the LightGBM model and the AttentionGRU model with different underlying principles, which improves the limitation of a single model that is difficult to migrate scenarios and greatly improves the accuracy of short-term output prediction of photovoltaic power stations.
[0177] 2. The embodiment of the present invention uses high-precision multi-source meteorological forecast data, including EC and GFS; in the preprocessing process, samples corresponding to the power-limited period are removed, and features are constructed using multiple methods, and the Boruta algorithm is used for feature selection to form input feature data with preset weights; the GRU model is transformed using the attention mechanism Attention, and the output of the LightGBM model is used as one of the input features of the AttentionGRU model during the AttentionGRU training process. This further improves the accuracy and efficiency of the short-term output forecast of photovoltaic power stations.
[0178] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "including a..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0179] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A photovoltaic power station short-term output prediction method based on the LightGBM-AttentionGRU combined model, characterized in that: include: Acquire and preprocess multi-source numerical meteorological forecast data and the first historical actual output data of the photovoltaic power station to be predicted; Based on the preprocessed multi-source numerical meteorological forecast data and the first historical actual output data, a plurality of features are constructed; wherein the features at least include irradiance features, statistical features, polynomial features, sliding window features and hysteresis features; Based on the correlation coefficient between each of the features and the target output, modify each of the features; Use the corrected feature data as the input of the pre-trained LightGBM model to obtain the first prediction result; The corrected feature data and the first prediction result are used as inputs of the pre-trained AttentionGRU model to obtain a second prediction result; The first prediction result and the second prediction result are weightedly summed using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted.
2. The photovoltaic power station short-term output prediction method according to claim 1 is characterized in that: The irradiance characteristics include the peak irradiance of the day and the difference between the irradiance at each moment and the peak irradiance; The statistical characteristics include one or a combination of any of the following: mean value, standard deviation, coefficient of variation, skewness, kurtosis, range and total added value; The polynomial features refer to multiple new combined features obtained by performing addition, subtraction, multiplication and division operations on irradiance features or statistical features; The sliding window feature refers to using the historical actual output data from 2 to 8 days before the target date; The lagging feature refers to the historical actual output data of the target day one week before and after the historical period.
3. The photovoltaic power station short-term output prediction method according to claim 2 is characterized in that: The multi-source numerical meteorological forecast data includes EC and GFS forecast data, and the characteristics specifically include: EC / GFS shortwave downward irradiance, EC / GFS peak irradiance for the day, the difference between EC / GFS irradiance and peak irradiance, GFS cloud cover, EC / GFS surface wind speed, EC humidity, EC air pressure, EC temperature, whether GFS has rain, whether GFS has snow, 0.8*EC irradiance+0.2*GFS irradiance, the square of EC irradiance, the sliding window characteristics of the actual output on date D-1 / D-2 / D-3 and the lag characteristics of the week before and after the same date D+1 of the previous year; where D represents the day.
4. The photovoltaic power station short-term output prediction method according to claim 1 is characterized in that: The training process of the LightGBM model includes: Obtain and preprocess historical EC and GFS forecast data and second historical actual output data; Based on the preprocessed historical EC and GFS forecast data, the irradiance features are constructed, and based on the preprocessed historical EC and GFS meteorological fields, the statistical features and polynomial features are constructed respectively; Based on the preprocessed second historical actual output data, sliding window features and hysteresis features are constructed respectively; The Boruta algorithm is used for feature selection to obtain multiple input features; Calculating the correlation coefficient between each of the input mold features and the target output, modifying each of the input mold features, and obtaining feature data with preset weights; A piece of preprocessed historical actual output data and corresponding feature data are spliced together as a piece of sample data; Each of the sample data is used as the input of the LightGBM model, and Optuna is used to optimize the parameters until the model converges.
5. The photovoltaic power station short-term output prediction method according to claim 4 is characterized in that: The training process of the AttentionGRU model includes: Each of the sample data and the corresponding third prediction result is used as the input of the AttentionGRU model, and optuna is used to optimize the parameters until the model converges; wherein the third prediction result is the prediction result obtained after the sample data is used as the input of the converged LightGBM model.
6. The photovoltaic power station short-term output prediction method according to claim 1 is characterized in that: The first prediction result and the second prediction result are weighted summed using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted; expressed as: f PV =ω L f L +oh G f G Among them, fP v Indicates the final short-term output forecast result; ω L 、f L Respectively represent the weight coefficient and the first prediction result of the LightGBM model; ω G 、f G Represent the weight coefficient of the AttentionGRU model and the second prediction result respectively; e L 、e G Represent the errors of the LightGBM model and the AttentionGRU model respectively.
7. A photovoltaic power station short-term output prediction system based on the LightGBM-AttentionGRU combined model, characterized in that: include: A data acquisition module, used for acquiring and preprocessing multi-source numerical meteorological forecast data and first historical actual output data of the photovoltaic power station to be predicted; A feature construction module, for constructing a plurality of features based on the preprocessed multi-source numerical meteorological forecast data and the first historical actual output data; wherein the features at least include irradiance features, statistical features, polynomial features, sliding window features and hysteresis features; A feature correction module, used for correcting each of the features based on a correlation coefficient between each of the features and the target output; The first output prediction module is used to use the corrected feature data as the input of the pre-trained LightGBM model to obtain a first prediction result; A second output prediction module is used to use the corrected feature data and the first prediction result as inputs of a pre-trained AttentionGRU model to obtain a second prediction result; The result fusion module is used to perform weighted summation on the first prediction result and the second prediction result by using the inverse error method to obtain the final short-term output prediction result of the photovoltaic power station to be predicted.
8. A storage medium, characterized in that: It stores a computer program for short-term output prediction of a photovoltaic power station based on the LightGBM-AttentionGRU combination model, wherein the computer program enables a computer to execute the short-term output prediction method of a photovoltaic power station as described in any one of claims 1 to 6.
9. An electronic device, characterized in that: include: one or more processors; Memory; and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, the programs including a program for executing the photovoltaic power station short-term output prediction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Short-term photovoltaic power prediction method based on VMD-IPSO-GRU
CN112348271A
Photovoltaic power station power prediction method based on NWP irradiance correction and error prediction
CN114091317A
Connection structure of photovoltaic module and photovoltaic support
CN116131725A
Photovoltaic output ultra-short-term prediction method and device
CN116663915A
Prediction method for photovoltaic power generation
CN116760017A
Cited By
DNI prediction method and device for photo-thermal power station
CN120562658A
Method and apparatus for dni prediction of a solar thermal power plant
CN120562658B