Photovoltaic power generation power prediction method and device, and storage medium

CN122905150APending Publication Date: 2026-10-13ARCTECH SOLAR HOLDING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611319329.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

单一预测模型受自身建模机制限制,通常难以同时兼顾输入特征与发电功率之间的非线性关系和光伏发电功率随时间变化的时序依赖关系

Benefits of technology

[0014]本申请的光伏发电功率预测方法,通过将待预测数据分别输入采用不同数据组织方式训练得到的功率预测模型,可以从非线性特征关系和历史时序关系两个方面获得针对同一目标预测时刻的功率预测结果;根据历史验证样本对应的融合预测误差预先确定目标融合权重组并进行加权融合,可以根据两类模型在历史验证数据上的预测表现协调其在最终预测结果中的贡献程度,降低采用单一预测模型或者固定经验权重时对特定建模方式的依赖,显著提升光伏功率预测的准确性、鲁棒性与实时性,为智能电网的安全调度、灵活调峰和新能源消纳提供有力支撑。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905150A_ABST
    Figure CN122905150A_ABST
Patent Text Reader

Abstract

The application discloses a photovoltaic power prediction method and device and a storage medium. The method comprises the following steps: obtaining to-be-predicted data corresponding to a target prediction time; inputting the to-be-predicted data into a first power prediction model and a second power prediction model respectively to obtain a first power prediction value and a second power prediction value for the target prediction time; the first power prediction model and the second power prediction model are determined based on a plurality of historical training samples. The first power prediction model is a nonlinear regression model, and the second power prediction model is a time series prediction model; obtaining a pre-determined target fusion weight set; and weighting and fusing the first power prediction value and the second power prediction value according to the first fusion weight and the second fusion weight to determine a photovoltaic power prediction value for the target prediction time. The application has the technical effect of improving the reliability of photovoltaic power prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of photovoltaic power generation prediction technology, and in particular to a photovoltaic power generation prediction method, apparatus and storage medium. Background Technology

[0002] With the continuous expansion of photovoltaic (PV) power generation capacity, PV power prediction has become a crucial foundation for power dispatch, energy storage control, and new energy consumption. PV power generation is easily affected by meteorological factors such as irradiance, temperature, humidity, and wind speed, exhibiting significant fluctuations and non-stationarity over time. Therefore, it is necessary to predict future PV power generation based on historical power generation data and meteorological data from PV power plants. Existing PV power prediction methods typically employ a single prediction model or combine multiple models in a predetermined order. A single prediction model, limited by its own modeling mechanism, often struggles to simultaneously consider the nonlinear relationship between input features and power generation, as well as the temporal dependence of PV power generation over time. When multiple prediction models are combined in a predetermined order, processing dependencies exist between the models, and model fusion typically uses fixed or empirical weights, making it difficult to effectively coordinate the prediction results of each model under different data conditions, thus affecting the accuracy and stability of PV power prediction. Therefore, the reliability of PV power prediction deserves attention. Summary of the Invention

[0003] In view of this, this application provides a photovoltaic power generation prediction method, apparatus and storage medium, in order to improve the reliability of photovoltaic power generation prediction.

[0004] Firstly, a method for predicting photovoltaic power generation is provided, including: Acquire the data to be predicted corresponding to the target prediction time. The data to be predicted includes meteorological data corresponding to the target prediction time and historical power generation data within a preset time window before the target prediction time. The data to be predicted is input into the first power prediction model and the second power prediction model respectively to obtain the first power prediction value and the second power prediction value for the target prediction time. The first power prediction model and the second power prediction model are determined by training based on multiple historical training samples. Each historical training sample corresponds to a historical target time, including: historical meteorological data, actual power generation, and historical power generation data within a preset time window before the historical target time. The first power prediction model is a nonlinear regression model trained using input features constructed from historical training samples, and the second power prediction model is a time series prediction model trained using time series input data constructed from historical training samples. Obtain a predetermined target fusion weight reassembly, which includes a first fusion weight corresponding to a first power prediction value and a second fusion weight corresponding to a second power prediction value. The target fusion weight reassembly is determined based on minimizing the fusion prediction error corresponding to historical verification samples. Based on the first fusion weight and the second fusion weight, the first power prediction value and the second power prediction value are weighted and fused to determine the photovoltaic power generation prediction value at the target prediction time.

[0005] Optionally, it may also include: obtaining the original historical dataset, which includes historical power generation data and historical meteorological data arranged according to the sampling time; The first historical dataset is selected from the original historical dataset, corresponding to the effective lighting period. The abnormal and missing data in the first historical dataset are corrected to obtain the second historical dataset. The second historical dataset is divided into training data and validation data. Multiple historical training samples are constructed based on the training data, and multiple historical validation samples are constructed based on the validation data.

[0006] Optionally, outlier data in the first historical dataset may be corrected, including: The data sequence to be processed is determined from the first historical dataset. The data sequence to be processed is formed by arranging the values ​​of the same monitoring parameter at multiple sampling times according to the sampling time. The monitoring parameters include multiple parameters such as power generation, irradiance, temperature, humidity and wind speed. Determine the first quartile, third quartile, and interquartile range of the data sequence to be processed; The difference between the first quartile and the interquartile range of a preset multiple is determined as the lower limit of the normal value range, and the sum of the interquartile ranges of the third quartile and the preset multiple is determined as the upper limit of the normal value range. Values ​​in the data sequence to be processed that are below the lower limit or above the upper limit are identified as abnormal data; The abnormal data is corrected by interpolation based on the adjacent normal values ​​before and after the abnormal data.

[0007] Optionally, the first power prediction model is a support vector regression model, and the second power prediction model is a gated recurrent unit model; the data to be predicted is input into the first power prediction model and the second power prediction model respectively, including: running the first power prediction model and the second power prediction model in parallel, so that the first power prediction model and the second power prediction model can independently predict the power at the target prediction time.

[0008] Optionally, training the first power prediction model includes: The historical meteorological data and historical power generation data of multiple past moments in each historical training sample are determined as input features, and the actual power generation corresponding to a certain future moment after multiple past moments is determined as the training target. Based on the selected kernel function, the input features are implicitly mapped to a high-dimensional feature space, and a nonlinear regression relationship between the input features and the training target is established in the mapped feature space. Based on the preset error tolerance range, the prediction deviation of the training power prediction value of the first power prediction model relative to the training target exceeds the preset error tolerance range. Based on the prediction bias and the model complexity of the first power prediction model, the model parameters of the first power prediction model are determined through training.

[0009] Optionally, training the second power prediction model includes: For each historical training sample, obtain multiple historical power generation values ​​that were within a preset time window before the historical target time corresponding to the historical training sample, and arrange the multiple historical power generation values ​​according to the sampling time. The arranged historical power generation is fused with the historical meteorological data corresponding to the historical target time, so that each historical target time is composed of a multi-dimensional feature vector composed of the corresponding power generation and meteorological data. The multiple multi-dimensional feature vectors are sorted by time to obtain the time series input data. The time-series input data is input into the second power prediction model. Based on the reset gate, the information involved in the generation of candidate hidden states in the previous hidden state is controlled. Based on the update gate, the previous hidden state and candidate hidden states are adaptively fused to obtain the current hidden state. Determine the predicted training power value based on the current hidden state; The model parameters of the second power prediction model are determined by training based on the difference between the predicted power value and the actual power generation in the corresponding historical training samples.

[0010] Optionally, the target fusion weight group is determined using an ant colony optimization algorithm based on the fusion prediction error corresponding to historical validation samples. The determination of the target fusion weight group includes: Multiple candidate fusion weight recombinations are generated in the fusion weight parameter space, and each candidate fusion weight recombination includes a candidate first fusion weight and a candidate second fusion weight. Determine the fusion prediction error of each candidate fusion weight reorganization on multiple historical validation samples; Update the pheromone intensity corresponding to each candidate fusion power recombination based on the fusion prediction error corresponding to each candidate fusion power recombination. Based on the updated pheromone intensities, the next iteration search is performed in the fusion weight parameter space to obtain multiple candidate fusion weight recombinations for the next iteration. When the preset iteration termination condition is met, the candidate fusion weight recombination with the smallest fusion prediction error in each iteration is determined as the target fusion weight recombination. Among them, the candidate first fusion weight and the candidate second fusion weight are both non-negative numbers, and the sum of the candidate first fusion weight and the candidate second fusion weight is 1.

[0011] Optionally, the fusion prediction error of each candidate fusion weight recombination on multiple historical validation samples is determined, and the pheromone intensity corresponding to each candidate fusion weight recombination is updated based on the fusion prediction error corresponding to each candidate fusion weight recombination, including: Obtain the verification input data and actual power generation from each historical verification sample; Each verification input data is input into the first power prediction model and the second power prediction model respectively to obtain the first verification prediction value and the second verification prediction value corresponding to each historical verification sample. For each candidate fusion weight reorganization, the first and second verification prediction values ​​corresponding to each historical verification sample are weighted and fused according to the first candidate fusion weight and the second candidate fusion weight to obtain the corresponding candidate fusion prediction value. The fusion prediction error of the corresponding candidate fusion weight group is determined based on the mean square error between each candidate fusion prediction value and the corresponding actual power generation. The fusion prediction error is determined as the search path length corresponding to the corresponding candidate fusion weight recombination, and the pheromone increment corresponding to the corresponding candidate fusion weight recombination is determined according to the ratio of the preset adjustment parameter to the search path length. The updated pheromone intensity is determined based on the current pheromone intensity, the preset pheromone evaporation coefficient, and the pheromone increment.

