Dynamic fusion prediction method and system for photovoltaic power generation power, and storage medium

By constructing a prediction framework that combines long and short time series and a dynamic weight fusion mechanism, the problem of not being able to take into account both long-term trends and short-term fluctuations in photovoltaic power generation prediction is solved, achieving high-precision and stable prediction results.

CN121791111APending Publication Date: 2026-04-03ZHEJIANG SINOPEC NEW ENERGY TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511840668.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing photovoltaic power generation forecasting methods struggle to balance long-term trends with short-term fluctuations, and their generalization ability is insufficient under complex and variable weather conditions, resulting in inadequate forecasting accuracy and stability.

Method used

A hybrid framework of long-term baseline prediction, short-term clustering correction, and dynamic weight fusion is constructed. Meteorological and power model clusters are divided through dynamic time warping and cluster analysis, long-term and short-term models are trained, and a dynamic weight allocation mechanism is used to fuse the prediction results.

Benefits of technology

It significantly improves the accuracy and stability of photovoltaic power generation forecasting, and can adaptively adjust the model contribution under complex weather conditions, enabling dynamic updates and real-time corrections of the forecast curve throughout the day.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121791111A_ABST
    Figure CN121791111A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic fusion prediction method and system for photovoltaic power generation power, and a storage medium. The method comprises the steps of collecting historical photovoltaic power generation power and corresponding multi-dimensional meteorological parameters; based on time sequence fragments in the historical data set, similarity measurement and clustering analysis are carried out on hour-level weather-power time sequence fragments in historical data by utilizing a dynamic time warping method, different weather-power mode clusters are divided, and a representative cluster center is determined for each cluster; training a long time sequence baseline prediction model and a plurality of short time sequence correction models in parallel; performing weighted fusion on the two prediction results by using the weight to obtain a final prediction value; and the prediction is updated by using the latest meteorological data by adopting an hour-by-hour rolling mechanism. According to the method, the problem that the long-period trend and the short-time fluctuation are difficult to consider at the same time is effectively solved, and the prediction precision, the stability and the adaptive capacity of the photovoltaic power generation power under the complex and changeable meteorological conditions are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of distributed energy management, specifically involving a power generation prediction method based on dynamic weighted fusion of long-time-series baseline and short-time-series cluster correction for photovoltaic power generation, which is used for the optimized scheduling of integrated photovoltaic-storage-charging energy sites. Background Technology

[0002] With the widespread adoption of electric vehicles, charging stations integrating photovoltaic (PV) power generation systems have become an important component of smart grids. However, PV power generation is intermittent, volatile, and uncertain, and its output power is affected by multiple environmental factors such as sunlight, temperature, cloud cover, and seasons, posing challenges to energy management and grid dispatching at charging stations. Achieving high-precision PV power generation forecasting is a key prerequisite for mitigating fluctuations, optimizing power purchase strategies, reducing operating costs, and enhancing the absorption capacity of new energy sources. Existing physical models rely on precise equipment and environmental parameters, which are difficult to obtain comprehensively in practical applications; statistical methods struggle to handle nonlinear and complex time-series relationships, resulting in limited prediction accuracy; while deep neural network models such as recurrent neural networks, long short-term memory networks, convolutional neural networks, and Transformer-based long-time-series modeling methods have improved prediction accuracy to some extent, they still have shortcomings in practical applications.

[0003] On the one hand, long-term time-series models are better suited to capturing overall trends across the entire day, but often perform poorly in predicting local fluctuations at short time scales. On the other hand, short-term time-series models have advantages in local predictions, but struggle to capture global trends. Furthermore, most existing methods model data under heterogeneous meteorological conditions uniformly, failing to fully utilize their differences and resulting in insufficient model generalization ability. Simultaneously, when fusing predictions from multiple models, they typically employ only static weighting or simple averaging, lacking a mechanism for dynamic adjustment based on input context and model divergence, making it difficult to achieve robust predictions under complex and variable meteorological conditions.

[0004] Therefore, there is an urgent need for a new forecasting method that can take into account both long-term trends and short-term fluctuations, and can adaptively integrate multiple forecasting sources. Summary of the Invention

[0005] (a) Technical problems to be solved

[0006] To address the shortcomings of existing technologies, this invention constructs a hybrid framework of "long-term baseline prediction - short-term clustering correction - dynamic weight fusion" to achieve high-precision and adaptive prediction of photovoltaic power output, effectively solving the industry problem of "difficulty in balancing long-term trends and short-term fluctuations".

[0007] (II) Technical Solution

[0008] To achieve the above objectives, the present invention provides the following technical solution: a dynamic fusion prediction method for photovoltaic power generation, comprising the following steps:

[0009] S1. Collect historical photovoltaic power generation and corresponding multi-dimensional meteorological parameters, clean the data, fill in missing values, handle outliers and standardize the data to construct a standardized feature sample set;

[0010] S2. Based on the time series segments in the historical dataset, the dynamic time warping method is used to perform similarity measurement and cluster analysis on the hourly meteorological-power time series segments in the historical data, divide them into different meteorological-power pattern clusters, and determine a representative cluster center for each cluster.

[0011] S3. Train a long-time-series baseline prediction model and multiple short-time-series correction models in parallel.

[0012] S4. For the current time period to be predicted, obtain the prediction results of the long-term baseline prediction model and the corresponding short-term correction model respectively.

