Photovoltaic power prediction method and device

By using hierarchical interpolation, time alignment, and dynamic normalization, various types of basic models are trained and stacked according to rules, solving the problems of data missingness, time misalignment, and model fusion in photovoltaic power prediction, and achieving more accurate and stable photovoltaic power prediction.

CN122026316APending Publication Date: 2026-05-12GOODWE TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GOODWE TECHNOLOGIES CO LTD
Filing Date
2025-12-31
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods suffer from inaccurate predictions due to factors such as missing data, time misalignment, incomplete anomaly detection, distribution drift, model fusion redundancy and high correlation, unreliable assessments, and lack of multi-step output capabilities.

Method used

Preprocessed data is generated through hierarchical interpolation, time alignment, hierarchical anomaly correction, and dynamic normalization. Various types of basic models are trained and stacked according to rules to select the optimal target prediction model.

Benefits of technology

It effectively fills in data gaps, corrects time misalignments, improves the temporal integrity and accuracy of data, enhances the robustness and accuracy of the prediction system, and has the ability to handle multi-step prediction tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122026316A_ABST
    Figure CN122026316A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of power generation prediction, and discloses a photovoltaic power prediction method and device, and the method comprises the steps: obtaining historical photovoltaic data in a preset time period, and sequentially carrying out the layering interpolation, time alignment, layering abnormality correction and dynamic normalization processing, and obtaining the preprocessing data; generating a training sample and a verification sample based on the preprocessed data; training multiple types of original models by using the training samples until preset conditions are met, and taking the original models as basic models; freezing the basic model, and stacking according to a pairing rule to obtain a target stacking model; and screening out a target prediction model from the target stacking model and the basic model based on the verification sample, wherein the target prediction model is used for executing photovoltaic power prediction operation. According to the method, the problem of inaccurate prediction caused by data missing, time dislocation, incomplete anomaly detection, distribution drift, model fusion redundancy, high correlation, incredible evaluation and lack of multi-step output capability in photovoltaic power prediction in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power generation prediction technology, and specifically to a photovoltaic power prediction method and apparatus. Background Technology

[0002] With the large-scale use of renewable energy, the proportion of photovoltaic (PV) power generation in the power system has been increasing year by year. Its output power is affected by multiple factors such as weather, irradiance, temperature, and cloud cover, exhibiting significant fluctuations and a degree of randomness. Accurate PV power forecasting is a crucial foundation for safe power system dispatch, energy storage control, load balancing, and renewable energy integration, and is of key significance to the economic efficiency and stability of power grid operation. Currently, PV power forecasting is widely used in power dispatch centers, smart energy management platforms, and integrated PV-storage systems, and is an important component of intelligent operation and maintenance of renewable energy.

[0003] Existing photovoltaic power prediction methods generally adopt a weather-driven and data-driven approach, that is, by collecting historical photovoltaic power data and weather forecast data, processing them through various data processing methods, and then inputting them into a single prediction model or a multi-model weighted fusion model for prediction. However, existing methods still have shortcomings in several key aspects: existing interpolation methods are mostly based on linear or spline methods, which do not take advantage of the significant periodic characteristics of photovoltaic power generation data, and are prone to problems such as discontinuous power curves, abnormal waveforms, or trend shifts when there are continuous or isolated points missing; there is often a collection delay or prediction offset between photovoltaic power and irradiance, and if the time offset is not corrected, the model will learn an incorrect input-output correspondence; traditional methods only use daily statistics or single-point outlier detection, which lacks a distribution process of initial screening followed by detailed inspection, and cannot simultaneously take into account daily and point-level anomalies, making it easy to miss or misjudge; traditional methods that normalize with global maximum values ​​or fixed rated power cannot adapt to scenarios such as power plant expansion, maintenance, or power rationing, resulting in data distribution drift and thus prediction errors; direct multi-model integration and stacking can easily generate parameter redundancy and high correlation between models, resulting in unstable weights in the fusion layer and the risk of overfitting; in addition, existing stacking methods usually only focus on the vertical fusion of multiple models, without training and predicting the stacked models in parallel with single models. Such structures lack the ability to utilize the complementary advantages of different models under different site environments, meteorological conditions, and temporal characteristics.

[0004] While existing technologies have some practical applications in engineering, they still have significant shortcomings in areas such as the physical rationality of data interpolation, the temporal consistency of power and meteorological data, the robustness of anomaly detection, the real-time performance of rated capacity changes, and the reliability of model fusion. These issues collectively lead to a decrease in the stability and accuracy of photovoltaic power prediction under multi-climate, cross-seasonal, and capacity-changing scenarios. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a photovoltaic power prediction method and apparatus to solve the problems of inaccurate photovoltaic power prediction in the prior art caused by data missing, time misalignment, incomplete anomaly detection, distribution drift, model fusion redundancy and high correlation, unreliable evaluation, and lack of multi-step output capability.

[0006] In a first aspect, embodiments of the present invention provide a photovoltaic power prediction method, the method comprising: Historical photovoltaic data within a preset time period is acquired, and the historical photovoltaic data is sequentially subjected to hierarchical interpolation, time alignment, hierarchical anomaly correction, and dynamic normalization to obtain preprocessed data. Training samples and validation samples generated based on the preprocessed data; The training samples are used to train different types of original models until the original models meet the preset conditions, and the original models that meet the preset conditions are used as the base models. Freeze the base model, and stack the base model according to the model pairing rules to obtain the target stacked model; Based on the validation samples, a target prediction model for photovoltaic power prediction is selected from the target stacking model and the basic model, and the corresponding prediction operation is performed through the target prediction model.

[0007] Furthermore, the hierarchical interpolation process includes: Identify the start and end timestamps of the missing areas covered in the historical photovoltaic data; Obtain valid historical data corresponding to the start and end timestamps from the preset photovoltaic dataset; The missing areas in the historical photovoltaic data are filled in using the valid historical data to obtain the first photovoltaic data.

[0008] Furthermore, obtaining valid historical data corresponding to the start and end timestamps from the preset photovoltaic dataset includes: The first reference time period is determined in the preset photovoltaic dataset according to the first period window; In the first reference time period, query whether there is first historical data corresponding to the start and end timestamps; If the first historical data exists in the first reference time period, then the first historical data in the first period window shall be used as the valid historical data. Alternatively, if the first historical data does not exist in the first reference time period, then a second reference time period is determined in the preset photovoltaic dataset according to the second period window, the second historical data corresponding to the start and end timestamps is queried in the second reference time period, and the second historical data in the second period window is taken as the valid historical data.

[0009] Furthermore, the time alignment process includes: The first photovoltaic data obtained after hierarchical interpolation is acquired, and the irradiance sequence and photovoltaic power sequence are extracted from the first photovoltaic data. The irradiance sequence is translated within a preset sliding time offset range to generate a translated irradiance sequence; Calculate the correlation coefficient between the photovoltaic power sequence and the shifted irradiance sequence for each offset, and select the offset with the largest correlation coefficient as the target offset for shifting the irradiance sequence; If the target offset is not a preset value, the first and last empty positions of the translated irradiance sequence are filled with a preset fill value to obtain a corrected irradiance sequence. The fill value includes, but is not limited to, zero, neighboring, or interpolated values. The photovoltaic power sequence and the corrected irradiance sequence are used as the second photovoltaic data.

[0010] Furthermore, the hierarchical anomaly correction process includes: Acquire the second photovoltaic data after time alignment processing, and calculate the daily photovoltaic power value based on the second photovoltaic data; The daily photovoltaic power value is used to determine the valid data period within the preset time cycle; Using irradiance level as the grouping condition, the second photovoltaic data within the effective data period are grouped according to the preset interval to which the irradiance value belongs, resulting in multiple irradiance groups; For the second photovoltaic data within each irradiance group, box plot statistics are calculated and outliers are identified. The outliers are then corrected to obtain corrected photovoltaic data. Based on the corrected photovoltaic data, a target regression model between photovoltaic power and irradiance is established. Obtain the regression residual distribution of the target regression model, and adjust the residual abnormal points in the corrected photovoltaic data according to the regression residual distribution to obtain the third photovoltaic data.

[0011] Furthermore, the dynamic normalization process includes: Obtain the third photovoltaic data after hierarchical anomaly correction processing; The fourth photovoltaic data is obtained by dividing the time-varying rated power at the corresponding moment by the third photovoltaic data, wherein the fourth photovoltaic data is the preprocessed data.

[0012] Furthermore, the stacking of the base models according to model pairing rules to obtain the target stacked model includes: The basic models are combined according to the model pairing rules to obtain candidate model groups; The candidate model group is stacked using the initial weight parameters to obtain an initial stacked model; The target stacking model is obtained by training the fusion layer in the initial stacking model using the training samples.

