Ultra-short-term photovoltaic power generation power prediction method and device and electronic equipment
By constructing an integrated learning prediction model and using PSO optimization algorithm during its training, the problem of poor overfitting and generalization in ultra-short-term photovoltaic power generation prediction is solved, achieving a more robust and efficient prediction effect.
Patent Information
- Application Number
- CN202411460253.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-02-18
AI Technical Summary
Deep learning methods have the risk of overfitting in ultra-short-term photovoltaic power generation prediction and have poor generalization.
Integrated learning prediction models are adopted, including XGboost model and LGBM model as the basis learners, logistic regression model (LR) as the meta learners, and model parameters are optimized using PSO optimization algorithm during model training.
By reducing the number of basic learners, avoiding redundant features and information conflicts, improving system robustness, reducing the risk of overfitting, and improving the generalization ability of the model through PSO optimization algorithm.
Smart Images

Figure CN119482368A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power prediction, and in particular to an ultra-short-term photovoltaic power prediction method, device and electronic equipment. Background Art
[0002] At present, ultra-short-term photovoltaic power prediction methods can be divided into physical methods and statistical methods. The physical method is a method of predicting photovoltaic power by constructing a physical model of the photovoltaic power generation system. However, since the photovoltaic power generation system is affected by many complex factors, such as topography and the conversion efficiency of the photovoltaic array, it is difficult to obtain accurate photovoltaic power prediction results through physical modeling.
[0003] Statistical methods are based on historical data and statistical models. By analyzing the operation of photovoltaic power generation systems and meteorological data and other factors, the future photovoltaic power generation is inferred. Commonly used statistical methods include time series analysis methods, regression analysis methods, and deep learning methods. Deep learning methods are currently the most commonly used and widely used methods. However, the current deep learning methods have a certain risk of overfitting in ultra-short-term photovoltaic power generation prediction, and the generalization on different data sets is poor. Summary of the invention
[0004] The present invention provides an ultra-short-term photovoltaic power prediction method, device and electronic equipment, which are used to solve the problem in the prior art that deep learning methods have a certain risk of overfitting in ultra-short-term photovoltaic power prediction and poor generalization on different data sets.
[0005] The present invention provides a lightweight small target pest detection method, comprising the following steps: Collect sample data sets of photovoltaic power generation systems; Performing correlation analysis on the sample data set to obtain a power prediction related data set; Constructing an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta learner in the integrated learning prediction model includes an LR model; According to the power prediction related data set, the integrated learning prediction model is trained to obtain a trained integrated learning prediction model; The trained integrated learning prediction model is applied to obtain an ultra-short-term photovoltaic power generation power prediction result of the photovoltaic power generation system.
[0006] According to the ultra-short-term photovoltaic power generation prediction method provided by the present invention, the integrated learning prediction model is trained according to the power prediction related data set to obtain the trained integrated learning prediction model, including: The XGboost model and the LGBM model are trained by using the power prediction related data set to obtain a trained XGboost model and a trained LGBM model; Obtaining a first prediction result of the trained XGboost model and a second prediction result of the trained LGBM model; The first prediction result and the second prediction result are used as inputs of the LR model to perform model training to obtain the trained integrated learning prediction model.
[0007] The ultra-short-term photovoltaic power generation power prediction method provided by the present invention also includes: During the training process of any one of the XGboost model, the LGBM model and the LR model, the model parameters are optimized based on the PSO optimization algorithm.
[0008] According to the ultra-short-term photovoltaic power generation prediction method provided by the present invention, the XGboost model and the LGBM model are trained by the power prediction related data set to obtain the trained XGboost model and the trained LGBM model, including: During the training of the XGboost model and the LGBM model, stacking training is performed using time series 5-fold cross validation to obtain a trained XGboost model and a trained LGBM model.
[0009] According to the ultra-short-term photovoltaic power prediction method provided by the present invention, the correlation analysis of the sample data set is performed to obtain a power prediction related data set, including: Through the Spearman correlation coefficient or the Kendall correlation coefficient, the correlation analysis is performed on each feature of the data set to obtain the correlation between each feature and the photovoltaic power generation; According to the correlation between each feature and the photovoltaic power generation, the features with low correlation are screened out and removed from the sample data set to obtain the power prediction related data set.
[0010] According to the ultra-short-term photovoltaic power prediction method provided by the present invention, before performing correlation analysis on the sample data set to obtain a power prediction related data set, the method further includes: The missing values or erroneous values in the sample data set are corrected by linear interpolation.
[0011] The present invention provides an ultra-short-term photovoltaic power generation prediction device, comprising: A data acquisition unit, used for acquiring a sample data set of a photovoltaic power generation system; A data analysis unit, used for performing correlation analysis on the sample data set to obtain a power prediction related data set; A model building unit, used to build an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta learner in the integrated learning prediction model includes an LR model; A model training unit, used to train the ensemble learning prediction model according to the power prediction related data set to obtain a trained ensemble learning prediction model; The model application unit is used to apply the trained integrated learning prediction model to obtain the ultra-short-term photovoltaic power generation power prediction result of the photovoltaic power generation system.
[0012] 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 computer program, an ultra-short-term photovoltaic power prediction method as described above is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the ultra-short-term photovoltaic power generation power prediction method as described in any one of the above is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the ultra-short-term photovoltaic power prediction method as described above is implemented.
[0015] The ultra-short-term photovoltaic power generation power prediction method, device and electronic device provided by the present invention obtain a power prediction related data set by performing correlation analysis on the sample data set; and construct an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta-learner in the integrated learning prediction model includes an LR model. Only by adopting two base learners, the integrated learning prediction model obtained after training is easy to implement and deploy in practical applications. Compared with the integration of multiple base learners, the combination of two base learners is easier to debug and optimize. Reducing the number of base learners avoids redundant features or information conflicts generated during the integration process, improves the robustness of the system, and reduces the risk of system overfitting. At the same time, the LGBM model enhances the generalization ability of the model through an early stopping mechanism and a deeper decision tree structure, so that the integrated learning prediction model can maintain good generalization on different data sets. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or 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 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.
[0017] Figure 1 This is one of the flow charts of the ultra-short-term photovoltaic power generation prediction method provided by the present invention.
[0018] Figure 2 This is the second flow chart of the ultra-short-term photovoltaic power generation prediction method provided by the present invention.
[0019] Figure 3 It is a schematic diagram of the principle of the time series 5-fold cross-validation method provided by the present invention.
[0020] Figure 4 It is a schematic diagram of the principle of performing correlation analysis on various features in the sample data set provided by the present invention.
[0021] Figure 5 It is a structural schematic diagram of the ultra-short-term photovoltaic power generation prediction device provided by the present invention.
[0022] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] 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.
[0024] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the descriptions used in this way can be interchanged where appropriate, so that the embodiments can be implemented in a sequence other than that illustrated or described in the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules that are clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products or devices. The naming or numbering of the steps that appear in the present application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The process steps that have been named or numbered can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved. The division of modules in this application is a logical division. There may be other division methods when it is implemented in actual applications. For example, multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection between units can be electrical or other similar forms, which are not limited in this application. In addition, the modules or submodules described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed in multiple circuit units, and some or all of the units may be selected according to actual needs to achieve the purpose of the present application.
[0025] The present invention aims at the problem of ultra-short-term photovoltaic power prediction in photovoltaic power generation system and proposes an ultra-short-term photovoltaic power prediction method to solve the problem that deep learning methods in the prior art have a certain risk of overfitting in ultra-short-term photovoltaic power prediction and poor generalization on different data sets. By integrating the advantages of different base learner models, the results of base learner learning are integrated and further delivered to meta learner learning to obtain higher prediction accuracy.
[0026] In the embodiments of the present invention, the ultra-short-term photovoltaic power generation in the photovoltaic power generation system is generally used to predict the photovoltaic power generation changes within the next 15 minutes to one day. Compared with the photovoltaic power generation prediction of other periods, the ultra-short-term photovoltaic power generation requires higher data capture accuracy and is more difficult to predict.
[0027] Combine the following Figure 1-Figure 6 The specific contents of the present invention are described.
[0028] Figure 1A schematic flow chart of an ultra-short-term photovoltaic power generation prediction method provided by the present invention includes steps S101-S105.
[0029] Step S101, collecting a sample data set of a photovoltaic power generation system.
[0030] For example, in a photovoltaic power station or photovoltaic power generation system, in order to make ultra-short-term photovoltaic power generation prediction, the photovoltaic power generation data, corresponding meteorological data (including temperature, humidity, wind speed, wind direction, irradiance, etc.) and operating parameters of the photovoltaic power generation system (such as the conversion efficiency of the photovoltaic array, the working status of the inverter, etc.) at a specific time period (for example, every hour) every day in the past year are first collected. The above data are integrated into a sample data set, which includes multiple features (independent variables) and corresponding photovoltaic power generation power (dependent variable). The sample data set is used to be subsequently divided into a training set and a test set for subsequent model training and verification.
[0031] Step S102: performing correlation analysis on the sample data set to obtain a power prediction related data set.
[0032] Specifically, correlation analysis was performed on each feature in the sample data set. Through the analysis, features that are highly correlated with photovoltaic power generation, such as irradiance, temperature, and photovoltaic array conversion efficiency, were identified. These highly correlated features were retained to form a power prediction-related data set. At the same time, features that were less correlated or irrelevant to photovoltaic power generation were removed to reduce the complexity of model training and improve the prediction accuracy of the model.
[0033] Step S103, constructing an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and a LGBM model, and the meta learner in the integrated learning prediction model includes an LR model.
[0034] Specifically, the XGboost model and the LGBM model are selected as the base learners in the ensemble learning prediction model. XGboost (eXtreme Gradient Boosting) is a distributed machine learning algorithm based on gradient boosting, which has the advantages of high efficiency, flexibility and scalability. LGBM (Light Gradient Boosting Machine) is a framework based on gradient boosting, which uses a histogram-based decision tree algorithm with faster training speed and higher accuracy.
[0035] In addition, the LR model, namely the Logistic Regression model (LR), is selected as the meta-learner in the ensemble learning prediction model. The role of the meta-learner is to further integrate and optimize the prediction results of the base learner to improve the overall prediction performance.
[0036] Step S104: training the ensemble learning prediction model according to the power prediction related data set to obtain a trained ensemble learning prediction model.
[0037] Specifically, the power prediction related data set is divided into a training set and a validation set. The training set is used to train the ensemble learning prediction model, and the performance of the model is optimized by adjusting the model parameters (such as learning rate, number of iterations, tree depth, etc.). During the training process, methods such as cross-validation are used to evaluate the generalization ability of the model to avoid overfitting. At the same time, the training effect of the model is evaluated by monitoring the prediction error on the validation set, and the parameters of the model are adjusted as needed.
[0038] Step S105 , applying the trained integrated learning prediction model to obtain an ultra-short-term photovoltaic power generation power prediction result of the photovoltaic power generation system.
[0039] Specifically, after the model training is completed, the trained ensemble learning prediction model is verified and applied using the test set or real-time collected data. The real-time collected meteorological data, photovoltaic power generation system operating parameters and other features are input into the model to obtain the ultra-short-term photovoltaic power generation power prediction results.
[0040] For example, the prediction results can be used in aspects such as operation scheduling, energy management and market transactions of photovoltaic power stations to improve the operation efficiency and economic benefits of photovoltaic power generation systems.
[0041] In a possible implementation, Figure 2 As shown, in step S104, the integrated learning prediction model is trained according to the power prediction related data set to obtain the trained integrated learning prediction model, including steps S201-S203.
[0042] Step S201 , training an XGboost model and an LGBM model using a power prediction related data set to obtain a trained XGboost model and a trained LGBM model.
[0043] Specifically, in an embodiment of the present invention, the steps of establishing an XGboost model are as follows: Step 1: Select a sample set to be input into the XGboost model. The sample set to be input into the XGboost model is obtained from a data set related to power prediction.
[0044] Step 2, the XGboost model is an algorithm based on decision trees, the core of which is the gradient boosting technology. The decision tree model is trained by this technology. In each round of iteration, XGboost will learn a new decision tree which is an optimized ensemble tree model. In an embodiment of the present invention, the tree ensemble model is determined according to the following formula:
[0045] Where: For the The model prediction value of samples; is the number of trees; is the collection space of trees; Indicates The feature vector of the data points; Corresponding to The structure of a single tree and leaf weights Related conditions.
[0046] Step 3: Determine the loss function of the XGboost model. The loss function calculation formula is determined according to the following formula:
[0047] Among them, the loss function consists of two parts, the first part is the predicted value and the target true value The second part is the sum of the complexity of the tree, which is a regular term used to control the complexity of the XGboost model. , the specific formula is as follows:
[0048] Among them, and represents the penalty coefficient for the model, w represents the leaf weight, and T represents the number of leaf nodes.
[0049] Specifically, in an embodiment of the present invention, the steps of establishing the LGBM model are as follows: Step 1: Select a sample set to be input into the LGBM model. The sample set to be input into the LGBM model is obtained from a data set related to power prediction.
[0050] Step 2, the LGBM model is a machine learning algorithm based on the gradient boosting decision tree, the core of which is the histogram algorithm and the Leaf-wise growth strategy algorithm. The present invention does not elaborate on the specific construction method of the model.
[0051] Step 3: Determine the loss function of the LGBM model. See the loss function of the XGboost model. The loss function of the LGBM model also includes training error and regularization terms.
[0052] Step S202, obtaining a first prediction result of the trained XGboost model and a second prediction result of the trained LGBM model.
[0053] Specifically, through the XGboost model and LGBM model constructed as above, and based on the training set obtained from the power prediction related data set, the trained XGboost model and the first prediction result of the model output are obtained; the trained LGBM model and the second prediction result of the model output are obtained.
[0054] Step S203, using the first prediction result and the second prediction result as inputs of the LR model, performing model training, and obtaining a trained integrated learning prediction model.
[0055] In an embodiment of the present invention, the LR model in the meta-learner is obtained by the following steps: Step 1: Input the sample set formed after XGboost and LGBM prediction are completed, that is, the first prediction result of the XGboost model and the second prediction result of the trained LGBM model.
[0056] Step 2: The core idea of the LR model is to map the linear function output to a probability range. The output value of the model is given by the following formula:
[0057] in, Represents the prediction result, is the base of natural logarithms, to are the coefficients of the model, to are input features.
[0058] Step 3: Construct the loss function of the LR model. The LR model uses a logarithmic loss function, which is determined according to the following formula:
[0059] in, is the logarithmic loss function, N is the number of samples, , are the true value and the predicted value respectively.
[0060] In a possible implementation, the ultra-short-term photovoltaic power generation prediction method further includes, during the training process of any one of the XGboost model, the LGBM model and the LR model, optimizing the model parameters based on the PSO optimization algorithm.
[0061] In an embodiment of the present invention, the PSO optimization algorithm is a swarm intelligence optimization algorithm that optimizes the model by simulating the foraging behavior of a flock of birds.
[0062] Specifically, the construction steps of the PSO optimization algorithm are as follows: Step 1: First, initialize the group and set the maximum number of iterations. PSO randomly initializes a group of particles, each particle represents a solution, and the initial position of each particle is randomly distributed in space.
[0063] Step 2: In each generation, each example will update its speed and position based on its own and the group's historical optimal position. The formula for example update speed is: (10)
[0064] Represents particles In Dimension The speed on represents the number of generations currently updated, represents the inertia weight, and represents the acceleration factor, and is a random number on the curve [0,1], is the particle's best historical position, It is a particle In Dimension The position on.
[0065] Step 3, the formula for updating the position is: (11)
[0066] Represents particles In Dimension The position on Represents particles In Dimension The position on Indicates the number of generations currently updated.
[0067] Step 4: After each iteration, update the global optimal position .
[0068] Step 5: Stop the iteration according to the number of iteration terminations.
[0069] In an embodiment of the present invention, the PSO optimization algorithm technology is applied during the training process to ensure that the parameters of each base learner and meta-learner are adjusted to the optimal state. The PSO optimization algorithm has a powerful global search capability by simulating the movement of particle swarms in multidimensional space. Compared with traditional gradient descent or grid search methods, the PSO optimization algorithm can more effectively jump out of the local optimal solution, thereby improving the global optimization capabilities of XGBoost and LGBM, which is particularly important for highly complex nonlinear problems such as super photovoltaic power prediction.
[0070] At the same time, both the XGBoost model and the LGBM model rely on multiple hyperparameters to adjust model performance, including tree depth, learning rate, number of leaf nodes, etc. Grid search and random search are inefficient in high-dimensional hyperparameter space, while the PSO optimization algorithm can find a better hyperparameter combination faster through the collaboration and iteration of a group of particles, thereby reducing model training time and improving training efficiency.
[0071] Through the hyperparameter combination of the PSO optimization algorithm, the XGBoost model and the LGBM model can better balance the complexity and generalization ability of the model and avoid overfitting or underfitting problems. The dynamic adjustment mechanism of the PSO optimization algorithm can adaptively adjust the flight direction and speed of the particles according to the search conditions at different stages, so as to find the appropriate model complexity.
[0072] In an embodiment of the present invention, since photovoltaic power prediction has complex spatiotemporal characteristics, the XGBoost model and the LGBM model need to mine effective features in high-dimensional data. The PSO optimization algorithm can better select appropriate hyperparameters, thereby enhancing the adaptability of the model to complex data sets. By optimizing the tree structure parameters of XGBoost or the leaf node splitting rules of LGBM, the PSO optimization algorithm can help the model better identify nonlinear features under different time periods or conditions.
[0073] In a possible implementation, in step S201, the XGboost model and the LGBM model are trained using a power prediction related data set to obtain a trained XGboost model and a trained LGBM model, specifically including: During the training of the XGboost model and the LGBM model, stacking training was performed using 5-fold cross validation of the time series to obtain the trained XGboost model and the trained LGBM model.
[0074] Specifically, if Figure 3As shown in the figure, during the training of the XGboost model and the LGBM model, the time series 5-fold cross validation is used for Stacking training to further avoid the model from falling into an overfitting state during the training process.
[0075] In a possible implementation manner, in step S102, correlation analysis is performed on the sample data set to obtain a power prediction related data set, including: Through the Spearman correlation coefficient or the Kendall correlation coefficient, the correlation analysis is performed on each feature of the data set to obtain the correlation between each feature and the photovoltaic power generation power; according to the correlation between each feature and the photovoltaic power generation power, the features with low correlation are screened out and removed from the sample data set to obtain the power prediction related data set.
[0076] Specifically, the Spearman correlation coefficient and the Kendall correlation coefficient describe the relationship between two variables in mathematical statistics and statistical methods.
[0077] The Kendall correlation coefficient is determined according to the following formula:
[0078] The Spearman relationship number is determined according to the following formula:
[0079] in, represents the rank correlation coefficient calculated by the Kendall method; N represents the number of consistent external numbers; C represents the number of inconsistent external numbers; and H represents the number of observations. (3) In the formula, represents the Spearman correlation coefficient, , Indicates the signal value , Sorting; Indicates signal , Dimension.
[0080] In the embodiment of the present invention, the Spearman correlation coefficient or the Kendall correlation coefficient is used to perform correlation analysis on each feature of the sample data set, and the obtained correlation coefficient is as follows: Figure 4 According to the correlation between each feature and photovoltaic power generation, the features with low correlation are screened out and removed from the sample data set to obtain the power prediction related data set.
[0081] exist Figure 4 The meanings of some features are as follows: DHR, Diffuse Horizontal Radiation. Meaning: Diffuse radiation on the horizontal plane, refers to the amount of radiation that reaches the horizontal plane after sunlight is scattered by the atmosphere.
[0082] RDT, Radiation Diffuse Tilted. Meaning: Scattered radiation on a tilted surface, which refers to the amount of radiation that reaches the tilted plane after being scattered by the atmosphere.
[0083] AP, Active Power. Meaning: Active power refers to the electrical power actually consumed or transmitted in the power system, usually measured in watts (W) or kilowatts (kW).
[0084] GHR, Global Horizontal Radiation. Meaning: The total radiation on the horizontal plane, which represents the sum of direct solar radiation and diffuse radiation.
[0085] RGT, Radiation Global Tilted. Meaning: The total radiation of the inclined surface, which means the sum of the direct solar radiation and the diffuse radiation on the inclined plane.
[0086] WS, Wind Speed. Meaning: Wind speed refers to the speed of air flow, usually measured in meters per second (m / s) or kilometers per hour (km / h).
[0087] WTC, Weather Temperature Celsius. Meaning: Weather temperature, refers to the temperature expressed in degrees Celsius (°C).
[0088] WRH, Wind Relative Humidity. Meaning: Relative humidity, which indicates the percentage of water vapor content in the air relative to the saturated water vapor content at the same temperature.
[0089] WD, Wind Direction. Meaning: Wind direction, which refers to the direction from which the wind blows, usually expressed in degrees (°).
[0090] WDR, Weather Daily Rainfall. Meaning: Daily rainfall, which indicates the amount of precipitation measured in one day, usually in millimeters (mm).
[0091] In a possible implementation, before step S102, that is, before performing correlation analysis on the sample data set to obtain the power prediction related data set, the method further includes: The missing values or erroneous values in the sample data set are corrected through linear interpolation.
[0092] Specifically, linear interpolation is used for missing values or error values in a sample data set, and its mathematical principle formula can be described by the following formula:
[0093] in, is the position to be estimated, is The estimated value of , is a known data point value, and It corresponds to value.
[0094] In a possible implementation manner, after performing correlation analysis on the sample data set to obtain a power prediction related data set in step S102, the method further includes: The power prediction related data set is divided into training set and test set.
[0095] Exemplarily, the training set uses 80 percent of the power prediction related data set, and the test set uses 20 percent of the power prediction related data set.
[0096] After the power prediction related data set is divided, the normalization method is used to normalize the feature columns in the training set and the test set. The normalization method is used to convert the data values in the power prediction related data set into the same scale to eliminate the dimensional differences between different features, which not only helps to reduce the amount of calculation, but also helps to improve the convergence speed of the model.
[0097] In a possible embodiment, a Min-Max normalization method is used, and its formula is as follows: (4)
[0098] in, Represents the original value of the data, Represents the data after normalization. In the original data set The minimum value of In the original data set The maximum value of .
[0099] The present invention, by adopting the above-mentioned ultra-short-term photovoltaic power generation prediction method, can achieve at least one of the following beneficial effects: 1. By performing correlation analysis on the sample data set, a power prediction related data set is obtained; and an integrated learning prediction model is constructed, wherein the base learners in the integrated learning prediction model include an XGboost model and a LGBM model, and the meta-learner in the integrated learning prediction model includes an LR model. By only adopting two base learners, the integrated learning prediction model obtained after training is easy to implement and deploy in practical applications. Compared with the integration of multiple base learners, the combination of two base learners is easier to debug and optimize. Reducing the number of base learners avoids redundant features or information conflicts generated during the integration process, improves the robustness of the system, and reduces the risk of system overfitting. At the same time, the LGBM model enhances the generalization ability of the model through an early stopping mechanism and a deeper decision tree structure, so that the integrated learning prediction model can maintain good generalization on different data sets.
[0100] 2. Both the XGBoost model and the LGBM model are known for their ability to quickly process large-scale data. Through the parallelization of the tree model and the efficient gradient boosting algorithm, they can process large data sets and high-dimensional data. Combined with the hyperparameter optimization mechanism of the PSO optimization algorithm, the optimal configuration can be found more quickly, further improving the efficiency of model training and application.
[0101] The ultra-short-term photovoltaic power generation prediction device provided by the present invention is described below. The ultra-short-term photovoltaic power generation prediction device described below and the ultra-short-term photovoltaic power generation prediction method described above can be referenced to each other.
[0102] Figure 5 The present invention provides a schematic diagram of the structure of an ultra-short-term photovoltaic power generation prediction device, comprising the following parts: The data collection unit 510 is used to collect sample data sets of the photovoltaic power generation system.
[0103] The data analysis unit 520 is used to perform correlation analysis on the sample data set to obtain a power prediction related data set.
[0104] The model building unit 530 is used to build an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and a LGBM model, and the meta learner in the integrated learning prediction model includes an LR model.
[0105] The model training unit 540 is used to train the integrated learning prediction model according to the power prediction related data set to obtain the trained integrated learning prediction model.
[0106] The model application unit 550 is used to apply the trained integrated learning prediction model to obtain the ultra-short-term photovoltaic power generation power prediction result of the photovoltaic power generation system.
[0107] In a possible implementation, the model training unit 540 is specifically used to train the XGboost model and the LGBM model using a power prediction related data set to obtain a trained XGboost model and a trained LGBM model; obtain a first prediction result of the trained XGboost model and a second prediction result of the trained LGBM model; use the first prediction result and the second prediction result as inputs of the LR model to perform model training to obtain a trained integrated learning prediction model.
[0108] In a possible implementation, the model training unit 540 is further used to optimize model parameters based on the PSO optimization algorithm during the training process of any one of the XGboost model, the LGBM model and the LR model.
[0109] In a possible implementation, the model training unit 540 is specifically configured to perform Stacking training using 5-fold cross validation of a time series during the training of the XGboost model and the LGBM model to obtain a trained XGboost model and a trained LGBM model.
[0110] In one possible implementation, the data analysis unit 520 is specifically used to perform correlation analysis on each feature of the data set using either the Spearman correlation coefficient or the Kendall correlation coefficient to obtain the correlation between each feature and the photovoltaic power generation power; based on the correlation between each feature and the photovoltaic power generation power, features with lower correlation are screened out and removed from the sample data set to obtain a power prediction related data set.
[0111] In a possible implementation, the ultra-short-term photovoltaic power prediction device further includes a data processing unit configured to correct missing values or erroneous values in the sample data set by linear interpolation.
[0112] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communications interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute an ultra-short-term photovoltaic power generation prediction method, the method comprising: Collect sample data sets of photovoltaic power generation systems; Perform correlation analysis on the sample data set to obtain a power prediction related data set; Constructing an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta learner in the integrated learning prediction model includes an LR model; According to the power prediction related data set, the integrated learning prediction model is trained to obtain the trained integrated learning prediction model; The trained ensemble learning prediction model is applied to obtain the ultra-short-term photovoltaic power generation prediction results of the photovoltaic power generation system.
[0113] 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, etc. Various media that can store program codes.
[0114] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute an ultra-short-term photovoltaic power generation prediction method provided by the above methods, the method comprising: Collect sample data sets of photovoltaic power generation systems; Perform correlation analysis on the sample data set to obtain a power prediction related data set; Constructing an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta learner in the integrated learning prediction model includes an LR model; According to the power prediction related data set, the integrated learning prediction model is trained to obtain the trained integrated learning prediction model; The trained ensemble learning prediction model is applied to obtain the ultra-short-term photovoltaic power generation prediction results of the photovoltaic power generation system.
[0115] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform an ultra-short-term photovoltaic power prediction method provided by the above methods, the method comprising: Collect sample data sets of photovoltaic power generation systems; Perform correlation analysis on the sample data set to obtain a power prediction related data set; Constructing an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta learner in the integrated learning prediction model includes an LR model; According to the power prediction related data set, the integrated learning prediction model is trained to obtain the trained integrated learning prediction model; The trained ensemble learning prediction model is applied to obtain the ultra-short-term photovoltaic power generation prediction results of the photovoltaic power generation system.
[0116] 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.
[0117] 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, 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.
[0118] 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 method for predicting ultra-short-term photovoltaic power generation, characterized in that: include: Collect sample data sets of photovoltaic power generation systems; Performing correlation analysis on the sample data set to obtain a power prediction related data set; Constructing an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta learner in the integrated learning prediction model includes an LR model; According to the power prediction related data set, the integrated learning prediction model is trained to obtain a trained integrated learning prediction model; The trained integrated learning prediction model is applied to obtain an ultra-short-term photovoltaic power generation power prediction result of the photovoltaic power generation system.
2. The ultra-short-term photovoltaic power generation prediction method according to claim 1, characterized in that: The step of training the integrated learning prediction model according to the power prediction related data set to obtain the trained integrated learning prediction model includes: The XGboost model and the LGBM model are trained by using the power prediction related data set to obtain a trained XGboost model and a trained LGBM model; Obtaining a first prediction result of the trained XGboost model and a second prediction result of the trained LGBM model; The first prediction result and the second prediction result are used as inputs of the LR model to perform model training to obtain the trained integrated learning prediction model.
3. The ultra-short-term photovoltaic power generation prediction method according to claim 2, characterized in that: Also includes: During the training process of any one of the XGboost model, the LGBM model and the LR model, the model parameters are optimized based on the PSO optimization algorithm.
4. The ultra-short-term photovoltaic power generation prediction method according to claim 2, characterized in that: The method of training the XGboost model and the LGBM model by using the power prediction related data set to obtain the trained XGboost model and the trained LGBM model includes: During the training of the XGboost model and the LGBM model, stacking training is performed using time series 5-fold cross validation to obtain a trained XGboost model and a trained LGBM model.
5. The ultra-short-term photovoltaic power generation prediction method according to claim 1, characterized in that: The performing correlation analysis on the sample data set to obtain a power prediction related data set includes: Through the Spearman correlation coefficient or the Kendall correlation coefficient, the correlation analysis is performed on each feature of the data set to obtain the correlation between each feature and the photovoltaic power generation; According to the correlation between each feature and the photovoltaic power generation, the features with low correlation are screened out and removed from the sample data set to obtain the power prediction related data set.
6. The ultra-short-term photovoltaic power generation prediction method according to claim 1, characterized in that: Before performing correlation analysis on the sample data set to obtain a power prediction related data set, the method further includes: The missing values or erroneous values in the sample data set are corrected by linear interpolation.
7. An ultra-short-term photovoltaic power generation prediction device, characterized in that: include: A data acquisition unit, used for acquiring a sample data set of a photovoltaic power generation system; A data analysis unit, used for performing correlation analysis on the sample data set to obtain a power prediction related data set; A model building unit, used to build an integrated learning prediction model, wherein the base learners in the integrated learning prediction model include an XGboost model and an LGBM model, and the meta learner in the integrated learning prediction model includes an LR model; A model training unit, used to train the ensemble learning prediction model according to the power prediction related data set to obtain a trained ensemble learning prediction model; The model application unit is used to apply the trained integrated learning prediction model to obtain the ultra-short-term photovoltaic power generation power prediction result of the photovoltaic power generation system.
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 computer program, the ultra-short-term photovoltaic power generation 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 ultra-short-term photovoltaic power generation prediction method 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 ultra-short-term photovoltaic power generation prediction method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Photovoltaic power prediction system and training method thereof
CN120258040A