[0013] S5. Using a dynamic weight allocation mechanism, the dynamic fusion weight is calculated based on recent meteorological context features, the predicted values ​​of the two models, and their degree of divergence.

[0014] S6. The two prediction results are weighted and fused using the weights to obtain the final prediction value; and the prediction is updated using the latest meteorological data by adopting an hourly rolling mechanism.

[0015] As a preferred embodiment, the multidimensional meteorological parameters include geographical location information, weather type, temperature, humidity, wind speed, air pressure, irradiance, ultraviolet radiation intensity, probability of rainfall, and specific time of day; missing values ​​are filled using linear interpolation, and outliers are identified and processed using the 3σ principle; the processed feature vectors are then standardized and normalized.

[0016] As a preferred embodiment, the hourly time-series segment It consists of feature vectors from k sub-periods within one hour, arranged in chronological order; two hourly sequences. and The DTW distance was obtained by solving for the minimum cumulative alignment cost using a dynamic programming algorithm; the k-medoids algorithm was used for clustering to determine the optimal number of clusters. The profile coefficient is determined by calculating the average profile coefficient under different numbers of candidate clusters and taking the maximum value:

[0017]

[0018] in, To determine the total number of hourly segments participating in clustering, select the one that makes... The largest number of clusters is the optimal number of clusters. .

[0019] As a preferred option, cluster center The hourly segment selected is the one with the smallest sum of DTW distances to all other samples within the cluster. For a new hourly meteorological sequence segment, the cluster with the closest DTW distance to each cluster center is selected by calculating its DTW distance, and the corresponding GRU neural network of that cluster is called for short-term time-series prediction.

[0020] As a preferred embodiment, the workflow of the dynamic weight allocation mechanism includes:

[0021] a) Contextual Feature Extraction: A lightweight temporal convolutional network is used to encode the meteorological sequence of the most recent hour, followed by global average pooling and linear transformation to obtain the contextual feature vector. ;

[0022] b) Query vector construction: constructing context feature vectors With a learnable step-size embedding vector representing the future prediction time. Add them together to get the query vector. ;

[0023] c) Evidence Vector Construction: For long-term and short-term models, their learnable identity vectors are constructed respectively. The predicted value at that moment and the degree of divergence in predictions between the two models at that moment. The data is concatenated to form an evidence vector. ;

[0024] d) Key-value pair mapping: mapping the evidence vector Mapped to keys through linear layers The corresponding predicted value As a value ;

[0025] e) Weight Calculation: Calculate the query vector With each key The similarity scores are normalized using a temperature-controlled softmax function to obtain dynamic fusion weights. ;

[0026] f) Weighted fusion: utilizing weights The final predicted value is obtained by weighted summation of the predicted values ​​from the two models. .

[0027] As a preferred embodiment, the dynamic weight allocation mechanism, during training, has a total loss function. Loss due to prediction error Weight smoothness loss and weight balance loss It consists of three parts;

[0028] in, To integrate the mean squared error between predicted and actual values;

[0029] The L1 norm penalty is applied to the weight difference between adjacent time points to suppress weight jitter.

[0030] A penalty term is used to encourage long-term model average weights to approach 0.5, in order to avoid model fusion collapse.

[0031] As a preferred option, the loss function consists of three parts:

[0032]

[0033]

[0034]

[0035] in For two adjacent The weight of each minute point is subject to L1 differential penalty; It is a penalty coefficient (set to 0.05) used to suppress drastic fluctuations in weights between adjacent 15-minute points.

[0036]

[0037] in, All samples within a batch, all of The average.

[0038] As a preferred embodiment, S4 employs a rolling prediction mechanism, specifically:

[0039] S41. At the beginning of the forecast period, use the long-time-series baseline forecast model to generate a 24-hour baseline forecast curve for the whole day.

[0040] S42. At the beginning of each new hour, the latest meteorological data of that hour is used to perform a short-time series correction model and a dynamic weight fusion module.

[0041] S43. Generate corrected forecasts for the hour and subsequent periods, and use these to cover the corresponding parts of the updated original baseline forecast curve.

[0042] The data preprocessing module is used to collect historical photovoltaic power generation and corresponding multi-dimensional meteorological parameters, clean the data, fill in missing values, handle outliers and standardize the data, and construct a standardized feature sample set.

[0043] The pattern clustering module is used to perform similarity measurement and clustering analysis on hourly meteorological-power time series segments based on the time series segments in the historical dataset using the dynamic time warping method, to divide different meteorological-power pattern clusters, and to determine a representative cluster center for each cluster;

[0044] The model training module is used to train a long-time-series baseline prediction model and multiple short-time-series correction models in parallel.

[0045] The prediction execution module is used to call the long-term baseline prediction model and the corresponding short-term correction model respectively to obtain the prediction results for the current time period to be predicted;

[0046] The dynamic weight fusion module is used to calculate dynamic fusion weights based on recent meteorological context features, the predicted values ​​of the two models and their divergence, and to use the weights to perform weighted fusion of the two prediction results to obtain the final prediction value.

[0047] The rolling forecast control module is used to control the system to update forecasts using the latest meteorological data by employing an hourly rolling mechanism.

[0048] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a dynamic fusion prediction method for photovoltaic power generation.

[0049] (III) Beneficial Effects

[0050] Compared with existing technologies, the present invention provides a dynamic fusion prediction method, system, and storage medium for photovoltaic power generation, which has the following beneficial effects:

