DUET photovoltaic generation power prediction method and system based on space-time bi-clustering and dynamic gating fusion
The DUET photovoltaic power generation prediction method, which integrates spatiotemporal dual clustering and dynamic gating, solves the problems of volatility and uncertainty in photovoltaic power generation prediction, and achieves high-precision and robust photovoltaic power generation prediction, supporting the stable operation and management of the power system.
Patent Information
- Application Number
- CN202511032167.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-11-11
AI Technical Summary
Existing photovoltaic power generation prediction methods suffer from problems such as low prediction accuracy, poor adaptability to dynamic weather disturbances, insufficient multivariate coupling modeling ability, limited prediction timeliness, and computational delay when dealing with the volatility and uncertainty of photovoltaic power generation. These problems make it difficult to meet the needs of high-precision dynamic prediction under complex conditions.
A DUET photovoltaic power prediction method based on spatiotemporal dual clustering and dynamic gating fusion is adopted. By combining the temporal clustering module TCM and the channel clustering module CCM with distributed routers, linear pattern extractors, causal sparsity constraints and frequency domain attention mechanisms, and utilizing bidirectional spatiotemporal cross-attention mechanism and adaptive gating fusion mechanism, high-precision prediction of photovoltaic power is achieved.
It effectively captures the time-series autocorrelation characteristics of photovoltaic power generation and the dynamic influence of control variables, improves the stability and accuracy of prediction results, reduces the computational complexity of the model, supports high-frequency rolling prediction and coordinated dispatch of power systems, and provides an actionable basis for decision-making.
Smart Images