[0012] Secondly, a photovoltaic power generation prediction device is provided, comprising: The first acquisition unit is used to acquire the data to be predicted corresponding to the target prediction time. The data to be predicted includes meteorological data corresponding to the target prediction time and historical power generation data before the target prediction time. The power prediction model unit is used to input the data to be predicted into the first power prediction model and the second power prediction model respectively to obtain the first power prediction value and the second power prediction value for the target prediction time. The first power prediction model and the second power prediction model are determined by training multiple historical training samples. Each historical training sample corresponds to a historical target time, including: historical meteorological data, actual power generation, and historical power generation data before the historical target time. The first power prediction model is a nonlinear regression model trained using input features constructed from the historical training samples, and the second power prediction model is a time-series prediction model trained using time-series input data constructed from the historical training samples. The second acquisition unit is used to acquire a predetermined target fusion weight recombination. The target fusion weight recombination includes a first fusion weight corresponding to the first power prediction value and a second fusion weight corresponding to the second power prediction value. The target fusion weight recombination is determined by minimizing the fusion prediction error corresponding to the historical verification samples through the ant colony optimization algorithm. The prediction unit is used to perform weighted fusion of the first power prediction value and the second power prediction value according to the first fusion weight and the second fusion weight, and determine the photovoltaic power generation prediction value at the target prediction time.

[0013] Thirdly, a computer-readable storage medium is provided, on which instructions are stored, which, when read by a processor, implement the photovoltaic power generation prediction method provided in the first aspect above.

[0014] The photovoltaic power generation prediction method of this application obtains power prediction results for the same target prediction time from two aspects: nonlinear characteristic relationship and historical time series relationship, by inputting the data to be predicted into power prediction models trained with different data organization methods. Based on the fusion prediction error corresponding to the historical verification samples, the target fusion weight group is pre-determined and weighted fusion is performed. The contribution of the two types of models in the final prediction result can be coordinated according to their prediction performance on the historical verification data. This reduces the dependence on specific modeling methods when using a single prediction model or fixed empirical weights, significantly improving the accuracy, robustness and real-time performance of photovoltaic power prediction, and providing strong support for the safe dispatch, flexible peak shaving and new energy consumption of smart grids. Attached Figure Description

[0015] The accompanying drawings used in the description of the embodiments of this disclosure are briefly introduced below: Figure 1 A flowchart illustrating a photovoltaic power generation prediction method provided in some embodiments of this application is shown. Figure 2 This paper illustrates a flowchart of a method for correcting anomalous data in a first historical dataset according to some embodiments of this application. Figure 3 A flowchart illustrating a training method for a first power prediction model provided in some embodiments of this application is shown. Figure 4 A flowchart illustrating a training method for a second power prediction model provided in some embodiments of this application is shown. Figure 5 A flowchart illustrating a method for determining a target fusion weight group provided in some embodiments of this application is shown; Figure 6 This paper illustrates a schematic diagram showing the comparison results of normalized root mean square error of different prediction models corresponding to the first dataset under different prediction durations in some embodiments of this application. Figure 7 This paper illustrates a schematic diagram showing the comparison results of normalized root mean square error of different prediction models corresponding to the second dataset under different prediction durations in some embodiments of this application. Figure 8 A schematic diagram showing the comparison results of predicted power generation and actual power generation over time in some embodiments of this application is illustrated. Figure 9 This paper illustrates a schematic diagram showing the correlation distribution between predicted power generation and actual power generation corresponding to multiple sets of test results in some embodiments of this application. Figure 10 A schematic diagram of the structure of a photovoltaic power generation prediction device provided in some embodiments of this application is shown. Detailed Implementation

[0016] To more clearly illustrate the technical solutions in the embodiments of this disclosure, examples of implementation methods of this disclosure will be described below with reference to the accompanying drawings. The accompanying drawings described below are merely some embodiments of this disclosure. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without creative effort. Adjustments and improvements made without departing from the concept of this disclosure are all within the protection scope of this disclosure.

[0017] As the proportion of photovoltaic (PV) power generation integrated into the power system continues to increase, PV power generation forecasting plays a crucial role in grid dispatching, energy storage control, and the consumption of new energy sources. PV power generation is easily affected by meteorological factors such as irradiance, temperature, humidity, and wind speed, exhibiting significant fluctuations, nonlinearity, and non-stationarity over time. Especially during periods of rapid irradiance change or frequent shifts in weather conditions, PV power generation may change significantly within a short period, increasing the difficulty of power forecasting.

[0018] In current photovoltaic (PV) power generation forecasting, traditional machine learning models can learn the relationship between input features and power generation based on meteorological and historical power generation data, but their ability to represent long-term temporal dependencies between historical data is relatively limited. Time-series forecasting models can utilize historical data arranged by sampling time to learn the patterns of PV power generation over time, but their forecasting performance is easily affected by factors such as the number of training samples, time windows, and changes in meteorological conditions. Therefore, using a single forecasting model often makes it difficult to simultaneously model nonlinear relationships and extract temporal variation patterns. Some existing methods combine multiple models in a preset order, but often subsequent models depend on the processing results of previous models, and errors may propagate along the processing chain. Therefore, improving the reliability of PV power generation forecasting is a crucial issue.

[0019] The following description is in conjunction with the accompanying drawings: Figure 1 A flowchart illustrating a photovoltaic power generation prediction method provided in some embodiments of this application is shown. The photovoltaic power generation prediction method includes the following steps: S110: Obtain the data to be predicted corresponding to the target prediction time. The data to be predicted includes meteorological data corresponding to the target prediction time and historical power generation data within a preset time window before the target prediction time. S120: Input the data to be predicted into the first power prediction model and the second power prediction model respectively to obtain the first power prediction value and the second power prediction value for the target prediction time; wherein, the first power prediction model and the second power prediction model are determined by training based on multiple historical training samples, each historical training sample corresponds to a historical target time, including: historical meteorological data corresponding to the historical target time, actual power generation, and historical power generation data within a preset time window before the historical target time; the first power prediction model is a nonlinear regression model trained using input features constructed from historical training samples, and the second power prediction model is a time series prediction model trained using time series input data constructed from historical training samples; S130: Obtain a predetermined target fusion weight reassembly. The target fusion weight reassembly includes a first fusion weight corresponding to the first power prediction value and a second fusion weight corresponding to the second power prediction value. The target fusion weight reassembly is determined by minimizing the fusion prediction error corresponding to the historical verification samples through the ant colony optimization algorithm. S140: Based on the first fusion weight and the second fusion weight, the first power prediction value and the second power prediction value are weighted and fused to determine the photovoltaic power generation prediction value at the target prediction time.

[0020] In the above embodiments, the target prediction time is the time to which this photovoltaic power generation prediction is directed, and can be determined according to the actual prediction task. For example, it can be a sampling time after the current time. The data to be predicted is used to characterize the meteorological conditions and historical output status related to the photovoltaic power generation at the target prediction time. The meteorological data corresponding to the target prediction time may include one or more of irradiance, temperature, humidity, and wind speed, and the historical power generation data before the target prediction time may include the power generation collected by the photovoltaic power plant at one or more sampling times before the target prediction time.

[0021] In some implementations, the meteorological data and historical power generation data in the data to be predicted can have a temporal correspondence adapted to the target prediction task. For example, based on the target prediction time and a preset sampling interval, several power values ​​prior to the target prediction time can be selected from continuously collected historical power generation data, and these selected power values, along with meteorological data used to characterize the meteorological conditions at the target prediction time, can be organized into the data to be predicted. The photovoltaic power plants corresponding to the data to be predicted can be the same as those corresponding to the photovoltaic power plants in the training data of the subsequent first and second power prediction models, so that the data relationships established during the model training phase can be applied to power prediction at the target prediction time.

[0022] The first and second power prediction values ​​in this application represent the photovoltaic power generation at the target prediction time. The difference between the two lies in the different data organization and modeling methods used by the first and second power prediction models for historical training samples. Each historical training sample corresponds to a historical target time. The historical meteorological data corresponding to the historical target time and the historical power generation data before the historical target time are used to form the model input, and the actual power generation at the historical target time is used as the target output during model training. By establishing the correspondence between the model input and the actual power generation at the historical target time, the first and second power prediction models can learn the prediction relationship from historical data to the target power, respectively.

[0023] The first power prediction model combines historical meteorological data corresponding to the target time with historical power generation data prior to that time as input features during the training phase, and uses the actual power generation corresponding to the historical target time as the training target. Since meteorological data and previous power generation may have a combined impact on the power output at the target time, and the relationship between different factors is usually not a simple linear one, the model learns the nonlinear correspondence between different meteorological conditions, historical power states, and actual power generation through historical training samples. After training, the first power prediction model can determine the power level matching the current input state based on the meteorological data at the target prediction time and previous power generation data, within the established correspondence, and then output the first power prediction value.