[0051] I. This invention addresses the problem of poor forecasting performance by employing a dual-pathway structure that simultaneously balances long-term smoothness and short-term sensitivity, significantly improving overall forecast accuracy. Furthermore, in terms of adaptability, this invention utilizes a context- and divergence-driven dynamic attention weighting mechanism to achieve adaptive fusion of long-term forecasts and short-term corrections. It also employs an hourly rolling update mechanism, continuously updating and correcting forecasts for the corresponding time period after acquiring the latest meteorological data, enabling dynamic updates to the forecast curve throughout the day, thereby further enhancing the real-time performance and robustness of forecasts.

[0052] Second, the context-aware dynamic weight fusion mechanism proposed in this invention can intelligently adjust the model contribution based on real-time meteorological context and the degree of divergence between models, which is superior to the static weighting method.

[0053] Third, this invention introduces smoothness and balance regularization constraints in weight allocation, effectively avoiding problems such as drastic weight fluctuations or monopolistic behavior by a single model, thus ensuring the stability of the prediction output. It effectively solves the problem of simultaneously considering long-term trends and short-term fluctuations, significantly improving the prediction accuracy, stability, and adaptability of photovoltaic power generation under complex and variable weather conditions. Attached Figure Description

[0054] Figure 1 This is a schematic diagram illustrating the algorithm framework and workflow of a conventional prediction method.

[0055] Figure 2 This is a schematic diagram of the model training technology route of the present invention;

[0056] Figure 3 This is a schematic diagram comparing the structure of the method of this invention and conventional prediction methods;

[0057] Figure 4 This is a flowchart of the method of the present invention. Detailed Implementation

[0058] To better understand the purpose, structure, and function of this invention, the following will further describe a dynamic fusion prediction method, system, and storage medium for photovoltaic power generation in conjunction with the accompanying drawings and specific embodiments.

[0059] Example 1

[0060] refer to Figure 2-4 The present invention provides a dynamic fusion prediction method for photovoltaic power generation, comprising the following steps:

[0061] S1. Collect historical photovoltaic power generation and corresponding multi-dimensional meteorological parameters, clean the data, fill in missing values, handle outliers and standardize the data to construct a standardized feature sample set;

[0062] S2. Based on the Dynamic Time Warping (DTW) method, similarity measurement and cluster analysis are performed on hourly meteorological-power time series segments in historical data to divide different meteorological-power pattern clusters and determine a representative cluster center for each cluster;

[0063] S3. Train a long-term baseline prediction model and multiple short-term correction models in parallel. The long-term baseline prediction model is a PatchTST model based on the Transformer architecture, which is used to output the global prediction curve for the next 24 hours. The short-term correction model is a GRU neural network trained separately for each mode cluster in S2, which is used to output the fine-grained prediction for the next hour under the corresponding mode.

[0064] S4. For the current time period to be predicted, obtain the prediction results of the long-term baseline prediction model and the corresponding short-term correction model respectively.

[0065] S5. Using a dynamic weight allocation mechanism, the dynamic fusion weight is calculated based on recent meteorological context features, the predicted values ​​of the two models, and their degree of divergence.

[0066] S6. The two prediction results are weighted and fused using the weights to obtain the final prediction value; and the prediction is updated using the latest meteorological data by adopting an hourly rolling mechanism.

[0067] Specifically, in step S1, the data preprocessing and feature construction stage...

[0068] Historical photovoltaic power generation and corresponding meteorological parameters were collected. The collected information included: geographical location (longitude). ,latitude Weather type ,temperature ,humidity Wind speed air pressure Irradiation intensity UV intensity Rainfall probability ,time (At what minute of the day).

[0069] Among them, (missing value handling) addresses missing values ​​in meteorological parameters and power data. If a certain meteorological parameter is missing at time... Missing information can be filled using linear interpolation:

[0070]

[0071] in, This represents the missing values ​​at time t that need to be interpolated and filled in; , These are known values ​​for adjacent time periods. For cases with long periods of continuous missing data, historical mean / median values ​​under the same date type or similar weather conditions are used to fill the gaps and maintain data continuity.

[0072] (Outlier Detection) For outlier data points, a 3-point method is used. The principle is to identify and process values ​​that exceed a reasonable range, correcting or eliminating them to prevent interference with model training. For feature x, if it satisfies...

[0073]

[0074] Then it is judged as an outlier, where The mean, This represents the standard deviation. Outliers can be replaced with the mean of nearby time steps or removed to avoid interfering with model training.

[0075] After data cleaning, meteorological feature vectors are extracted from the original samples:

[0076]

[0077] in, This represents a d-dimensional real-valued feature vector. To eliminate differences in units and numerical ranges, all features are uniformly standardized and normalized. Standardization uses the traditional Z-score method, and normalization uses the Min-Max linear transformation.

[0078] Divide the data for the entire day (24 hours) into granular levels. Divided into Each time period is indexed by hour. "and Sub-period index" "Tagged Samples:"

[0079]

[0080] in, This is the dataset for that day, containing... Sample; Indicates the first Hours; Indicates the number of hours in that hour Sub-periods; It is the feature vector of this sub-period, with dimension . , Indicates and The corresponding actual photovoltaic power generation.

[0081] For a historical dataset with many days, its set is defined as:

[0082]

[0083] in, Indicates the number of days in history.

[0084] More specifically, in step S2, the sample clustering and pattern segmentation stage, the similarity of each hourly meteorological-power sequence segment is calculated using the Dynamic Time Warping (DTW) algorithm, and the k-medoids clustering algorithm is used to divide them into several representative pattern clusters. The optimal number of clusters is determined by the silhouette coefficient, and a cluster center is selected for each cluster.

