Photovoltaic power online prediction method, device and medium based on hierarchical classification modeling
Patent Information
- Application Number
- CN202510544926.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2026-11-03
AI Technical Summary
Existing photovoltaic power prediction models fail to effectively distinguish between the direct and indirect effects of meteorological parameters, lack weather type adaptability and offline update mechanisms, resulting in insufficient prediction accuracy, especially performance degradation under complex meteorological scenarios.
A hierarchical classification modeling approach was adopted, dividing meteorological parameters into two categories: indirectly related (temperature, humidity, etc.) and directly related (sunlight, radiation), and establishing a two-layer prediction model. The first layer uses an adaptive ensemble extreme learning machine (ELM-Adaboost) to derive sunlight and radiation intensity, and the second layer constructs a photovoltaic power prediction model based on sunlight and radiation, and updates the model weights in real time through a recursive least squares algorithm.
It significantly improves the interpretability and prediction accuracy of the model, especially enhancing robustness under sudden weather changes such as cloudy skies and heavy rain, achieving a dual breakthrough in the accuracy and stability of photovoltaic power prediction.
Smart Images

Figure CN123034338A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hydrogen production technology for new energy power generation, specifically to a method, equipment, and medium for online prediction of photovoltaic power based on hierarchical classification modeling. Background Technology
[0002] Green electricity-based hydrogen production, as an alternative to traditional coal-based hydrogen production, has become a key path for promoting energy structure transformation. Photovoltaic power generation for hydrogen production has attracted much attention due to its cleanliness and sustainability; however, photovoltaic output is significantly affected by weather conditions, exhibiting randomness, fluctuation, and discontinuity, making it difficult to achieve precise "load-following-source" control of electrolyzer load. The core issue lies in how to provide reliable day-ahead output forecasts for electrolyzer start-up plans through high-precision photovoltaic power prediction models, thereby improving the energy efficiency and operational stability of the hydrogen production system.
[0003] Current photovoltaic (PV) power prediction technologies mostly employ a single-layer, single-model architecture, inputting multiple meteorological parameters such as temperature, humidity, wind speed, and radiation into the model with equal weights, neglecting the differences in the interaction mechanisms between these parameters. Research shows that parameters such as solar radiation and light intensity are directly and strongly correlated with PV output, while parameters such as temperature and humidity indirectly affect the PV system by influencing surface energy exchange. Existing methods do not perform hierarchical modeling of parameters, leading to weakened correlation between model input and output and insufficient interpretability of prediction results. Although some studies have attempted to screen input parameters through correlation analysis, such methods sever the synergistic effects between meteorological elements, potentially losing key coupling information and thus limiting the improvement of model accuracy.
[0004] Furthermore, photovoltaic (PV) power output characteristics change dynamically with weather type, making it difficult for a single static model to simultaneously meet the prediction needs of both stable and abruptly changing weather scenarios. For example, PV power output exhibits regular changes under sunny conditions, while the power curve fluctuates drastically under cloudy or abrupt weather conditions. Traditional offline models rely on historical data for training and cannot capture the power output change trends caused by meteorological abrupt changes in real time, especially when facing extreme weather events, resulting in a significant increase in prediction errors. Although machine learning methods (such as support vector machines and random forests) have improved prediction accuracy to some extent, their offline training mechanisms and fixed parameter structures limit the model's adaptability to dynamic environments.
[0005] In recent years, researchers have made some progress in model optimization, such as using deep learning networks to mine high-dimensional features of meteorological data or improving the generalization performance of models through ensemble learning. However, these methods still have the following limitations: (1) They do not build a hierarchical modeling framework to distinguish the direct / indirect effects of meteorological parameters, resulting in high redundancy in model input; (2) They lack classification modeling strategies for different weather types, resulting in insufficient robustness of models in complex meteorological scenarios; (3) They rely on offline training, and parameter updates lag behind rapid weather changes, making it difficult to achieve real-time and accurate prediction. Summary of the Invention
[0006] This invention provides a method, device, and medium for online photovoltaic power prediction based on hierarchical classification modeling. Its purpose is to solve the problem of insufficient prediction accuracy caused by traditional photovoltaic power prediction models, which fail to distinguish between the direct and indirect effects of meteorological parameters, lack weather type adaptability, and lack offline update mechanisms.
[0007] To achieve the above objectives, the first aspect of the present invention provides a method for online prediction of photovoltaic power based on hierarchical classification modeling, comprising the following steps:
[0008] Collect meteorological data indirectly related to photovoltaic power, and preprocess the meteorological data;
[0009] The preprocessed meteorological data is input into the first-layer prediction model. The first-layer prediction model uses the preprocessed meteorological data as input parameters, adopts an extreme learning machine as a weak learner, integrates multiple weak learners through an adaptive ensemble learning algorithm, and outputs the predicted values of light intensity and radiation intensity.
[0010] An expert experience database of weather types was established based on historical meteorological data, including stable weather types and changing weather types.
[0011] Based on the expert experience base, determine the weather type corresponding to the current meteorological data, and select the second-layer prediction model corresponding to the weather type;
[0012] The predicted values of light intensity and radiation intensity are input into the second-layer prediction model. The second-layer prediction module uses a recursive least squares algorithm to update the weights of the second-layer prediction model online, and obtains the updated second-layer prediction model.
[0013] The updated second prediction model is used to output the photovoltaic power prediction results.
[0014] Furthermore, the preprocessing involves using the SG filtering method to preprocess the meteorological data. The calculation formula for the SG filtering method is as follows:
[0015]
[0016] Among them, X * These are meteorological data after SG filtering, where X is the original meteorological data and C is the raw meteorological data. i is the coefficient for the i-th numerical filter, m is the width of half a filter window, and N = 2m + 1 is the length of the filter.
[0017] Furthermore, the method for constructing the first-layer prediction model includes:
[0018] Multiple Extreme Learning Machine (ELM) models are constructed as weak learners for the adaptive ensemble learning algorithm, where the hidden layer output matrix of each ELM model is defined as follows:
[0019]
[0020] Where H is the hidden layer output matrix, ω k It is the weight from the input layer to the hidden layer, b k It is the bias of the hidden layer, x n is the input parameters of the model training set, and g(·) is the activation function;
[0021] For each extreme learning machine model, the weights from the input layer to the hidden layer and the hidden layer biases are randomly generated.
[0022] The Sigmoid function was chosen as the activation function for the hidden layer neurons of each Extreme Learning Machine model.
[0023] The number of hidden layer neurons in each Extreme Learning Machine model is determined based on the following empirical formula:
[0024]
[0025] Where h is the number of hidden layer neurons, m is the number of input layer neurons, n is the number of output layer neurons, and a is a constant between 1 and 10;
[0026] Based on the input parameters of the training set and the activation function, calculate the hidden layer output matrix of each extreme learning machine model;
[0027] Based on the hidden layer output matrix and the training set output parameters, the connection weights from the hidden layer to the output layer are calculated using the following formula:
[0028]
[0029] Where β is the connection weight from the hidden layer to the output layer. H is the Moore-Penrose generalized inverse of matrix H, and Y is the output parameter of the training set;
[0030] An adaptive ensemble learning algorithm is used to integrate multiple trained Extreme Learning Machine models into a strong learner. The output of the strong learner is calculated by the following formula:
[0031]
[0032] Where S(x) is the output of the strong learner, T is the number of weak learners, and G is the output of the strong learner. t (x) is a weak learning machine, a t It is the weight between the weak learning machine and the strong learning machine;
[0033] Based on the training data with input and output parameters, a first-layer prediction model is constructed using the strong learner.
[0034] Furthermore, the method for constructing the second-layer prediction model includes:
[0035] Based on the changing trends of historical meteorological data, establish a weather type expert experience database that includes both stable and variable weather types;
[0036] For the aforementioned stable weather type, a first initial prediction sub-model is constructed using the corresponding historical light intensity, radiation intensity, and photovoltaic power data;
[0037] For the aforementioned changing weather types, a second initial prediction sub-model is constructed using the corresponding historical light intensity, radiation intensity, and photovoltaic power data;
[0038] Determine the structural parameters of the second-layer prediction model, and obtain the initial weights of the first and second initial prediction sub-models through offline training;
[0039] The first initial prediction sub-model, the second initial prediction sub-model, and the structural parameters and initial weights are integrated to construct a complete second-layer prediction model.
[0040] Furthermore, during the prediction process of the second-layer prediction model, a recursive least squares algorithm is used to uniformly update the initial weights of the strong learners of the first and second initial prediction sub-models online. The unified online update method includes:
[0041] When new data is received at time k+1, the intermediate parameter matrix is updated according to the intermediate parameter matrix at time k and the input parameter matrix at time k+1, using the following formula:
[0042]
[0043] Among them, P k+1 For the updated intermediate parameter matrix, P k Let be the intermediate parameter matrix at time k. It is the transpose of the input parameter matrix at time k+1, where I is the identity matrix and H is the transpose of the input parameter matrix at time k+1. k+1 It is the input parameter matrix at time k+1;
[0044] Based on the updated intermediate parameter matrix, the model weights at time k, and the output parameters at time k+1, the weights of the second-level prediction model at time k+1 are calculated using the following formula:
[0045]
[0046] Where, β k+1β represents the weights of the second-layer prediction model at time k+1. k S represents the weights of the second-layer prediction model at time k. k+1 These are the output parameters at time k+1;
[0047] The calculated weights of the second-layer prediction model are applied to the second-layer prediction model to obtain the updated second-layer prediction model.
[0048] Furthermore, the recursive least squares algorithm triggers an online update each time a new data stream is received. The updated intermediate parameter matrix and the weights of the second-layer prediction model cover the original parameters in real time. In addition, a sliding window mechanism is used during the update process to retain only historical data within the most recent preset time period for weight update calculation.
[0049] Furthermore, meteorological data indirectly related to photovoltaic power include temperature, humidity, wind speed, wind direction, pressure, and cloud cover.
[0050] Furthermore, the method for determining the weather type corresponding to the current meteorological data based on the expert experience base includes:
[0051] Acquire meteorological data sequences for the current moment and the preceding preset time window, and extract the rate of change of light intensity, the rate of change of radiation intensity, and the amplitude of cloud cover fluctuation as judgment features;
[0052] A weather type is classified as stable if all of the following conditions are met; otherwise, it is classified as changing weather:
[0053] The rate of change of light intensity is lower than the first threshold, and the direction of change remains unchanged;
[0054] The rate of change of radiation intensity is below the second threshold, and the direction of change remains unchanged;
[0055] The fluctuation range of cloud cover is less than the third threshold of the cloud cover baseline value;
[0056] The first and second thresholds are set based on the standard deviation of natural fluctuations in illumination / radiation in clear weather scenarios in historical data, the third threshold is set based on the critical value of cloud cover abrupt changes in stable and changing weather in historical data, and the preset time window length is 5-10 times the period of meteorological data sampling interval.
[0057] To achieve the above objectives, a second aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program supporting the processor to execute a photovoltaic power online prediction method based on hierarchical classification modeling, and the processor is configured to execute the program stored in the memory.
[0058] To achieve the above objectives, a third aspect of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the steps of the online photovoltaic power prediction method based on hierarchical classification modeling.
[0059] The beneficial effects of this invention are:
[0060] Compared with existing technologies, this invention provides a photovoltaic power online prediction method, device, and medium based on hierarchical classification modeling. Through the comprehensive design of hierarchical modeling, classification modeling, and online update mechanisms, it systematically solves the limitations of traditional photovoltaic power prediction models. Specifically:
[0061] By classifying meteorological parameters into two categories—indirectly correlated (temperature, humidity, etc.) and directly correlated (sunlight, radiation)—a two-layer prediction model is established. The first layer utilizes an adaptive ensemble extreme learning machine (ELM-Adaboost) to accurately derive sunlight and radiation intensity from indirect parameters, eliminating the interference of redundant inputs on the model. The second layer directly constructs a photovoltaic power prediction model based on sunlight and radiation, ensuring a strong causal relationship between input parameters and output results, and significantly improving the model's interpretability.
[0062] An expert experience database is built based on historical meteorological data. Weather types are divided into stable weather (such as continuous sunny / cloudy) and variable weather (such as sudden cloudy weather), and targeted prediction sub-models are trained for each. During the prediction phase, the optimal sub-model is dynamically selected by matching the weather type in real time, avoiding the performance degradation of a single model under complex meteorological scenarios and improving the prediction robustness of sudden weather changes such as cloudy weather and sudden rain.
[0063] For the second-layer model, a recursive least squares algorithm is introduced to update the model weights in real time. When new meteorological data arrives, the algorithm dynamically adjusts the parameters based on a sliding window mechanism, enabling the model to continuously track the instantaneous fluctuations in light intensity and radiation intensity. This effectively addresses the shortcomings of offline models in responding to sudden weather changes, and significantly improves prediction accuracy, especially in the afternoon or cloudy periods when light intensity changes rapidly.
[0064] Through the synergy of the above technologies, this invention optimizes the model structure and dynamic response capability while retaining the comprehensive influence of meteorological parameters, ultimately achieving a dual breakthrough in the accuracy and stability of photovoltaic power prediction. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below.
[0066] Figure 1 This is a flowchart of an online photovoltaic power prediction method based on hierarchical classification modeling disclosed in an embodiment of the present invention.
[0067] Figure 2 This is a system model structure diagram disclosed in an embodiment of the present invention. Detailed Implementation
[0068] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0069] According to embodiments of the present invention, it should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the following manufacturing method, in some cases the steps shown or described may be performed in a different order than that shown here.
[0070] like Figure 1 As shown, this invention provides an online photovoltaic power prediction method based on hierarchical classification modeling, comprising the following steps:
[0071] Step S100: Collect meteorological data indirectly related to photovoltaic power and preprocess the meteorological data;
[0072] Meteorological data indirectly related to photovoltaic (PV) power output is collected, including parameters such as temperature, humidity, wind speed, wind direction, atmospheric pressure, and cloud cover. These parameters are acquired through meteorological sensor networks, meteorological satellites, or regional meteorological stations and are synchronized with real-time data from the PV power plant. While this meteorological data does not directly determine PV power output, it indirectly affects the output efficiency of PV panels by influencing irradiance and solar radiation intensity (directly related parameters). For example, increased cloud cover blocks sunlight, leading to a decrease in irradiance; changes in wind speed and humidity may affect atmospheric transmittance, thereby altering the actual amount of radiation reaching the PV panels.
[0073] Raw meteorological data may contain short-term, drastic fluctuations such as sensor errors and transient interference. Therefore, the collected raw meteorological data needs to be preprocessed using SG filtering (Savitzky-Golay filtering). SG filtering is a smoothing method based on local polynomial fitting. Its core is to eliminate short-term, drastic fluctuations in the data (such as sensor noise and transient interference) while preserving long-term trends.
[0074] The calculation formula for the SG filtering method is shown in equation (1):
[0075]
[0076] Among them, X * These are meteorological data after SG filtering, where X is the original meteorological data and C is the raw meteorological data. i is the coefficient for the i-th numerical filter, m is the width of half a filter window, and N = 2m + 1 is the length of the filter.
[0077] Step S200: Input the preprocessed meteorological data into the first-layer prediction model. The first-layer prediction model uses the preprocessed meteorological data as input parameters, adopts an extreme learning machine as a weak learner, integrates multiple weak learners through an adaptive ensemble learning algorithm, and outputs the predicted values of light intensity and radiation intensity.
[0078] Understandably, the first-layer model establishes the relationship between ordinary meteorological data and light intensity and radiation intensity. The input parameters of the model are preprocessed meteorological data such as temperature and humidity that are indirectly related to photovoltaic power, and the output parameters of the model are the predicted values of light intensity and radiation intensity that are strongly correlated with photovoltaic power.
[0079] A first-layer model is built using a combination of Extreme Learning Machine (ELM) and Adaptive Ensemble Learning (AELM). The ELM model is used as a weak learner in the AELM algorithm, and the hidden layer output matrix of the ELM model is defined as follows:
[0080]
[0081] Where H is the hidden layer output matrix, ω k It is the weight from the input layer to the hidden layer, b k It is the bias of the hidden layer, ω during model training. k and b k Given randomly, x n is the input parameters of the model training set, and g(·) is the activation function.
[0082] The Sigmoid function was chosen as the activation function for the hidden layer neurons in the Extreme Learning Machine, and the model was trained accordingly. The number of hidden layer neurons was determined based on an empirical formula:
[0083]
[0084] Where h is the number of hidden layer neurons, m is the number of input layer neurons, n is the number of output layer neurons, and a is a constant between 1 and 10. The relationship between the hidden layer output matrix H and the model training set output parameters Y is as follows:
[0085] Hβ=Y (4)
[0086] Where β is the connection weight from the hidden layer to the output layer, β can be calculated according to equation (5):
[0087]
[0088] in, It is the Moore-Penrose generalized inverse of matrix H.
[0089] After training the Extreme Learning Machine (ELM) model, the adaptive ensemble learning algorithm is used to integrate multiple ELM models into a strong learner, and its calculation formula is shown in Equation (6).
[0090]
[0091] Where S(x) is the output of the strong learner, T is the number of weak learners, and G is the output of the strong learner. t (x) is a weak learning machine, a t It is the weight between the weak learning machine and the strong learning machine;
[0092] Based on the training data with input and output parameters, a first-layer prediction model is constructed using the strong learner.
[0093] Step S300: Establish an expert experience database for weather types based on historical meteorological data, wherein the weather types include stable weather types and changing weather types;
[0094] Based on the changing trends of historical meteorological data, a weather type classification database is constructed using expert experience rules. Specifically, this involves analyzing the fluctuation characteristics of key parameters such as light intensity, radiation intensity, and cloud cover in long-term historical data; statistically analyzing the rate of change, duration, and abrupt change thresholds under typical weather conditions such as sunny, cloudy, and partly cloudy days; and setting discrimination criteria between stable and changing weather based on meteorological knowledge. This results in an expert experience knowledge base containing two types of weather models, providing a basis for subsequent classification modeling. This step achieves objective classification of weather types by quantifying the dynamic characteristics of historical meteorological parameters and integrating domain expert criteria.
[0095] Step S400: Based on the expert experience base, determine the weather type corresponding to the current meteorological data, and select the second-layer prediction model corresponding to the weather type;
[0096] This step involves real-time monitoring of key parameters such as light intensity, radiation intensity, and cloud cover within the current and previous time periods. It extracts hourly variation rates, fluctuation amplitudes, and persistence indicators, and compares these with preset thresholds for stable and changing weather in an expert database. For example, if the hourly variation rate of light intensity is consistently below 15% and the cloud cover fluctuation amplitude is less than 20% with no directional abrupt changes within the current window, the weather is classified as stable. Conversely, if there are drastic fluctuations in light or radiation parameters (e.g., hourly variation rate exceeding 30%) or sudden changes in cloud cover (e.g., cloud cover increase exceeding 40% within 10 minutes), the weather is classified as changing.
[0097] The model selection logic relies on multi-dimensional judgment rules in the expert experience base. During the judgment process, dynamic features such as the rate of change of light intensity, standard deviation of radiation intensity, and coefficient of variation of cloud cover within the time window are first extracted from the real-time data stream. These features are then matched item by item with preset stable weather threshold ranges in the expert experience base. When all feature parameters meet the stable weather thresholds, a first initial prediction sub-model optimized for stable weather is automatically selected; if any feature exceeds the threshold range, a changing weather judgment mechanism is triggered, and a second initial prediction sub-model optimized for changing weather types is selected. This dynamic matching mechanism enables adaptive switching of prediction strategies for different weather scenarios, ensuring strong adaptability of the model to current meteorological conditions.
[0098] Preferably, the method for constructing the second-layer prediction model includes:
[0099] Step S401: Based on the changing trends of historical meteorological data, establish a weather type expert experience database that includes stable weather types and changing weather types;
[0100] Step S402: For the stable weather type, construct a first initial prediction sub-model using the corresponding historical light intensity, radiation intensity and photovoltaic power data;
[0101] Step S403: For the aforementioned changing weather type, construct a second initial prediction sub-model using the corresponding historical light intensity, radiation intensity, and photovoltaic power data;
[0102] Step S404: Determine the structural parameters of the second-layer prediction model, and obtain the initial weights of the first and second initial prediction sub-models through offline training;
[0103] Step S405: Integrate the first initial prediction sub-model, the second initial prediction sub-model, and the structural parameters and initial weights to construct a complete second-layer prediction model.
[0104] Preferably, the method for determining the weather type corresponding to the current meteorological data includes: acquiring the meteorological data sequence within the current time and the preceding preset time window, and extracting the rate of change of light intensity, the rate of change of radiation intensity, and the fluctuation amplitude of cloud cover as determination features; when the following conditions are met simultaneously, it is determined to be a stable weather type; otherwise, it is determined to be a changing weather type:
[0105] The rate of change of light intensity is lower than the first threshold, and the direction of change remains unchanged;
[0106] The rate of change of radiation intensity is below the second threshold, and the direction of change remains unchanged;
[0107] The fluctuation range of cloud cover is less than the third threshold of the cloud cover baseline value;
[0108] The first and second thresholds are set based on the standard deviation of natural fluctuations in illumination / radiation in clear weather scenarios in historical data, the third threshold is set based on the critical value of cloud cover abrupt changes in stable and changing weather in historical data, and the preset time window length is 5-10 times the period of meteorological data sampling interval.
[0109] Step S500: Input the predicted values of light intensity and radiation intensity into the second-layer prediction model. The second-layer prediction module uses the recursive least squares algorithm to update the weights of the second-layer prediction model online to obtain the updated second-layer prediction model.
[0110] The input parameters of the second-layer prediction model are the predicted values of light intensity and radiation intensity obtained in the preceding steps. These two parameters are meteorological data directly related to photovoltaic power. The output parameter of the second-layer prediction model is photovoltaic power. When the weather changes rapidly, offline models have difficulty predicting changes in photovoltaic power. Therefore, the modeling method of the second-layer prediction model adds a recursive least squares algorithm to update the parameters online, based on the first-layer prediction model. During the modeling and prediction process, as new data arrives, the recursive least squares algorithm is used to uniformly update the initial weights of the strong learners of the first and second initial prediction sub-models online. The unified online update method includes:
[0111] When new data is received at time k+1, the intermediate parameter matrix is updated according to the intermediate parameter matrix at time k and the input parameter matrix at time k+1, using the following formula:
[0112]
[0113] Among them, P k+1 For the updated intermediate parameter matrix, P k Let be the intermediate parameter matrix at time k. It is the transpose of the input parameter matrix at time k+1, where I is the identity matrix and H is the transpose of the input parameter matrix at time k+1. k+1 It is the input parameter matrix at time k+1;
[0114] Based on the updated intermediate parameter matrix, the model weights at time k, and the output parameters at time k+1, the weights of the second-level prediction model at time k+1 are calculated using the following formula:
[0115]
[0116] Where, β k+1 β represents the weights of the second-layer prediction model at time k+1. k S represents the weights of the second-layer prediction model at time k. k+1 These are the output parameters at time k+1;
[0117] The calculated weights of the second-layer prediction model are applied to the second-layer prediction model to obtain the updated second-layer prediction model.
[0118] Step S600: Output the photovoltaic power prediction results using the updated second prediction model.
[0119] This step uses the predicted light intensity and radiation intensity output from step S200 as input parameters. Combined with the model weights dynamically updated using the recursive least squares algorithm in step S500, the real-time calculation and output of photovoltaic power is performed through a prediction algorithm adapted to the current weather type (stable or changing) in the second-layer prediction model. This process effectively improves prediction accuracy and robustness under different meteorological conditions by integrating the strong correlation of hierarchical modeling, the scenario adaptability of classification modeling, and the dynamic correction capability of online learning, while ensuring clear causal logic between model input and output parameters.
[0120] In this embodiment, as described in step S500 above, the recursive least squares algorithm triggers an online update each time a new data stream is received. The updated intermediate parameter matrix and the weights of the second-layer prediction model cover the original parameters in real time. Furthermore, a sliding window mechanism is used during the update process to retain only historical data within the most recent preset time period for weight update calculation.
[0121] According to another aspect of this embodiment, the present invention also provides an online photovoltaic power prediction system based on hierarchical classification modeling, such as... Figure 2 As shown, it includes the following modules:
[0122] The data acquisition and preprocessing module acquires meteorological data such as temperature, humidity, wind speed, wind direction, pressure, and cloud cover, which are indirectly related to photovoltaic power but directly related to solar irradiance and radiation intensity, and stores them in a database. This meteorological data will serve as the input parameters for the first-layer prediction model. The SG filtering method is used to preprocess the meteorological data to eliminate data spikes and short-term drastic fluctuations while preserving long-term trends.
[0123] The first-layer prediction model calculation module selects meteorological data such as temperature, humidity, and cloud cover, which are indirectly related to photovoltaic power but directly related to light intensity and radiation intensity, as input parameters for the first-layer prediction model. The output parameters of the first-layer prediction model are light intensity and radiation intensity. The prediction model is built and trained using the Extreme Learning Machine (ELM) method. A single ELM model acts as a weak learner, and an adaptive ensemble learning algorithm (Adaboost) is used to integrate multiple weak learners into a strong learner.
[0124] The second-layer prediction model calculation module. Since irradiance and radiation intensity are parameters directly affecting photovoltaic power generation, an online prediction model is established between irradiance, radiation intensity, and photovoltaic power. Based on the changing trends of meteorological data in the historical database, an expert experience database of weather types is established, specifically including stable and variable weather types. Based on expert experience rules, prediction models are established for different types of weather conditions. Before each prediction, it is determined whether the meteorological data for that period belongs to a stable or variable weather type, and then a targeted prediction is made. In the specific prediction model, online learning is performed using newly arriving data streams. The weights of the strong learner are updated online based on the recursive least squares algorithm. The optimized prediction model is then used for online prediction of photovoltaic power.
[0125] This invention effectively overcomes the limitations of traditional single-layer offline models by combining hierarchical and classification modeling strategies. First, addressing the issues of weak correlation between meteorological parameters and poor model interpretability, meteorological data is divided into two categories: directly correlated (light intensity, radiation intensity) and indirectly correlated (temperature, humidity, etc.). A hierarchical modeling framework is adopted: the first layer uses an adaptive ensemble learning algorithm to establish the mapping relationship between indirect parameters and light radiation parameters; the second layer constructs a classification prediction model based on light radiation parameters, strengthening the model's logic and prediction accuracy by decomposing the physical causal relationships of the input parameters. Second, considering the diversity of meteorological scenarios, a weather type expert experience database (stable / changing weather) is constructed. Weather types are dynamically determined based on real-time data, and appropriate prediction sub-models are called. Classification modeling significantly improves the model's generalization ability across different scenarios. Finally, addressing the challenge of predicting dynamic changes in photovoltaic power, a recursive least squares algorithm is introduced to update the weights of the second-layer model online. Combined with a sliding window mechanism, the changing trends of the data stream are captured in real time, ensuring the model's rapid response capability in scenarios of sudden weather changes. This invention enhances parameter correlation through a hierarchical structure, improves scenario adaptability through a classification mechanism, and ensures dynamic prediction capabilities through online learning. It achieves synergistic optimization of photovoltaic power prediction accuracy and stability, providing reliable technical support for the efficient regulation of green electricity hydrogen production systems.
[0126] According to another aspect of the embodiments of this application, an electronic device is also provided, including a processor and a memory, wherein the processor is configured to implement the steps of the method when executing a computer program stored in the memory.
[0127] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0129] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0130] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0131] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for online prediction of photovoltaic power based on hierarchical classification modeling, characterized in that, Includes the following steps: Collect meteorological data indirectly related to photovoltaic power, and preprocess the meteorological data; The preprocessed meteorological data is input into the first-layer prediction model. The first-layer prediction model uses the preprocessed meteorological data as input parameters, adopts an extreme learning machine as a weak learner, integrates multiple weak learners through an adaptive ensemble learning algorithm, and outputs the predicted values of light intensity and radiation intensity. An expert experience database of weather types was established based on historical meteorological data, including stable weather types and changing weather types. Based on the expert experience base, determine the weather type corresponding to the current meteorological data, and select the second-layer prediction model corresponding to the weather type; The predicted values of light intensity and radiation intensity are input into the second-layer prediction model. The second-layer prediction module uses a recursive least squares algorithm to update the weights of the second-layer prediction model online, and obtains the updated second-layer prediction model. The updated second prediction model is used to output the photovoltaic power prediction results.
2. The photovoltaic power online prediction method based on hierarchical classification modeling as described in claim 1, characterized in that, The preprocessing involves using the SG filtering method to preprocess the meteorological data. The calculation formula for the SG filtering method is as follows: Among them, X * These are meteorological data after SG filtering, where X is the original meteorological data and C is the raw meteorological data. i represents the coefficients for the i-th numerical filter, m is the width of half a filter window, and N = 2m + 1 is the length of the filter.
3. The online photovoltaic power prediction method based on hierarchical classification modeling as described in claim 1, characterized in that, The method for constructing the first-layer prediction model includes: Multiple Extreme Learning Machine (ELM) models are constructed as weak learners for the adaptive ensemble learning algorithm, where the hidden layer output matrix of each ELM model is defined as follows: Where H is the hidden layer output matrix, ω k It is the weight from the input layer to the hidden layer, b k It is the bias of the hidden layer, x n is the input parameters of the model training set, and g(·) is the activation function; For each extreme learning machine model, the weights from the input layer to the hidden layer and the hidden layer biases are randomly generated. The Sigmoid function was chosen as the activation function for the hidden layer neurons of each Extreme Learning Machine model. The number of hidden layer neurons in each Extreme Learning Machine model is determined based on the following empirical formula: Where h is the number of hidden layer neurons, m is the number of input layer neurons, n is the number of output layer neurons, and a is a constant between 1 and 10; Based on the input parameters of the training set and the activation function, calculate the hidden layer output matrix of each extreme learning machine model; Based on the hidden layer output matrix and the training set output parameters, the connection weights from the hidden layer to the output layer are calculated using the following formula: Where β is the connection weight from the hidden layer to the output layer. H is the Moore-Penrose generalized inverse of matrix H, and Y is the output parameter of the training set; An adaptive ensemble learning algorithm is used to integrate multiple trained Extreme Learning Machine models into a strong learner. The output of the strong learner is calculated by the following formula: Where S(x) is the output of the strong learner, T is the number of weak learners, and G is the output of the strong learner. t (x) is a weak learning machine, a t It is the weight between the weak learning machine and the strong learning machine; Based on the training data with input and output parameters, a first-layer prediction model is constructed using the strong learner.
4. The online photovoltaic power prediction method based on hierarchical classification modeling as described in claim 1, characterized in that, The construction method of the second-layer prediction model includes: Based on the changing trends of historical meteorological data, establish a weather type expert experience database that includes stable weather types and changing weather types; For the aforementioned stable weather type, a first initial prediction sub-model is constructed using the corresponding historical light intensity, radiation intensity, and photovoltaic power data; For the aforementioned changing weather types, a second initial prediction sub-model is constructed using the corresponding historical light intensity, radiation intensity, and photovoltaic power data; Determine the structural parameters of the second-layer prediction model, and obtain the initial weights of the first and second initial prediction sub-models through offline training; The first initial prediction sub-model, the second initial prediction sub-model, and the structural parameters and initial weights are integrated to construct a complete second-layer prediction model.
5. The online photovoltaic power prediction method based on hierarchical classification modeling as described in claim 4, characterized in that, During the prediction process of the second-layer prediction model, the recursive least squares algorithm is used to uniformly update the initial weights of the strong learners of the first and second initial prediction sub-models online. The unified online update method includes: When new data is received at time k+1, the intermediate parameter matrix is updated according to the intermediate parameter matrix at time k and the input parameter matrix at time k+1, using the following formula: Among them, P k+1 For the updated intermediate parameter matrix, P k Let be the intermediate parameter matrix at time k. It is the transpose of the input parameter matrix at time k+1, where I is the identity matrix and H is the transpose of the input parameter matrix at time k+1. k+1 It is the input parameter matrix at time k+1; Based on the updated intermediate parameter matrix, the model weights at time k, and the output parameters at time k+1, the weights of the second-level prediction model at time k+1 are calculated using the following formula: Where, β k+1 β represents the weights of the second-layer prediction model at time k+1. k S represents the weights of the second-layer prediction model at time k. k+1 These are the output parameters at time k+1; The calculated weights of the second-layer prediction model are applied to the second-layer prediction model to obtain the updated second-layer prediction model.
6. The online photovoltaic power prediction method based on hierarchical classification modeling as described in claim 5, characterized in that, The recursive least squares algorithm triggers an online update each time a new data stream is received. The updated intermediate parameter matrix and the weights of the second-layer prediction model cover the original parameters in real time. Furthermore, a sliding window mechanism is used during the update process to retain only historical data within the most recent preset time period for weight update calculation.
7. The online photovoltaic power prediction method based on hierarchical classification modeling as described in claim 1, characterized in that, Meteorological data indirectly related to photovoltaic power include temperature, humidity, wind speed, wind direction, pressure, and cloud cover.
8. The online photovoltaic power prediction method based on hierarchical classification modeling as described in claim 1, characterized in that, The methods for determining the weather type corresponding to the current meteorological data based on the expert experience base include: Acquire meteorological data sequences for the current moment and the preceding preset time window, and extract the rate of change of light intensity, the rate of change of radiation intensity, and the fluctuation amplitude of cloud cover as judgment features; A weather type is classified as stable if all of the following conditions are met; otherwise, it is classified as changing weather: The rate of change of light intensity is lower than the first threshold, and the direction of change remains unchanged; The rate of change of radiation intensity is below the second threshold, and the direction of change remains unchanged; The fluctuation range of cloud cover is less than the third threshold of the cloud cover baseline value; The first and second thresholds are set based on the standard deviation of natural fluctuations in illumination / radiation in clear weather scenarios in historical data, the third threshold is set based on the critical value of cloud cover abrupt changes in stable and changing weather in historical data, and the preset time window length is 5-10 times the period of meteorological data sampling interval.
9. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store programs that support the processor in executing the online photovoltaic power prediction method based on hierarchical classification modeling as described in any of claims 1-8, and the processor is configured to execute the programs stored in the memory.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is run by the processor, it performs the steps of the online photovoltaic power prediction method based on hierarchical classification modeling as described in any one of claims 1-8.