[0024] During the training phase, the second power prediction model retains the chronological relationships between historical power generation data according to sampling time, enabling the model to identify power changes over consecutive sampling moments. When historical power generation is at the same or similar levels, the direction and magnitude of previous changes may differ. For example, power may have continuously increased from a lower level to the current level, or it may have continuously decreased from a higher level to the current level; these two changes do not indicate the same subsequent power changes. The second power prediction model learns the state transfer relationships between consecutive sampling moments using historical training samples and, combined with relevant historical meteorological conditions, extracts trend information related to the target moment during power changes. After training is complete, the second power prediction model can determine the second power prediction value based on the power evolution process before the target prediction moment and the corresponding meteorological conditions.

[0025] In the above processing, the first power prediction value mainly reflects the correspondence between the current meteorological conditions and historical operating status and the target power level, while the second power prediction value further reflects the evolution trend of power over time. Both prediction values ​​target the same prediction time but originate from different model results, thus providing complementary power prediction information for subsequent fusion. In this application, both models use the photovoltaic power generation at the target prediction time as the prediction object, and their output results are consistent in physical meaning and temporal orientation, thus enabling fusion in subsequent processing. By employing power prediction models with different modeling mechanisms, the photovoltaic power generation at the target prediction time can be characterized from two perspectives: the nonlinear relationship between input features and the temporal relationship between historical data, providing complementary prediction results for subsequent fusion. In the target fusion weighting of this application, the first and second fusion weights are used to adjust the proportion of the two power prediction values ​​in the fusion result. Since the two power prediction models use different modeling methods, their prediction results on the same historical validation sample may also differ. Therefore, the prediction effect of different fusion weight combinations can be evaluated through historical validation samples. Historical validation samples can include validation input data and the corresponding actual power generation. The validation input data is input into the trained first and second power prediction models, respectively, to obtain the first and second validation prediction values ​​for the corresponding historical target time. These two validation prediction values ​​are then weighted according to a set of fusion weights to be evaluated, resulting in the corresponding fused validation prediction value. Finally, by comparing the difference between the fused validation prediction value and the actual power generation, the fusion prediction error corresponding to that set of fusion weights can be determined.

[0026] The target fusion weight reassembly proposed in this application can determine the first and second fusion weights based on engineering practice experience and experiments, combined with historical verification samples. It can also employ a reasonable optimal weight analysis algorithm, such as the ant colony optimization algorithm, using the minimization of fusion prediction errors corresponding to different fusion weight combinations as the search evaluation criterion. Multiple weight combinations are iteratively searched within the range of fusion weight values. Taking the ant colony optimization algorithm as an example, as the search process continues, the subsequent search direction can be adjusted according to the fusion prediction errors corresponding to each set of fusion weights, ultimately determining the target fusion weight reassembly that meets the error evaluation requirements. The final prediction result after fusion can simultaneously utilize the modeling results of the nonlinear regression model on the nonlinear relationship between meteorological conditions, historical power generation status, and power output, as well as the modeling results of the time-series prediction model on the historical power generation change process, thereby forming a comprehensive power prediction result for the target prediction time.

[0027] In the above implementation, by inputting the data to be predicted into power prediction models trained using different data organization methods, two power prediction results for the same target prediction time can be obtained from both nonlinear characteristic relationships and historical time-series relationships. Furthermore, by pre-determining the target fusion weighting based on the fusion prediction error corresponding to the historical validation samples and performing weighted fusion, the contribution of the two models to the final prediction result can be coordinated based on their prediction performance on the historical validation data. This reduces the dependence on specific modeling methods when using a single prediction model or fixed empirical weights, thereby improving the accuracy and stability of photovoltaic power generation prediction results.

[0028] In this method, the parallel prediction component is configured as a nonlinear regression prediction model and a time-series prediction model according to the technical functions of the models. The nonlinear regression prediction model is used to learn the nonlinear mapping relationship between input features such as irradiance, temperature, humidity, wind speed, and historical power and photovoltaic power. Support vector machines, random forests, gradient boosting regression trees, Gaussian process regression, or radial basis function neural networks can be selected. The time-series prediction model is used to extract short-term fluctuations, periodic changes, and cross-time dependencies of the photovoltaic power sequence. Gated recurrent units, recurrent neural networks, long short-term memory networks, temporal convolutional networks, or Transformer models based on self-attention mechanisms can be selected. Both prediction models use the same data preprocessing results and prediction time scale, outputting photovoltaic power prediction values ​​corresponding to the target time, and then the fusion weights are uniformly determined by an ant colony optimization algorithm. The combination of support vector machines and gated recurrent units is the preferred implementation.

[0029] In some embodiments of this application, it also includes: Obtain the original historical dataset, which includes historical power generation data and historical meteorological data arranged according to the sampling time. The first historical dataset is selected from the original historical dataset, corresponding to the effective lighting period. The abnormal and missing data in the first historical dataset are corrected to obtain the second historical dataset. The second historical dataset is divided into training data and validation data. Multiple historical training samples are constructed based on the training data, and multiple historical validation samples are constructed based on the validation data.

[0030] Specifically, the original historical dataset can consist of data collected by the photovoltaic power plant operation monitoring platform and the meteorological monitoring platform within a preset historical time range. Historical power generation data is used to record the actual output power of the photovoltaic power plant at each sampling time, while historical meteorological data can include one or more of irradiance, temperature, humidity, and wind speed. A correspondence can be established between historical power generation data and historical meteorological data according to the sampling time, linking the power generation and meteorological conditions at the same sampling time, thus providing a time-corresponding data foundation for subsequent model training and validation.

[0031] Since photovoltaic (PV) power plants typically do not generate electricity at night when there is no effective solar radiation, the original historical dataset may contain a significant amount of nighttime data with zero or near-zero power. If this data is used together with data from specific sunshine periods for model training, the model is susceptible to the influence of a large number of invalid zero-value data points. Therefore, data corresponding to effective sunshine periods can be selected from the original historical dataset to form the first historical dataset. Effective sunshine periods can be determined based on the solar radiation conditions in the area where the PV power plant is located, or based on irradiance data from historical meteorological data. For example, periods when irradiance meets preset sunshine conditions can be defined as effective sunshine periods. Furthermore, effective sunshine periods can be adjusted based on seasonal changes, geographical location, or the actual operating conditions of the PV power plant, and are not limited to fixed start and end times.

[0032] The first historical dataset may contain anomalous and missing data caused by sensor malfunctions or data transmission fluctuations. Anomalous data may deviate significantly from the range of data changes between adjacent sampling times, while missing data will disrupt the correspondence between data from consecutive sampling times. Therefore, anomalous and missing data can be corrected during preprocessing to reduce the interference of outlier values ​​on the model parameter learning process.

[0033] The second historical dataset can be divided into training data and validation data according to a preset ratio. Training data is used to construct historical training samples to train both the first and second power prediction models. Validation data is used to construct historical validation samples to evaluate the fusion prediction performance corresponding to different fusion weights after model training is complete. Training and validation data can each consist of data from different time intervals to avoid the same data being used simultaneously for model parameter learning and fusion weight evaluation.

[0034] In some implementations, the second historical dataset can be divided sequentially according to sampling time. For example, data from earlier times can be used as training data, and subsequent data as validation data. Dividing the dataset chronologically preserves the inherent temporal structure of the photovoltaic power generation data and ensures that the validation data is temporally independent of the data used for model training. Alternatively, the dataset can be divided according to a preset ratio. For instance, 70% of the data in the second historical dataset can be allocated as training data, 15% as validation data, and the remaining data can be used to evaluate the trained prediction model and the fused prediction results. The specific division ratio can be determined based on the amount of historical data and the model training requirements.

[0035] When constructing historical training and validation samples, different historical target times can be selected from the relevant data, and meteorological data corresponding to each historical target time, historical power generation data before the historical target time, and actual power generation corresponding to the historical target time can be extracted. Samples constructed from training data are used to establish the predictive relationship between the model input and actual power generation, while samples constructed from validation data are used to evaluate the trained power prediction model and the prediction results corresponding to different fusion weights. The training and validation data can use the same sample construction rules to ensure consistency in data structure and temporal correspondence between the data used in the model training and fusion weight evaluation phases.

[0036] Figure 2 A flowchart illustrating a method for correcting anomalous data in a first historical dataset according to some embodiments of this application is shown. The method includes: S210: Determine the data sequence to be processed from the first historical dataset. The data sequence to be processed is formed by arranging the values ​​of the same monitoring parameter at multiple sampling times according to the sampling time. The monitoring parameters include multiple of the following: power generation, irradiance, temperature, humidity and wind speed. S220: Determine the first quartile, third quartile, and interquartile range of the data sequence to be processed; S230: The difference between the first quartile and the interquartile range of a preset multiple is determined as the lower limit of the normal value range, and the sum of the interquartile ranges of the third quartile and the preset multiple is determined as the upper limit of the normal value range. S240: Values ​​in the data sequence to be processed that are below the lower limit or above the upper limit are identified as abnormal data; based on the adjacent normal values ​​before and after the abnormal data, the abnormal data are interpolated and corrected.