[0085] This invention employs a dynamic time warping method to measure the similarity between different time segments. Specifically, it divides the 24-hour data of a day into hourly segments, and further subdivides each hour into... Each sub-time period is combined chronologically to form a multivariate sequence segment:

[0086]

[0087] in, Indicates the first The characteristic sequence of hours contains Sub-periods; It is the feature vector of this sub-period, with dimension . To measure two arbitrary hourly sequences and Similarity is defined by a pointwise cost function:

[0088]

[0089] This involves using Euclidean distance to measure the difference between two sub-time periods in the feature space. Based on this cost function, the minimum cumulative cost is recursively obtained using DTW dynamic programming.

[0090]

[0091]

[0092] Among them, boundary conditions This recursive formula, by allowing for "non-linear alignment" on the time axis, more reasonably measures the similarity between time series of different lengths or those with misalignments. Ultimately, it applies to all hourly segments of the same dataset. Calculating the pairwise DTW distances yields a symmetric distance matrix:

[0093]

[0094] Next, based on the distance matrix Clustering is performed on hourly segments. Since DTW distances cannot be directly added, the k-medoids (PAM) algorithm is used to partition the cluster structure, and the candidate cluster size set is used. This defines the search range. For each candidate cluster number... Clusters, using DTW distance to calculate profile coefficients:

[0095]

[0096] in, Indicates sample The average distance to other samples within the cluster. Indicates sample The average distance to the nearest cluster. The average silhouette coefficient of the overall clustering is:

[0097]

[0098] in, To determine the total number of hourly segments participating in clustering, select the one that makes... The largest number of clusters is the optimal number of clusters. :

[0099]

[0100] Ultimately, each hourly segment Each will be assigned a cluster label. Based on this, a training subset corresponding to each cluster can be constructed:

[0101]

[0102] in, This represents the true power sequence for that hour. Then, a dedicated GRU network is trained on a subset of data for each cluster, enabling it to output the hourly predicted segment for that cluster. Simultaneously, a representative hourly segment is automatically selected as the cluster center for each cluster. This fragment originates from a sample within the cluster and has the smallest total DTW distance to all samples within the cluster, thus serving as a typical pattern for that cluster. In the subsequent online prediction phase, new input fragments are selected based on their DTW distance to the cluster centers to find the closest cluster, and the corresponding GRU network is invoked for prediction.

[0103] refer to Figure 1 In existing technologies, each cluster requires training a separate network, which increases maintenance costs as the number of clusters increases. Furthermore, over time, the distribution of photovoltaic / load data may drift, rendering the original clustering and models inapplicable. This invention employs a more flexible clustering method (DTW clustering), capable of distinguishing weather and power patterns based on curve morphology, resulting in more realistic and reasonable data for each category. Each pattern cluster represents a typical meteorological condition and its corresponding photovoltaic power output pattern, and a representative cluster center is determined. This mechanism enables the system to identify and utilize data differences under various meteorological conditions, laying the foundation for subsequent differentiated modeling and thus improving the model's generalization ability under heterogeneous meteorological conditions.

[0104] In step S3 of the present invention, the multi-model prediction modeling stage

[0105] In this phase, long-term and short-term modeling are carried out in parallel.

[0106] Specifically, at the long-term time series level, complete 24-hour time series meteorological data and corresponding photovoltaic power data from multiple historical days are used as training sets and input into the PatchTST model based on Transformer for training, thereby obtaining a global baseline model that can output a full-day prediction curve.

[0107] At the short-term time series level, the historical samples are first divided into hourly segments, and then the Dynamic Time Warping (DTW) method is used to cluster each hourly segment, resulting in a total of [number missing] clusters. Clusters.

[0108] Specifically, for each cluster, the hourly meteorological sequence and its corresponding power sequence are extracted to construct a corresponding training subset, and an independent GRU neural network (denoted as GRU) is trained on this basis. This enables it to output hourly forecasts for specific weather patterns.

[0109] In the actual forecasting phase, the entire day's weather forecast is first input into the PatchTST model to obtain the complete 24-hour forecast baseline curve. Simultaneously, whenever a new hourly period begins, the latest hourly weather sequence is divided into segments and matched with cluster centers using DTW distance to determine the cluster affiliation. For the real-time arrival of the [missing information], [missing information]... Hourly data snippets Calculate its relationship with the center of each cluster. Calculate the DTW distance and select the nearest cluster:

[0110]

[0111] Will Send to the corresponding network After obtaining short-term forecasts, the baseline forecast results from PatchTST and the corresponding short-term forecast results from GRU will be fed into the subsequent dynamic weighted fusion module to achieve an organic combination of the overall trend and local fluctuations.

[0112] Furthermore, the workflow of the dynamic weight allocation mechanism of this invention includes:

[0113] a) Contextual Feature Extraction: A lightweight temporal convolutional network is used to encode the meteorological sequence of the most recent hour, followed by global average pooling and linear transformation to obtain the contextual feature vector. ;

[0114] b) Query vector construction: constructing context feature vectors With a learnable step-size embedding vector representing the future prediction time. Add them together to get the query vector. ;

[0115] c) Evidence Vector Construction: For long-term and short-term models, their learnable identity vectors are constructed respectively. The predicted value at that moment and the degree of divergence in predictions between the two models at that moment. The data is concatenated to form an evidence vector. ;

