Photovoltaic power generation short-term power prediction method and device, electronic equipment and storage medium
By using Stacking integrated prediction model in photovoltaic power prediction, combined with K-fold cross-validation and data affinity analysis, the problems of poor prediction accuracy and weak generalization ability in the prior art are solved, and more efficient photovoltaic power prediction is achieved.
Patent Information
- Application Number
- CN202411392635.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has poor prediction accuracy and weak generalization ability in photovoltaic power prediction, and cannot fully reflect the differences between different prediction algorithms.
Using Stacking integrated prediction model, including a primary learner and a meta learner, divide the data sets through K-fold cross-validation method to prevent model overfitting, and weight the output results based on the data affinity ratio of the primary learner to train Meta-learning machine.
It improves the prediction accuracy and generalization ability of photovoltaic power, integrates the model advantages of primary learners, and enhances the accuracy and applicability of prediction results.
Smart Images

Figure CN119476561A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photovoltaic power prediction, and in particular to a method, device, electronic equipment and storage medium for short-term photovoltaic power generation prediction. Background Art
[0002] There are three main types of photovoltaic power prediction technologies: physical modeling methods, data statistical models, and combined prediction models. The prediction accuracy of the physical modeling method is mainly affected by the model calibration data, and the process of establishing a physical model in the system is complicated, and the prediction model has low anti-interference ability. The data statistical model relies on a large amount of historical data for training. The combined prediction model cannot fully reflect the differences between different prediction algorithms. In addition, the algorithms cannot be trained with each other in a complementary manner to produce a better comprehensive model. Therefore, the predicted power accuracy is low and the generalization ability is weak. Summary of the invention
[0003] The present invention provides a method, device, electronic device and storage medium for short-term photovoltaic power generation prediction, which are used to solve the problems of poor power prediction accuracy, weak generalization ability and inability to reflect the differences between different prediction algorithms in the prior art, and can improve the prediction accuracy and generalization ability of photovoltaic power.
[0004] The present invention provides a method for short-term photovoltaic power generation power prediction, comprising:
[0005] Inputting the data of the first number of meteorological factors into the trained Stacking integrated prediction model;
[0006] Obtaining the photovoltaic power prediction result output by the trained Stacking integrated prediction model;
[0007] The Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes:
[0008] Acquire a data set, the data set comprising data of a first number of meteorological factors;
[0009] The data set is divided by using a K-fold cross-validation method, and the primary learner is trained based on the divided data set to obtain an output result of the primary learner;
[0010] Performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner;
[0011] The output results of the primary learner are weighted based on the data affinity ratio of the primary learner, and the weighted output results are used as the training data set of the meta learner to train the meta learner.
[0012] According to the photovoltaic power generation short-term power prediction method provided by the present invention, the step of acquiring a data set includes:
[0013] Calculating the Pearson coefficient between the photovoltaic power generation and the second number of meteorological factors;
[0014] Selecting the first number of meteorological factors with the highest Pearson coefficient among the second number of meteorological factors and acquiring data of the first number of meteorological factors;
[0015] The data of the first number of meteorological factors are normalized, and the normalized data of the first number of meteorological factors are used as the data set.
[0016] According to the photovoltaic power generation short-term power forecasting method provided by the present invention, the first number of meteorological factors includes: temperature, global horizontal irradiance, wind speed and humidity.
[0017] According to the photovoltaic power generation short-term power prediction method provided by the present invention, after taking the normalized data of the first number of meteorological factors as the data set, the method further includes:
[0018] Training a third number of photovoltaic power prediction models based on the data set;
[0019] Calculate mean square errors corresponding to the third number of photovoltaic power prediction models respectively;
[0020] Based on the mean square errors respectively corresponding to the third number of photovoltaic power prediction models, difference analysis is performed to obtain the Pearson coefficients respectively corresponding to the third number of photovoltaic power prediction models;
[0021] The primary learner and the meta learner are determined based on the Pearson coefficients respectively corresponding to the third number of photovoltaic power prediction models.
[0022] According to the photovoltaic power generation short-term power prediction method provided by the present invention, the primary learner includes LSSVM, RF and XgBoost, and the meta learner is LightGBM.
[0023] According to the photovoltaic power generation short-term power prediction method provided by the present invention, the third number of photovoltaic power prediction models includes: long short-term memory network model, bp neural network model, bidirectional long short-term memory network model, RNN model, RF model, LightGBM model, Xgboost model, LSSVM model.
[0024] The present invention also provides a photovoltaic power generation short-term power prediction device, comprising:
[0025] An input module, used for inputting data of a first number of meteorological factors into the trained Stacking integrated prediction model;
[0026] An acquisition module is used to acquire the photovoltaic power prediction result output by the trained Stacking integrated prediction model;
[0027] The Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes:
[0028] Acquire a data set, the data set comprising data of a first number of meteorological factors;
[0029] The data set is divided by using a K-fold cross-validation method, and the primary learner is trained based on the divided data set to obtain an output result of the primary learner;
[0030] Performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner;
[0031] The output results of the primary learner are weighted based on the data affinity ratio of the primary learner, and the weighted output results are used as the training data set of the meta learner to train the meta learner.
[0032] The present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-mentioned photovoltaic power generation short-term power prediction methods is implemented.
[0033] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the short-term power prediction method for photovoltaic power generation as described above is implemented.
[0034] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the short-term power prediction method for photovoltaic power generation as described above is implemented.
[0035] The present invention provides a photovoltaic power generation short-term power prediction method, device, electronic device and storage medium. The photovoltaic power is predicted using a trained Stacking integrated prediction model. During the training process, the data set is divided by a K-fold cross-validation method to prevent model overfitting. The output result of the primary learner is weighted based on the data affinity ratio of the primary learner, and the weighted output result is used as a training data set for a meta-learner. The meta-learner is trained to integrate the advantages of the model of the primary learner and improve the prediction accuracy and generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are 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.
[0037] Figure 1 This is one of the flow diagrams of the photovoltaic power generation short-term power prediction method provided by the present invention;
[0038] Figure 2 It is a schematic diagram of the training process of the Stacking integrated prediction model provided by the present invention;
[0039] Figure 3 It is a schematic diagram of the Pearson coefficient between models provided by the present invention;
[0040] Figure 4 This is the second flow chart of the photovoltaic power generation short-term power prediction method provided by the present invention;
[0041] Figure 5 It is a schematic diagram of the structure of the photovoltaic power generation short-term power prediction device provided by the present invention;
[0042] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. 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.
[0044] First, the following contents are introduced:
[0045] There are three main types of photovoltaic power prediction in related technologies: physical modeling method, data statistical model, and combined prediction model. The physical modeling method is a method that calculates the photovoltaic power generation process and principle by deriving physical formulas such as the solar radiation transfer equation. It establishes a physical model based on data such as photovoltaic power station environmental information, component parameters, and solar irradiance to achieve photovoltaic power prediction. However, some studies have shown that the prediction accuracy of the physical model is mainly affected by the model calibration data. In addition, the process of establishing the physical model is complicated, and the anti-interference ability of the prediction model is low.
[0046] The data statistical model is a method that uses statistical laws to analyze the relationship between photovoltaic power generation output power and meteorological factors and establish a corresponding photovoltaic power prediction model. It relies on a large amount of historical data for training and reveals the laws between photovoltaic power generation power and meteorological factors through statistical analysis.
[0047] The combined prediction model is due to the limitations of a single prediction model, and the prediction effect often does not meet expectations. In order to improve the prediction effect of the model and give full play to the advantages of different prediction models, a combined prediction method that mixes different prediction models has emerged. The commonly used combination method is mainly achieved by calculating the prediction mean of multiple models or models with different parameters. This method cannot fully reflect the differences between different prediction algorithms. In addition, the algorithms cannot be trained with each other in a complementary way to produce a better comprehensive model. This combination method lacks sufficient theoretical support, and its principle is relatively simple.
[0048] In view of the above-mentioned defects, the present invention provides a method, device, electronic device and storage medium for short-term photovoltaic power generation prediction, which can improve the prediction accuracy and generalization ability of photovoltaic power.
[0049] Combine the following Figure 1-Figure 4 The present invention describes a photovoltaic power generation short-term power prediction method.
[0050] Figure 1 This is one of the flow charts of the photovoltaic power generation short-term power prediction method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0051] Step 100, inputting data of a first number of meteorological factors into a trained Stacking integrated prediction model;
[0052] The Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes:
[0053] Acquire a data set, the data set comprising data of a first number of meteorological factors;
[0054] The data set is divided by using a K-fold cross-validation method, and the primary learner is trained based on the divided data set to obtain an output result of the primary learner;
[0055] Performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner;
[0056] The output results of the primary learner are weighted based on the data affinity ratio of the primary learner, and the weighted output results are used as the training data set of the meta learner to train the meta learner.
[0057] Optionally, the present invention uses a Stacking integrated prediction model to predict photovoltaic power, wherein the Stacking integrated prediction model includes a primary learner and a meta-learning period. Using the Stacking integrated prediction model for prediction can integrate the advantages of the primary learner model and improve the prediction accuracy.
[0058] Optionally, in order to train the Stacking integrated prediction model, a data set for training may be first obtained and the data set may be divided into a training set and a test set. The data set may include data of a first number of meteorological factors.
[0059] Optionally, the meteorological factors may be temperature, wind speed, rainfall, and other meteorological factors that may affect photovoltaic power generation, and the present invention is not limited thereto.
[0060] Optionally, the first number may be 3, 4, or 5, which is not limited in the present invention.
[0061] Optionally, after obtaining the data set, the K-fold cross-validation method can be used to divide the data set to prevent the Stacking ensemble prediction model from overfitting.
[0062] Alternatively, K-fold cross validation is a commonly used method for building models and verifying model parameters in machine learning. The data set is divided into K subsets of similar size called folds. This can be achieved by randomly assigning samples in the data set to each fold, and then training and evaluating the model K times. This can better understand the performance of the model on different samples, more accurately evaluate the generalization ability of the model, and avoid the problem of overfitting or underfitting the model on a specific data set.
[0063] Optionally, K is usually taken as (5, 10, 15). In one embodiment of the present invention, K is set to 5, and a 5-fold cross validation is performed on the data set.
[0064] Optionally, the primary learner can be trained based on the divided data set to obtain output results.
[0065] Optionally, the primary learner may include multiple models, and the output results of the multiple models may be obtained by training the primary learner.
[0066] Optionally, data affinity analysis may be performed on the output results of multiple models to obtain data affinity ratios corresponding to the multiple models.
[0067] Optionally, the data affinity ratio refers to comparing the training results with the actual results after the primary learner is trained, recording each row of source data with the minimum error of the corresponding primary learner, and obtaining the proportion of the training data with the minimum error for each primary learner is called data affinity.
[0068] For example: the primary learner includes model A, model B and model C. The first row of data has the smallest training error using model A, that is, the data affinity ratio of model A is 1, and the others are 0; the second row of data has the smallest training error using model B, which can be inferred that the data affinity ratio of model A is 1 / 2, the data affinity ratio of model B is 1 / 2, and the data affinity ratio of model C is 0.
[0069] Optionally, the data affinity ratio of each model in the primary learner can be used as the weight of each model to weight the output result of the primary learner, and the weighted output result is used as the training data set of the meta-learner to train the meta-learner.
[0070] Optionally, the calculation formula for the data affinity ratio may be as follows:
[0071]
[0072] Where: W l is the weight of the lth primary learner, l = 1, 2, ... T; T is the number of models in the primary learner; E Da,h is the minimum number of error data of the lth primary learner model, E Da,h is the data affinity ratio of the h-th primary learner.
[0073] Step 110, obtaining the photovoltaic power prediction result output by the trained Stacking integrated prediction model;
[0074] Optionally, after the training of the Stacking integrated prediction model is completed, data of a first number of meteorological factors may be input into the Stacking integrated prediction model, and then a photovoltaic power prediction result output by the Stacking integrated prediction model may be obtained.
[0075] The photovoltaic power generation short-term power prediction method provided by the present invention uses a trained Stacking integrated prediction model to predict photovoltaic power. During the training process, the data set is divided by a K-fold cross-validation method to prevent model overfitting. The output result of the primary learner is weighted based on the data affinity ratio of the primary learner, and the weighted output result is used as a training data set for a meta-learner. The meta-learner is trained to integrate the advantages of the model of the primary learner and improve the prediction accuracy and generalization ability.
[0076] Optionally, acquiring the data set includes:
[0077] Calculating the Pearson coefficient between the photovoltaic power generation and the second number of meteorological factors;
[0078] Selecting the first number of meteorological factors with the highest Pearson coefficient among the second number of meteorological factors and acquiring data of the first number of meteorological factors;
[0079] The data of the first number of meteorological factors are normalized, and the normalized data of the first number of meteorological factors are used as the data set.
[0080] Optionally, in order to obtain a data set for training the Stacking integrated prediction model, the Pearson coefficient may be first used to analyze the correlation between various meteorological factors and photovoltaic power generation.
[0081] Specifically, the Pearson coefficient between the photovoltaic power generation power and the second number of meteorological factors may be calculated.
[0082] Optionally, the second number may be 3, 4, or 5, which is not limited in the present invention.
[0083] Alternatively, the Pearson coefficient can be used to describe the relationship between two variables in mathematical statistics and statistical methods. The calculation formula is as follows:
[0084]
[0085] Among them, n represents the number of calculated data of a certain meteorological factor, x i Calculate data for the i-th meteorological factor, y i Calculate the photovoltaic power output power corresponding to the data of the i-th meteorological factor, and They represent the average values of variables x and y respectively, and r represents the Pearson coefficient between the variables.
[0086] Optionally, after calculating the Pearson coefficient between the photovoltaic power generation power and the second number of meteorological factors, the first number of meteorological factors with the highest Pearson coefficient can be selected, that is, the first number of meteorological factors with the highest correlation with the photovoltaic power generation power, and the data of the first number of meteorological factors can be obtained.
[0087] Optionally, since different meteorological factor data have different dimensions, in order to convert the data into a uniform scale range and eliminate the dimension differences between different variables, the data of the first number of meteorological factors may be normalized.
[0088] Optionally, the data of the first number of meteorological factors may be normalized by the following formula:
[0089]
[0090] Where x is the data of a certain meteorological factor, x max is the maximum value of the data of a certain meteorological factor, x min is the minimum value of the data of a certain meteorological factor, x nor is the normalized value of x.
[0091] Optionally, the normalized data of the first number of meteorological factors may be used as a data set for training the Stacking integrated prediction model.
[0092] Optionally, the normalized data of the first number of meteorological factors may be divided into a training set and a test set in a ratio of 8:2.
[0093] The photovoltaic power generation short-term power prediction method provided by the present invention selects the first number of meteorological factors with the highest correlation with photovoltaic power generation power from multiple meteorological factors through the Pearson coefficient, and normalizes the meteorological factor data to obtain a data set for training the Stacking integrated prediction model.
[0094] Optionally, the first number of meteorological factors include: temperature, global horizontal irradiance, wind speed and humidity.
[0095] In one embodiment of the present invention, by calculating the Pearson coefficient between the photovoltaic power generation power and the second number of meteorological factors, the four meteorological factors with the highest Pearson coefficients can be obtained, which are temperature, global horizontal irradiance, wind speed and humidity.
[0096] Optionally, data of temperature, global horizontal irradiance, wind speed, and humidity may be obtained and normalized, and then the Stacking integrated prediction model may be trained based on the normalized data of temperature, global horizontal irradiance, wind speed, and humidity.
[0097] The photovoltaic power generation short-term power prediction method provided by the present invention uses the temperature with the highest Pearson coefficient between the photovoltaic power, the global horizontal irradiance, the wind speed and the humidity data as the data set to train the Stacking integrated prediction model, which can improve the prediction accuracy.
[0098] Optionally, after taking the normalized data of the first number of meteorological factors as the data set, the method further comprises:
[0099] Training a third number of photovoltaic power prediction models based on the data set;
[0100] Calculate mean square errors corresponding to the third number of photovoltaic power prediction models respectively;
[0101] Based on the mean square errors respectively corresponding to the third number of photovoltaic power prediction models, difference analysis is performed to obtain the Pearson coefficients respectively corresponding to the third number of photovoltaic power prediction models;
[0102] The primary learner and the meta learner are determined based on the Pearson coefficients respectively corresponding to the third number of photovoltaic power prediction models.
[0103] Optionally, in order to determine the primary learner and the meta-learner in the Stacking ensemble prediction model, a model with higher prediction accuracy may be selected from multiple photovoltaic power prediction models.
[0104] Optionally, the third number may be 3, or 4, or 5, or other numbers, which is not limited in the present invention.
[0105] Optionally, the photovoltaic power prediction model may be any model that can predict photovoltaic power, such as a long short-term memory network model, or a BP neural network model, etc., and the present invention is not limited to this.
[0106] Specifically, the third number of photovoltaic power prediction models may be trained using the training data set. After the training is completed, the test set in the data set is used for testing to calculate the mean square errors corresponding to the third number of photovoltaic power prediction models.
[0107] Optionally, the mean square errors corresponding to the third number of photovoltaic power prediction models can be calculated using the following formula:
[0108]
[0109] Among them, E MSE is the mean square error; is the jth predicted value; y j is the jth actual value; m is the number of samples.
[0110] Optionally, after obtaining the mean square errors corresponding to the third number of photovoltaic power prediction models, a difference analysis can be performed based on the mean square errors corresponding to the third number of photovoltaic power prediction models to obtain the Pearson coefficients corresponding to the third number of photovoltaic power prediction models.
[0111] Optionally, a Pearson correlation coefficient analysis may be performed based on the mean square error, and the primary learner and the meta learner may be selected based on the prediction accuracy of each model and the correlation coefficient between the models.
[0112] Optionally, several photovoltaic power prediction models with the highest Pearson coefficients may be selected as primary learners.
[0113] The photovoltaic power generation short-term power prediction method provided by the present invention obtains the corresponding mean square error by training and testing multiple photovoltaic power prediction models, calculates the Pearson coefficient based on the mean square error, and finally selects the primary learner and the meta learner based on the Pearson coefficient to improve the photovoltaic power prediction accuracy.
[0114] Optionally, the primary learner includes LSSVM, RF and XgBoost, and the meta learner is LightGBM.
[0115] In one embodiment of the present invention, based on the Pearson coefficient of each photovoltaic power prediction model and factors such as the advantages of each model, LSSVM, RF, and XgBoost are selected as primary learners, LightGBM is selected as a meta-learner, and the Stacking integrated prediction model has the best prediction effect.
[0116] Optionally, the step of establishing the LSSVM prediction model includes the following steps:
[0117] 1a. Obtain the dataset for training;
[0118] 2a. Select appropriate samples, use nonlinear high-dimensional feature space, and construct the optimal decision function to fit the sample set. The formula is as follows:
[0119]
[0120] Where ω is the weight vector; is the nonlinear mapping relationship from input space to high-dimensional space; b is the bias variable;
[0121] 3a. Use structural minimization theory to transform the regression problem into a quadratic optimization problem;
[0122] 4a. Lagrange transformation;
[0123] 5a. Solve the regression function:
[0124]
[0125] In the formula, a i is the Lagrange multiplier; k(x i ·x j ) is the kernel function used in the prediction model, mainly polynomial kernel function, linear function, etc.
[0126] Optionally, the steps of establishing an XGBoost prediction model include the following steps:
[0127] 1b. Obtain the dataset for training;
[0128] 2b. XGBoost is an optimized ensemble tree model, which is improved and extended from the gradient boosting tree model. The tree ensemble model is as follows:
[0129]
[0130] Where: is the model prediction value of the i-th sample; K is the number of trees; F is the tree collection space; x i represents the feature vector of the i-th data point; f k The structure q and leaf weight w of the k-th independent tree;
[0131] 3b. The XGBoost model loss function L consists of two parts:
[0132]
[0133] Where: Part 1 is the predicted value and the target true value y i The second part is the sum of the complexity of the tree, which is a regular term used to control the complexity of the model, namely:
[0134]
[0135] Where Ω(f) is the regularization term of complexity, γ and λ represent the penalty coefficients for the model, w represents the leaf weight, and T represents the number of leaf nodes;
[0136] 4b. In the process of sequential minimization of the loss function L, the incremental function f added in each round t (x i ) To minimize the loss function as much as possible, the objective function of the tth round can be written as:
[0137]
[0138] In the formula represents the cumulative term of loss, represents the regular cumulative term, Ω(f t ) represents the regular update term, f t (x i ) is the incremental function. The second-order Taylor expansion method is used to approximate the objective function.
[0139] Figure 2 : is a schematic diagram of the training process of the Stacking integrated prediction model provided by the present invention, such as Figure 2As shown, in one embodiment of the present invention, the original data set is divided using 5-fold cross validation, and then the primary learners LSSVM, RF, and XgBoost are trained to obtain the prediction results corresponding to LSSVM, RF, and XgBoost, respectively, and then the meta-learner LightGBM is trained based on the prediction results corresponding to LSSVM, RF, and XgBoost, respectively.
[0140] The photovoltaic power generation short-term power prediction method provided by the present invention uses LSSVM, RF, and XgBoost as primary learners, LightGBM as a meta-learner, and the Stacking integrated prediction model has the best prediction effect.
[0141] Optionally, the third number of photovoltaic power prediction models include: long short-term memory network model, bp neural network model, bidirectional long short-term memory network model, RNN model, RF model, LightGBM model, Xgboost model, LSSVM model.
[0142] Figure 3 Schematic diagram of the Pearson coefficient between models provided by the present invention, such as Figure 3 As shown, in one embodiment of the present invention, by calculating the Pearson coefficient of the long short-term memory network model, the bp neural network model, the bidirectional long short-term memory network model, the RNN model, the RF model, the LightGBM model, the Xgboost model, and the LSSVM model, the RF model, the Xgboost model, and the LSSVM model can be selected as primary learners, and the LightGBM model can be used as a meta-learner.
[0143] Figure 4 This is the second flow chart of the photovoltaic power generation short-term power prediction method provided by the present invention, such as Figure 4 As shown, in one embodiment of the present invention, the photovoltaic power generation short-term power prediction method includes the following steps:
[0144] 1c. Use the Pearson coefficient to obtain four meteorological factors with high correlation as model input variables;
[0145] 2c. Normalize the input data;
[0146] 3c. Train each model to obtain the mean square error of each model;
[0147] 4c. Select primary learners and meta-learners based on the differences in prediction models;
[0148] 5c. Train the primary learner;
[0149] 6c. Perform k-fold cross validation.
[0150] 7c. Obtain affinity ratio and perform affinity ratio weighting;
[0151] 8c. Train the meta-learner.
[0152] 9c. Output the results.
[0153] Optionally, Table 1 is a comparison of error indicators of the Stacking integrated prediction model provided by the present invention and other models. It can be seen that the Stacking integrated prediction model has a higher prediction accuracy.
[0154] Table 1 Comparison of model error indicators
[0155]
[0156] The photovoltaic power generation short-term power prediction method provided by the present invention calculates the Pearson coefficient of the long short-term memory network model, the bp neural network model, the bidirectional long short-term memory network model, the RNN model, the RF model, the LightGBM model, the Xgboost model, and the LSSVM model, thereby selecting the RF model, the Xgboost model, and the LSSVM model as primary learners and the LightGBM model as a meta-learner, which can improve the photovoltaic power prediction accuracy.
[0157] The photovoltaic power generation short-term power prediction device provided by the present invention is described below. The photovoltaic power generation short-term power prediction device described below and the photovoltaic power generation short-term power prediction method described above can be referenced to each other.
[0158] Figure 5 Schematic diagram of the structure of the photovoltaic power generation short-term power prediction device provided by the present invention. Figure 5 As shown, the device includes an input module 510 and an acquisition module 520, wherein:
[0159] An input module 510 is used to input data of a first number of meteorological factors into the trained Stacking integrated prediction model;
[0160] An acquisition module 520 is used to acquire the photovoltaic power prediction result output by the trained Stacking integrated prediction model;
[0161] The Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes:
[0162] Acquire a data set, the data set comprising data of a first number of meteorological factors;
[0163] The data set is divided by using a K-fold cross-validation method, and the primary learner is trained based on the divided data set to obtain an output result of the primary learner;
[0164] Performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner;
[0165] The output results of the primary learner are weighted based on the data affinity ratio of the primary learner, and the weighted output results are used as the training data set of the meta learner to train the meta learner.
[0166] The photovoltaic power generation short-term power prediction device provided by the present invention uses a trained Stacking integrated prediction model to predict photovoltaic power. During the training process, the data set is divided by a K-fold cross-validation method to prevent model overfitting. The output result of the primary learner is weighted based on the data affinity ratio of the primary learner, and the weighted output result is used as a training data set for a meta-learner. The meta-learner is trained to integrate the advantages of the model of the primary learner and improve the prediction accuracy and generalization ability.
[0167] It can be understood that the photovoltaic power generation short-term power prediction device provided by the present invention corresponds to the photovoltaic power generation short-term power prediction method provided by the above-mentioned embodiments. The relevant technical features of the photovoltaic power generation short-term power prediction device provided by the present invention can refer to the relevant technical features of the photovoltaic power generation short-term power prediction method provided by the above-mentioned embodiments, and will not be repeated here.
[0168] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6As shown, the electronic device may include: a processor (processor) 610, a communication interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call the logic instructions in the memory 630 to execute a photovoltaic power generation short-term power prediction method, which includes: inputting data of a first number of meteorological factors into a trained Stacking integrated prediction model; obtaining a photovoltaic power prediction result output by the trained Stacking integrated prediction model; wherein the Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes: obtaining a data set, the data set includes data of a first number of meteorological factors; using the K-fold cross-validation method to divide the data set, and training the primary learner based on the divided data set to obtain the output result of the primary learner; performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner; weighting the output result of the primary learner based on the data affinity ratio of the primary learner, and using the weighted output result as the training data set of the meta-learner to train the meta-learner.
[0169] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0170] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the photovoltaic power generation short-term power prediction method provided by the above-mentioned methods, the method including: inputting data of a first number of meteorological factors into a trained Stacking integrated prediction model; obtaining the photovoltaic power prediction result output by the trained Stacking integrated prediction model; wherein the Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes: obtaining a data set, the data set including data of a first number of meteorological factors; dividing the data set using a K-fold cross-validation method, and training the primary learner based on the divided data set to obtain the output result of the primary learner; performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner; weighting the output result of the primary learner based on the data affinity ratio of the primary learner, and using the weighted output result as the training data set of the meta-learner to train the meta-learner.
[0171] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the photovoltaic power generation short-term power prediction method provided by the above-mentioned methods, the method comprising: inputting data of a first number of meteorological factors into a trained Stacking integrated prediction model; obtaining a photovoltaic power prediction result output by the trained Stacking integrated prediction model; wherein the Stacking integrated prediction model comprises a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model comprises: obtaining a data set, the data set comprising data of a first number of meteorological factors; dividing the data set using a K-fold cross-validation method, and training the primary learner based on the divided data set to obtain an output result of the primary learner; performing data affinity analysis on the output result of the primary learner to obtain a data affinity ratio of the primary learner; weighting the output result of the primary learner based on the data affinity ratio of the primary learner, and using the weighted output result as a training data set for the meta-learner to train the meta-learner.
[0172] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0173] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. 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 generation short-term power prediction method, characterized in that: include: Inputting the data of the first number of meteorological factors into the trained Stacking integrated prediction model; Obtaining the photovoltaic power prediction result output by the trained Stacking integrated prediction model; The Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes: Acquire a data set, the data set comprising data of a first number of meteorological factors; The data set is divided by using a K-fold cross-validation method, and the primary learner is trained based on the divided data set to obtain an output result of the primary learner; Performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner; The output results of the primary learner are weighted based on the data affinity ratio of the primary learner, and the weighted output results are used as the training data set of the meta learner to train the meta learner.
2. The photovoltaic power generation short-term power prediction method according to claim 1, characterized in that: The acquiring of the data set comprises: Calculating the Pearson coefficient between the photovoltaic power generation and the second number of meteorological factors; Selecting the first number of meteorological factors with the highest Pearson coefficient among the second number of meteorological factors and acquiring data of the first number of meteorological factors; The data of the first number of meteorological factors are normalized, and the normalized data of the first number of meteorological factors are used as the data set.
3. The photovoltaic power generation short-term power prediction method according to claim 2, characterized in that: The first number of meteorological factors include: temperature, global horizontal irradiance, wind speed and humidity.
4. The photovoltaic power generation short-term power prediction method according to claim 2, characterized in that: After taking the normalized data of the first number of meteorological factors as the data set, the method further includes: Training a third number of photovoltaic power prediction models based on the data set; Calculate mean square errors corresponding to the third number of photovoltaic power prediction models respectively; Based on the mean square errors respectively corresponding to the third number of photovoltaic power prediction models, difference analysis is performed to obtain the Pearson coefficients respectively corresponding to the third number of photovoltaic power prediction models; The primary learner and the meta learner are determined based on the Pearson coefficients respectively corresponding to the third number of photovoltaic power prediction models.
5. The photovoltaic power generation short-term power prediction method according to claim 1 or 4, characterized in that: The primary learners include LSSVM, RF and XgBoost, and the meta learner is LightGBM.
6. The photovoltaic power generation short-term power prediction method according to claim 4, characterized in that: The third number of photovoltaic power prediction models include: long short-term memory network model, bp neural network model, bidirectional long short-term memory network model, RNN model, RF model, LightGBM model, Xgboost model, and LSSVM model.
7. A photovoltaic power generation short-term power prediction device, characterized in that: include: An input module, used for inputting data of a first number of meteorological factors into the trained Stacking integrated prediction model; An acquisition module is used to acquire the photovoltaic power prediction result output by the trained Stacking integrated prediction model; The Stacking integrated prediction model includes a primary learner and a meta-learner, and the training process of the Stacking integrated prediction model includes: Acquire a data set, the data set comprising data of a first number of meteorological factors; The data set is divided by using a K-fold cross-validation method, and the primary learner is trained based on the divided data set to obtain an output result of the primary learner; Performing data affinity analysis on the output result of the primary learner to obtain the data affinity ratio of the primary learner; The output results of the primary learner are weighted based on the data affinity ratio of the primary learner, and the weighted output results are used as the training data set of the meta learner to train the meta learner.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the photovoltaic power generation short-term power prediction method according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for short-term power prediction of photovoltaic power generation according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for short-term power prediction of photovoltaic power generation according to any one of claims 1 to 6 is implemented.