Irradiance rolling prediction method based on Pyraformer
By combining the Pyraformer model with dynamic calculation of feature weights from multiple data sources and segmented rolling prediction, the problems of limited data update cycles and high computational resource consumption in existing technologies are solved, enabling high-precision irradiance prediction for complex weather conditions and improving prediction accuracy and computational efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-03
AI Technical Summary
Existing deep learning-based irradiance prediction technologies suffer from problems such as limited data update cycles, inability to capture minute-level cloud movement, high computational resource consumption, and lack of short-cycle dynamic feedback mechanisms when fusing multi-source data, resulting in insufficient prediction accuracy and real-time performance under complex weather conditions.
A rolling irradiance prediction method based on Pyraformer is adopted. Through dynamic calculation of feature weights of multi-source data, pyramid attention module and segmented rolling prediction, combined with historical measured data and future weather forecast data, the model parameters are dynamically adjusted to achieve accurate adaptation to complex meteorological environments.
It significantly reduced the RMSE error in rainy scenarios by 70.3% and the RMSE error in 24-hour forecasts by 62.75%, improving computational efficiency and enabling rapid response and high-precision forecasting of weather changes.
Smart Images

Figure CN121786604A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of photovoltaic power generation, specifically involving irradiance prediction technology based on deep learning, especially the Pyraformer model. Background Technology
[0002] Currently, deep learning-based irradiance prediction technology has become a core research direction in the photovoltaic power generation field, but there are still significant technical limitations in existing patented technologies.
[0003] Patent CN117077515A provides a photovoltaic power generation prediction method and system based on LSTM, which improves prediction accuracy by utilizing the time-series modeling capabilities of LSTM. However, this technology relies solely on historical meteorological monitoring data and does not integrate future meteorological information such as numerical weather prediction (NWP), resulting in low prediction errors under sudden weather conditions. Furthermore, it employs an end-to-end 24-hour one-time prediction framework, lacking a short-cycle dynamic feedback mechanism, and cannot adapt to scenarios with rapidly changing cloud formations.
[0004] Patent CN114357885B proposes a method for predicting the proportion of photosynthetically active radiation (RAEP) scattering by fusing multi-source data. The advancement of this technology lies in the introduction of remote sensing data sources for the first time; however, significant legacy issues remain. Specifically, the data update cycle is limited by the satellite transmission frequency, with delays reaching up to one hour, making it difficult to capture minute-level cloud movement. Furthermore, the lack of a quantitative mapping relationship between weather types such as precipitation and cloud cover and irradiance results in insufficient robustness in predictions under complex weather conditions.
[0005] Patent CN112991090A developed a photovoltaic power prediction method based on the Transformer model, which captures long sequence dependencies through a self-attention mechanism and introduces air pressure field data as a novel feature input. However, the Transformer's self-attention mechanism has a time complexity of O(L²d) and a memory usage of O(L²) for sequence length L and hidden dimension d. As L increases, it quickly becomes a bottleneck, resulting in extremely high hardware resource consumption. Furthermore, it does not optimize computational efficiency for actual photovoltaic power plant deployment scenarios, leading to poor real-time performance on edge devices.
[0006] Existing TimeXer models (Wang Y, Wu H, Dong J, et al. Timexer: Empowering transformers for time series forecasting with exogenous variables[J]. Advances in Neural Information Processing Systems, 2025, 37: 469-498.) and NeurIPS2024 and Pyraformer models (Liu S, Yu H, Liao C, et al. Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting (C). virtual event, April 25 - 29, 2022.) also cannot adequately meet industry needs. Summary of the Invention
[0007] To address the problems existing in the prior art, this invention provides a Pyraformer-based rolling irradiance prediction method. According to one aspect of the invention, a Pyraformer-based rolling irradiance prediction method is provided, the steps of which are as follows:
[0008] S101. Data preprocessing;
[0009] S102. The obtained multi-source forecast data values are fused together, and the feature weights are dynamically calculated.
[0010] S103, Pyraformer prediction model, coarse-scale building block (CSCM), pyramid attention module (PAM);
[0011] S104, Segmented rolling prediction.
[0012] Furthermore, according to one aspect of the present invention, a rolling irradiance prediction method based on Pyraformer is provided. The above data preprocessing yields quantitative data of precipitation and cloud conditions and normalized data of irradiance, a 0 / 1 coding formula for precipitation (such as the definition of Rain_code), and a three-level coding standard for cloud conditions (sunny / partly cloudy / overcast = 0 / 1 / 2). By transforming qualitative meteorological descriptions into quantitative features, the nonlinear mapping problem between weather type and irradiance is solved.
[0013] Furthermore, according to one aspect of the present invention, a Pyraformer-based rolling irradiance prediction method is provided. This method includes feature weight allocation, assigning dynamic weights to the forecast data: when dealing with a multi-dimensional feature set, a weight W that dynamically changes with time step t is designed. The weights are applied to each feature based on different time steps t. Dynamic weight allocation enables the model to adapt more accurately to complex and changing weather environments.
[0014] Furthermore, according to one aspect of the present invention, a Pyraformer-based irradiance rolling prediction method is provided, the method comprising constructing a fused feature vector by weighted summation.
[0015] The above-mentioned fused feature vector construction: This invention constructs the fused feature vector through a weighted summation method.
[0016]
[0017] in:
[0018] The feature vector obtained after fusion at time step t;
[0019] The weights of the historical data features at time t;
[0020] Let t be the feature vector of historical data at time t;
[0021] The feature weights of the weather forecast at time t;
[0022] (t) represents the feature vector of the weather forecast data at time t;
[0023] The weight of the previous cycle's forecast result is a fixed constant of 0.1, which is not dynamically adjusted by factors such as time step or weather conditions.
[0024] (t) is the feature vector of the prediction result at time t.
[0025] This fusion approach fully integrates the advantages of multi-source data, enabling the model to acquire more comprehensive and richer information, thus providing strong support for improving prediction accuracy. Compared to models that do not fuse weather types, this invention reduces RMSE error by 70.3% in rainy scenarios.
[0026] Furthermore, according to one aspect of the present invention, a Pyraformer-based rolling irradiance prediction method is provided, wherein the method employs a segmented rolling prediction architecture:
[0027] Step 1: Combine the actual sensor data fields (temperature, humidity, atmospheric pressure, wind speed, irradiance, etc.) from the historical 24 hours with the indirect observation fields (rainfall probability, cloud thickness, etc.) from the weather forecast for the same period to obtain the time range T0-T 23 data;
[0028] Step 2: Input the data from Step 1 into the model to infer the radiation value for the next 3 hours;
[0029] Step 3: Concatenate the predicted irradiance value with all fields in the weather forecast except for the irradiance value to obtain the time range T0-T 26 The data also slides the 24-hour time window to T3-T. 26 Based on the time frame, a new inference input dataset is obtained;
[0030] Step 4: Input the data from Step 3 into the model for inference, and repeat Step 2-Step 4 a total of 7 times to obtain the irradiance prediction data for the next 24 hours.
[0031] The 3-hour granularity-based division formula balances prediction accuracy and computational efficiency, and reduces RMSE error by 62.75% compared to existing technologies that complete 24-hour predictions in one step.
[0032] The innovation of the rolling update logic lies in:
[0033] Retain the most recent 3 hours of measured data instead of all historical data to reduce interference from redundant information.
[0034] Real-time inclusion of the latest forecast data (such as when the forecast is about to be updated) (Reload)
[0035] Through this rolling update mechanism, the model can quickly respond to weather changes and achieve dynamic optimization of model parameters. The error of each sub-cycle... The corresponding correction formula is: ,in For learning rate, This represents the error gradient for the k-th sub-cycle, which enables the model to maintain high-precision prediction performance under constantly changing weather conditions.
[0036] Furthermore, according to one aspect of the present invention, a Pyraformer-based irradiance rolling prediction method is provided, wherein the above-mentioned step S101 involves data preprocessing:
[0037] Precipitation characteristics are quantified using a 0 / 1 binary code to represent precipitation status, as shown in the following formula:
[0038]
[0039] Cloud condition feature encoding:
[0040] Cloud cover is classified into three levels according to meteorological standards, using integer codes:
[0041]
[0042] Irradiance data transformation:
[0043] The original irradiance values (unit: W / m²) were normalized to eliminate the influence of dimensions.
[0044]
[0045] Furthermore, according to one aspect of the present invention, a Pyraformer-based irradiance rolling prediction method is provided, wherein the above-mentioned step S102 multi-source feature fusion module:
[0046] Dynamic allocation of feature weights:
[0047] Multidimensional feature set: denoted as Where n is the total number of meteorological features participating in the fusion. Represents the i-th complete meteorological feature type, such as For precipitation characteristics, This refers to cloud cover characteristics.
[0048] Feature weight adjustment factor: denoted as , is the i-th feature The normalized dynamic parameters (taking values [0,1]) are used to adjust Weight allocation, such as of ,
[0049] of (Cloud coverage), detailed formula is as follows:
[0050]
[0051] The definitions and numerical determination methods for each parameter in the above weight allocation formula are as follows:
[0052] In the formula, W hist,i (t) represents the i-th feature. Historical data weights;
[0053] W forecast,i (t) represents the i-th feature. The weighting of forecast data;
[0054] Wprev,i (t) represents the i-th feature. The weight of the previous period's prediction result is a fixed value that does not change with time step t;
[0055] For the i-th feature The historical weighting adjustment factor is obtained based on the correlation statistics between historical data and irradiance values;
[0056] For the i-th feature The forecast weight adjustment factor is obtained based on the statistical analysis of the deviation rate between the forecast data and the irradiance.
[0057] For the i-th feature The weighting coefficients of the previous period's prediction results are determined through normalization constraint derivation.
[0058] For the i-th feature The sensitivity weight adjustment factor, based on The sensitivity coefficient was obtained statistically.
[0059] The above formula assigns dynamic weights to features from different sources based on weather conditions. Taking precipitation feature fusion as an example, Rain_code(t) represents the probability of precipitation in the weather forecast at time step t. When the probability of precipitation is high (Rain_code(t)=1), the weight of future forecast data will be increased accordingly to enhance the capture of the impact of precipitation.
[0060] Furthermore, according to one aspect of the present invention, a Pyraformer-based irradiance rolling prediction method is provided, wherein in step S103 above, the Pyraformer prediction model has the following structure: Figure 2 As shown:
[0061] Coarse-scale Construction Module:
[0062] Hereinafter referred to as the CSCM module, it constructs multi-scale feature representations through multi-layer convolutional operations. The specific process is as follows:
[0063]
[0064]
[0065] Where S1, S2, and S3 are feature sequences of 1 / 2, 1 / 4, and 1 / 8 of the original length, respectively; Conv is the convolution operation using the ReLU activation function; kernel_size is the convolution kernel size, which affects the range of feature vector extraction; and stride is the stride, which affects the scaling ratio of the output feature size.
[0066] Embedding refers to the input feature representation obtained after processing by the embedding layer, as shown in the following formula:
[0067]
[0068] Among them, Pos_Enc is the encoding for adding time-series location information to historical data;
[0069] Cov_Enc is the encoding for converting covariates (cloud codes, rain codes, etc.) into feature representations;
[0070] Hist_Data is the historical time-series data used for prediction;
[0071] Cloud_code is a covariate for cloud coverage.
[0072] Rain_code is a covariate for the probability of rainfall.
[0073] The purpose of CSCM is to initialize feature nodes at a coarser scale in the pyramid graph, which serve as input to the Pyramid Attention Module (PAM) for information extraction between nodes.
[0074] Improved Pyramidal Attention Module:
[0075] Hereinafter referred to as the PAM module, it combines the hierarchical nature of meteorological time series characteristics to capture multi-scale features and construct the mapping relationship between nodes of the CSCM model. The simplified PAM formula is as follows:
[0076]
[0077] in This represents the i-th level feature sequence output by the CSCM module, whose length is equal to the length of the original input. , which serves as the input feature of the PAM module; num_heads=4 indicates that the number of heads used in parallel computation in the attention mechanism is 4, which captures features from different subspaces through a multi-head mechanism, thereby improving the feature representation capability.
[0078] By associating tree nodes, meteorological multi-scale features are embedded into the tree structure. The attention calculation of the tree structure is improved and optimized. Based on the definition of tree nodes, the attention formula is improved and node hierarchy weight coefficients are introduced.
[0079] Raw attention calculation:
[0080]
[0081] in , , Features Query matrix, features The key matrix and value matrix, The dimension of the key matrix, The three-level feature sequences of 1 / 2, 1 / 4, and 1 / 8 of the original length output by the CSCM module are indexed respectively for cross-scale attention computation.
[0082] By employing cross-scale attention computation, temporal information from different scales is fused to generate a global feature representation. ;
[0083] Corrected attention calculation:
[0084]
[0085] in For the scale to which node j belongs, For node type; via The coefficients of the interaction weights between the i-th and j-th level features are dynamically adjusted, and the contribution of different tree nodes to attention is dynamically adjusted.
[0086] Fully connected layer prediction
[0087] The PAM module performs attention calculations on multi-scale features to enable information interaction between features at different scales. It maps the global feature representation to irradiance prediction values through a fully connected layer, as shown in the following formula:
[0088]
[0089] Where FC is a fully connected layer, and the parameter matrix is... (d represents global features) (dimension of the radiance), the output is the predicted irradiance value for the k-th sub-period, 3 hours. .
[0090] Furthermore, according to one aspect of the present invention, a Pyraformer-based rolling irradiance prediction method is provided, wherein the above-mentioned step S104 involves segmented rolling prediction, dividing the 24-hour prediction into 8 × 3-hour rolling predictions. The segmented rolling prediction execution flow is as follows:
[0091] The 24-hour forecast period is divided into eight 3-hour sub-periods. The time range of the k-th sub-period is defined as follows:
[0092]
[0093] in To predict the start time (e.g., 00:00), k = 1, 2, ..., 8.
[0094] Step 1: Predict the first sub-cycle (T0-T2)
[0095] Input data embedding:
[0096]
[0097] Step 2: Generate multi-scale features via the CSCM module:
[0098]
[0099]
[0100]
[0101] Step 3: Pyramid Attention Calculation:
[0102]
[0103] Step 4: Output predicted values:
[0104]
[0105] Where FC is a fully connected layer, and the parameter matrix is... (d is the feature dimension).
[0106] Step 5: Repeat Steps 1 to 4: Iteratively predict the k-th sub-cycle (repeated 7 times).
[0107] Integrating the results of Step 5 from the previous cycle's forecast with the forecast data for the next three hours:
[0108]
[0109] Furthermore, according to one aspect of the present invention, a Pyraformer-based method for predicting rolling irradiance is provided, and the effectiveness of the above method is verified as follows:
[0110] Mean square error formula:
[0111] Root mean square error formula:
[0112] Mean Absolute Error Formula:
[0113] In the formula, This represents the predicted irradiance at time t for a future time t+k;
[0114] : Represents the true value of irradiance at time t + k.
[0115] Enhanced dynamic adaptability: Segmented forecasting can respond to weather changes in real time, and the error correction formula for each sub-cycle is:
[0116]
[0117] in For learning rate, The error gradient of the Kth sub-cycle is used to achieve dynamic optimization of model parameters.
[0118] The technical solution of this invention is generally divided into four core parts: a data preprocessing module, a multi-source feature fusion module, a Pyraformer prediction model, and a rolling prediction module. The logical relationship between each module is shown in Figure 1. Specifically, the data preprocessing module is responsible for converting raw meteorological data into feature vectors that the model can recognize; the multi-source feature fusion module realizes the weight fusion and adjustment of historical measured data and multi-source forecast data; the Pyraformer model captures multi-scale temporal dependencies through the coarse-scale construction module (CSCM) and the pyramid attention module (PAM); and the rolling correction module dynamically adjusts the model parameters based on real-time error feedback.
[0119] The irradiance rolling prediction method based on Pyraformer provided by this invention has the following characteristics.
[0120] (1) Dynamic fusion of multi-source data:
[0121] Existing models, such as traditional Transformer models and LSTM models, rely solely on historical data and cannot incorporate future weather forecast data, resulting in large prediction biases when weather changes suddenly occur. For example, in the formula of the traditional Pyraformer model mentioned above, the input only contains historical data and lacks future meteorological features.
[0122] By incorporating 24-hour weather forecast data (such as precipitation, cloud cover, and wind speed), and by quantifying key meteorological factors such as precipitation (0 / 1 coding) and cloud condition classification (sunny / partly cloudy / overcast = 0 / 1 / 2), the model's ability to model the nonlinear relationship between weather and irradiance is enhanced, thereby improving the accuracy of short-term dynamic response.
[0123] By combining historical irradiance characteristics, a multi-dimensional input is constructed, which significantly improves the forecast robustness under complex weather conditions.
[0124] (2) Segmented rolling prediction mechanism:
[0125] Traditional models often use a one-time prediction of the next 24 hours, and their error accumulation formula is:
[0126]
[0127]
[0128] The 24-hour forecast period is divided into multiple 3-hour sub-periods. Each sub-period integrates the latest weather data with the forecast results of the previous period in real time, avoiding error accumulation and dynamically correcting deviations caused by sudden weather events, thereby improving forecast accuracy. The error accumulation formula of this invention is as follows:
[0129]
[0130]
[0131] In the formula, This represents the predicted irradiance at time t for a future time t+k;
[0132] : Represents the true value of irradiance at time t + k.
[0133] (3) Improved computational efficiency: The Pyraformer of this invention introduces pyramid sparse attention, which reduces the complexity to O(Ld), significantly reducing computation and storage overhead, while retaining the ability to model global dependencies. Attached Figure Description
[0134] Figure 1 This is a flowchart of the method of the present invention;
[0135] Figure 2 This is a structural diagram of the Pyraformer prediction model of the present invention;
[0136] Figure 3 This is a comparison of the 24-hour irradiance prediction curves of a photovoltaic power station in Ningbo on a sunny day, as shown in one embodiment of the present invention.
[0137] Figure 4 This is a comparison of the 24-hour irradiance prediction curves for a photovoltaic power station in Ningbo on cloudy and rainy days, as shown in one embodiment of the present invention. Detailed Implementation
[0138] The following embodiments are for further illustration of some preferred embodiments of the present invention, and are not all embodiments. Other embodiments based on the present invention made by those skilled in the art without inventive effort are all within the scope of protection of the present invention. The present invention will be further described below with reference to the accompanying drawings.
[0139] Example 1
[0140] Step S101: Data Preprocessing
[0141] Precipitation characteristics are quantified using a 0 / 1 binary code to represent precipitation status, as shown in the following formula:
[0142]
[0143] Cloud condition feature encoding:
[0144] Cloud cover is classified into three levels according to meteorological standards, using integer codes:
[0145]
[0146] Irradiance data transformation:
[0147] The original irradiance values (unit: W / m²) were normalized to eliminate the influence of dimensions.
[0148]
[0149] Step S102 Multi-source feature fusion module:
[0150] Dynamic allocation of feature weights:
[0151] Multidimensional feature set: denoted as Where n is the total number of meteorological features participating in the fusion. Represents the i-th complete meteorological feature type, such as For precipitation characteristics, This refers to cloud cover characteristics.
[0152] Feature weight adjustment factor: denoted as , is the i-th feature The normalized dynamic parameters (taking values [0,1]) are used to adjust Weight allocation, such as of , of (Cloud coverage), detailed formula is as follows:
[0153]
[0154] The definitions and numerical determination methods for each parameter in the above weight allocation formula are as follows:
[0155] In the formula, For the i-th feature Historical data weights;
[0156] For the i-th feature The weighting of forecast data;
[0157] For the i-th feature The weight of the previous period's prediction result is a fixed value that does not change with time step t;
[0158] For the i-th feature The historical weighting adjustment factor is obtained based on the correlation statistics between historical data and irradiance values;
[0159] For the i-th feature The forecast weight adjustment factor is obtained based on the statistical analysis of the deviation rate between the forecast data and the irradiance.
[0160] For the i-th feature The weighting coefficients of the previous period's prediction results are determined through normalization constraint derivation.
[0161] For the i-th feature The sensitivity weight adjustment factor, based on The sensitivity coefficient was obtained statistically.
[0162] The above formula assigns dynamic weights to features from different sources based on weather conditions. Taking precipitation feature fusion as an example, Rain_code(t) represents the probability of precipitation in the weather forecast at time step t. When the probability of precipitation is high ( When this happens, the weight of future forecast data will be increased accordingly to enhance the capture of the impact of precipitation;
[0163] The above-mentioned fused feature vector is constructed by weighted summation, as shown in the following formula:
[0164]
[0165] in:
[0166] The feature vector obtained after fusion at time step t;
[0167] The weights of the historical data features at time t;
[0168] Let t be the feature vector of historical data at time t;
[0169] The feature weights of the weather forecast at time t;
[0170] (t) represents the feature vector of the weather forecast data at time t;
[0171] The weight of the previous cycle's forecast result is a fixed constant of 0.1, which is not dynamically adjusted by factors such as time step or weather conditions.
[0172] (t) is the feature vector of the prediction result at time t.
[0173] Step S103, Pyraformer prediction model, structure as follows Figure 2 As shown:
[0174] Coarse-scale Construction Module
[0175] Hereinafter referred to as the CSCM module, it constructs multi-scale feature representations through multi-layer convolutional operations. The specific process is as follows:
[0176]
[0177]
[0178]
[0179] Where S1, S2, and S3 are feature sequences of 1 / 2, 1 / 4, and 1 / 8 of the original length, respectively; Conv is the convolution operation using the ReLU activation function; kernel_size is the convolution kernel size, which affects the range of feature vector extraction; and stride is the stride, which affects the scaling ratio of the output feature size.
[0180] Embedding refers to the input feature representation obtained after processing by the embedding layer, as shown in the following formula:
[0181]
[0182] Among them, Pos_Enc is the encoding for adding time-series location information to historical data;
[0183] Cov_Enc is the encoding for converting covariates (cloud codes, rain codes, etc.) into feature representations;
[0184] Hist_Data is the historical time-series data used for prediction;
[0185] Cloud_code is a covariate for cloud coverage.
[0186] Rain_code is a covariate representing the probability of rainfall.
[0187] The purpose of CSCM is to initialize feature nodes at a coarser scale in the pyramid graph, which serve as input to the Pyramid Attention Module (PAM) for information extraction between nodes.
[0188] Improved Pyramidal Attention Module
[0189] Hereinafter referred to as the PAM module, it combines the hierarchical nature of meteorological time series characteristics to capture multi-scale features and construct the mapping relationship between nodes of the CSCM model. The simplified PAM formula is as follows:
[0190]
[0191] in This represents the i-th level feature sequence output by the CSCM module, whose length is equal to the length of the original input. , which serves as the input feature of the PAM module; num_heads=4 indicates that the number of heads used in parallel computation in the attention mechanism is 4, which captures features from different subspaces through a multi-head mechanism, thereby improving the feature representation capability.
[0192] By associating tree nodes, meteorological multi-scale features are embedded into the tree structure. The attention calculation of the tree structure is improved and optimized. Based on the definition of tree nodes, the attention formula is improved and node hierarchy weight coefficients are introduced.
[0193] Raw attention calculation:
[0194]
[0195] in , , Features Query matrix, features The key matrix and value matrix, The dimension of the key matrix, The three-level feature sequences of 1 / 2, 1 / 4, and 1 / 8 of the original length output by the CSCM module are indexed respectively for cross-scale attention computation.
[0196] By employing cross-scale attention computation, temporal information from different scales is fused to generate a global feature representation. ;
[0197] Corrected attention calculation:
[0198]
[0199] in For the scale to which node j belongs, For node type; via The coefficients of the interaction weights between the i-th and j-th level features are dynamically adjusted, and the contribution of different tree nodes to attention is dynamically adjusted.
[0200] Fully connected layer prediction
[0201] The PAM module performs attention calculations on multi-scale features to enable information interaction between features at different scales. It maps the global feature representation to irradiance prediction values through a fully connected layer, as shown in the following formula:
[0202]
[0203] Where FC is a fully connected layer, and the parameter matrix is... (d represents global features) (dimension of the radiance), the output is the predicted irradiance value for the k-th sub-period, 3 hours. .
[0204] In the above-mentioned Pyraformer-based rolling irradiance prediction method, step S104 divides the 24-hour prediction into 8 × 3-hour rolling predictions, employing a segmented rolling prediction execution flow:
[0205] The 24-hour forecast period is divided into eight 3-hour sub-periods. The time range of the k-th sub-period is defined as follows:
[0206]
[0207] in To predict the start time (e.g., 00:00), k = 1, 2, ..., 8;
[0208] Step 1: Predict the first sub-cycle (T0-T2)
[0209] Input data embedding:
[0210]
[0211] Step 2: Generate multi-scale features via the CSCM module:
[0212]
[0213]
[0214]
[0215] Step 3: Pyramid Attention Calculation:
[0216]
[0217] Step 4: Output predicted values:
[0218]
[0219] Where FC is a fully connected layer, and the parameter matrix is... (d is the feature dimension);
[0220] Step 5: Repeated embedding, CSCM and PAM processing, output:
[0221]
[0222] Step 6: Repeat Steps 1 to 5: Iteratively predict the k-th sub-cycle (repeated 7 times).
[0223] Integrating the results of Step 5 from the previous cycle's forecast with the forecast data for the next three hours:
[0224]
[0225] Effect verification:
[0226] Improved prediction accuracy: Through multi-source data fusion and segmented recursion, error metrics are significantly optimized.
[0227] Mean square error: The performance has been reduced from 113 in the traditional Pyraformer to 42.1.
[0228] Mean absolute error: It decreased from 61.2 to 26.2.
[0229] Enhanced dynamic adaptability: Segmented forecasting can respond to weather changes in real time, and the error correction formula for each sub-cycle is:
[0230]
[0231] in For learning rate, The error gradient of the kth sub-cycle is used to achieve dynamic optimization of model parameters.
[0232] Example 2: Comparison of Framework and Object Design
[0233] To objectively verify the superiority of the technical solution of this invention, a comparison system was constructed using the principle of "same scenario, same data," and the root mean square error (RMSE) and mean absolute error (MAE) were selected as the comparison indicators. RMSE reflects the dispersion of the deviation between the predicted and actual values, is more sensitive to larger errors, and can effectively measure the stability of the model's prediction; MAE directly reflects the average magnitude of the error between the predicted and actual values, and can objectively reflect the accuracy of the model's prediction. The smaller the values of RMSE and MAE, the lower the deviation between the model's prediction results and the actual values, and the higher the model's prediction accuracy, as detailed below:
[0234] Data source: Measured data from a photovoltaic power station in Ningbo, China, from May to June 2025 (including 5-dimensional characteristics: irradiance, temperature, humidity, atmospheric pressure, and wind speed) + 6-hourly forecast data (including 7 indicators such as cloud cover, cloud condition classification, and precipitation probability).
[0235] [1] Comparison Model 1: TimeXer Model [ Wang Y, Wu H, Dong J, et al. Timexer: Empowering transformers for time series forecasting with exogenous variables[J]. Advances in Neural Information Processing Systems, 2025, 37: 469-498., NeurIPS 2024 ]
[0236] [2] Comparison Model 2: Pyraformer Model [ Liu S, Yu H, Liao C, et al. Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting (C). virtual event, April 25 - 29, 2022. ]
[0237] This patented method is an improved Pyraformer solution that integrates a "multi-source feature fusion module + rolling prediction module".
[0238] Table 1-1 Comparison of Indicators of Irradiance Prediction Models
[0239]
[0240] Example 3: Specific Comparison of Typical Weather Scenarios
[0241] To fully verify the effectiveness and scenario adaptability of the innovative point of "multi-source feature fusion (such as precipitation weight adjustment)" in this invention, the irradiance value collected by a photovoltaic power station in Ningbo was selected as the verification dataset, and a detailed comparative analysis of indicators was carried out for different weather scenarios.
[0242] This comparison focuses on the irradiance prediction data for the photovoltaic power station under sunny conditions in May, covering the next 24 hours. Here, the method of this invention is comprehensively compared with the TimeXer and Pyraformer models.
[0243] Table 2-1 clearly presents a comparison of the performance indicators of various models for the Ningbo photovoltaic power station under this sunny weather scenario. The data shows that the patented method exhibits significant advantages in irradiance prediction under sunny weather conditions. Compared to the TimeXer and Pyraformer models, the indicators are improved.
[0244] Table 2-1 Comparison of Indicators of Irradiance Prediction Models for a Sunny Day at a Photovoltaic Power Station in Ningbo
[0245]
[0246] For detailed prediction curves of each model for sunny day scenarios, please refer to [link / reference]. Figure 3 The predicted irradiance patterns all conform to the characteristics of a sunny day.
[0247] Table 2-2 compares the model indicators for predicting the irradiance of a photovoltaic power station in Ningbo under a cloudy and rainy weather scenario in May, for the next 24 hours. In irradiance prediction under cloudy and rainy weather scenarios, the patented method also demonstrates significant advantages. Compared to the TimeXer model, the RMSE of this patented method is reduced by 79%, and the MAE is reduced by 73.4%; compared to the Pyraformer model, the RMSE is reduced by 70.3%, and the MAE is reduced by 57.10%. Table 2-2 Comparison of Irradiance Prediction Model Indicators for a Photovoltaic Power Station in Ningbo under Cloudy and Rainy Weather
[0248]
[0249] For detailed prediction curves of each model for rainy day scenarios, please refer to [link / reference]. Figure 4 Both the Pyraformer model and the method in this patent show a decline in irradiance due to rain after 11:00. Furthermore, the method in this patent accurately predicts the irradiance fluctuation pattern caused by cloud cover at 12:00 and 13:00, which is a significant improvement over other methods.
[0250] The above embodiments are for further illustration of some preferred embodiments of the present invention and are not all embodiments. Other embodiments based on the present invention made by those skilled in the art without inventive effort are all within the scope of protection of the present invention.
Claims
1. A rolling irradiance prediction method based on Pyraformer, characterized in that, The steps of the method are as follows: S101. Data preprocessing; S102. The obtained multi-source forecast data values are fused together, and the feature weights are dynamically calculated. S103, Pyraformer prediction model, coarse-scale building block (CSCM), pyramid attention module (PAM); S104, Segmented rolling forecast: The 24-hour forecast is split into 8×3-hour rolling forecasts.
2. The irradiance rolling prediction method based on Pyraformer according to claim 1, characterized in that, The data preprocessing yields quantitative data on precipitation and cloud conditions, normalized data on irradiance, a 0 / 1 coding formula for precipitation, and a three-level coding standard for cloud conditions.
3. The irradiance rolling prediction method based on Pyraformer according to claim 2, characterized in that, The method includes feature weight allocation, assigning dynamic weights to the forecast data: when dealing with a multi-dimensional feature set, a weight W that dynamically changes with time step t is designed. The weights are dynamically assigned to each feature based on different time steps t, giving each feature a proportional importance.
4. The irradiance rolling prediction method based on Pyraformer according to claim 3, characterized in that, The method includes constructing a fused feature vector through weighted summation. The fused feature vector is constructed by weighted summation, as shown in the following formula: in: The feature vector obtained after fusion at time step t; The weights of the historical data features at time t; Let t be the feature vector of historical data at time t; The feature weights of the weather forecast at time t; (t) represents the feature vector of the weather forecast data at time t; The weight of the previous cycle's forecast result is a fixed constant of 0.1, which is not dynamically adjusted by factors such as time step or weather conditions. (t) is the feature vector of the prediction result at time t.
5. The irradiance rolling prediction method based on Pyraformer according to claim 4, characterized in that, The method employs a segmented rolling prediction architecture: Step 1: Combine the actual sensor data fields from the historical 24-hour period with the indirect observation fields from the weather forecast for the same period to obtain the time range T0-T 23 data; Step 2: Input the data from Step 1 into the model to infer the radiation value for the next 3 hours; Step 3: Concatenate the predicted irradiance value with all fields in the weather forecast except for the irradiance value to obtain the time range T0-T 26 The data also slides the 24-hour time window to T3-T. 26 Based on the time frame, a new inference input dataset is obtained; Step 4: Input the data from Step 3 into the model for inference to obtain the irradiance prediction data for the next 24 hours; Error per sub-cycle The corresponding correction formula is: ,in For learning rate, Let be the error gradient of the kth sub-cycle.
6. The irradiance rolling prediction method based on Pyraformer according to claim 1, characterized in that, The data preprocessing step S101 of the method is as follows: Precipitation characteristics are quantified using a 0 / 1 binary code to represent precipitation status, as shown in the following formula: Cloud condition feature encoding: Cloud cover is classified into three levels according to meteorological standards, using integer codes: Irradiance data transformation: The original irradiance values (unit: W / m²) were normalized to eliminate the influence of dimensions. 。 7. The irradiance rolling prediction method based on Pyraformer according to claim 1, characterized in that, The method step S102 employs a multi-source feature fusion module as follows: Multidimensional feature set: denoted as Where n is the total number of meteorological features participating in the fusion. This represents the i-th complete meteorological feature type; Feature weight adjustment factor: denoted as , is the i-th feature The normalized dynamic parameters (taking values [0,1]) are used to adjust Weight allocation, such as of , of The definitions and numerical determination methods for each parameter in the weight allocation formula are as follows: In the formula, For the i-th feature Historical data weights; For the i-th feature The weighting of forecast data; For the i-th feature The weight of the previous period's prediction result is a fixed value that does not change with time step t; For the i-th feature The historical weighting adjustment factor is obtained based on the correlation statistics between historical data and irradiance values; For the i-th feature The forecast weight adjustment factor is obtained based on the statistical analysis of the deviation rate between the forecast data and the irradiance. For the i-th feature The weighting coefficients of the previous period's prediction results are determined through normalization constraint derivation. For the i-th feature The sensitivity weight adjustment factor, based on The sensitivity coefficient was obtained statistically.
8. The irradiance rolling prediction method based on Pyraformer according to claim 1, characterized in that, The method step S103 Pyraformer prediction model is as follows: The coarse-scale construction module, hereinafter referred to as the CSCM module, constructs multi-scale feature representations through multi-layer convolutional operations. The specific process is as follows: in , , The feature sequences are 1 / 2, 1 / 4, and 1 / 8 of the original length, respectively. Conv is the convolution operation using the ReLU activation function; kernel_size is the kernel size, which affects the range of feature vector extraction; stride is the stride, which affects the scaling ratio of the output feature size. Embedding refers to the input feature representation obtained after processing by the embedding layer, as shown in the following formula: Among them, Pos_Enc is the encoding for adding time-series location information to historical data; Cov_Enc is the encoding for converting covariates into feature representations; Hist_Data is the historical time-series data used for prediction; Cloud_code is a covariate for cloud coverage. Rain_code is a covariate representing the probability of rainfall; The improved Pyramid Attention module, hereinafter referred to as the PAM module, combines the hierarchical nature of meteorological time series features to capture multi-scale features and construct the mapping relationship between nodes of the CSCM model; the simplified PAM formula is as follows: in This represents the i-th level feature sequence output by the CSCM module, whose length is equal to the length of the original input. , as input features of the PAM module; This refers to the number of heads used in parallel computation within the attention mechanism being 4. By associating tree nodes, meteorological multi-scale features are embedded into the tree structure. The attention calculation of the tree structure is improved and optimized. Based on the definition of tree nodes, the attention formula is improved and node hierarchy weight coefficients are introduced. Raw attention calculation: in , , Features Query matrix, features The key matrix and value matrix, The dimension of the key matrix is... The three-level feature sequences of 1 / 2, 1 / 4, and 1 / 8 of the original length output by the CSCM module are indexed respectively for cross-scale attention computation; By employing cross-scale attention computation, temporal information from different scales is fused to generate a global feature representation. ; Corrected attention calculation: in For the scale to which node j belongs, For node type; via The coefficients of the interaction weights between the i-th and j-th level features are dynamically adjusted, and the contribution of different tree nodes to attention is dynamically adjusted. Fully connected layer prediction The PAM module performs attention calculations on multi-scale features to enable information interaction between features at different scales. It maps the global feature representation to irradiance prediction values through a fully connected layer, as shown in the following formula: Where FC is a fully connected layer, and the parameter matrix is... (d represents global features) (dimension of the radiance), the output is the predicted irradiance value for the k-th sub-period, 3 hours. .
9. The irradiance rolling prediction method based on Pyraformer according to claim 1, characterized in that, The method step S104 divides the 24-hour prediction into 8×3-hour rolling predictions, using a segmented rolling prediction execution flow: The 24-hour forecast period is divided into eight 3-hour sub-periods. The time range of the k-th sub-period is defined as follows: in To predict the start time (e.g., 00:00), k = 1, 2, ..., 8; Step 1: Predict the first sub-cycle (T0-T2) Input data embedding: Step 2: Generate multi-scale features via the CSCM module: Step 3: Pyramid Attention Calculation: Step 4: Output predicted values: Where FC is a fully connected layer, and the parameter matrix is... (d is the feature dimension); Step 5: Repeated embedding, CSCM and PAM processing, output: Step 6: Repeat Steps 1 to 5: Iteratively predict the k-th sub-cycle (repeated 7 times). Integrating the results of Step 5 from the previous cycle's forecast with the forecast data for the next three hours: .
10. The irradiance rolling prediction method based on Pyraformer according to claim 1, characterized in that, Verification of the effectiveness of the method: Mean square error formula: Root mean square error formula: Mean Absolute Error Formula: In the formula, This represents the predicted irradiance at time t for a future time t+k; : Represents the true value of irradiance at time t + k; Enhanced dynamic adaptability: Segmented forecasting can respond to weather changes in real time, and the error correction formula for each sub-cycle is: in For learning rate, Let be the error gradient of the kth sub-cycle.
Citation Information
Patent Citations
Transform model-based photovoltaic power prediction method
CN112991090A
Photovoltaic power generation power prediction method and system based on LSTM
CN117077515A