[0037] In the above embodiments, taking irradiance as the monitoring parameter as an example, the irradiance values ​​can be arranged according to the sampling time to form an irradiance data sequence. When the monitoring parameter is power generation, the power generation values ​​can be arranged according to the sampling time to form a power generation data sequence. Forming separate data sequences for different monitoring parameters avoids mutual influence between the numerical ranges and variation characteristics of different physical quantities, ensuring that the judgment of abnormal data is based on similar monitoring data.

[0038] For a data sequence containing n sample values, the sample values ​​can be arranged in ascending order, and the first quartile Q1 and the third quartile Q3 can be determined according to a preset quartile calculation method. The first quartile Q1 corresponds to the value with a cumulative distribution ratio of 25% in the data sequence, and the third quartile Q3 corresponds to the value with a cumulative distribution ratio of 75%. The range between the first and third quartiles reflects the distribution of the data in the middle of the data sequence. Compared to directly using the maximum and minimum values ​​to determine the data range, it is less affected by individual extreme values. The interquartile range (IQR) can be determined based on the difference between the first quartile Q1 and the third quartile Q3, i.e., IQR = Q1 - Q3. The interquartile range is used to characterize the dispersion of the middle 50% of the data in the data sequence. When the sample values ​​in the data sequence are relatively concentrated, the interquartile range decreases accordingly; when the fluctuation range between the sample values ​​increases, the interquartile range increases accordingly. Therefore, determining the judgment range of abnormal data based on the interquartile range allows the judgment range to be adapted to different monitoring parameters and different data fluctuation states. The lower limit L and upper limit U of the normal value range can be determined with reference to the following formula 1: Formula 1 Where k represents the preset multiple, which is used to adjust the width of the normal range of values. For example, the preset multiple can be 1.5. For any sample value x in the data sequence to be processed... i When a sampled value meets the conditions of Formula 2 below, it can be identified as outlier data: Formula 2 Sample values ​​below the lower limit of the normal range indicate that the sample value is abnormally low relative to the main distribution of the data sequence being processed, while sample values ​​above the upper limit of the normal range indicate that the sample value is abnormally high. By setting both the lower and upper limits simultaneously, low-value anomalies and high-value anomalies can be identified.

[0039] After identifying outlier data, the sampling time corresponding to the outlier data can be retained, and the correction value can be calculated using adjacent normal values ​​before and after that sampling time. For cases where the sampling interval is the same and adjacent samples are all normal values, the corrected sample value... Formula 3 can be used as a reference: Formula 3 Where, x i-1 x represents the adjacent normal value before the abnormal data. i+1 This represents the adjacent normal value following the abnormal data. The calculated correction value is written to the sampling position corresponding to the abnormal data, allowing for abnormal data correction without deleting the corresponding sampling time.

[0040] For example, the irradiance data obtained by a photovoltaic power station at multiple consecutive sampling times are [200, 210, 205, 5000, 215, 220, 225], with units of watts per square meter. Based on the normal distribution of this data set, the first quartile (Q1) is approximately 205, the third quartile (Q3) is approximately 220, and the interquartile range (IQR) is approximately 15. With a preset multiplier of 1.5, the lower limit of the normal range is approximately 182.5, and the upper limit is approximately 242.5. Since the sampled value 5000 is higher than the upper limit of the normal range (242.5), it can be identified as an outlier. The adjacent normal value before this outlier is 205, and the adjacent normal value after it is 215. After interpolation based on the adjacent normal values, the correction value can be determined to be 210. After replacing the original sampling position 5000 with 210, the corrected irradiance data sequence is [200, 210, 205, 210, 215, 220, 225]. It can be seen that the corrected value is between the adjacent normal values ​​and continues the irradiance change state within this time period.

[0041] Understandably, the monitoring parameters include multiple parameters such as power generation, irradiance, temperature, humidity, and wind speed. This is because photovoltaic power generation is not determined by a single factor but is the result of the combined effects of multiple meteorological factors. Only by inputting all influencing factors into the prediction model can the model learn a complete mapping relationship. Therefore, when correcting abnormal data in the first historical dataset, all of the above parameters must be processed one by one according to the above methods to correct the abnormal data, thereby ensuring the accuracy and precision of subsequent power predictions.

[0042] In some embodiments of this application, the first power prediction model is a support vector regression model, and the second power prediction model is a gated recurrent unit model; inputting the data to be predicted into the first power prediction model and the second power prediction model respectively includes: running the first power prediction model and the second power prediction model in parallel, so that the first power prediction model and the second power prediction model can independently predict the power at the target prediction time.

[0043] Figure 3A flowchart illustrating a training method for a first power prediction model provided in some embodiments of this application is shown. The training method includes: S310: Determine the historical meteorological data and historical power generation data from multiple past moments in each historical training sample as input features, and take the actual power generation corresponding to a future moment after multiple past moments as the training target. S320: Based on the selected kernel function, the input features are implicitly mapped to a high-dimensional feature space, and a nonlinear regression relationship between the input features and the training target is established in the mapped feature space. S330: Based on the preset error tolerance range, determine the prediction deviation of the training power prediction value of the first power prediction model from the training target that exceeds the preset error tolerance range; S340: Based on the prediction bias and the model complexity of the first power prediction model, train to determine the model parameters of the first power prediction model.

[0044] In the above implementation, for the i-th historical training sample, the input vector can be denoted as z. i The training objective can be denoted as p. i , representing the actual power generation at the historical target time. Thus, multiple corresponding input vectors and training targets can be formed to train the first power prediction model. The regression function of the first power prediction model can be expressed as follows: (Formula 4) Formula 4 Where φ(z) represents the feature vector obtained after feature mapping of the input vector, ω represents the weight vector used to determine the regression function, b represents the bias parameter used to adjust the position of the regression function, and f(z) represents the power prediction value determined by the first power prediction model based on the input vector.

[0045] Specifically, in step S310, assuming there are three samples, a complete training sample includes the following information:

[0046] As shown in the table above, for example, in Sample 1, the output is the power generation at time t. The input features include not only external conditions that directly affect the power generation at time t, such as irradiance, temperature, humidity, and wind speed, but also the actual historical power at times t-1 and t-2. This historical power reflects the power station's own status and power change trend. If the power has been rising in the past two times, it indicates that the power station is operating normally, and it is highly likely to continue to rise at time t. If the power suddenly drops in the past, it may be due to cloud cover or equipment problems, which will also affect the power at time t. Combining these two factors makes the model's prediction more accurate. Similarly, in Sample 2, the input information includes irradiance, temperature, humidity, and wind speed at time t+1, and the actual power at times t and t-1 in the past, and the output is the actual power at time t+1. In Sample 3, the input information includes irradiance, temperature, humidity, and wind speed at time t+2, and the actual power at times t+1 and t in the past, and the output is the actual power at time t+2. It is also understandable that, for each sample data in the table above, multiple past historical power data points can be added according to actual needs, rather than being limited to the past two historical moments.

[0047] As shown in the table above, in step S310, historical meteorological data (including irradiance, temperature, humidity, wind speed, etc.) and historical power generation data from multiple past moments in each historical training sample are used as input features, and the actual power generation corresponding to a future moment after the aforementioned past moments is used as the training target. By constructing this time-displaced input-output mapping relationship, the model can learn the dynamic law between meteorological conditions and power output, thereby achieving the prediction of future photovoltaic power generation. After the construction of the training samples is completed in step S310, they are input into the subsequent optimization training process (S320~S340) to solve for the model parameters.

[0048] In step S320, during training, a kernel function can be used to calculate the inner product of different input vectors in the feature space. Based on the selected kernel function, the input features are implicitly mapped to a high-dimensional feature space, constructing an optimization problem with the objective of minimizing structural risk. This optimization problem includes error tolerance interval constraints and slack variables to establish a nonlinear regression relationship between the input features and the training objective. For the input vector z of the i-th historical training sample... i Given the input vector z to be processed, the kernel function can be found in the following formula 5: Formula 5 In some implementations, the kernel function may be a radial basis function, as shown in Equation 6 below: Formula 6 Where γ represents the kernel function parameter, used to control the rate at which the kernel function value decays as the distance between input vectors increases, and ||zi-z|| represents the distance between input vectors zi and z. In photovoltaic power plants, the relationship between irradiance, temperature, humidity, wind speed, etc., and power is often nonlinear. The radial basis function can implicitly map the data to a high-dimensional space to achieve linear regressibility of the data. The training objective function can be expressed as shown in Equation 7 below: Formula 7 The corresponding constraints can be found in Formula 8 below: Formula 8 Where, ||ω|| 2 Used to characterize the model complexity of the first power prediction model, used to control the smoothness of the regression hyperplane, and to reflect structural risk; ε represents the training error term, used to measure the cumulative deviation of each training sample from the preset error tolerance interval ε, reflecting empirical risk; C represents the penalty factor, used to adjust the relative impact of model complexity and prediction bias during the training process. and As slack variables, the degree of deviation when the sample predicted value is below the lower limit and above the upper limit is recorded respectively. Through the construction of the above optimization problem, a nonlinear regression relationship framework between input features (historical meteorological data and historical power generation data) and training objective (actual power generation at future times) is mathematically established.