[0116] d) Key-value pair mapping: mapping the evidence vector Mapped to keys through linear layers The corresponding predicted value As a value ;

[0117] e) Weight Calculation: Calculate the query vector With each key The similarity scores are normalized using a temperature-controlled softmax function to obtain dynamic fusion weights. ;

[0118] f) Weighted fusion: utilizing weights The final predicted value is obtained by weighted summation of the predicted values ​​from the two models. .

[0119] refer to Figure 3 As shown, the left side represents the traditional photovoltaic prediction method used in engineering; the right side represents the method of this invention.

[0120] In this invention, instead of simply averaging the two predictions, a "dynamic weight allocation" mechanism is introduced. This mechanism intelligently adjusts the weights of the two models based on real-time weather characteristics and the differences between them, ensuring a stable and accurate final result.

[0121] This method, through "stronger neural networks + more reasonable clustering + dual-path prediction + dynamic fusion", not only ensures the smooth trend of the curve throughout the day, but also can quickly correct when the weather is changeable. The overall prediction accuracy and stability are higher than those of traditional methods.

[0122] Specifically, the dynamic weight fusion and rolling prediction stage

[0123] At the start of the prediction period By inputting the 24-hour meteorological data dataset obtained from the meteorological forecasting system into the PatchTST network, baseline forecasts for the next 0–24 hours can be obtained. This result is stored as a full-day curve, and can be viewed at any given time. We can extract the corresponding prediction segment for the next hour from it, and denote it as... At the same time, "moment" The latest weather forecast data is input into the GRU network to obtain forecast results for the same time period, which are recorded as follows: The final predicted value is obtained through analysis of... and The weighted fusion was obtained.

[0124] Before performing weighting, we need to extract contextual features using the "most recent 1-hour weather sequence". Let this sequence be:

[0125]

[0126] in, Indicates time The meteorological feature vector, with dimension . , This represents the number of time periods within one hour. (This is for extracting...) To capture the temporal features, a lightweight encoder, TCN-lite, is introduced. This encoder consists of three one-dimensional convolutional layers, each configured as follows:

[0127] ① Number of convolution channels: ;

[0128] ② Kernel size: ;

[0129] ③ Expansion coefficients: 1, 2, and 4 respectively, used to expand the receptive field;

[0130] ④ Each layer of structure: (Including residual connections).

[0131] enter Output .

[0132] Network structure (3-layer one-dimensional dilated convolution, causal padding, with residuals)

[0133] First layer: Conv1D(in= out= kernel=3, dilation= , stride=1, padding='causal')

[0134] Second layer: Conv1D(in= out= kernel=3, dilation= , stride=1, padding='causal')

[0135] Third layer: Conv1D(in= out= kernel=3, dilation= , stride=1, padding='causal')

[0136] Residual connections: Each layer is residually connected to its input; when channels are inconsistent, a 1*1 convolution is added to match the channels.

[0137] Normalization: LayerNorm can be selected after each layer.

[0138] Aggregation: Global average pooling (along the time dimension)

[0139] Among them, the hyperparameter to be selected is the number of channels. (Selectable options: 16 / 32 / 64, 32 is preferred); (Range 0.05~0.2); Convolution kernel size kernel=3; 14:30 "The causal padding method is adopted, that is, padding is only performed on the left side of the time series to keep the output length consistent with the input, and to ensure that the convolution at each time step only depends on the current and historical information and does not use future information. It is suitable for time series prediction, streaming / online inference and autoregressive modeling. When the convolution kernel size is 𝑘 and the dilation coefficient is d, the padding on the left side is d(k−1) and the padding on the right side is 0.

[0140] Expansion coefficient: Used to ensure that the receptive field ≥ k. The receptive field is calculated as follows: .

[0141] like

[0142]

[0143] After three layers of convolution, the feature map in the time dimension is obtained, denoted as:

[0144]

[0145] In order to aggregate time-dimensional information into a unified representation, Performing global average pooling on the time dimension yields a fixed-dimensional representation vector:

[0146]

[0147] in, It is a length of The vector represents the "comprehensive characteristics of the meteorological sequence in the most recent hour". Represents the input sequence The result after TCN-lite encoding. Then, a linear transformation is applied to... Projected onto a low-dimensional latent space:

[0148]

[0149] in The final extracted context features are represented by a vector resulting from a linear transformation; the encoder network weights are... The encoder network bias vector is These two network weights can be trained.

[0150] Next, define each future step size. Define a learnable step size embedding (common Each independent trainable vector, with a number of parameters. ), randomly initialized and gradually optimized during training.

[0151] Therefore, a query vector can be constructed:

[0152]

[0153] Its physical meaning is "the weather context of the last hour + the future being predicted". Minutes.