[0013] Furthermore, the step of training the fusion layer in the initial stacked model using the training samples to obtain the target stacked model includes: Obtain the sample prediction values ​​output by the base model based on the training samples during the training process; The sample prediction value is input into the fusion layer in the initial stacked model to obtain the target prediction value, wherein the fusion layer is set after the candidate model group in the initial stacked model; The weight parameters of the fusion layer in the initial stacked model are adjusted using the target predicted value and the actual value corresponding to the training sample to obtain the target stacked model.

[0014] Furthermore, the step of selecting a target prediction model for photovoltaic power prediction from the target stacked model and the base model based on the validation samples includes: Extract the input values ​​and actual values ​​from the verification samples; The input values ​​are respectively input into the base model and the target stacked model to obtain the predicted values ​​output by each model; Calculate the error index between the predicted value output by each model and the actual value in the validation sample; The model with the smallest error index is selected from the target stacked model and the base model as the target prediction model.

[0015] Secondly, embodiments of the present invention provide a photovoltaic power prediction device, the device comprising: The acquisition module is used to acquire historical photovoltaic data and perform hierarchical interpolation, time alignment, hierarchical anomaly correction, and dynamic normalization on the historical photovoltaic data in sequence to obtain preprocessed data. A generation module is used to generate training samples and validation samples based on the preprocessed data; The training module is used to train different types of original models using the training samples until the original models meet preset conditions, and the original models that meet the preset conditions are used as the base models. The stacking module is used to freeze the base model and stack the base model according to the model pairing rules to obtain the target stacked model. The execution module is used to select a target prediction model for photovoltaic power prediction from the target stacking model and the base model based on the verification sample, and to perform the corresponding prediction operation through the target prediction model.

[0016] The method provided in this application has the following beneficial effects: The method provided in this application effectively fills in the missing continuous or isolated data caused by communication interruption or sampling anomalies through hierarchical interpolation, restoring the temporal integrity and physical form of the data; through time alignment processing, it corrects the temporal misalignment between power and irradiance data, significantly improving the temporal correlation between key variables; through hierarchical anomaly correction processing, it differentiates and corrects anomalies at different time scales (such as point-level and whole-day), taking into account the accuracy of both local and overall data; through dynamic normalization processing, it adapts to data distribution drift caused by photovoltaic capacity expansion, maintenance, and power rationing scenarios, avoiding the problem of unified normalization failure; by training multiple types of basic models and selecting the best one, it fully utilizes the advantages of different models, enhancing the robustness of the prediction system; by freezing the basic models and stacking them according to rules, it reduces parameter redundancy and high correlation between models, improving fusion efficiency and stability; finally, through objective screening based on validation samples, it determines the optimal target prediction model, ensuring the accuracy and reliability of the final prediction results and possessing the ability to handle multi-step prediction tasks. Attached Figure Description

[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is a schematic flowchart of a photovoltaic power prediction method according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating another photovoltaic power prediction method according to an embodiment of the present invention; Figure 3 This is a structural block diagram of a photovoltaic power prediction device according to an embodiment of the present invention; Detailed Implementation To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] According to embodiments of the present invention, a photovoltaic power prediction method and apparatus are provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0020] This embodiment provides a photovoltaic power prediction method. Figure 1 This is a flowchart of a photovoltaic power prediction method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps: Step S101: Obtain historical photovoltaic data within a preset time period, and sequentially perform hierarchical interpolation, time alignment, hierarchical anomaly correction, and dynamic normalization on the historical photovoltaic data to obtain preprocessed data.

[0021] In this embodiment, firstly, the data source is defined. Time-series data, actually recorded or predicted, is collected from data sources such as the Supervisory Control and Data Acquisition (SCADA) system of the photovoltaic power plant or related historical databases within a specified current time period (e.g., the past few months or years). Secondly, the data content is defined. The acquired historical photovoltaic data includes the following two core time-series sequences: Historical photovoltaic power data: i.e., the sequence of actual output power values ​​of the photovoltaic power plant at each sampling moment (e.g., every 15 minutes) within the time period. Forecasted meteorological data: i.e., the meteorological forecast information at the corresponding moment within the time period, mainly including the future predicted key meteorological characteristic sequences such as irradiance (GHI), temperature (TEM), and cloud cover (CLO). These data together constitute a complete multidimensional time series, which can be uniformly represented as:

[0022] in, Historical photovoltaic data; Indicates the total data length; Indicates the first The time for each sampling point; Indicates time The photovoltaic power value or meteorological characteristic value.

[0023] This provides the original input material for subsequent model training and selection processes. The acquired historical photovoltaic data... Starting from this point, the data undergoes preprocessing operations such as hierarchical interpolation, time alignment, hierarchical anomaly correction, and dynamic normalization, ultimately generating preprocessed data for model training, stacking, and filtering.

[0024] Step S102: Training samples and validation samples generated based on preprocessed data.

[0025] In this embodiment, firstly, a sample set is constructed. Assume the historical window length is... The predicted step size is For each prediction time in the preprocessed data. Construct a sample pair Among them, input features Contains multidimensional information:

[0026] in, where n is the total dimension of the features; This represents K consecutive historical photovoltaic power values ​​from time t-K+1 to t; , , These represent the predicted sequences of irradiance, temperature, and cloud cover for the next M predicted lengths, respectively. Represents the time characteristics (e.g., hours) of the next M moments; and These represent the hourly mean and standard deviation extracted from historical power data, respectively.

[0027] Output target The actual photovoltaic power values ​​at M future moments:

[0028] By iterating through the entire timeline of the preprocessed data using a sliding window (with a sliding step of one time interval, such as 15 minutes), a sample set is generated.

[0029] in, This represents the total number of time steps for preprocessing the data.

[0030] Next, the samples are partitioned. The generated sample set is then... The data is randomly divided into two non-overlapping parts according to a preset ratio (e.g., 8:2): training samples and validation samples. Training samples are used for independent training of multiple original models and for training the weights of the fusion layer when stacking base models. Validation samples are used for performance evaluation and selection of all candidate models (base models and stacked models). In practice, the entire dataset can be used as both stacked training data and validation evaluation data. The preprocessed time-series data is transformed into a sample format suitable for supervised learning models, and through reasonable partitioning, provides high-quality, structured data support for subsequent model training, fusion, and selection.

[0031] Step S103: Use training samples to train different types of original models until the original models meet the preset conditions, and use the original models that meet the preset conditions as the base models.

[0032] First, the set of original models is defined. This method presupposes at least four different types of machine learning models, including Support Vector Regression (SVR), LightGBM, XGBoost, and Bayesian linear models. These models each have their own strengths in linear / nonlinear fitting, noise robustness, and feature interaction capture.

[0033] Secondly, since this task involves multi-step power prediction over the next M time steps, it is necessary to ensure that all models have multi-output capabilities. Models that inherently support multi-output (such as Bayesian linear models) can be trained directly. For models that are inherently single-step predictors (i.e., SVR, LightGBM, XGBoost), it is necessary to construct M parallel single-step prediction sub-models or use the framework's built-in multi-output structure to enable them to output the predicted values ​​for the next M steps at once.

[0034] Then, independent and parallel model training and hyperparameter optimization are performed. This is done using training samples (i.e....) Each original model is trained independently using a set of sample pairs. During training, hyperparameter search techniques (such as grid search, random search, or Bayesian optimization) are used to find the optimal combination of hyperparameters for each model that minimizes its prediction error (such as mean squared error) on the training set.

[0035] Ultimately, the base models are obtained. Each original model, after completing the above training and hyperparameter optimization, becomes a trained base model with fixed parameters. These base models collectively constitute a diverse set of base models, which can be formally represented as:

[0036] in, This represents the m-th completed base model (e.g., For SVR, $f^{(2)}$ corresponds to LightGBM, etc., and its predicted output for input X is Y(m)=f(X).

[0037] By utilizing different types of learners to learn from the same training data, base learners with diverse predictive capabilities are generated, laying the foundation for building a stacked fusion model that can capture the complementary advantages between different models in subsequent steps. The parameters of all base models are fixed after training in this stage and will remain frozen in subsequent stacked training.

[0038] Step S104: Freeze the base model and stack the base models according to the model pairing rules to obtain the target stacked model.

[0039] In this embodiment of the application, after the basic model training is completed, all basic models are trained using technical means (e.g., setting the trainable attribute of the model to False in the machine learning framework). The internal parameters (including weights, biases, etc.) are set to a frozen state. This is intended to use the base model as a stable feature extractor or predictor in subsequent stacked training, preventing its parameters from changing in tandem with the top-level fusion weights, thereby reducing the risk of overfitting and improving training efficiency.

[0040] Step S105: Based on the validation samples, select the target prediction model for photovoltaic power prediction from the target stacking model and the basic model, and perform the corresponding prediction operation through the target prediction model.

[0041] In this embodiment, firstly, pre-constructed input values ​​and corresponding actual values ​​are extracted from the validation samples. The input values ​​are then sequentially input into all candidate models, including the already trained and parameter-frozen base model and the target stacked model obtained through stacking, to obtain the predicted values ​​for future time periods for each model. Next, the root mean square error (RMSE) between the predicted and actual values ​​is calculated for each model, serving as an error metric for evaluating the model's prediction accuracy. Finally, the model with the smallest RMS error among all candidate models is selected as the final target prediction model. This model will be used to predict the power of photovoltaic data that has undergone the same preprocessing, outputting prediction results with actual physical dimensions.

[0042] In this embodiment of the application, the layered interpolation process includes: Step A1: Identify the start and end timestamps of the missing area coverage in the historical photovoltaic data.

[0043] Specifically, firstly, the acquired raw photovoltaic data (including time series of photovoltaic power and meteorological characteristics) is thoroughly examined to identify blank or invalid data segments caused by communication interruptions or sampling anomalies, i.e., missing regions. Missing regions are categorized into two types based on the number of consecutive invalid sampling points they contain: when the number of consecutive invalid points is greater than 1, it is recorded as a missing segment (continuous missing segment); when the number is equal to 1, it is recorded as a missing single point. For each identified missing region, the starting sampling time covered on the time axis is determined. With the end of sampling time Together, these define the coverage area of ​​the missing region, i.e., the start and end timestamps (or trigger period), which will serve as the basis for data completion. The length of the missing segment is defined as:

[0044] in, The number of sampling points contained in the missing segment; This represents the start time of the missing segment; This represents the end time of the missing segment; The sampling interval (e.g., 15 minutes). If If, then it is recorded as a continuous missing segment; if If a point is missing, it is recorded as a single missing point.

[0045] Each identified missing region (i.e., blank or invalid data segment) corresponds to a clearly defined start and end range. Therefore, the starting sampling time for each missing region is identified. With the end of sampling time These two moments together define the time range covered by the missing region, namely the start and end timestamps (or trigger period).

[0046] Step A2: Obtain valid historical data corresponding to the start and end timestamps from the preset photovoltaic dataset.

[0047] In this embodiment of the application, obtaining valid historical data corresponding to the start and end timestamps from a preset photovoltaic dataset includes: Step A201: Determine the first reference time period in the preset photovoltaic dataset according to the first period window.

[0048] Specifically, the first level of reference time range, or first reference time period, is determined within the preset photovoltaic dataset (i.e., a database storing photovoltaic and meteorological data). The first period window is defined as the intra-weekly period in daily units, i.e., the "near-period." The specific determination method is as follows: Based on the start time of the missing region In a historical dataset, using days as the offset unit, dates with the same intraday time are searched within a certain number of days forward (past) and backward (future) to form the first reference time period. Mathematically, this is expressed as follows: for a given... Calculate a set of potential reference time points :

[0049] in, This indicates that the search results found in the historical dataset are related to... Potential reference time points with the same intraday time; This represents the number of days offset; a negative value indicates an offset of days to the past, while a positive value indicates an offset of days to the future. The search radius is the preset first period window, which is the maximum range for searching forward and backward in the number of days dimension. The first reference time period consists of all time points that meet the requirements. The resulting set. Establishing a time base for historical data on similar weather and power generation patterns within a nearby time window, using daily periods as the unit, is the foundation for subsequent near-period interpolation. The search follows the principle of prioritizing data from the nearest day in time to maintain consistency in data trends.

[0050] Step A202: In the first reference time period, query whether there is first historical data corresponding to the start and end timestamps.

[0051] Specifically, firstly, based on the start and end timestamps and length of the missing region, the candidate reference time points are queried sequentially in ascending order of temporal distance. For each candidate... Check the data for the following time periods in the preset photovoltaic dataset: If the missing region is a continuous missing segment, then the query will use... The starting point and the length are The query checks whether all data points within a continuous time period exist and are valid values ​​(i.e., normal data that is neither missing nor abnormal); if the missing region is a single missing point, then the query... Is a single data point at time 1 valid? If in a candidate... If a complete and valid continuous data segment or single data point is found at a certain location, it is determined that the first historical data exists, and this data is then recorded. The corresponding valid data records are considered the first historical data. The query process follows the principle of "prioritizing data from the nearest day in time," so once data that meets the criteria is found... That is, stop the search. If all candidates within the first reference time period are traversed... If no complete and valid data is found, it is determined that no first historical data exists. The query result of this step is the key criterion for deciding whether to perform near-period interpolation or switch to far-period search.

[0052] Step A203: If there is first historical data in the first reference time period, then the first historical data in the first period window shall be used as valid historical data.

[0053] Specifically, if the query result indicates the existence of the missing data, meaning that the first historical data suitable for filling the missing data has been found within the first reference time period (first period window), this data is extracted and officially used as valid historical data for subsequent interpolation and filling. The specific operation is divided into the following two cases depending on the type of missing region: For consecutive missing segments: Let the start time of the found valid consecutive reference segment be... Its continuum If there are 1 valid sample, then this sequence is considered valid historical data, and fragment interpolation is performed to fill in the original missing time periods:

[0054] in, It is the one to be filled, located in the missing time period. Power or meteorological values ​​at any given moment; These are valid historical data values ​​extracted from the first reference time period; The sampling interval is denoted as .

[0055] For single point of absence: Let the time point of the historical data of the found valid single point of absence be defined, and its value be... This value is then treated as valid historical data, and point-level interpolation is performed to fill in the original missing time points.

[0056] in, It is to be filled and is located at the missing time. Power or meteorological value; It is the corresponding valid single-point historical data value extracted from the first reference time period.

[0057] The purpose of this process is to use the effective historical data of the nearest neighbor day, based on the diurnal cycle similarity of photovoltaic power generation, to complete the missing areas with high quality and reasonable physical meaning, thereby obtaining key data fragments for constructing a complete dataset.

[0058] Step A204: If the first historical data does not exist in the first reference time period, then determine the second reference time period in the preset photovoltaic dataset according to the second period window, query the second historical data corresponding to the start and end timestamps in the second reference time period, and take the second historical data in the second period window as the valid historical data.

[0059] Specifically, this step is the entry point and core operation for performing long-period interpolation (long-period matching with a weekly cycle). If the query result is non-existent, confirming that no valid data for filling missing data could be found within the first reference time period, the second-level search and interpolation process is initiated. This includes the following sub-steps: First, the second reference time period is determined according to the second period window. The second period window is defined as a long-term period in weeks, i.e., the "long-term period." The determination method is similar to that of the first period, but the time scale is longer. This is based on the start time of the missing region. In historical datasets, using weeks as the offset unit, dates with the same day of the week and time of day are searched within a certain number of weeks forward (past) and backward (future) to form a second reference time period. Mathematically, this is expressed as follows: for a given... Calculate a set of potential reference time points :

[0060] in, This indicates that the search results found in the historical dataset are related to... Potential reference time points with the same day of the week and intraday time; This is the week offset; a negative value indicates a week offset to the past, and a positive value indicates a week offset to the future. The second reference time period is the search radius of the preset second period window, which is the maximum range for searching forward and backward in the week dimension. The set that constitutes.

[0061] Then, in the second reference time period, query the second historical data corresponding to the start and end timestamps. The query logic is the same as the recent period, but the search scope changes. Sets. Similarly, arranged in order of increasing temporal distance ( Query sequentially (from smallest to largest), and check accordingly. The starting point and the length are Continuous time period (for consecutive missing segments) or Is the data at a single point in time (for cases of single-point missing data) complete and valid? Once a data point that meets the criteria is found... Then the search stopped.

[0062] Finally, the second historical data in the second periodic window is used as valid historical data. If valid second historical data is found in the above query, it is extracted and used as the final valid historical data to fill the original missing regions. Based on the missing type, the corresponding interpolation operation is performed: For consecutive missing segments ( Let the start time of the found valid continuous reference segment be... If the sequence contains valid samples, then fragment interpolation is performed:

[0063] in, It is the one to be filled, located in the missing time period. Power or meteorological values ​​at any given moment; It is a valid second historical data value extracted from the second reference time period; The sampling interval is denoted as .

[0064] For single point missing ( Let the time point of the found valid single-point historical data be denoted as and its value be . Then point-level interpolation is performed:

[0065] in, It is the one to be filled, located in the missing time period. Power or meteorological values ​​at any given moment; It is the corresponding valid single-point second historical data value extracted from the second reference time period.

[0066] The purpose of this step is to ensure the robustness and completeness of the data preprocessing process by extending to longer, more seasonally similar weekly periods and utilizing historical data from further back but with the same periodic patterns to finally fill in the missing areas when the near-term period cannot provide effective reference data.

[0067] Step A3: Fill in the missing areas in the historical photovoltaic data using valid historical data to obtain the first photovoltaic data.

[0068] Specifically, valid historical data refers to the valid historical photovoltaic power or meteorological data fragments or single points located in the first reference time period (near period) or the second reference time period (far period) through hierarchical search and query, corresponding to the start and end timestamps of the missing area. The filling operation is performed according to the type of missing area, following the logic of fragment priority and single-point supplementation, and prioritizing the use of the most recently available valid data in time. For filling consecutive missing segments: Assuming the acquired valid historical data is a continuous sequence, this sequence is directly and sequentially filled into each sampling moment of the original missing time period, i.e.:

[0069] in, It is the photovoltaic power or meteorological value at the k-th moment within the original missing time period after filling; These are valid historical data values ​​obtained from the reference time period; The sampling interval is denoted as .

[0070] Imputation for single missing data points: Assume the acquired valid historical data is a single data point, and its reference time is... (Right now or ), value Then the value will be directly filled into the original missing time step. ,Right now:

[0071] in, It is the photovoltaic power or meteorological value at the k-th moment within the original missing time period after filling; These are valid historical data values ​​obtained from the reference time period.

[0072] The above filling operation is performed in the order in which the missing regions were identified. For each missing region, if valid historical data is returned, the corresponding filling is performed immediately. Once all identified missing regions in the original photovoltaic data (whether continuous missing segments or single missing points) have been filled using the above method, the entire dataset forms a complete data sequence that is continuous in time and has no missing points. This final generated data sequence is the first photovoltaic data.

[0073] By utilizing historical data that most closely resembles the physical patterns of the missing periods, high-quality and physically meaningful completion of missing values ​​was achieved, providing a continuous and complete input data foundation for subsequent data alignment, anomaly detection, and other processing procedures.

[0074] In this embodiment of the application, the time alignment process includes: Step B1: Obtain the first photovoltaic data after hierarchical interpolation processing, and extract the irradiance sequence and photovoltaic power sequence from the first photovoltaic data.

[0075] Specifically, the preliminary operation of data alignment correction aims to separate two key time series from the first photovoltaic data: the irradiance series and the photovoltaic power series, providing clear input data for subsequent sliding correlation analysis and time offset correction. The first photovoltaic data is a complete and continuous dataset obtained after hierarchical interpolation processing, where each sampling time... All data contain multiple synchronously recorded data, including at least photovoltaic power values ​​and corresponding meteorological characteristics (such as irradiance GHI, temperature TEM, cloud cover CLO, etc.). Perform the following extraction operations: First, iterate through all sampling times of the first photovoltaic data set, extracting the photovoltaic power value recorded at each time point in chronological order to form a time series. This series represents the actual output power of the photovoltaic power station at each time point, denoted as:

[0076] in, Indicates at the sampling time The photovoltaic power value; This represents the total number of sampling points.

[0077] Similarly, by iterating through all sampling times of the first photovoltaic data set, the irradiance (GHI) value recorded at each time point is extracted in chronological order to form another time series. This series characterizes the total solar irradiance reaching the surface of the photovoltaic module, denoted as:

[0078] in, Indicates at the sampling time Irradiance value.

[0079] The two extracted sequences and Strict time alignment must be maintained, meaning that for any identical index or time... , and These are the records corresponding to the same sampling time in the original data. This forms the basis for subsequent meaningful correlation calculations and time offset corrections.

[0080] The purpose of this step is to isolate the core variables mixed in multidimensional data, forming a clean power and irradiance time series that can be directly processed by subsequent algorithms, thereby initiating an automatic time alignment process based on physical relationships.

[0081] Step B2: Translate the irradiance sequence within a preset sliding time offset range to generate the translated irradiance sequence.

[0082] Specifically, within the preset sliding time offset range Within, at a fixed time step (i.e., sampling interval) (e.g., 15 minutes) for the original irradiance sequence Perform a cyclic translation. For each integer offset within the range... Generate a corresponding translated sequence:

[0083] in, This indicates that at an offset of At time , the newly generated translational irradiance sequence is at time . The value; This indicates the original irradiance sequence at time [time]. The value; The offset is an integer, and its value range is... , This indicates a forward (future time) shift of the sequence. This indicates that the sequence has been shifted backward (in the past time direction); The half-width of the search window is defined by the preset maximum offset; The sampling interval is denoted as .

[0084] The generated offset is To create a translated sequence, simply move each data point of the original sequence along the time axis. The location of each sampling interval. For example, when At that time, the new sequence was The value at time is equal to the value of the original sequence at time 1. The value at time is equivalent to shifting the entire sequence in the past direction (or in the direction of decreasing time index). The duration. Ultimately, it will produce... Several different translated irradiance sequences, each corresponding to a specific offset. These sequences together form a candidate aligned sequence set, preparing for the next step of calculating the correlation with the photovoltaic power sequence at each offset.

[0085] Step B3: Calculate the correlation coefficient between the photovoltaic power sequence and the shifted irradiance sequence for each offset, and select the offset with the largest correlation coefficient as the target offset for shifting the irradiance sequence.

[0086] Specifically, first, calculate the correlation coefficient for each offset. For the sliding time offset range... For each integer offset k, calculate the photovoltaic power sequence. With the corresponding translational irradiance sequence Pearson correlation coefficient between :

[0087] in, This represents the Pearson correlation coefficient between the photovoltaic power sequence and the shifted irradiance sequence at an offset of k. This describes the method for calculating the Pearson correlation coefficient. Indicates at the sampling time The photovoltaic power value; Indicates the offset is At time , the translated irradiance sequence at time The value of .

[0088] The Pearson correlation coefficient is used to measure the degree of linear correlation between two sequences, and its range is [value range missing]. A larger absolute value indicates a stronger linear correlation. This is achieved by calculating each possible offset. Below This will give us a curve describing how the correlation changes with the offset.

[0089] Then, the offset with the highest correlation coefficient is selected as the target offset. Among all calculated correlation coefficients... In the process, find the offset that maximizes the correlation coefficient and determine it as the optimal target offset. :

[0090] in, This is the target offset, which is the integer offset that makes the correlation between photovoltaic power and irradiance sequence strongest; This indicates taking the objective function (here, the correlation coefficient). The independent variable that reaches its maximum value .

[0091] like This indicates that the original, unshifted irradiance sequence and the power sequence have the strongest correlation, meaning they are essentially aligned in time and require no correction. This indicates a significant temporal misalignment, and optimal alignment requires shifting the irradiance sequence. Each sampling interval.

[0092] Through systematic searching and quantitative comparison, the objective, data-driven identification of the power-irradiance time misalignment was achieved, providing a direct basis for performing precise time shift correction.

[0093] Step B4: If the target offset is not a preset value, the first and last empty positions of the translated irradiance sequence are filled with preset fill values ​​to obtain the corrected irradiance sequence. The fill values ​​include, but are not limited to, zero values, neighboring values, or interpolated values.

[0094] Specifically, first, determine whether to perform correction. The default value is usually set to 0. If the target offset... This indicates the existence of a non-zero optimal time offset, requiring correction of the irradiance sequence. If If the result is positive, it indicates that no correction is needed and you can proceed directly to the next step.

[0095] Then, time-shift correction is performed on the original irradiance sequence. Apply optimal offset Generate the translation-corrected sequence :

[0096] in, This represents the value of the corrected irradiance sequence at time t; This indicates the original irradiance sequence at time [time]. The value; The determined target offset; The sampling interval is denoted as .

[0097] Next, the gaps at the beginning and end are filled. The translation operation will cause data gaps at the beginning or end of the time axis in the corrected sequence (depending on...). (positive and negative). To maintain the sequence length and ensure complete alignment with the photovoltaic power sequence in the time dimension, these gaps must be filled. Preset fill values ​​include, but are not limited to, the following: zero-value filling, where the value at the gap is directly set to 0; neighbor-value filling, where the value of the nearest valid data point in the sequence is used (e.g., forward or backward filling); and interpolated value filling, where the value at the gap is calculated based on adjacent valid data points using methods such as linear interpolation.

[0098] Finally, the corrected irradiance sequence is obtained. After completing the above translation and filling operations, the complete sequence is obtained. This is the corrected irradiance sequence. Its duration is the same as the original photovoltaic power sequence. They are completely consistent, and the time correspondence between them has been optimally corrected according to the principle of maximum correlation.

[0099] By using physical-driven (correlation maximization) automatic time alignment and robust data imputation, the misalignment between power and irradiance data caused by acquisition or prediction link delays is eliminated, laying a crucial foundation for establishing the correct physical input-output relationship in subsequent models.

[0100] Step B5: Use the photovoltaic power sequence and the corrected irradiance sequence as the second photovoltaic data.

[0101] Specifically, after processing, the following two core time series were obtained: photovoltaic power series. After the optimal time offset Correct and complete the irradiance sequence after gap filling The two sequences are sampled at the same time. Realign and recombine. Simultaneously, other meteorological features from the first photovoltaic data that were not involved in the time alignment process (such as temperature sequences) will be included. Cloud cover sequence (etc.) and possible time characteristics, according to its original relationship with photovoltaic power sequence Synchronized timestamps are also integrated. The resulting second photovoltaic data is a multi-dimensional time-series dataset, whose key characteristic is that for any identical sampling time... The photovoltaic power value at that moment With irradiance value Optimal temporal alignment has been achieved by maximizing Pearson correlation, and the physical driving relationship between the two has been accurately recovered. Other meteorological features and power sequences have maintained their original synchronous acquisition relationship.

[0102] By constructing a second photovoltaic dataset, this method ensures that the core input features (power and irradiance) used for subsequent hierarchical anomaly detection and model training have the correct physical-temporal correspondence, eliminating misalignment interference caused by acquisition delays. This provides a high-quality data foundation for subsequent anomaly detection based on physical laws (such as power-irradiance regression) and accurate learning of data-driven models, and is a key step in improving the robustness and accuracy of the entire prediction process.

[0103] In this embodiment of the application, the hierarchical anomaly correction process includes: Step C1: Obtain the second photovoltaic data after time alignment processing, and calculate the daily photovoltaic power value based on the second photovoltaic data.

[0104] Specifically, firstly, based on the photovoltaic power sequence in the second photovoltaic data... The time frame is divided and data is aggregated in calendar days. Each calendar day after the division is denoted as the [number]th day. On that day, the following three statistical calculations are performed: the arithmetic mean of the photovoltaic power values ​​at all sampling points within that day, used to measure the average power output level for that day:

[0105] in, Indicates the first Daily average photovoltaic power; Indicates the first Total number of sampling points within a day; Indicates the first Time of day The photovoltaic power value.

[0106] Secondly, the daily standard deviation is calculated, which reflects the dispersion of the daily photovoltaic power value from its daily average value, and is used to reflect the volatility of the daily power output.

[0107] in, This represents the daily standard deviation of photovoltaic power on day d; This represents the total number of sampling points within day d; Indicates the first Time of day The photovoltaic power value; This is the daily average value for that day.

[0108] Next, calculate the daily correlation coefficient. (If corresponding irradiance data exists for that day): Calculate the photovoltaic power sequence for that day. With irradiance (GHI) sequence The Pearson correlation coefficient, over the entire day, is used to measure the synchronicity and physical correlation strength between changes in daily power and irradiance.

[0109] in, The daily Pearson correlation coefficient between photovoltaic power and irradiance on day d; This describes the method for calculating the Pearson correlation coefficient. Indicates the first The photovoltaic power sequence of the day; Indicates the first Daily irradiance sequence.

[0110] Ultimately, each natural day generates a set of... , and The statistical triplet. These statistical quantities are collectively referred to as the daily photovoltaic power values ​​for that day, and they constitute the direct input data for daily anomaly detection.

[0111] Step C2: Determine the valid data period for the daily photovoltaic power value within a preset time cycle.

[0112] Specifically, firstly, three preset anomaly detection thresholds are set: daily average threshold... Daily standard deviation threshold Correlation coefficient threshold .

[0113] Then, for each day d within the current time period, check whether its daily photovoltaic power value meets any of the following abnormal conditions:

[0114] in, This represents the set of dates that have been identified as abnormal days; Indicates the first sky; This represents the daily average photovoltaic power on day d. This is the threshold for determining abnormal daily average values. This represents the daily standard deviation of photovoltaic power on day d; The threshold for determining daily standard deviation anomalies; The daily Pearson correlation coefficient between photovoltaic power and irradiance on day d; The threshold for determining abnormal daily correlation coefficients.

[0115] If the statistics for a certain day satisfy or or If the daily average value is too low, the fluctuation is too small, or the correlation with irradiance is too weak, then the day is identified as an abnormal day and included in the abnormal day set. It was excluded from the list.

[0116] Finally, all dates that do not meet the above-mentioned anomaly conditions are retained. The time periods formed by these dates, whether consecutive or discontinuous, are collectively identified as valid data periods. All data within these periods (photovoltaic power, irradiance, and other meteorological characteristics) will be retained and processed in subsequent point-level fine-grained anomaly detection.

[0117] By using rapid daily statistical screening, abnormal dates caused by equipment failure, communication interruption, extreme weather, etc. can be filtered out in advance, significantly reducing the data scale of subsequent refined anomaly detection and improving the overall process efficiency while ensuring the accuracy of anomaly detection.

[0118] Step C3: Using irradiance level as the grouping condition, the second photovoltaic data within the valid data period are grouped according to the preset interval to which the irradiance value belongs, resulting in multiple irradiance groups.

[0119] Specifically, based on the physical assumption that the statistical distribution of photovoltaic power should be consistent under similar irradiance conditions, a reasonable data foundation is created for subsequent point-level anomaly detection based on within-group statistical characteristics. The partitioning process is as follows: Within the valid data period, for each sampling time Sample data, which includes photovoltaic power values and its corresponding time-aligned irradiance (GHI) value. The set of all sample points is represented as:

[0120] in, , Indicates the time within the valid data period The sample includes photovoltaic power values and irradiance value ; This represents the set of all sampling times included in the valid data period.

[0121] In terms of irradiance value As the core criterion for segmentation, a preset irradiance range or grouping boundary (e.g., segmentation based on equal width ranges, equal frequency ranges, or specific thresholds based on physical experience) is used to divide the entire sample set. Divided into Each subset has non-overlapping subsets. It includes all irradiance values ​​falling within the first... The sample points within each interval form a photovoltaic data set:

[0122] in, Indicates the first The photovoltaic data set, i.e., all irradiance values ​​belonging to the first... each interval The sample set; and They represent the number of elements in the group. Photovoltaic power and irradiance values ​​for each sample; This is the preset total number of groups.

[0123] The boundaries between groups are clear and mutually exclusive, ensuring that each sample point belongs to only one photovoltaic data group. The goal of grouping is to ensure that samples within the same group have similar irradiance levels, so that their photovoltaic power values ​​should theoretically follow similar distribution patterns, facilitating subsequent analysis of each group. Independently perform outlier detection based on distribution statistics (such as box plots).

[0124] By dividing the data according to its main driving factor (irradiance), the global anomaly detection problem is transformed into a series of anomaly detection subproblems under local similarity conditions. This significantly improves the accuracy and physical interpretability of point-level outlier detection and provides structured input for box plot statistics calculation.

[0125] Step C4: Calculate the box plot statistics for the second photovoltaic data within each irradiance group and identify outliers. Correct the outliers to obtain corrected photovoltaic data.

[0126] Specifically, for the first Irradiance group Its included photovoltaic power sample set is Calculate the lower quartiles of this irradiance grouping data. and upper quartiles Based on the quartiles, calculate the lower bound of the normal range for this irradiance grouping data. and the Upper Realm ;

[0127]

[0128] in, Indicates the first Interquartile range of grouped irradiance data; Indicates the first Lower bound threshold of the normal range for irradiance grouping data; Indicates the first The upper limit threshold of the normal range for group data; Indicates the first Lower quartiles of photovoltaic power data grouped by irradiance; Indicates the first Upper quartiles of photovoltaic power data grouped by irradiance.

[0129] Then, point-level outliers in the irradiance groupings are corrected based on box plot statistics. (The process iterates through the...) Each photovoltaic power value in the irradiance group Make judgments and corrections: If or Then determine These are point-level outliers. For identified outliers, the median of the second photovoltaic data within the irradiance group is used to replace them, maintaining the central tendency and monotonic consistency of the power data at the same irradiance level. For groups with extremely low irradiance, to avoid misjudging or amplifying noise data from nighttime or extremely weak light conditions, the photovoltaic power values ​​of all samples within that group are directly used. Set to 0. For all the photovoltaic data groups obtained from the division of irradiance groups... Repeat the above calculation, judgment and correction operations.

[0130] Finally, the corrected photovoltaic data is obtained. After all photovoltaic data sets have completed the detection and correction of point-level outliers, all corrected sample data (including corrected photovoltaic power values, corresponding irradiance values, and other meteorological characteristics) are re-integrated according to the original time sequence. The resulting dataset is the corrected photovoltaic data.

[0131] Based on daily screening, statistical methods were used to further identify and correct point-level outliers caused by random noise, transient interference, or local equipment malfunctions under locally similar irradiance conditions. This significantly improved the purity and consistency of the dataset, laying the foundation for establishing a more robust power-irradiance regression model.

[0132] Step C5: Establish a target regression model between photovoltaic power and irradiance based on the corrected photovoltaic data.

[0133] Specifically, firstly, the irradiance value at each sampling time i is extracted from the corrected photovoltaic data. As input features, and the corresponding photovoltaic power values As the prediction target, based on these data, a linear regression model is established, which has the following form:

[0134] in, To represent the photovoltaic power prediction value of the model at time i; The weight parameters (slope) of the model represent the sensitivity of photovoltaic power to irradiance. Represents the bias parameter (intercept) of the model; This represents the irradiance (GHI) value at time i.

[0135] The parameters w and b of the model are estimated by minimizing a robust loss function. To reduce the impact of outliers on model fit, the Huber loss function is used as the optimization objective. The Huber loss combines the advantages of mean squared error (MSE) and absolute error (MAE), and is insensitive to outliers. Its definition is as follows:

[0136] in, Indicates based on residuals Huber's loss value; Indicates time The predicted residual, i.e. the actual photovoltaic power value Compared with model predictions The difference; It is a preset threshold parameter used to control the transition point of the loss function from quadratic loss to linear loss.

[0137] The model parameters are fitted by minimizing the sum of the Huber losses for all samples. and That is, to solve the following optimization problem:

[0138] Ultimately, the model that completes the parameter estimation is the target regression model. This model can describe the basic linear relationship between photovoltaic power and irradiance under normal conditions, and the distribution of its fitting residuals will serve as the benchmark for the next step of detecting residual anomalous points.

[0139] Step C6: Obtain the regression residual distribution of the target regression model, and adjust and correct the residual abnormal points in the photovoltaic data according to the regression residual distribution to obtain the third photovoltaic data.

[0140] Specifically, obtain the regression residual distribution of the target regression model. Use the trained target regression model to predict all samples in the corrected photovoltaic data, obtaining the predicted value for each sample. Calculate the difference between the predicted value and the measured value for each sample, i.e., the regression residual:

[0141] in, Indicates sample The regression residuals; Indicates sample The actual photovoltaic power value (from corrected photovoltaic data); This indicates that the objective regression model applies to the sample. The predicted photovoltaic power.

[0142] Based on all the calculated residuals Calculate the mean and standard deviation of its distribution; these two statistics together constitute the core characteristics of the regression residual distribution.

[0143]

[0144] in, This represents the mean of the regression residuals; This represents the standard deviation of the regression residuals; This indicates the total number of samples in the corrected photovoltaic data; This represents the regression residual of sample i.

[0145] Then, residual anomalies in the photovoltaic data are adjusted and corrected based on the regression residual distribution. An anomaly detection threshold is set based on the residual distribution. A threshold coefficient is defined. For each sample's residual... Check if it meets the following abnormal conditions:

[0146] in, This is a preset threshold coefficient; The mean of the residuals; This represents the standard deviation of the residuals.

[0147] If the absolute value of the residual of sample i deviating from the residual mean exceeds If the deviation is more than one-fold from the standard deviation, the sample is considered an outlier. Data points identified as outliers are adjusted through correction or removal (e.g., model predictions can be used). Replace original value (or directly mark as invalid). For samples that do not meet the requirements, retain their original values.

[0148] Finally, the third photovoltaic data is obtained. After all samples have completed the identification and adjustment of residual anomalies, all the data (photovoltaic power, irradiance and other meteorological characteristics) that have undergone this final processing step are re-integrated in chronological order, and the resulting dataset is the third photovoltaic data.

[0149] Based on daily statistical screening and point-level statistical outlier correction, the physical laws revealed by the robust regression model are used to filter out those hidden anomalies that are not statistically obvious but seriously inconsistent with physical relationships, thereby producing high-quality and highly reliable target data for subsequent dynamic normalization processing and model training.

[0150] In this embodiment of the application, the dynamic normalization process includes: Step D1: Obtain the third photovoltaic data after the hierarchical anomaly correction process.

[0151] Specifically, the third photovoltaic (PV) data is derived from the second PV data (i.e., the time-aligned power and irradiance series) through stratified anomaly correction processing. This includes daily statistical anomaly screening, box plot point-level anomaly correction grouped by irradiance, and residual anomaly adjustment based on Huber regression to obtain the PV power and meteorological characteristic series. The third PV data still retains the rated power information corresponding to each time point, which is a key parameter for performing dynamic normalization. The third PV data will be directly used to calculate the dynamic normalization dependent variable, thereby initiating the entire time-varying capacity dynamic normalization process.

[0152] Step D2: Divide the time-varying rated power at the corresponding moment by the third photovoltaic data to obtain the fourth photovoltaic data, where the fourth photovoltaic data is preprocessed data.

[0153] Specifically, by introducing time-varying capacity normalization at the input and inversely normalizing the output based on future capacity, the data distribution offset caused by capacity changes due to the addition / removal of equipment is effectively eliminated, ensuring the accuracy of the prediction. Given a historical power sequence... Rated power at the corresponding time Define the dynamically normalized dependent variable as:

[0154] in, It represents the normalized photovoltaic power value, which is a dimensionless utilization rate or capacity factor; This represents the historical photovoltaic power value at time t in the third photovoltaic data set; This represents the real-time rated power at time t.

[0155] Multiply the model output by the rated power at future time points to obtain the predicted power result of the true magnitude:

[0156] in, This represents the predicted value of the actual power at time t after inverse normalization. This represents the dynamically normalized power prediction value at time t output by the model; This represents the planned rated power at a future time t.

[0157] Traditional normalization uses a globally fixed scale (such as global maximum value / fixed rated power) to uniformly scale data across all time points, while the method here scales the data according to the rated power at each time point. Perform dynamic normalization and use future values ​​at the output. Inverse normalization is used to eliminate prediction bias caused by distribution shifts due to capacity changes.

[0158] In this embodiment of the application, the base models are stacked according to model pairing rules to obtain the target stacked model, including: Step E1: Combine the basic models according to the model pairing rules to obtain candidate model groups.

[0159] Specifically, first, clarify the model pairing rules. The rules are defined as follows: from the base model (M=4, i.e. In this process, all possible pairs of elements are selected without repetition. When combining elements, the order is not considered, and they are treated as the same combination.

[0160] Next, the combination operation is performed. According to the above rules, the four basic models are combined in pairs, generating a total of six different model pairs, each of which is a candidate model group. These candidate model groups are as follows:

[0161] Each candidate model group contains two distinct base models with their parameters frozen. These base models have been independently trained in previous steps and each possesses different learning characteristics and predictive capabilities.

[0162] By systematically combining pairs, a set of well-structured candidate pairs covering all possible complementary relationships between the two models is generated for subsequent steps (building the initial stacked model). This ensures that the stacked fusion process can fully explore the diverse synergistic potential between different base models, laying a structural foundation for building a better fusion prediction model.

[0163] Step E2: Stack the candidate model groups using the initial weight parameters to obtain the initial stacked model.

[0164] Specifically, firstly, for each candidate model group , (in Define a fusion layer in the form of a linear weighted sum as its initial stacking model:

[0165] in, This represents the initial stacked model consisting of base models a and b; X represents the input feature sample. and These represent the predicted outputs of the base models a and b for the input X, respectively. The parameters of these two models are frozen. This represents the initial weight parameters of the bias term (intercept) of the stacked model; This represents the initial weight parameters assigned to the predicted output of the base model a; This represents the initial weight parameters assigned to the predicted output of the base model b.

[0166] Initial weight parameters , , Initialization is performed during construction, and the initial value can be set randomly (e.g., sampled from a distribution with a mean of 0 and a small variance), or set to a specific fixed value (e.g., set...). , , which means that the prediction results of the two base models are initially simply averaged.

[0167] For each potentially complementary pair of base models, a simple, trainable initial fusion structure is established. This stage only defines the model structure and initializes the parameters; training has not yet begun, hence it is called the initial stacked model. This model is the direct target for subsequent optimization of the fusion layer weights using the second training samples.

[0168] Step E3: Train the fusion layer in the initial stacked model using training samples to obtain the target stacked model.

[0169] In this embodiment of the application, the fusion layer in the initial stacked model is trained using training samples to obtain the target stacked model, including: Step E301: Obtain the sample prediction values ​​output by the base model based on the training samples during the training process.

[0170] Specifically, firstly, the training samples are simultaneously input into the two base models corresponding to this initial stacked model. and In this case, since the base model parameters are frozen, they perform forward inference rather than training. The two base models compute independently, each producing its own predictions for samples at the next M time steps:

[0171] in, These are the sample predictions for the basic model a; These are the sample predictions for the basic model b.

[0172] Step E302: Input the sample prediction values ​​into the fusion layer in the initial stacked model to obtain the target prediction values. The fusion layer is set after the candidate model group in the initial stacked model.

[0173] Specifically, the sample prediction values ​​of the two base models and Together with the current initial weight parameters , , The values ​​are input together into the fusion layer for weighted summation, thereby calculating the final prediction output of the initial stacked model, i.e., the target prediction value:

[0174] in, The target predicted value output by the fusion layer in the initial stacking model is a vector of length M, representing the prediction of photovoltaic power over the next M time steps. , , These are the weight parameters for the initial stacked model; their initial values ​​(not yet optimized) are used here. and These are the sample prediction values ​​output during the training process of the basic model, respectively.

[0175] Step E303: Adjust the weight parameters of the fusion layer in the initial stacked model using the target predicted value and the actual values ​​corresponding to the training samples to obtain the target stacked model.

[0176] Specifically, first, calculate the prediction error (loss). Then, calculate the target predicted value. Actual values ​​corresponding to training samples Compare using a preset loss function. (e.g., mean squared error, MSE) Calculate the difference between the two:

[0177] in, This represents the calculated loss value, which measures the inaccuracy of the current stacked model's predictions. The target predicted value; These are the actual values ​​corresponding to the training samples.

[0178] Then, based on the calculated loss The loss is calculated using the backpropagation algorithm on the weight parameters of the fusion layer. , , The gradient. Gradient descent or its variants (such as Adam) are used to optimize the model by updating only these three weight parameters while preserving the base model. and The parameters are always frozen.

[0179] Finally, iterative optimization is performed until convergence to obtain the target stacked model. The process of forward prediction, loss calculation, and backpropagation to update weights is repeated multiple times on the training samples. Training stops when the loss function value converges to a stable minimum or when the preset number of iterations is reached. At this point, the fusion layer weights of the initial stacked model are... , , Having been optimized to its best state, this model becomes the target stacked model after training.

[0180] In this embodiment of the application, a target prediction model for photovoltaic power prediction is selected from the target stacking model and the base model based on validation samples, including: Step F1: Extract the input values ​​and actual values ​​from the validation sample.

[0181] Specifically, each validation sample is a pair of samples, containing the model's input value and the actual value. Input value It is a multidimensional feature vector containing historical photovoltaic power sequences, future weather forecast sequences (GHI, TEM, CLO), temporal features, and historical statistical features. The actual values ​​in the sample are vectors of length M, representing the true photovoltaic power values ​​at the next M time steps.

[0182] Extracted input values In subsequent steps, these inputs will be fed one by one into all candidate models to be evaluated (including all base models). , , , This is done by stacking all target models to obtain the predicted values ​​from the outputs of each model. Actual values This will serve as the true value reference when calculating the prediction error of each model. It provides standardized, unbiased test data for the final evaluation of model performance. The second input value drives all candidate models to produce prediction results, while the actual value serves as the true benchmark for calculating error metrics such as the root mean square error (RMSE), and is the direct basis for subsequent model selection.

[0183] Step F2 involves inputting the input values ​​into the base model and the target stacked model respectively to obtain the predicted values ​​output by each model.

[0184] Specifically, the first step is to evaluate the set of candidate models. Composed of four basic models , , , and six target stacking models Together they form, namely:

[0185] Then, for the candidate model set Each model in , the second input value The input is fed into the model, and an independent forward computation is performed. Each model outputs a power prediction sequence for the next M time steps, denoted as the model's prediction value:

[0186] in, Representation Model The output predicted value is a vector of length M; This indicates that model f is related to the input values. The forward computation function.

[0187] The parameters of all base models and target stacked models are fixed (the parameters of the base models are fixed after training; the weights of the fusion layer of the target stacked models are fixed after training optimization), so forward inference does not involve any parameter updates or adjustments.

[0188] By performing forward prediction on a uniform validation sample, a set of comparable prediction results for all candidate models is obtained. The predicted values ​​serve as input for the next step of calculating the prediction error index for each model, providing a direct predictive data basis for subsequent model selection based on the principle of error minimization.

[0189] Step F3: Calculate the error index between the predicted values ​​output by each model and the actual values ​​in the validation samples.

[0190] Specifically, firstly, the root mean square error (RMSE) is used as the preset error evaluation function. For any model f in the candidate model set F, its corresponding error index is... The calculation is as follows:

[0191] in, Representation Model The error index (root mean square error) indicates that the smaller the value, the more accurate the model prediction. The predicted value output by model f is a vector of length M. express The predicted value at the m-th time step; It represents the actual value and is a vector of length M; express The true value at the m-th time step; This indicates the prediction step size (the number of future time steps).

[0192] Then, for the candidate model set Each model in the (including all base models and target stacked models) is computed independently. Ultimately, a scalar error index value is obtained for each model. .

[0193] By using a unified and quantified error metric, the predictive accuracy of all candidate models on the same validation data is objectively measured and compared. The calculated set of error metrics forms the direct and core basis for numerical comparison and decision-making in the next step (model selection).

[0194] Step F4: Select the model with the smallest error index from the target stacking model and the base model as the target prediction model.

[0195] Specifically, first, an error metric set for all candidate models was obtained, comprising four base models and six target stacked models. The root mean square error (RMSE) value has been calculated for each of these models. .

[0196] Then, in the set of error metrics, find the error metric with the smallest value and determine its corresponding model. This model is the optimal model with the smallest prediction error on the validation set, i.e., the target prediction model. This selection process can be formally represented as:

[0197] in, This indicates the selected target prediction model; This represents the set of all candidate models; Representation Model The error index (root mean square error).

[0198] This process follows the principle of minimum error, which means selecting the model with the smallest prediction error on the independent validation set as the final deployment prediction model. This ensures that the selected model has the best generalization performance under the current data distribution and task conditions.

[0199] Determined target prediction model It can be any base model or any stacked model. This model will be used to predict target photovoltaic data that has undergone the same preprocessing steps, outputting the final predicted photovoltaic data. Through an objective optimization mechanism, the best predictor is automatically selected from multiple candidate models with different structures and characteristics, thereby ensuring that the prediction system can operate with the highest accuracy during the deployment phase and improving the overall reliability of photovoltaic power prediction.

[0200] As an example, such as Figure 2 As shown, the photovoltaic power prediction process includes: after startup, the collection of load, photovoltaic, and meteorological data is completed first; then, a data preprocessing stage is performed, including data cleaning, data alignment, photovoltaic anomaly detection, feature extraction, dynamic normalization, and training and test set partitioning; next, sample construction is carried out to extract power data. Power statistical characteristics (mean) Standard deviation Meteorological features (such as GHI, TEM, CLO) and temporal features (Time) are integrated into the sample input. With output The process then proceeds to the model building and training phase, where basic models such as Bayesian linear models, SVR, LightGBM, and XGB are built and stacked into a stacked model. The optimal model is then selected from these stacked models. Finally, the optimal model is used to perform time series predictions, and the process ends upon completion.

[0201] This embodiment also provides a photovoltaic power prediction device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the systems described in the following embodiments are preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0202] This embodiment provides a photovoltaic power prediction device, such as... Figure 3 As shown, the device includes: The acquisition module 31 is used to acquire historical photovoltaic data and perform hierarchical interpolation, time alignment, hierarchical anomaly correction and dynamic normalization on the historical photovoltaic data in sequence to obtain preprocessed data. Generation module 32 is used to generate training samples and validation samples based on preprocessed data; Training module 33 is used to train different types of original models using training samples until the original models meet preset conditions, and the original models that meet the preset conditions are used as the base models. Stacking module 34 is used to freeze the base model and stack the base model according to the model pairing rules to obtain the target stacked model. The execution module 35 is used to select a target prediction model for photovoltaic power prediction from the target stacking model and the basic model based on the validation samples, and to perform the corresponding prediction operation through the target prediction model.

[0203] In this embodiment of the application, the acquisition module 31 is specifically used to identify the start and end timestamps of the missing area covered in the historical photovoltaic data; acquire valid historical data corresponding to the start and end timestamps from the preset photovoltaic dataset; and fill the missing area in the historical photovoltaic data with the valid historical data to obtain the first photovoltaic data.

[0204] In this embodiment of the application, the acquisition module 31 is specifically used to determine a first reference time period in a preset photovoltaic dataset according to a first period window; query whether there is first historical data corresponding to the start and end timestamps in the first reference time period; if there is first historical data in the first reference time period, then the first historical data in the first period window is used as valid historical data; or, if there is no first historical data in the first reference time period, then determine a second reference time period in the preset photovoltaic dataset according to a second period window, query the second historical data corresponding to the start and end timestamps in the second reference time period, and use the second historical data in the second period window as valid historical data.

[0205] In this embodiment, the acquisition module 31 is specifically used to acquire the first photovoltaic data obtained after layered interpolation processing, and extract the irradiance sequence and photovoltaic power sequence from the first photovoltaic data; translate the irradiance sequence within a preset sliding time offset range to generate a translated irradiance sequence; calculate the correlation coefficient between each offset between the photovoltaic power sequence and the translated irradiance sequence, and select the offset with the largest correlation coefficient as the target offset for irradiance sequence translation; if the target offset is not a preset value, fill the first and last empty positions of the translated irradiance sequence with a preset fill value to obtain a corrected irradiance sequence, wherein the fill value includes, but is not limited to, zero value, neighboring value or interpolation value; and use the photovoltaic power sequence and the corrected irradiance sequence as the second photovoltaic data.

[0206] In this embodiment, the acquisition module 31 is specifically used to acquire the second photovoltaic data after time alignment processing, and calculate the daily photovoltaic power value based on the second photovoltaic data; determine the effective data period for the daily photovoltaic power value within a preset time period; group the second photovoltaic data within the effective data period according to the preset interval to which the irradiance value belongs, using irradiance level as the grouping condition, to obtain multiple irradiance groups; calculate the box plot statistics for the second photovoltaic data in each irradiance group and identify outliers, correct the outliers, and obtain corrected photovoltaic data; establish a target regression model between photovoltaic power and irradiance based on the corrected photovoltaic data; acquire the regression residual distribution of the target regression model, and adjust the residual outliers in the corrected photovoltaic data according to the regression residual distribution to obtain the third photovoltaic data.

[0207] In this embodiment of the application, the acquisition module 31 is specifically used to acquire the third photovoltaic data obtained after the hierarchical anomaly correction processing; and to obtain the fourth photovoltaic data by dividing the time-varying rated power at the corresponding time by the third photovoltaic data, wherein the fourth photovoltaic data is preprocessed data.

[0208] In this embodiment, the stacking module 34 is specifically used to combine the basic models according to the model pairing rules to obtain a candidate model group; stack the candidate model group using the initial weight parameters to obtain an initial stacked model; and train the fusion layer in the initial stacked model using training samples to obtain a target stacked model.

[0209] In this embodiment, the stacking module 34 is specifically used to obtain the sample prediction values ​​output by the base model based on the training samples during the training process; input the sample prediction values ​​into the fusion layer in the initial stacked model to obtain the target prediction value, wherein the fusion layer is set after the candidate model group in the initial stacked model; and adjust the weight parameters of the fusion layer in the initial stacked model using the target prediction value and the actual values ​​corresponding to the training samples to obtain the target stacked model.

[0210] In this embodiment of the application, the execution module 35 is specifically used to extract the input value and the actual value in the verification sample; input the input value into the base model and the target stacked model respectively to obtain the predicted value output by each model; calculate the error index between the predicted value output by each model and the actual value in the verification sample; and select the model with the smallest error index from the target stacked model and the base model as the target prediction model.

[0211] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A photovoltaic power prediction method, characterized in that, The method includes: Historical photovoltaic data within a preset time period is acquired, and the historical photovoltaic data is sequentially subjected to hierarchical interpolation, time alignment, hierarchical anomaly correction, and dynamic normalization to obtain preprocessed data. Training samples and validation samples generated based on the preprocessed data; The training samples are used to train different types of original models until the original models meet the preset conditions, and the original models that meet the preset conditions are used as the base models. Freeze the base model, and stack the base model according to the model pairing rules to obtain the target stacked model; Based on the validation samples, a target prediction model for photovoltaic power prediction is selected from the target stacking model and the basic model, and the corresponding prediction operation is performed through the target prediction model.

2. The method according to claim 1, characterized in that, The hierarchical interpolation process includes: Identify the start and end timestamps of the missing areas covered in the historical photovoltaic data; Obtain valid historical data corresponding to the start and end timestamps from the preset photovoltaic dataset; The missing areas in the historical photovoltaic data are filled in using the valid historical data to obtain the first photovoltaic data.

3. The method according to claim 2, characterized in that, The step of obtaining valid historical data corresponding to the start and end timestamps from the preset photovoltaic dataset includes: The first reference time period is determined in the preset photovoltaic dataset according to the first period window; In the first reference time period, query whether there is first historical data corresponding to the start and end timestamps; If the first historical data exists in the first reference time period, then the first historical data in the first period window shall be used as the valid historical data. Alternatively, if the first historical data does not exist in the first reference time period, then a second reference time period is determined in the preset photovoltaic dataset according to the second period window, the second historical data corresponding to the start and end timestamps is queried in the second reference time period, and the second historical data in the second period window is taken as the valid historical data.

4. The method according to claim 1, characterized in that, The time alignment process includes: The first photovoltaic data obtained after hierarchical interpolation is acquired, and the irradiance sequence and photovoltaic power sequence are extracted from the first photovoltaic data. The irradiance sequence is translated within a preset sliding time offset range to generate a translated irradiance sequence; Calculate the correlation coefficient between the photovoltaic power sequence and the shifted irradiance sequence for each offset, and select the offset with the largest correlation coefficient as the target offset for shifting the irradiance sequence; If the target offset is not a preset value, the first and last empty positions of the translated irradiance sequence are filled with a preset fill value to obtain a corrected irradiance sequence. The fill value includes, but is not limited to, zero, neighboring, or interpolated values. The photovoltaic power sequence and the corrected irradiance sequence are used as the second photovoltaic data.

5. The method according to claim 1, characterized in that, The hierarchical anomaly correction process includes: Acquire the second photovoltaic data after time alignment processing, and calculate the daily photovoltaic power value based on the second photovoltaic data; The daily photovoltaic power value is used to determine the valid data period within the preset time cycle; Using irradiance level as the grouping condition, the second photovoltaic data within the effective data period are grouped according to the preset interval to which the irradiance value belongs, resulting in multiple irradiance groups; For the second photovoltaic data within each irradiance group, box plot statistics are calculated and outliers are identified. The outliers are then corrected to obtain corrected photovoltaic data. Based on the corrected photovoltaic data, a target regression model between photovoltaic power and irradiance is established. Obtain the regression residual distribution of the target regression model, and adjust the residual abnormal points in the corrected photovoltaic data according to the regression residual distribution to obtain the third photovoltaic data.

6. The method according to claim 5, characterized in that, The dynamic normalization process includes: Obtain the third photovoltaic data after hierarchical anomaly correction processing; The fourth photovoltaic data is obtained by dividing the time-varying rated power at the corresponding moment by the third photovoltaic data, wherein the fourth photovoltaic data is the preprocessed data.

7. The method according to claim 1, characterized in that, The process of stacking the base models according to model pairing rules to obtain the target stacked model includes: The basic models are combined according to the model pairing rules to obtain candidate model groups; The candidate model group is stacked using the initial weight parameters to obtain an initial stacked model; The target stacking model is obtained by training the fusion layer in the initial stacking model using the training samples.

8. The method according to claim 7, characterized in that, The step of training the fusion layer in the initial stacked model using the training samples to obtain the target stacked model includes: Obtain the sample prediction values ​​output by the base model based on the training samples during the training process; The sample prediction value is input into the fusion layer in the initial stacked model to obtain the target prediction value, wherein the fusion layer is set after the candidate model group in the initial stacked model; The weight parameters of the fusion layer in the initial stacked model are adjusted using the target predicted value and the actual value corresponding to the training sample to obtain the target stacked model.

9. The method according to claim 1, characterized in that, The step of selecting a target prediction model for photovoltaic power prediction from the target stacked model and the base model based on the validation samples includes: Extract the input values ​​and actual values ​​from the verification samples; The input values ​​are input into the base model and the target stacked model respectively to obtain the predicted values ​​output by each model; Calculate the error index between the predicted value output by each model and the actual value in the validation sample; The model with the smallest error index is selected from the target stacked model and the base model as the target prediction model.

10. A photovoltaic power prediction device, characterized in that, The device includes: The acquisition module is used to acquire historical photovoltaic data and perform hierarchical interpolation, time alignment, hierarchical anomaly correction, and dynamic normalization on the historical photovoltaic data in sequence to obtain preprocessed data. A generation module is used to generate training samples and validation samples based on the preprocessed data; The training module is used to train different types of original models using the training samples until the original models meet preset conditions, and the original models that meet the preset conditions are used as the base models. The stacking module is used to freeze the base model and stack the base model according to the model pairing rules to obtain the target stacked model. The execution module is used to select a target prediction model for photovoltaic power prediction from the target stacking model and the base model based on the verification sample, and to perform the corresponding prediction operation through the target prediction model.