[0049] In step S330, based on the current model parameters w and b, the predicted value of each training sample is calculated, and the prediction deviation e of each sample is determined according to the preset error tolerance interval ε. i + and e i - For the i-th historical training sample, when the training target p i Compared with the training power prediction value f(z) i When the difference between the two values ​​does not exceed the error tolerance parameter ε, this difference can be disregarded in the prediction deviation that needs to be constrained. When the difference exceeds the error tolerance parameter ε, the portion exceeding the preset error tolerance range can be recorded using the deviation variable. Where e i - This indicates that the predicted value is lower than the actual value and exceeds the lower limit. -ε deviation, This indicates that the predicted value is higher than the actual value and exceeds the upper limit. The deviation of +ε will be input into the objective function of S340 to guide the optimization direction of the model parameters.

[0050] In step S340, the prediction bias e of each training sample calculated in S330 is... i + and e i - The objective function is to minimize the structural risk objective function constructed in S320. An optimization algorithm is used to iteratively solve the problem until the objective function converges, thereby training and determining the optimal model parameters w and b of the first power prediction model. In a preferred embodiment, the optimization algorithm is a sequential minimum optimization algorithm.

[0051] In each iteration, S330 calculates the prediction bias of each training sample under the current model parameters and feeds this bias back to the objective function of S340 to determine whether the current solution meets the preset convergence condition. If it does, the algorithm converges and outputs the current optimal model parameters w and b. If it does not, the optimization algorithm selects a set of Lagrange multipliers to be optimized for analytical update to obtain the updated w and b, and returns to S330 to recalculate the prediction bias. This process is repeated until the objective function value no longer decreases significantly.

[0052] After solving for the training objective function and constraints, the regression function of the first power prediction model can be expressed as follows (Formula 9): Formula 9 Where, α i and K(z) represents the multiplier parameter corresponding to the i-th historical training sample; i (z) represents the input vector z of the historical training samples. i The kernel function value between the input vector z to be processed.

[0053] Using the above training method, the input features of the first power prediction model are jointly composed of historical meteorological data and historical power generation data from multiple past moments in the historical training samples. The actual power generation at the historical target moment is used as the training objective. A kernel function is used to establish a nonlinear regression relationship between historical meteorological data, historical power generation data, and actual power generation. A preset error tolerance interval is used to reduce the impact of small data fluctuations on model training. Simultaneously, by considering model complexity and prediction bias exceeding the error tolerance interval in the training objective, the possibility of an overly complex model structure or overfitting of historical training samples can be reduced, thereby improving the applicability of the first power prediction model to different meteorological conditions and historical power generation states.

[0054] Understandably, the first power prediction model is not limited to support vector machines. When using random forests, multiple regression decision trees are used to learn different feature subsets, and the outputs of each tree are averaged to reduce the sensitivity of a single model to fluctuations in local samples. When using gradient boosting regression trees, subsequent regression trees are built step by step according to the prediction residuals of the previous regression tree to fit the complex nonlinear relationship between meteorological features and photovoltaic power. When using Gaussian process regression, the covariance relationship between input samples is constructed through kernel functions to obtain the regression prediction of the target power. When using radial basis function neural networks, the nonlinear mapping of input features is completed through the hidden layers of the radial basis functions. The inputs of the above models are all preprocessed multi-source meteorological features and historical power data, and the outputs are all photovoltaic power prediction values ​​at the corresponding prediction time. Therefore, they can replace support vector machines to complete nonlinear mapping predictions without changing the data preprocessing, parallel computing, and subsequent weight fusion processes.

[0055] Figure 4 A flowchart illustrating a training method for a second power prediction model provided in some embodiments of this application is shown. The training method includes: S410: For each historical training sample, obtain multiple historical power generation powers that were within a preset time window before the historical target time corresponding to the historical training sample, and arrange the multiple historical power generation powers according to the sampling time. S420: The arranged historical power generation is fused with the historical meteorological data corresponding to the historical target time, so that each historical target time is composed of a multi-dimensional feature vector composed of the corresponding power generation and meteorological data. The multiple multi-dimensional vector features are arranged according to time to obtain the time-series input data. S430: Input the timing input data into the second power prediction model, control the information of the candidate hidden state in the previous hidden state based on the reset gate, and adaptively fuse the previous hidden state and the candidate hidden state based on the update gate to obtain the current hidden state; S440: Determine the training power prediction value based on the current hidden state; train and determine the model parameters of the second power prediction model based on the difference between the training power prediction value and the actual power generation in the corresponding historical training samples.

[0056] In the above embodiments, each historical training sample corresponds to a historical target time. Multiple historical power generation values ​​within a preset time window can be selected backward from the target time as the endpoint and arranged in chronological order according to their corresponding sampling times to form a power time-series vector. The preset time window is used to limit the range of historical power values ​​referenced by the second power prediction model in a single prediction. Its window length can be determined based on the sampling interval of historical data, the rate of change of photovoltaic power generation, and the prediction time scale.

[0057] In one specific embodiment, assuming the historical data sampling interval is 15 minutes, the preset time window length is 2 hours (i.e., 8 sampling points), and the time to be predicted is 10:00 AM on a certain day, then using 10:00 AM as the endpoint, the historical power generation of 8 sampling points (i.e., 08:30, 08:45...09:55) are selected backwards and arranged in chronological order to constitute the power time series input of the training sample. The actual power generation at 10:00 AM corresponding to this input sequence is the training target of the training sample. The second power prediction model learns the changing trend of these 8 consecutive historical power values ​​to predict the power generation at 10:00 AM.

[0058] In step S420, the arranged historical power generation data can be combined with historical meteorological data corresponding to the target historical time to form time-series input data. The arranged historical power generation data reflects the power generation status and trends before the target historical time, and the combined time-series input data can be used as the multi-dimensional time series input of the second power prediction model. When the second power prediction model processes the time-series input data according to the sampling order, the input corresponding to the current processing position is denoted as u. t .

[0059] Specifically, ,in, Represents the historical photovoltaic power sequence, Indicates irradiance, Indicates temperature. Indicates humidity. Indicates wind speed. Indicates the length of the time window.

[0060] In step S430, the second power prediction model can use a gated loop unit to process the time-series input data. The gated loop unit can control the transmission of historical information between different sampling times through reset gates and update gates, thereby obtaining the current hidden state based on the current input and the previously formed hidden state. That is, the time-series input data of the second power prediction model is composed of the fusion of historical power generation at multiple sampling times within a preset time window in the historical training samples and the historical meteorological data at the corresponding times, and the time-series dependencies are captured through a gating mechanism. The output of the reset gate can be expressed as follows: Formula 10 Where, r t Let σ represent the reset gate output at processing time t, σ() represent the sigmoid activation function, Wr represent the learning parameters corresponding to the reset gate, and h represent the learning parameters corresponding to the reset gate. t-1 u represents the hidden state at the previous processing time. tThis represents the input data at the current processing moment. The reset gate controls the information from the previous hidden state that participates in the generation of candidate hidden states. When the reset gate assigns a smaller retention rate to some information from the previous hidden state, the influence of that historical information on the candidate hidden state is correspondingly weakened; when the reset gate assigns a larger retention rate to the corresponding historical information, that historical information can participate more in the generation of candidate hidden states. Therefore, the previously accumulated historical information can be filtered based on the current input state. The output of the update gate can be expressed as follows: (Formula 11) Formula 11 Among them, Z t W represents the update gate output at the t-th processing time. z This indicates updating the learning parameters corresponding to the gate. Reset gate r t Participate in the information filtering between the previous hidden state and the candidate hidden state, and update gate Z. t This is used to adjust the fusion ratio of the previous hidden state and the candidate hidden state in the current hidden state. Based on the current input and the previous hidden state controlled by the reset gate, the candidate hidden state can be obtained. The candidate hidden state can be represented by the following formula 12: Formula 12 in, Let W represent the candidate hidden state at the t-th processing time, tanh() represent the hyperbolic tangent function, and W... h The symbols represent the learning parameters corresponding to the candidate hidden states. This indicates element-wise multiplication.

[0061] Candidate hidden states are generated based on the current input and historical information filtered by the reset gate. They are used to reflect new information that can be written into the hidden state under the current input conditions. When some information in the previous hidden state has a weak relationship with the current change in power generation, the reset gate can reduce the impact of that information on the candidate hidden state; when the information in the previous hidden state is still helpful for the current prediction, the corresponding historical information can be retained.

[0062] After obtaining the candidate hidden states, the update gate can be used to merge the previous hidden state and the candidate hidden states to obtain the current hidden state. The current hidden state can be represented by the following formula 13: Formula 13 Among them, h t This represents the current hidden state corresponding to the t-th processing time.

[0063] Update Gate Z tThis is used to adjust the proportion of the previous hidden state and the candidate hidden state in the current hidden state. When the update gate makes the previous hidden state more preserved, the current hidden state continues more of the historical change information accumulated previously. When the update gate makes the candidate hidden state more preserved, the current hidden state absorbs more of the new information formed by the current input.