[0154] Subsequently, for the model PatchTST( ) and GRU ( Each of these two networks is assigned a learnable identity vector. And calculate the divergence strength in this step:

[0155]

[0156] The evidence vector is obtained by concatenating the data.

[0157]

[0158] Through linear transformation Bundle Mapping to and querying Same dimensions:

[0159]

[0160] in For model i at this time point, the corresponding value is defined as

[0161]

[0162] To calculate the weights, the query vector can be... Perform an optional linear transformation:

[0163]

[0164] in, , This is a trainable linear layer used to re-align the query to the "key" space. The matching degree is then calculated:

[0165]

[0166] This is the model The key to be constructed Indicates the similarity between the query and the key; the higher the similarity, the more likely it is that "the context of this hour is in the first hour". Minutes are more like a model "Evidence"; It is standard scaling to prevent the fractional variance from increasing as the vector dimension increases, thus keeping the training values ​​stable. It is the result, representing a scalar fraction.

[0167] Use a temperature-based softmax function to convert scores into weights:

[0168]

[0169] in, It is a temperature constant that adjusts the sharpness of the weight distribution.

[0170] After calculating the weights, the final predicted value is obtained by... and The weighted fusion yielded:

[0171]

[0172] in, PatchTST is in the 19th Baseline forecast at minute points; It is GRU in the Short-term forecasts at minute points; It is the point prediction after fusion.

[0173] Furthermore, during model training, the loss needs to be calculated to update the parameters in the above process, including the convolutional weights of TCN-lite and linear projection. , Step size embedding Model embedding Key mapping , Optional query mapping , The loss function consists of three parts:

[0174]

[0175]

[0176]

[0177] in For two adjacent The weight of each minute point is subject to L1 differential penalty; It is a penalty coefficient (set to 0.05) used to suppress drastic fluctuations in weights between adjacent 15-minute points.

[0178]

[0179] in, All samples within a batch, all of The average; the purpose of this formula is to ensure that both models are used in the long run, without collapsing to the point where only one is used; It is a coefficient, usually taken as 0.01.

[0180] Based on the above loss function, the network parameters are updated using the backpropagation algorithm, thereby optimizing the prediction performance. The PatchTST and GRU models can be kept frozen.

[0181] The method of this invention achieves adaptive fusion of long-term prediction and short-term correction by constructing a dynamic attention weight mechanism based on context and divergence, thereby improving the accuracy of short-term prediction and the robustness of the system while ensuring the trend throughout the day.

[0182] This invention does not rely on a single model, but instead designs two parallel data streams: one responsible for "long-term baseline prediction" to ensure a reasonable trend throughout the day; and the other responsible for "short-term correction prediction" to refine the prediction for local fluctuations. This avoids the problem of inaccurate predictions from a single model.

[0183] The following experiment (Table 1) compares the prediction results of the method of this patent with different prediction models in various weather scenarios.

[0184] Table 1 Comparison of prediction performance of various models under multiple weather scenarios

[0185]

[0186] To verify the effectiveness and superiority of the method of this invention, traditional linear regression (LR), decision tree (DT), support vector machine (SVM), ensemble tree, Gaussian process regression (GPR), and backpropagation neural network (BP-NN) were selected as comparative models, and experiments were conducted on the same historical meteorological and power datasets of photovoltaic power plants. The coefficient of determination R², mean square error (MSE), and root mean square error (RMSE) were used as performance evaluation indicators, and the experiments were conducted under typical weather conditions such as sunny, cloudy, overcast, foggy, light rain, and showers.

[0187] The model performance evaluation metrics are calculated as follows:

[0188] Model evaluation parameters

[0189] The predictive performance of a model is evaluated using metrics such as mean squared error (MSE), root mean squared error (RMSE), and coefficient of determination (R²).

[0190] (a) Mean Squared Error (MSE)

[0191] Definition: MSE is the average of the squares of the errors between the predicted and actual values.

[0192] formula:

[0193]

[0194] A smaller MSE value indicates a smaller discrepancy between the model's predictions and the actual values, meaning a better model fit. It can be used to compare how well different models fit the same dataset. When multiple models are available, the model with a smaller MSE is generally considered to have better predictive performance.

[0195] (b) Root Mean Square Error (RMSE)

[0196] Definition: RMSE is the square root of MSE, used to restore the units of error to the same units as the original data.

[0197] formula:

[0198]

[0199] RMSE uses the same units as the original data and squares the error during calculation, which mathematically penalizes larger errors more significantly. Therefore, in photovoltaic forecasting scenarios, RMSE is more intuitively interpretable than MSE; a lower value indicates higher prediction accuracy.

[0200] (c) Coefficient of determination (R-squared score, R²)

[0201] Definition: The R² score measures the correlation between the model's predicted values ​​and the actual values, indicating how much variance of the target variable the model explains.

[0202] formula:

[0203]

[0204] The higher the R², the stronger the model's ability to explain data fluctuations.

[0205] The experimental results (Table 1) show that:

[0206] I. Overall forecast accuracy has been significantly improved.

[0207] The method of this invention achieved an average R² of 0.90 on the test set, which is higher than all the comparative models (linear regression 0.84, decision tree 0.73, SVM 0.42, ensemble tree 0.85, Gaussian process regression 0.81, and BP neural network 0.87). The corresponding average MSE was 1212.24 and RMSE was 34.82, with significantly lower errors than existing methods. These results demonstrate that the present invention has significant advantages in overall accuracy and stability for photovoltaic power generation prediction.

[0208] Second, it exhibits stronger robustness under complex weather conditions.

[0209] Under highly volatile weather conditions such as cloudy days, smog, and showers, traditional models generally experience accuracy degradation or even negative R², while the method of this invention maintains R² ≥ 0.65 under the same conditions, with prediction errors controlled within the thousandth order of magnitude, demonstrating stronger generalization ability and perturbation resistance. This is due to the dual-path structure of "long-term trend modeling + short-term clustering correction" adopted in this invention, which can simultaneously capture both the overall trend and local fluctuation characteristics.

[0210] Third, the dynamic weight fusion mechanism effectively improves the model's adaptability.

[0211] Unlike traditional static weighting or simple averaging fusion methods, this invention introduces contextual feature encoding and model divergence information during the fusion stage. A trainable attention weight network is used to achieve dynamic weighting, thereby adaptively adjusting the contribution ratio of long and short time series models under different meteorological conditions. Experimental results show that this mechanism can significantly suppress weight oscillations and single-model "monopoly" problems, making the prediction results smoother and more stable over continuous time periods.

[0212] IV. The training process shows smooth convergence and excellent generalization performance.

[0213] The MSE of this invention on the training set is 1103.08, and the corresponding RMSE is 33.21, which is lower than other deep models. This indicates that the model is superior to the comparison methods in terms of fitting efficiency and generalization ability, and no overfitting or oscillation phenomenon is observed.

[0214] In summary, compared with the prior art, the present invention has the following beneficial effects:

[0215] ① By using a complementary structure of long and short time series dual models, the global trend fitting ability and local fluctuation capture ability of the whole day photovoltaic power prediction are improved;

[0216] ② By using a dynamic weight fusion mechanism based on contextual features and model divergence, adaptive allocation of prediction weights is achieved, improving robustness under complex meteorological conditions;

[0217] ③ By introducing regularization smoothing and balance constraints, the continuity of the fusion weights and the synergy of multiple models are ensured, making the prediction results more stable and reliable;

[0218] ④ Experimental verification shows that the prediction accuracy of this invention is better than that of traditional methods in various weather scenarios, significantly reducing prediction errors and improving the practicality and engineering scalability of photovoltaic power generation prediction.

[0219] Example 2

[0220] This invention provides a dynamic fusion prediction system for photovoltaic power generation, comprising:

[0221] The data preprocessing module is used to collect historical photovoltaic power generation and corresponding multi-dimensional meteorological parameters, clean the data, fill in missing values, handle outliers and standardize the data, and construct a standardized feature sample set.

[0222] The pattern clustering module is used to perform similarity measurement and clustering analysis on hourly meteorological-power time series segments based on the time series segments in the historical dataset using the dynamic time warping method, to divide different meteorological-power pattern clusters, and to determine a representative cluster center for each cluster;

[0223] The model training module is used to train a long-time-series baseline prediction model and multiple short-time-series correction models in parallel.

[0224] The prediction execution module is used to call the long-term baseline prediction model and the corresponding short-term correction model respectively to obtain the prediction results for the current time period to be predicted;

[0225] The dynamic weight fusion module is used to calculate dynamic fusion weights based on recent meteorological context features, the predicted values ​​of the two models and their divergence, and to use the weights to perform weighted fusion of the two prediction results to obtain the final prediction value.

[0226] The rolling forecast control module is used to control the system to update forecasts using the latest meteorological data by employing an hourly rolling mechanism.

[0227] This invention constructs a prediction framework combining long and short time series data to ensure the stability of overall trend prediction while achieving refined correction of short-term fluctuations. Specifically, it first establishes a baseline prediction using a long-term Transformer model to ensure the smoothness and rationality of the overall curve; then, it combines a clustering method based on dynamic time warping (DTW) to divide hourly data segments under different meteorological conditions into several pattern subsets, and trains a short-term recurrent neural network for each cluster to achieve differentiated modeling for different weather types, thereby improving the adaptability and accuracy of short-term prediction.

[0228] In the multi-model result fusion stage, this invention proposes a context-aware dynamic weight allocation mechanism. This mechanism comprehensively utilizes features of nearest-neighbor time segments, prediction results from different models, and their divergence information. Through a gating network, it adaptively generates time-varying weights, intelligently adjusting the contribution of each model according to changes in the meteorological environment. This avoids the accuracy problems caused by static weighting or simple averaging in traditional methods. Simultaneously, this invention introduces smoothness and balance regularization terms during weight allocation, effectively suppressing the risks of weight fluctuations and long-term monopolization by a single model, ensuring the stability and generalization ability of the fusion results.

[0229] Furthermore, this invention employs an hourly rolling update mechanism, which real-time overlays and corrects the forecast results for the corresponding time period after acquiring the latest meteorological data, enabling the forecast curve to be dynamically updated throughout the day, thereby further improving the real-time performance and robustness of the forecast.

[0230] The present invention also includes a computer-readable storage medium storing a computer program that, when executed by a processor, implements a dynamic fusion prediction method for photovoltaic power generation.

[0231] In summary, under complex and ever-changing meteorological conditions, this invention can take into account both long-term trend modeling and short-term fluctuation correction, and has higher prediction accuracy, stability and adaptability. It has significant application value for the operation and scheduling of photovoltaic power plants and integrated photovoltaic-storage-charging energy stations.

[0232] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.

Claims

1. A dynamic fusion prediction method for photovoltaic power generation, characterized in that, Includes the following steps: Historical photovoltaic power generation and corresponding multidimensional meteorological parameters were collected. The data were cleaned, missing values ​​were filled, outliers were processed and standardized to construct a standardized feature sample set. Based on the time series segments in the historical dataset, the dynamic time warping method is used to perform similarity measurement and cluster analysis on the hourly meteorological-power time series segments in the historical data, divide them into different meteorological-power pattern clusters, and determine a representative cluster center for each cluster. Train a long-time-series baseline prediction model and multiple short-time-series correction models in parallel; For the current time period to be predicted, obtain the prediction results of the long-term baseline prediction model and the corresponding short-term correction model respectively; A dynamic weighting mechanism is used to calculate the dynamic fusion weights based on recent meteorological context features, the predicted values ​​of the two models, and their divergence. The two prediction results are weighted and fused using the aforementioned weights to obtain the final prediction value; It also employs an hourly rolling mechanism to update forecasts using the latest meteorological data.

2. The dynamic fusion prediction method for photovoltaic power generation according to claim 1, characterized in that, The multidimensional meteorological parameters include geographic location information, weather type, temperature, humidity, wind speed, air pressure, irradiance, ultraviolet radiation intensity, probability of rainfall, and specific time of day; linear interpolation is used to fill in missing values, and the 3σ principle is used to identify and process outliers; the processed feature vectors are standardized and normalized.

3. The dynamic fusion prediction method for photovoltaic power generation according to claim 1 or 2, characterized in that, The hourly time sequence segment The sequence is composed of feature vectors from k sub-periods within one hour, arranged in chronological order; two hourly sequences. and The DTW distance is obtained by solving for the minimum cumulative alignment cost using a dynamic programming algorithm; The clustering algorithm uses the k-medoids algorithm to determine the optimal number of clusters. The maximum value is determined by calculating the average silhouette coefficient under different numbers of candidate clusters.

4. The dynamic fusion prediction method for photovoltaic power generation according to claim 3, characterized in that, Cluster center The hourly segment selected is the one with the smallest sum of DTW distances to all other samples within the cluster. For a new hourly meteorological sequence segment, the cluster with the closest DTW distance to each cluster center is selected by calculating its DTW distance, and the corresponding GRU neural network of that cluster is called for short-term time-series prediction.

5. The dynamic fusion prediction method for photovoltaic power generation according to claim 1, characterized in that, The workflow of the dynamic weight allocation mechanism includes: a) Contextual Feature Extraction: A lightweight temporal convolutional network is used to encode the meteorological sequence of the most recent hour, followed by global average pooling and linear transformation to obtain the contextual feature vector. ; b) Query vector construction: constructing context feature vectors With a learnable step-size embedding vector representing the future prediction time. Add them together to get the query vector. ; c) Evidence Vector Construction: For long-term and short-term models, their learnable identity vectors are constructed respectively. The predicted value at that moment and the degree of divergence in predictions between the two models at that moment. The data is concatenated to form an evidence vector. ; d) Key-value pair mapping: mapping the evidence vector Mapped to keys through linear layers The corresponding predicted value As a value ; e) Weight Calculation: Calculate the query vector With each key The similarity scores are normalized using a temperature-controlled softmax function to obtain dynamic fusion weights. ; f) Weighted fusion: utilizing weights The final predicted value is obtained by weighted summation of the predicted values ​​from the two models. .