Figure CN120933913A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of new energy power system prediction technology, and relates to a DUET photovoltaic power generation prediction method and system based on spatiotemporal dual clustering and dynamic gating fusion. Background Technology
[0002] With the widespread application of photovoltaic (PV) power generation in power generation systems, accurate prediction of PV power output has become increasingly important. Due to the influence of day-night cycles and external weather conditions, PV power output exhibits strong randomness, volatility, and uncertainty, posing a significant challenge to accurate prediction. This invention addresses the uncertainty in PV power output prediction by researching a DUET PV power output prediction method based on the Time Clustering Module (TCM) and Channel Clustering Module (CCM). A high-precision, robust PV power output prediction model is proposed to solve the problem of insufficient prediction accuracy. The technical process of this invention includes several key steps. First, the TCM is used to extract time features from historical PV power output data. Through TCM, the time series is decomposed into multiple mode components, removing noise and effectively extracting key time-series information. Second, a dynamic channel clustering module (CCM) based on causal sparsity constraints and frequency domain enhancement mechanisms is designed. This module performs causal relationship screening and frequency domain feature enhancement on multiple control variables, highlighting the influence of key control variables and suppressing noise interference in the prediction. Building upon this foundation, a fusion module (FM) is proposed to simultaneously capture the temporal autocorrelation characteristics of the target variable and the joint influence of the control variables. The fusion module employs a bidirectional spatiotemporal cross-attention mechanism to jointly model the temporal pattern of photovoltaic power generation and the cross-channel influence of the control variables, explicitly modeling their dynamic correlation. Furthermore, an adaptive gating fusion mechanism is used to adaptively allocate temporal and channel attention weights based on input features, enhancing the model's robustness and ensuring prediction accuracy under different operating conditions. This technique effectively captures the temporal autocorrelation characteristics of photovoltaic power generation and the dynamic influence of the control variables, improving the stability and accuracy of prediction results, particularly under changing weather conditions. This method enhances the accuracy of photovoltaic power generation prediction results through collaborative modeling in both temporal and channel dimensions.
[0003] Photovoltaic power generation exhibits strong volatility and uncertainty, and existing prediction methods often fail to adequately handle these fluctuations, resulting in low prediction accuracy. While neural network-based prediction models can fit nonlinear relationships, they also have shortcomings in areas such as local minima and convergence speed. Particularly in abrupt weather scenarios, the prediction bias of BP neural networks increases significantly, and their high dependence on the quantity and quality of training samples makes them difficult to adapt to rapidly changing meteorological conditions. Extreme Learning Machine (ELM) and Long Short-Term Memory (LSTM), despite their strong nonlinear fitting capabilities and reduced computational cost, still face challenges in handling complex multivariate time series. Support Vector Machines (SVMs) based on Gaussian radial basis kernels are prone to the curse of dimensionality during feature mapping, and their computational efficiency drops significantly when the training sample size exceeds a certain scale. Hard clustering methods force each meteorological variable to belong to only a single cluster, failing to effectively represent multiple complex spatiotemporal coupling relationships, thus limiting model flexibility. Traditional K-means clustering algorithms assume time stationarity of sequence data, making it difficult to capture the non-steady-state characteristics of photovoltaic power output in different seasons and diurnal cycles, and this algorithm is also sensitive to noise. The EEMD-SVM combined prediction method, based on ensemble empirical mode decomposition and support vector machine, performs well under certain conditions, but is still limited by issues such as data quality and model complexity, and cannot completely solve the challenges in photovoltaic power generation prediction. While existing methods can address some problems to a certain extent, they still suffer from drawbacks such as poor adaptability to dynamic weather disturbances, insufficient multivariate coupling modeling capabilities, limited prediction timeliness, and high computational latency. These shortcomings make traditional methods unable to meet the demands of high-precision dynamic prediction under complex conditions. Therefore, there is an urgent need to develop a new model to overcome these challenges, improve the accuracy, robustness, and real-time performance of photovoltaic power generation prediction, and thus better support the stable operation and management of the power system. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a DUET photovoltaic power generation prediction method and system based on the fusion of spatiotemporal dual clustering and dynamic gating.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion includes:
[0007] S10: Perform instance normalization processing on historical photovoltaic power generation data and control variable data to obtain normalized time series data;
[0008] S20: Process the normalized time-series data through the Time Clustering Module (TCM), including:
[0009] S21: Extracting univariate time series X using a distributed router n,: ∈R T The latent normal distribution parameters are used to generate the weights G(X) of k candidate distributions. n,: )∈R k ;
[0010] S22: Based on the weight G(X) n,: ), X n,: The input is fed into k linear pattern extractors to extract trend features. With fluctuation characteristics And merged into time features
[0011] S23: Aggregate the outputs of all linear pattern extractors to generate the global temporal feature X. temp ∈R N×d ;
[0012] S30: Process control variable data through the Channel Clustering Module (CCM), including:
[0013] S31: Regarding the control variable h n ∈R T Perform a real Fourier transform to obtain the frequency domain features.
[0014] S32: Generate a causal mask matrix C∈{0,1} based on Granger causality test. N×N C, combined with learnable matrices Calculate the weighted distance D ij ;
[0015] S33: Enhance key frequency band features through a frequency domain attention mechanism to obtain enhanced channel features h' n ;
[0016] S34: Based on probability matrix P ij Dynamic sampling channel mask M ij Filter valid channels;
[0017] S40: The global time feature X is jointly processed by the fusion module FM. temp With enhanced channel features M, including:
[0018] S41: Calculate temporal attention Attn separately using a bidirectional spatiotemporal cross-attention mechanism. temp With channel attention Attn chan ;
[0019] S42: Generate fused features X by fusing two types of attention outputs through dynamic gating G. final ;
[0020] S50: The fusion feature X final Input a linear projection layer, output predicted photovoltaic power generation.
[0021] Furthermore, in S21, the operation of the distributed router includes:
[0022] Calculate the mean μ(X) n,: ) = ReLU(X n,: ·W0 μ )·W1 μ With standard deviation σ(X) n,: ) = ReLU(X n,: ·W0 σ )·W1 σ ;
[0023] Generate candidate distribution representation Z n =μ(X) n,: )+ε⊙Softplus(σ(X n,: )), where ε ~ N(0,1);
[0024] Choose the Top-k distribution weights G(X) n,: =Softmax(KeepTopK(H(X)) n,: ),k)), where H(X n,: ) = W H ·Z n , W H ∈R M×M .
[0025] Furthermore, in S22, the operation of the linear pattern extractor includes:
[0026] Extracting trend features:
[0027] Extracting fluctuation features:
[0028] Feature fusion: in This is a learnable weight matrix.
[0029] Furthermore, in step S32, the formula for calculating the weighted distance is:
[0030]
[0031] Where C ij =1 indicates that there is a Granger causal relationship between channel i and channel j.
[0032] Furthermore, in S33, the operation of the frequency domain attention mechanism includes:
[0033] Generate a frequency domain attention mask: in Let be the convolution kernel with channel n, representing a one-dimensional convolution;
[0034] Enhanced spectral characteristics:
[0035] Inverse transform to the time domain:
[0036] Furthermore, in S41, the calculation of bidirectional spatiotemporal cross-attention includes:
[0037] Intertemporal attention:
[0038]
[0039] Q t =X temp ·W t Q K c =M·W c K V c =M·W c V ;
[0040] Cross-channel attention:
[0041]
[0042] Among them, Q c =M·W c Q K t =X temp ·W t K V t =X temp ·W t V .
[0043] Furthermore, in S42, the calculation formula for dynamic gating fusion is:
[0044] G=σ(W g [Attn temp Attn chan ]+b g )
[0045] X mix =G⊙Attn temp +(1-G)⊙Attn chan
[0046] Xfinal =LayerNorm(X mix +X temp )
[0047] in, Let b be the weight matrix. g This is a bias term.
[0048] A DUET photovoltaic power generation prediction system based on spatiotemporal dual clustering and dynamic gating fusion includes:
[0049] The data preprocessing unit is used to perform instance normalization on the input data.
[0050] Temporal clustering apparatus, comprising:
[0051] A distributed router is configured to extract the distribution parameters of the time series and generate k candidate distribution weights through two fully connected layers.
[0052] A linear pattern extractor cluster consists of k parallel extractors, each of which processes the trend and fluctuation components using the difference method and wavelet transform, respectively.
[0053] An aggregator is used to weight and fuse the outputs of the extractor cluster;
[0054] Channel clustering device, comprising:
[0055] The causal sparsity constraint module is configured to calculate the weighted distance between channels based on Granger causality tests and the learnable matrix Q.
[0056] Frequency domain attention module, containing channel-specific convolutional filters Used to enhance key frequency band characteristics;
[0057] The dynamic clustering module generates a channel mask M through Gumbel-Softmax sampling. ij ;
[0058] The fusion device includes:
[0059] A bidirectional spatiotemporal cross-attention layer is used to calculate cross-attention in the time dimension and the channel dimension, respectively.
[0060] The dynamic gating unit fuses two types of attention outputs through Sigmoid gating;
[0061] The prediction output unit is configured to linearly project the fused features into predicted power generation values.
[0062] Furthermore, the circuit structure of the distributed router includes:
[0063] The first fully connected layer group, input X n,: And output μ(X)n,: ), including weight matrix and
[0064] The second fully connected layer group, input X n,: And output σ(X) n,: ), including weight matrix and
[0065] A noise injection unit is used to generate random noise ε that satisfies the N(0,1) distribution;
[0066] The Top-k selector is configured to retain the k distributions with the highest probabilities.
[0067] Furthermore, the hardware implementation of the bidirectional spatiotemporal cross-attention layer includes:
[0068] The core of the time-cross attention calculation includes the projection matrix W. t Q , W c V and programmable position encoder E pos ;
[0069] The core of channel cross-attention calculation includes the projection matrix. W t K W t V ;
[0070] Parallel computing architecture for simultaneously performing attention computations in both time and channel dimensions.
[0071] The beneficial effects of this invention are as follows:
[0072] (1) The time clustering module innovatively adopts a distributed router and linear pattern extractor cluster to effectively capture the non-steady-state characteristics of photovoltaic power during day-night and seasonal changes, fundamentally solving the problem of prediction bias accumulation caused by time distribution drift in traditional methods. By adaptively decomposing the trend component and fluctuation component of time series data, it realizes the essential modeling of the dynamic evolution law of photovoltaic power output.
[0073] (2) The channel clustering module integrates causal sparsity constraints and frequency domain attention enhancement mechanisms, and for the first time realizes the quantification of the physical correlation of meteorological control variables. The channel screening technology based on Granger causality test accurately identifies key influencing factors such as scattered radiation and ambient temperature, while the frequency domain convolution kernel enhances the ability to extract periodic meteorological features, completely overcoming the defects of traditional clustering methods in terms of noise sensitivity and variable independence assumptions.
[0074] (3) The bidirectional spatiotemporal cross-attention mechanism of the fusion module innovatively establishes a dynamic correlation model between the target variable and the control variable. Through the collaborative perception of the time dimension and the channel dimension, it solves the problem of response lag in traditional methods under sudden weather changes. The adaptive gating fusion unit dynamically allocates spatiotemporal weights according to the input features to ensure that the prediction stability is maintained under complex conditions such as alternating sunny and rainy weather and sudden cloud changes.
[0075] (4) The Top-k fast filtering strategy of distributed routers and the Gumbel-Softmax sampling technique for dynamic channel clustering significantly reduce the computational complexity of the model. The modular architecture design supports distributed deployment, meets the real-time requirements of power systems for high-frequency rolling forecasts, and provides a technical foundation for the collaborative scheduling of large-scale photovoltaic power plant clusters.
[0076] (5) Causal mask matrix and frequency domain attention weight visualization technology intuitively reveal the driving mechanism of meteorological variables on power generation. The time clustering results can be mapped to specific meteorological periods, and the channel clustering features can be associated with physical sensors, providing an actionable decision-making basis for power plant operation and maintenance, breaking through the interpretation barrier of traditional black box models.
[0077] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0078] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0079] Figure 1 This is the structure of a distributed router model;
[0080] Figure 2 It is a linear pattern extractor structure;
[0081] Figure 3 This forms the overall framework for the DUET dynamic prediction model.
[0082] Figure 4 A graph showing the predicted photovoltaic power generation output.
[0083] Figure 5 This is a flowchart illustrating the overall framework of the DUET dynamic prediction model. Detailed Implementation
[0084] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0085] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0086] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0087] 1. Instance Normalization
[0088] Instance normalization is a normalization method proposed by Ulyanov et al. in 2016 [InstanceNormalization: The Missing Ingredient for Fast Stylization]. It was first applied to image generation tasks, especially style transfer models. In traditional batch normalization, normalization is performed across the entire batch, while instance normalization normalizes each sample individually. It can eliminate the differences in feature distribution between individual samples, making the model more robust to different samples. The instance normalization expression is as follows:
[0089] X norm =InstanceNorm(X)
[0090] In the formula: Xi X is the observed value in the sample; norm It is the normalized feature value; it is the index of the sample.
[0091] 2. Temporal Clustering Module (TCM)
[0092] In photovoltaic power generation forecasting, factors such as weather and equipment status may change over time, causing time distribution drift (TSD). To simulate heterogeneous time patterns caused by TDS, this paper designs a cluster of linear pattern extractors, where each linear pattern extractor extracts temporal features for time series with the same latent distribution. Furthermore, this paper designs a simple and effective distributed router that can extract the latent distribution of the current time series and determine the corresponding linear patterns. Both routing and extraction processes are channel-independent, focusing on univariate time series X based on distribution clustering. n,: ∈R T And fully extract its time pattern.
[0093] 2.1 Distributed Router
[0094] This paper first designs two encoders based on fully connected layers to adaptively capture each time series X. n,: ∈R T The M candidate latent distributions are given, where M represents the size of the linear pattern extractor cluster. The routing router structure is as follows: Figure 1 As shown.
[0095] Based on experience, this paper assumes that each time series follows an underlying normal distribution, which can be described as follows:
[0096]
[0097] In the formula: It is the weight matrix in a linear transformation. μ(X n,: ) is the sample data X n,: The mean; σ(X) n,: ) is the sample data X n,: The standard deviation.
[0098] Subsequently, this paper utilizes noise gating technology to select X. n,: We identify the k most likely distributions to which the distribution belongs and calculate their respective weights. Because the reparameterization technique used to measure the normal distribution is similar to the noise addition technique in noise gating, we combine them into a unified form:
[0099] Z n =Encoderμ(X n,:)+ε⊙Softplus(Encoder(X n,: ))
[0100] H(X n,: ) = W H ·Z n
[0101] In the formula: Z n It is a representation of the candidate latent distribution; Softplus(Encoderσ(X) n,: ε is the activation function for the standard deviation, used to ensure it is positive; ε is a noise term used to add randomness, enabling the model to better handle different patterns and variations during clustering. i ~N(0,1);H(X) n, ;) represents the projected weights of the distribution; H(X) n,: ), ε∈R M W H It is used to map to the weight space Z n The weight matrix, W H ∈R M×M .
[0102] Next, we select k (k < M) of the most likely latent distributions and calculate their weights:
[0103] G(X n,: =Softmax(KeepTopK(H(X)) n,: ),k))
[0104]
[0105] In the formula: where G(X) n,: )∈R k This represents the probability of each candidate distribution.
[0106] From a clustering perspective, time series X n,: ∈R T , n = 1, ..., N belong to the same k most likely latent distributions and tend to be processed by the same set of k linear pattern extractors.
[0107] 2.2 Linear Pattern Extractor
[0108] After that, X n,: The data is passed to k selected linear pattern extractors for temporal feature extraction. The linear pattern extractor structure is as follows: Figure 2 As shown.
[0109] For the i-th linear pattern extractor, we first extract X using the finite difference method. n,:The trend part is extracted using Discrete Wavelet Transform (DWT) to obtain X. n,: The minute-level fluctuations in the data are analyzed, features are extracted separately, and finally they are fused to better capture time series patterns from the same distribution.
[0110]
[0111] In the formula, The trend data was obtained through the difference method; It is the short-term fluctuation component extracted through wavelet transform; These are the weights learned by the model, used to fuse the short-term fluctuation and trend components respectively.
[0112] 2.3 Aggregator
[0113] After the selected linear pattern extractor outputs the corresponding features, the aggregator collects the time features based on the previously calculated weighted gate:
[0114]
[0115] In the formula, G(X) n,: ) i This represents the weight of the i-th linear pattern extractor. This represents X extracted through clustering based on a linear pattern extractor. n,: Temporal characteristics; acquiring each X in a channel-independent manner n,: After considering the time features of (n = 1, ..., N), these features are ultimately integrated into X. temp ∈R N×d middle.
[0116] 3-channel clustering module CCM
[0117] In photovoltaic (PV) power generation systems, PV power output is affected by the coupling effects of four variables: scattering, temperature, horizontal radiation, and wind speed. To identify the most meaningful channels for PV power output prediction from complex environmental and system signals, we designed an improved CCM module. By combining causal sparsity constraints and frequency domain attention, we can automatically filter and enhance key channels, thereby improving the accuracy and stability of PV power output prediction.
[0118] 3.1 Causal Sparsity Constraint Mechanism
[0119] Granger causality tests were used to assess the causal significance between the control variables and photovoltaic power generation in advance. There are four influencing factor channels; the original time series for the nth channel is h. n ∈R T First, perform a real Fourier transform (rFFT) on it and take the amplitude:
[0120]
[0121] In the formula, norm(·) represents an optional normalization operation that makes the spectral amplitudes of different channels comparable.
[0122] Subsequently, the Granger causality test was used to evaluate the causal significance of each channel on the photovoltaic power generation sequence, generating a binary causal mask matrix C∈{0,1}. N×N C ij =1 indicates that channel i has a significant causal effect on channel j.
[0123] Later, a learnable positive semidefinite matrix was introduced. Weighting the distances between channels using causal masks:
[0124] D ij =d(X) i,: ,X j,: )
[0125]
[0126] This metric assigns non-zero distance only to causally related channels, suppressing false similarities between invalid channels and improving the responsiveness of channel clustering to the true causal structure.
[0127] Then, construct the relationship strength matrix based on the weighted distance matrix D:
[0128]
[0129] In the formula, R ij It reflects the similarity strength of channels i and j in the frequency domain; the larger the value, the closer the relationship.
[0130] Parallel normalization to probability distribution:
[0131]
[0132] In the formula, γ acts as a parameter to control the smoothness of the connection probabilities, preventing excessive sparsity or excessive density. When γ→0, P ij It tends to retain only the channels with the highest similarity, while it tends to be uniformly distributed as γ→1.
[0133] 3.2 Frequency Domain Attention Enhancement Mechanism
[0134] To more effectively extract the periodic feature information of each influencing factor channel, we introduce a channel-specific attention mechanism in the frequency domain to enhance the model's ability to perceive the periodic changes of influencing factors.
[0135] We will analyze the spectrum of each channel. Channel-specific trainable filters input to trainable convolutional filters Extract the response of key frequency bands:
[0136]
[0137] In the formula, is the frequency domain convolution kernel for channel n, and the learned weights can be focused on specific frequencies; * denotes one-dimensional convolution; σ(·) is the Sigmoid activation function, which normalizes the convolution result to [0,1], forming the frequency domain attention mask G. n Highlight important frequency bands and suppress noise frequency bands.
[0138] Attention weights are then applied to the original spectrum.
[0139]
[0140] In the formula, ⊙ represents element-wise multiplication; the output is... The frequency-domain attention-weighted spectrum enhances the key periodic components.
[0141] Then, the inverse Fourier transform is used to restore it to its time-domain representation:
[0142]
[0143] The enhanced channel temporal features h' are obtained n This contains the periodic enhancement information of the original physical signal.
[0144] Through this mechanism, the model can more flexibly adjust its cyclical response to different influencing factors when predicting photovoltaic power generation, thereby improving the accuracy of short-term fluctuation prediction and medium- to long-term trend characterization.
[0145] 3.3 Dynamic Channel Clustering Mechanism
[0146] After causal enhancement and frequency domain enhancement, channel embedding features The input is a dynamic channel clustering module. It employs the Gumbel-Softmax strategy, based on the probability matrix P. ij Perform random sampling to obtain the channel mask:
[0147] M ij ≈Bernoulli(P ij ),M∈R N×N
[0148] In the formula, the Bernoulli sampling mechanism breaks the deterministic choice by introducing randomness, allowing the model to dynamically explore different channel combinations during training;
[0149] The final retained M ij The matrix preserves the deterministic representation of key channels while allowing for the accidental participation of secondary channels, thus enhancing model robustness. The channel selection process considers not only spatial similarity but also causal and frequency sensitivity, ensuring that the clustering results are more physically interpretable and predictive.
[0150] 4. Fusion Module (FM)
[0151] In photovoltaic (PV) power generation prediction, the Temporal Clustering (TCM) module and the Channel Clustering (CCM) module deconstruct complex operating conditions from two dimensions: temporal dynamics and variable interactions, respectively. The fusion module simultaneously captures the temporal autocorrelation characteristics of the target variable (temporal clustering patterns extracted by TCM) and the joint influence of the control variables (channel clustering features extracted by CCM). However, it suffers from modal fragmentation and noise sensitivity. Existing methods handle target and control variables independently, neglecting their cross-modal dynamic interactions; sensor noise in the control variables easily interferes with the robustness of PV power generation prediction.
[0152] To optimize predictions, a bidirectional spatiotemporal cross-attention and adaptive gating fusion mechanism is introduced to explicitly model the dynamic relationship between photovoltaic power generation and control variables, thereby improving prediction accuracy and adaptability to operating conditions, and enhancing the interpretability and robustness of the model.
[0153] 4.1 Spatiotemporal Cross-Attention Layer
[0154] This layer uses dual-path parallel attention to capture the temporal dimension and the cross-variable spatial correlation characteristics. A spatiotemporal cross-attention layer is constructed to jointly model the time-series pattern of photovoltaic power generation and the cross-channel influence of control variables.
[0155] (1) Temporal Cross-Attention: This method mines the correlation between channel features at different time steps. By applying attention weights along the time dimension, it filters out noise or redundant information in the channels and captures the time lag effect. The temporal cross-attention calculation is expressed as follows:
[0156] Q t =X temp ·W t Q K c =M·W c K V c =M·W c V
[0157]
[0158] In the formula, W t Q It is the projection matrix in the channel intersection attention block; W cK W c V ∈R d×d It is the projection matrix in the time-interlaced attention block; E pos ∈R T×d It is a learnable positional encoding that explicitly models temporal positional differences.
[0159] (2) Channel Cross-Attention: Identifying the influence weights of different channels on temporal evolution. Through channel attention, we focus on historical or future time points that significantly impact the current state, revealing the temporal evolution patterns under the combined effects of multiple channels. Channel cross-attention is expressed as:
[0160] Q c =M·W c Q K t =X temp ·W t K V t =X temp ·W t V
[0161]
[0162] In the formula, W c Q It is the projection matrix in the time-interlaced attention block; W t K W t V ∈R d×d It is the projection matrix in the channel intersection attention block.
[0163] 4.2 Dynamic Gating Fusion
[0164] By employing dual clustering along both the time and channel dimensions, temporal and channel attention weights are adaptively assigned based on input features to suppress noise interference. A dynamic gating mechanism is then used for fusion. The dynamic fusion is expressed as:
[0165] G=σ(W g [Attn temp Attn chan ]+b g )
[0166] X mix =G⊙Attn temp +(1-G)⊙Attn chan
[0167] X final =LayerNorm(X mix +X temp)
[0168] In the formula, σ is the Sigmoid activation function, which compresses the linear transformation result to the interval [0, 1]. This is the weight matrix, used to map the input features X to the gate space; This is a bias term used to adjust the baseline of the linear transformation, preventing gating failure when all features are zero; X mix ∈R N×dis The fusion features are represented by the element-wise multiplication method. LayerNorm is used for residual connection and normalization to preserve the original photovoltaic power generation characteristics, prevent information loss, and ensure stability and robustness, thereby optimizing the representativeness and training efficiency of the fusion module.
[0169] When the control variable noise is significant, G→1, and the model relies on the autocorrelation time series pattern of photovoltaic power generation; when the control variable is closely related to photovoltaic power generation, G→0, and the model focuses on cross-channel interaction features. Thus, dynamic gating fusion is achieved by adaptively adjusting the attention weights based on the input features.
[0170] Finally, linear projection is used to obtain the future values:
[0171]
[0172] Among them W O ∈R d×F , is a linear projection weight matrix that maps d-dimensional fused features to an F-dimensional prediction space; This represents the predicted photovoltaic power generation for N samples over the next F time steps.
[0173] 5DUET dynamic prediction model
[0174] 5.1 Overall Framework
[0175] The overall framework of the DUET dynamic prediction model is as follows: Figure 3 As shown, the model consists of four main modules. First, the raw data is processed by the instance normalization module, decomposed into multiple sub-time series data, and then input into the time clustering module (TCM) and channel clustering module (CCM) for deconstruction in two dimensions: time dynamics and variable interaction. Then, it passes through the fusion module (FM), which introduces a bidirectional spatiotemporal cross-attention and adaptive gating fusion mechanism to reflect the dynamic correlation between photovoltaic power generation and control variables, and obtain the prediction results.
[0176] This invention addresses the accuracy problem in predicting photovoltaic (PV) power generation in dynamic environments by proposing a DUET PV power generation prediction model based on a time-based clustering module (TCM) and a channel-based clustering module (CCM). Through numerical examples, this model demonstrates superior error evaluation metrics and better prediction performance compared to general nonlinear PV power generation prediction models. The PV power generation prediction results are shown in the figure below. Figure 4 As shown. The specific effect is as follows:
[0177] (1) The Time Clustering Module (TCM) designed a simple and effective distribution router to extract the potential distribution of the current time series and determine the corresponding linear pattern, thereby better capturing different time change patterns and solving the problem of increased prediction error caused by time distribution drift.
[0178] (2) The Channel Clustering Module (CCM) processes the complex correlations between channels, preserves the information flow between useful channels, filters out noisy channels, and solves the problem of reducing model accuracy by simply assuming that channels are independent of each other.
[0179] (3) The fusion model selectively, dynamically and adaptively integrates time-varying features and channel dependencies, which enhances prediction performance and ensures efficiency and robustness.
[0180] Figure 5 This is a flowchart illustrating the overall framework of the present invention.
[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion, characterized in that: include: S10: Perform instance normalization processing on historical photovoltaic power generation data and control variable data to obtain normalized time series data; S20: Process the normalized time-series data through the Time Clustering Module (TCM), including: S21: Extracting univariate time series X using a distributed router n,: ∈R T The latent normal distribution parameters are used to generate the weights G(X) of k candidate distributions. n,: )∈R k ; S22: Based on the weight G(X) n,: ), X n,: The input is fed into k linear pattern extractors to extract trend features. With fluctuation characteristics And merged into time features S23: Aggregate the outputs of all linear pattern extractors to generate the global temporal feature X. temp ∈R N×d ; S30: Process control variable data through the Channel Clustering Module (CCM), including: S31: Regarding the control variable h n ∈R T Perform a real Fourier transform to obtain the frequency domain features. S32: Generate a causal mask matrix C∈{0,1} based on Granger causality test. N×N C, combined with learnable matrices Calculate the weighted distance D ij ; S33: Enhance key frequency band features through a frequency domain attention mechanism to obtain enhanced channel features h' n ; S34: Based on probability matrix P ij Dynamic sampling channel mask M ij Filter valid channels; S40: The global time feature X is jointly processed by the fusion module FM. temp With enhanced channel features M, including: S41: Calculate temporal attention Attn separately using a bidirectional spatiotemporal cross-attention mechanism. temp With channel attention Attn chan ; S42: Generate fused features X by fusing two types of attention outputs through dynamic gating G. final ; S50: The fusion feature X final Input a linear projection layer, output predicted photovoltaic power generation.
2. The DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion as described in claim 1, characterized in that: In step S21, the operation of the distributed router includes: Calculate the mean μ(X) n,: ) = ReLU(X n,: ·W0 μ )·W1 μ With standard deviation σ(X) n,: ) = ReLU(X n,: ·W0 σ )·W1 σ ; Generate candidate distribution representation Z n =μ(X) n,: )+ε⊙Softplus(σ(X n,: )), where ε ~ N(0,1); Choose the Top-k distribution weights G(X) n,: =Softmax(KeepTopK(H(X)) n,: ),k)), where H(X n,: ) = W H ·Z n , W H ∈R M×M .
3. The DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion as described in claim 1, characterized in that: In step S22, the operation of the linear pattern extractor includes: Extracting trend features: Extracting fluctuation features: Feature fusion: in This is a learnable weight matrix.
4. The DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion as described in claim 1, characterized in that: In S32, the formula for calculating the weighted distance is: Where C ij =1 indicates that there is a Granger causal relationship between channel i and channel j.
5. The DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion as described in claim 1, characterized in that: In S33, the operation of the frequency domain attention mechanism includes: Generate a frequency domain attention mask: in Let be the convolution kernel with channel n, representing a one-dimensional convolution; Enhanced spectral characteristics: Inverse transform to the time domain:
6. The DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion as described in claim 1, characterized in that: In S41, the calculation of bidirectional spatiotemporal cross-attention includes: Intertemporal attention: where Q t = X temp · W t Q , K c = M · W c K , V c = M · W c V ; Cross-channel attention: Among them, Q c = M·W c Q , K t = X temp ·W t K , V t = X temp ·W t V .
7. The DUET photovoltaic power generation prediction method based on spatiotemporal dual clustering and dynamic gating fusion as described in claim 1, characterized in that: In S42, the calculation formula for dynamic gating fusion is: G=σ(W g [Attn temp ;Attn chan ]+b g ) X mix =G⊙Attn temp +(1-G)⊙Attn chan X final =LayerNorm(X mix +X temp ) in, Let b be the weight matrix. g This is a bias term.
8. A DUET photovoltaic power generation prediction system based on spatiotemporal dual clustering and dynamic gating fusion, characterized in that: include: The data preprocessing unit is used to perform instance normalization on the input data; Temporal clustering apparatus, comprising: A distributed router is configured to extract the distribution parameters of the time series and generate k candidate distribution weights through two fully connected layers. A linear pattern extractor cluster consists of k parallel extractors, each of which processes the trend and fluctuation components using the difference method and wavelet transform, respectively. An aggregator is used to weight and fuse the outputs of the extractor cluster; Channel clustering device, comprising: The causal sparsity constraint module is configured to calculate the weighted distance between channels based on Granger causality tests and the learnable matrix Q. Frequency domain attention module, containing channel-specific convolutional filters Used to enhance key frequency band characteristics; The dynamic clustering module generates a channel mask M through Gumbel-Softmax sampling. ij ; The fusion device includes: A bidirectional spatiotemporal cross-attention layer is used to calculate cross-attention in the time dimension and the channel dimension, respectively. The dynamic gating unit fuses two types of attention outputs through Sigmoid gating; The prediction output unit is configured to linearly project the fused features into predicted power generation values.
9. The DUET photovoltaic power generation prediction system based on spatiotemporal dual clustering and dynamic gating fusion as described in claim 8, characterized in that: The circuit structure of the distributed router includes: The first fully connected layer group, input X n,: And output μ(X) n,: ), including the weight matrix and The second fully connected layer group, input X n,: And output σ(X) n,: ), including the weight matrix and A noise injection unit is used to generate random noise ε that satisfies the N(0,1) distribution; The Top-k selector is configured to retain the k distributions with the highest probabilities.
10. The DUET photovoltaic power generation prediction system based on spatiotemporal dual clustering and dynamic gating fusion according to claim 8, characterized in that: The hardware implementation of the bidirectional spatiotemporal cross-attention layer includes: The core of time-cross attention calculation includes the projection matrix W. t Q , and programmable position encoder E pos ; The core of channel cross-attention calculation includes the projection matrix. W t K W t V ; Parallel computing architecture for simultaneously performing attention computations in both time and channel dimensions.
Citation Information
Cited By
Regional distributed photovoltaic power prediction method and system based on multivariate data cross-modal fusion
CN121637430A