[0064] By sequentially performing the above processing on the time-series input data within the preset time window, the hidden state can be gradually updated along the sampling time, transforming the historical power generation change process and related meteorological conditions into time-series state information for predicting power generation at historical target times.

[0065] In step S440, the training power prediction value of the training sample is determined based on the current hidden state; according to the difference between the training power prediction value and the actual power generation in the corresponding historical training sample, the backpropagation algorithm is used to update the model parameters of the second power prediction model. The model parameters include the weight matrix and bias term of each gate unit, so as to gradually reduce the prediction error; the above process is repeated until the model converges, and the training of the second power prediction model is completed.

[0066] Specifically, the current hidden state can be mapped to the output space using the output weight matrix to obtain the predicted training power. The predicted training power can be expressed as shown in Equation 14 below: Formula 14 Among them, y t W represents the training power prediction value output by the second power prediction model for the corresponding historical target time. o This represents the output weight matrix, used to map the current hidden state to the power prediction result, and σ() represents the sigmoid activation function. The trained power prediction value can be compared with the actual power generation in the corresponding historical training samples, and W can be adjusted based on the difference between the two. r W z W h and W o The model parameters are configured such that, with multiple historical training samples participating in the training, the second power prediction model gradually learns the temporal relationship between historical power generation changes, meteorological conditions, and actual power generation at historical target times. After training is complete, when the second power prediction model receives the temporal input data corresponding to the target prediction time, it uses a reset gate to filter historical information in the previously hidden state, uses an update gate to coordinate the historical state with the current input to form a new state, and outputs the second power prediction value based on the final hidden state. This model can utilize the information transmission relationship between consecutive sampling times to model the rise, fall, and fluctuation process of photovoltaic power generation, providing temporally characteristic prediction results for subsequent fusion with the prediction results of the first power prediction model.

[0067] Understandably, the second power prediction model is not limited to gated recurrent units. When using recurrent neural networks, historical information is passed between adjacent time points through hidden states; when using long short-term memory networks, the retention and updating of historical information are regulated through input gates, forget gates, and output gates; when using temporal convolutional networks, the temporal receptive field is expanded without using future information through causal convolution and dilated convolution; when using Transformer models, the correlation weights between different historical time points and the target time point are calculated through positional encoding and self-attention mechanisms. All of the above models take meteorological sequences and historical power sequences organized according to sliding time windows as inputs and output photovoltaic power prediction values ​​with the same prediction step size. Therefore, they can replace gated recurrent units to complete time-dependent feature modeling without changing the parallel branch interface and fusion method.

[0068] Figure 5 A flowchart illustrating a method for determining a target fusion weight group according to some embodiments of this application is shown. The method includes: S510: Generate multiple candidate fusion weight recombinations in the fusion weight parameter space. Each candidate fusion weight recombination includes a candidate first fusion weight and a candidate second fusion weight. S520: Determine the fusion prediction error of each candidate fusion weight reorganization on multiple historical validation samples; S530: Update the pheromone intensity corresponding to each candidate fusion weight recombination based on the fusion prediction error corresponding to each candidate fusion weight recombination. S540: Based on the updated pheromone intensity, perform the next iteration search in the fusion weight parameter space to obtain multiple candidate fusion weight recombinations for the next iteration; S550: When the preset iteration termination condition is met, the candidate fusion weight recombination with the smallest fusion prediction error in each iteration is determined as the target fusion weight recombination; wherein, the candidate first fusion weight and the candidate second fusion weight are both non-negative numbers, and the sum of the candidate first fusion weight and the candidate second fusion weight is 1.

[0069] In the above embodiments, the fusion weights corresponding to the first power prediction model and the second power prediction model can be set as the variables to be optimized in the ant colony optimization algorithm. For example, the candidate first fusion weight is denoted as ω1, and the candidate second fusion weight is denoted as ω2. At this time, the candidate first fusion weight and the candidate second fusion weight satisfy the requirements of Formula 15: Formula 15 In this algorithm, both the first and second candidate fusion weights are non-negative. The fusion weight parameter space can be transformed into a search space for a continuous fusion weight variable, and the path in the ant colony optimization algorithm is a candidate search path in the fusion weight parameter space. Multiple candidate fusion weight recombinations are generated in the fusion weight parameter space based on pheromone intensity distribution and heuristic information. The states in the fusion weight parameter space can correspond to candidate fusion weight values ​​or candidate fusion weight intervals. Each ant constructs a candidate search path in one iteration by selecting the corresponding state; this candidate search path corresponds to a set of candidate fusion weights. Different ants can construct different candidate fusion weight recombinations in the same iteration, thereby searching different positions in the fusion weight parameter space.

[0070] In step S520, multiple historical verification samples can be input into the trained first power prediction model and second power prediction model respectively to obtain two verification prediction values ​​corresponding to each historical verification sample. For example, the verification prediction value output by the first power prediction model for the t-th historical verification sample is denoted as... The validation prediction value output by the second power prediction model for the same historical validation sample is denoted as... After fusing the two validation predictions according to a set of candidate fusion weights, the resulting fused prediction can be expressed as follows: Formula 16: Formula 16 in, Let represent the fusion prediction value corresponding to the t-th historical verification sample. For the same candidate fusion weight reorganization, the fusion prediction values ​​corresponding to multiple historical verification samples can be determined sequentially. After comparing each fusion prediction value with the actual power generation in the corresponding historical verification sample, the prediction differences on multiple historical verification samples can be summarized using normalized mean square error or mean absolute error, and the resulting mean square error is determined as the fusion prediction error corresponding to the candidate fusion weight reorganization.

[0071] In the ant colony optimization algorithm, the path length of the candidate search path constructed by the k-th ant in the q-th iteration is denoted as L. k (q). In the fusion weight search scenario of this application, the path length L k (q) can be characterized by the fusion prediction error of the corresponding candidate fusion weight recombination on multiple historical verification samples. The smaller the fusion prediction error, the closer the fusion prediction result generated by the candidate fusion weight recombination is to the actual power generation, and the shorter the path length of the corresponding candidate search path.

[0072] In step S530, after the k-th ant completes one candidate fusion weight search, the pheromone increment released on that path can be determined based on the path length of the corresponding candidate search path. The pheromone increment can be expressed as follows: Formula 17 Formula 17 Where, Δτ k (q) represents the increment of pheromone released by the k-th ant in the q-th iteration, L k (q) represents the path length of the candidate search path constructed by the k-th ant in the q-th iteration. Q represents the adjustment parameter used to adjust the amount of pheromone released each time. Since the path length is characterized by the fusion prediction error of the corresponding candidate fusion weight group, the path length L is relatively small when the fusion prediction error corresponding to the candidate fusion weight group is small. k (q) is relatively small, and the pheromone increment Δτ k (q) is relatively large; when the fusion prediction error is large, the path length is large, and the pheromone increment decreases accordingly. Therefore, the prediction performance of candidate fusion weight recombination on historical validation samples can be transformed into pheromone feedback.

[0073] After all ants have completed the q-th iteration, the pheromone intensity corresponding to the path edges between each candidate state can be updated based on pheromone evaporation and the pheromone released by each ant. Therefore, the formula for updating the pheromone intensity can be expressed as follows: Formula 18 Formula 18 Where, τ ab (q) represents the pheromone intensity on the path edge corresponding to state a to state b at the q-th iteration, τ ab (q+1) represents the pheromone intensity after the pheromone update is complete, ρ represents the pheromone evaporation coefficient, and m represents the number of ants. This represents the pheromone increment generated by the k-th ant on the path edge corresponding to state a to state b in the q-th iteration.

[0074] When the path edge corresponding to state a to state b belongs to the candidate search path constructed by the k-th ant Based on the increment of pheromones released by the ant Confirmed. When multiple ants pass through the same path edge, the pheromone increments generated by each ant on that path edge can be accumulated.

[0075] Pheromones evaporate to reduce the lasting impact of historical search results on subsequent searches, preventing the algorithm from being dominated by early candidate search paths for an extended period. Pheromones increment, on the other hand, strengthen candidate search paths with smaller fusion prediction errors. Through the combined effect of pheromone evaporation and pheromone accumulation, the search process can gradually concentrate on fusion weight regions with smaller historical verification errors, while retaining the possibility of continuing to search other candidate weight regions.

[0076] In step S540, the probability of each ant transitioning from its current state to a candidate state in the next iteration can be determined based on the updated pheromone intensity and heuristic function value. The state transition probability can be expressed using the following formula 19: Formula 19 in, Let τ represent the probability that the k-th ant transitions from state a to state b in the q-th iteration. ab (q) represents the pheromone intensity on the path edge corresponding to state a to state b, η ab The heuristic function value corresponding to the edge of the path can be determined based on the expected reward of the path. α represents the pheromone importance parameter, used to adjust the influence of pheromone intensity on the state transition probability, and β represents the heuristic pheromone importance parameter, used to adjust the influence of the heuristic function value on the state transition probability. k Let represent the set of states that the k-th ant can currently choose, and let c represent any candidate state that can be chosen.