6. The dynamic fusion prediction method for photovoltaic power generation according to claim 5, characterized in that, The dynamic weight allocation mechanism, during training, has a total loss function. Loss due to prediction error Weight smoothness loss and weight balance loss It consists of three parts; in, To integrate the mean squared error between predicted and actual values; The L1 norm penalty is applied to the weight difference between adjacent time points to suppress weight jitter. A penalty term is used to encourage long-term model average weights to approach 0.5, in order to avoid model fusion collapse.

7. The dynamic fusion prediction method for photovoltaic power generation according to claim 6, characterized in that, The loss function consists of three parts: in For two adjacent The weight of each minute point is subject to L1 differential penalty; It is a penalty coefficient (set to 0.05) used to suppress drastic fluctuations in weights between adjacent 15-minute points. in, All samples within a batch, all of The average.

8. The dynamic fusion prediction method for photovoltaic power generation according to claim 1, characterized in that, The S4 uses a rolling prediction mechanism, specifically: S41. At the beginning of the forecast period, use the long-time-series baseline forecast model to generate a 24-hour baseline forecast curve for the whole day. S42. At the beginning of each new hour, the latest meteorological data of that hour is used to perform a short-time series correction model and a dynamic weight fusion module. S43. Generate corrected forecasts for the hour and subsequent periods, and use these to cover the corresponding parts of the updated original baseline forecast curve.

9. A dynamic fusion prediction system for photovoltaic power generation, characterized in that, include: The data preprocessing module is used to collect historical photovoltaic power generation and corresponding multi-dimensional meteorological parameters, clean the data, fill in missing values, handle outliers and standardize the data, and construct a standardized feature sample set. The pattern clustering module is used to perform similarity measurement and clustering analysis on hourly meteorological-power time series segments based on the time series segments in the historical dataset using the dynamic time warping method, to divide different meteorological-power pattern clusters, and to determine a representative cluster center for each cluster; The model training module is used to train a long-time-series baseline prediction model and multiple short-time-series correction models in parallel. The prediction execution module is used to call the long-term baseline prediction model and the corresponding short-term correction model respectively to obtain the prediction results for the current time period to be predicted; The dynamic weight fusion module is used to calculate dynamic fusion weights based on recent meteorological context features, the predicted values ​​of the two models and their divergence, and to use the weights to perform weighted fusion of the two prediction results to obtain the final prediction value. The rolling forecast control module is used to control the system to update forecasts using the latest meteorological data by employing an hourly rolling mechanism.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Wide-area photovoltaic power prediction method and system based on space-time residual feature fusion

    CN122026337A

  • Space-time fusion photovoltaic power generation prediction method, system, equipment and medium

    CN122026338A