[0077] Path edges with higher pheromone intensity have a higher selection probability in subsequent iterations, causing the search process to focus more on weight regions with smaller fusion prediction errors. The heuristic function value provides directional information for candidate weight selection in the current state. Each ant continues to select candidate states in the fusion weight parameter space based on state transition probabilities, thus forming the candidate fusion weight reorganization for the next iteration.

[0078] In the next iteration, the two verification prediction values ​​corresponding to the historical verification samples can be weighted and fused again using the recombination of each candidate fusion weight, and the corresponding fusion prediction error can be calculated. Subsequently, the pheromone increment calculation, pheromone intensity update, and candidate search path construction are continued, so that the search process in the fusion weight parameter space is iterated step by step.

[0079] In step S550, after each iteration, the minimum fusion prediction error and the corresponding candidate fusion weight recombination can be recorded, and it can be determined whether the current search process meets the preset iteration termination condition. The preset iteration termination condition may include, but is not limited to, reaching a preset number of iterations or the search result meeting a preset convergence condition, thereby stopping the generation of new candidate fusion weight recombinations, comparing the fusion prediction errors corresponding to each candidate fusion weight recombination in each iteration, and determining the candidate fusion weight recombination with the smallest fusion prediction error as the target fusion weight recombination.

[0080] Based on the above embodiments, this application can further summarize the methods of steps S520 and S530 as follows: acquiring verification input data and actual power generation from each historical verification sample; inputting each verification input data into a first power prediction model and a second power prediction model respectively to obtain a first verification prediction value and a second verification prediction value corresponding to each historical verification sample; for each candidate fusion weight recombination, weighting and fusing the first verification prediction value and the second verification prediction value corresponding to each historical verification sample according to the candidate first fusion weight and the candidate second fusion weight to obtain the corresponding candidate fusion prediction value; determining the fusion prediction error of the corresponding candidate fusion weight group according to the mean square error between each candidate fusion prediction value and the corresponding actual power generation; determining the fusion prediction error as the search path length corresponding to the corresponding candidate fusion weight recombination, and determining the pheromone increment corresponding to the corresponding candidate fusion weight recombination according to the ratio of the preset adjustment parameter to the search path length; determining the updated pheromone intensity according to the current pheromone intensity, the preset pheromone evaporation coefficient, and the pheromone increment. In this embodiment, the prediction error (using mean square error) is used as a fitness evaluation index to measure the merits of the candidate weight scheme. The smaller the error, the higher the fitness of the corresponding path and the greater the pheromone increment; the larger the error, the lower the probability of the corresponding path being selected in subsequent iterations. Therefore, path selection in ACO is specifically transformed into the selection and iterative update process of fusion weight candidate values, while the pheromone update mechanism corresponds to the enhanced search of low-error weight regions. After multiple iterations, the algorithm outputs the weight combination that minimizes the prediction error on the validation set as the final fusion weight.

[0081] When the first or second power prediction model adopts one of the other models mentioned above, the ant colony optimization algorithm still processes the power prediction sequences output by the two parallel branches at the same prediction time. The fusion weights are still determined based on the prediction error between the fused prediction value and the actual power, and each fusion weight satisfies the normalization constraint. Therefore, model replacement only changes the feature learning method within the corresponding branch, without changing the overall process of original data preprocessing, parallel prediction, weight search, and fusion result output. The following example uses a first power prediction model employing Support Vector Machine (SVM), a second power prediction model employing Gated Recurrent Unit (GRU), and an ant colony optimization algorithm (ACO) to determine the fusion weights to illustrate the prediction effect of the above photovoltaic power prediction method.

[0082] For example, two sets of historical operating data from a photovoltaic power station in a city in southwest my country were selected for testing. The data included photovoltaic power generation, humidity, irradiance, temperature, and wind speed. After the aforementioned data preprocessing, the data was divided into training data, validation data, and test data in proportions of 70%, 15%, and 15%, respectively. The training data was used for model training, the validation data was used for adjusting model parameters and determining fusion weights, and the test data was used to evaluate the prediction effects of different prediction methods.

[0083] In the experiments, in addition to the schemes adopted in this application, Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), Gaussian Kernel Support Vector Machine (SVM), and Linear Kernel Support Vector Machine (SVM) were also used as comparative models. Prediction performance was evaluated using the correlation coefficient R, normalized root mean square error (nRMSE), mean absolute error (MAE), and training time. The correlation coefficient R reflects the correlation between predicted and actual power generation, while the normalized root mean square error (nRMSE) and mean absolute error (MAE) reflect the deviation between predicted and actual power generation. See Formula 20 below for details. Formula 20 in, and They represent j respectively i and y i The predicted value, and They represent j respectively i and y i The mean of the sample, where n represents the sample size. Figure 6 This paper illustrates a schematic diagram showing the comparison results of normalized root mean square error of different prediction models corresponding to the first dataset in some embodiments of this application under different prediction durations. Figure 6In the histogram illustrating the five types of normalized root mean square error (nRMSE) results, Long Short-Term Memory (LSTM) networks are represented by blank patterns, gated recurrent units by left-sloping patterns, Gaussian kernel vector machines by right-sloping patterns, linear kernel vector machines by dot patterns, and the technical solution of this application by cross-line patterns. Figure 6 The experiment shown compares prediction results for different prediction durations: 5 minutes, 15 minutes, 30 minutes, 1 hour, 12 hours, and 24 hours. Figure 6 It can be seen that the fusion prediction results obtained by adopting the technical solution of this application have low normalized root mean square error (nRMSE) under different prediction durations, indicating that the fusion prediction method can maintain good prediction performance under different prediction time scales.

[0084] Figure 7 This paper illustrates a schematic diagram showing the comparison results of normalized root mean square error of different prediction models corresponding to the second dataset in some embodiments of this application under different prediction durations. Figure 7 The bar chart pattern in the text is the same as the one used in the text. Figure 6 In terms of the data structure, the second dataset has fewer samples than the first dataset, and the correlation between photovoltaic power generation and related variables is relatively low, with higher data volatility. Figure 7 The experiment shown compares prediction results for different prediction durations: 5 minutes, 15 minutes, 30 minutes, 1 hour, and 6 hours. Figure 7 It can be seen that even with relatively high data volatility, the fusion prediction model of this application still exhibits a low normalized root mean square error (nRMSE), indicating that parallel prediction and fusion weight optimization can improve the stability of photovoltaic power generation prediction under different data conditions.

[0085] Figure 8 The diagram illustrates a comparison of predicted power generation and actual power generation over time in some embodiments of this application. Figure 8 In this application, the predicted power generation corresponding to SVM-GRU-ACO is represented by a solid line, the predicted power generation corresponding to gated recurrent units is represented by a short dashed line, the predicted power generation corresponding to vector machines is represented by a dotted line, the predicted power generation corresponding to long short-term memory networks is represented by a dashed-dot line, and the actual power generation is represented by a long dashed line. Figure 8 It can be seen that, within the test time range, the fusion prediction results change accordingly with the increase, decrease, and local fluctuations of the actual power generation, and the fusion prediction curve and the actual power generation curve have a high degree of agreement. This indicates that the fusion prediction results obtained in this application can follow the time variation trend of the actual photovoltaic power generation well.

[0086] Figure 9The diagram illustrates the correlation distribution between predicted power generation and actual power generation corresponding to multiple sets of test results in some embodiments of this application. Figure 9 Each scatter point in the graph corresponds to a test sample. The horizontal axis represents the normalized actual power generation of that test sample, and the vertical axis represents the normalized predicted power generation of that test sample. Multiple sets of scatter points correspond to multiple sets of test results (e.g., test results a, b, c, and d in the figure). The diagonal reference line represents the ideal state where the predicted power generation is equal to the actual power generation. The closer the scatter point is to the diagonal reference line, the higher the consistency between the predicted and actual power generation.

[0087] Depend on Figure 9 It can be seen that the scatter points under different test scenarios are generally distributed along the diagonal reference line, indicating a good correlation between predicted and actual power generation. Combined with... Figures 6 to 8 The experimental results show that the photovoltaic power generation prediction method of this application can obtain prediction results that are close to the actual power generation under different prediction durations and different data conditions, thus improving the accuracy and stability of photovoltaic power generation prediction.

[0088] Figure 10 This illustration shows a schematic diagram of a photovoltaic power generation prediction device provided in some embodiments of this application. The photovoltaic power generation prediction device 1000 includes: The first acquisition unit 1010 is used to acquire the data to be predicted corresponding to the target prediction time. The data to be predicted includes meteorological data corresponding to the target prediction time and historical power generation data before the target prediction time. The power prediction model unit 1020 is used to input the data to be predicted into the first power prediction model and the second power prediction model respectively to obtain the first power prediction value and the second power prediction value for the target prediction time. The first power prediction model and the second power prediction model are respectively trained and determined based on multiple historical training samples. Each historical training sample corresponds to a historical target time, including: historical meteorological data corresponding to the historical target time, actual power generation, and historical power generation data within a preset window before the historical target time. The first power prediction model is a nonlinear regression model trained using input features constructed from historical training samples, and the second power prediction model is a time series prediction model trained using time series input data constructed from historical training samples. The second acquisition unit 1030 is used to acquire a predetermined target fusion weight reassembly. The target fusion weight reassembly includes a first fusion weight corresponding to the first power prediction value and a second fusion weight corresponding to the second power prediction value. The target fusion weight reassembly is determined based on minimizing the fusion prediction error corresponding to the historical verification sample. The prediction unit 1040 is used to perform weighted fusion of the first power prediction value and the second power prediction value according to the first fusion weight and the second fusion weight to determine the photovoltaic power generation prediction value at the target prediction time.

[0089] Based on the same technical concept, this application also provides a computer-readable storage medium storing instructions thereon, which, when read by a processor, implement the photovoltaic power generation prediction method provided in the above embodiments.

[0090] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not described in detail or in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Furthermore, the above embodiments can be freely combined as needed.

Claims

1. A method for predicting photovoltaic power generation, characterized in that, include: Obtain the data to be predicted corresponding to the target prediction time, the data to be predicted including meteorological data corresponding to the target prediction time and historical power generation data within a preset time window before the target prediction time; The data to be predicted is input into the first power prediction model and the second power prediction model respectively to obtain the first power prediction value and the second power prediction value for the target prediction time. The first power prediction model and the second power prediction model are respectively trained and determined based on multiple historical training samples. Each historical training sample corresponds to a historical target time, including: historical meteorological data, actual power generation, and historical power generation data within a preset time window before the historical target time. The first power prediction model is a nonlinear regression model trained using input features constructed from the historical training samples, and the second power prediction model is a time-series prediction model trained using time-series input data constructed from the historical training samples. A predetermined target fusion weight reassembly is obtained, the target fusion weight reassembly includes a first fusion weight corresponding to the first power prediction value and a second fusion weight corresponding to the second power prediction value, and the target fusion weight reassembly is determined based on minimizing the fusion prediction error corresponding to the historical verification samples; Based on the first fusion weight and the second fusion weight, the first power prediction value and the second power prediction value are weighted and fused to determine the photovoltaic power prediction value at the target prediction time.

2. The photovoltaic power generation prediction method according to claim 1, characterized in that, Also includes: Obtain the original historical dataset, which includes historical power generation data and historical meteorological data arranged according to the sampling time. The first historical dataset corresponding to the effective lighting period is selected from the original historical dataset, and the abnormal and missing data in the first historical dataset are corrected to obtain the second historical dataset. The second historical dataset is divided into training data and validation data. Multiple historical training samples are constructed based on the training data, and multiple historical validation samples are constructed based on the validation data.

3. The photovoltaic power generation prediction method according to claim 2, characterized in that, Correcting outlier data in the first historical dataset includes: The data sequence to be processed is determined from the first historical dataset. The data sequence to be processed is formed by arranging the values ​​of the same monitoring parameter at multiple sampling times according to the sampling time. The monitoring parameters include multiple of the following: power generation, irradiance, temperature, humidity and wind speed. Determine the first quartile, the third quartile, and the interquartile range of the data sequence to be processed; The difference between the first quartile and the interquartile range of the preset multiple is determined as the lower limit of the normal value range, and the sum of the third quartile and the interquartile range of the preset multiple is determined as the upper limit of the normal value range. Values ​​in the data sequence to be processed that are below the lower limit or above the upper limit are identified as abnormal data. The abnormal data is corrected by interpolation based on the adjacent normal values ​​before and after the abnormal data.

4. The photovoltaic power generation prediction method according to claim 1, characterized in that, The first power prediction model is a support vector regression model, and the second power prediction model is a gated recurrent unit model; The data to be predicted is input into the first power prediction model and the second power prediction model, respectively, including: The first power prediction model and the second power prediction model are run in parallel so that the first power prediction model and the second power prediction model can independently predict the power at the target prediction time.

5. The photovoltaic power generation prediction method according to claim 4, characterized in that, The training of the first power prediction model includes: The historical meteorological data and historical power generation data of multiple past moments in each of the historical training samples are determined as input features, and the actual power generation corresponding to a certain future moment after the multiple past moments is determined as the training target. Based on the selected kernel function, the input features are implicitly mapped to a high-dimensional feature space, and a nonlinear regression relationship between the input features and the training target is established in the mapped feature space. Based on a preset error tolerance range, the prediction deviation of the training power prediction value of the first power prediction model relative to the training target exceeds the preset error tolerance range; Based on the prediction bias and the model complexity of the first power prediction model, the model parameters of the first power prediction model are determined through training.

6. The photovoltaic power generation prediction method according to claim 4, characterized in that, The training of the second power prediction model includes: For each of the historical training samples, obtain multiple historical power generation values ​​that were within a preset time window before the historical target time corresponding to the historical training sample, and arrange the multiple historical power generation values ​​according to the sampling time; The multiple historical power generation caps are merged with the historical meteorological data corresponding to the historical target time, so that each historical target time is composed of a multi-dimensional feature vector composed of the corresponding power generation caps and meteorological data. The multiple multi-dimensional feature vectors are sorted by time to obtain time-series input data. The time-series input data is input into the second power prediction model. Based on the reset gate, the information involved in the generation of candidate hidden states in the previous hidden state is controlled. Based on the update gate, the previous hidden state and the candidate hidden state are adaptively fused to obtain the current hidden state. The training power prediction value is determined based on the current hidden state; the model parameters of the second power prediction model are trained and determined based on the difference between the training power prediction value and the actual power generation in the corresponding historical training samples.

7. The photovoltaic power generation prediction method according to any one of claims 1 to 6, characterized in that, The target fusion weight regrouping is determined using an ant colony optimization algorithm based on the fusion prediction error corresponding to historical validation samples. The determination of the target fusion weight group includes: Multiple candidate fusion weight recombinations are generated in the fusion weight parameter space, and each candidate fusion weight recombination includes a candidate first fusion weight and a candidate second fusion weight. Determine the fusion prediction error of each of the candidate fusion weight reorganizations on the plurality of the historical verification samples; Based on the fusion prediction error corresponding to each candidate fusion weight recombination, update the pheromone intensity corresponding to each candidate fusion weight recombination. Based on the updated pheromone intensities, the next iteration search is performed in the fusion weight parameter space to obtain multiple candidate fusion weight recombinations corresponding to the next iteration. When the preset iteration termination condition is met, the candidate fusion weight recombination with the smallest fusion prediction error in each iteration is determined as the target fusion weight recombination; Wherein, both the first candidate fusion weight and the second candidate fusion weight are non-negative numbers, and the sum of the first candidate fusion weight and the second candidate fusion weight is 1.

8. The photovoltaic power generation prediction method according to claim 7, characterized in that, Determine the fusion prediction error of each candidate fusion weight recombination on multiple historical verification samples, and update the pheromone intensity corresponding to each candidate fusion weight recombination based on the fusion prediction error corresponding to each candidate fusion weight recombination, including: Obtain the verification input data and actual power generation from each of the historical verification samples; Each of the verification input data is input into the first power prediction model and the second power prediction model respectively to obtain the first verification prediction value and the second verification prediction value corresponding to each of the historical verification samples; For each candidate fusion weight reorganization, the first verification prediction value and the second verification prediction value corresponding to each historical verification sample are weighted and fused according to the first candidate fusion weight and the second candidate fusion weight to obtain the corresponding candidate fusion prediction value. The fusion prediction error of the corresponding candidate fusion weight group is determined based on the mean square error between each candidate fusion prediction value and the corresponding actual power generation. The fusion prediction error is determined as the search path length corresponding to the corresponding candidate fusion weight recombination, and the pheromone increment corresponding to the corresponding candidate fusion weight recombination is determined according to the ratio of the preset adjustment parameter to the search path length. The updated pheromone intensity is determined based on the current pheromone intensity, the preset pheromone evaporation coefficient, and the pheromone increment.

9. A photovoltaic power generation prediction device, characterized in that, include: The first acquisition unit is used to acquire the data to be predicted corresponding to the target prediction time. The data to be predicted includes meteorological data corresponding to the target prediction time and historical power generation data before the target prediction time. A power prediction model unit is used to input the data to be predicted into a first power prediction model and a second power prediction model respectively to obtain a first power prediction value and a second power prediction value for the target prediction time. The first power prediction model and the second power prediction model are respectively trained and determined based on multiple historical training samples. Each historical training sample corresponds to a historical target time, including: historical meteorological data, actual power generation, and historical power generation data within a preset time window before the historical target time. The first power prediction model is a nonlinear regression model trained using input features constructed from the historical training samples, and the second power prediction model is a time-series prediction model trained using time-series input data constructed from the historical training samples. The second acquisition unit is used to acquire a predetermined target fusion weight recombination, the target fusion weight recombination including a first fusion weight corresponding to the first power prediction value and a second fusion weight corresponding to the second power prediction value, the target fusion weight recombination is determined by minimizing the fusion prediction error corresponding to the historical verification sample through the ant colony optimization algorithm; The prediction unit is used to perform weighted fusion of the first power prediction value and the second power prediction value according to the first fusion weight and the second fusion weight, and determine the photovoltaic power generation prediction value at the target prediction time.

10. A computer-readable storage medium, characterized in that, It stores instructions that, when read by a processor, implement the photovoltaic power generation prediction method as described in any one of claims 1 to 8.