A dual-channel wind power generation prediction method and system

By employing a dual-channel wind power prediction method, utilizing the gradient-aware EMA algorithm and improved Mamba, LSTM modules, and multi-head cross-attention mechanisms, the shortcomings of traditional models in data smoothing, adaptation, and feature fusion are addressed, thereby improving the accuracy and stability of wind power prediction.

CN120414534BActive Publication Date: 2025-10-28NANCHANG INST OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510905922.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-10-28
Estimated Expiration
2045-07-02

AI Technical Summary

Technical Problem

Traditional wind power prediction models have shortcomings in data smoothing and noise reduction, adaptive capabilities, spatiotemporal feature fusion, and utilization of the advantages of multiple models, resulting in incomplete feature extraction and affecting prediction accuracy.

Method used

A dual-channel wind power generation prediction method is adopted. Data is processed by the gradient-aware exponential moving average (EMA) algorithm, combined with an improved Mamba module and LSTM module, and a multi-head cross-attention mechanism and FFN feedforward network are introduced to achieve adaptive feature fusion and prediction.

Benefits of technology

It significantly improves the data smoothing and noise reduction effect, enhances the model's robustness to noise, improves the ability to capture temporal features and prediction accuracy, and achieves more comprehensive feature extraction and fusion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120414534B_ABST
    Figure CN120414534B_ABST
Patent Text Reader

Abstract

This invention discloses a dual-channel wind power generation prediction method and system. The method includes: acquiring time-series power load data, and processing the time-series power load data according to a preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time-series data; inputting the target power load time-series data into a pre-built Mamba module and an LSTM module, respectively, with the Mamba module outputting a first result and the LSTM module outputting a second result; inputting the first result and the second result into a multi-head cross-attention mechanism for adaptive adjustment, and outputting the final prediction result via an FFN feedforward network. This significantly improves the accuracy and stability of wind power generation prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of wind power generation prediction technology, and particularly relates to a dual-channel wind power generation prediction method and system. Background Technology

[0002] In wind power forecasting technology, the traditional EMA function performs poorly in data smoothing and noise reduction, lacks adaptability, and struggles to effectively handle noise and outliers in the data. Furthermore, the existing Mamba module design is relatively simple and cannot fully capture complex patterns and long-term dependencies in the data, limiting the model's ability to capture temporal features. Moreover, the traditional LSTM module is inefficient in handling spatiotemporal feature fusion and lacks utilization of frequency domain information, resulting in the model's inability to comprehensively consider various influencing factors in wind power data. Additionally, single-channel model architectures cannot fully leverage the advantages of different models, leading to incomplete feature extraction. Summary of the Invention

[0003] This invention provides a dual-channel wind power generation prediction method and system to solve the technical problem that a single-channel model architecture cannot fully utilize the advantages of different models, resulting in incomplete feature extraction.

[0004] In a first aspect, the present invention provides a dual-channel wind power generation prediction method, comprising:

[0005] Acquire power load time-series data and process the power load time-series data according to the preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time-series data;

[0006] The target power load time series data is input into a pre-built Mamba module and an LSTM module, respectively. The Mamba module outputs a first result, and the LSTM module outputs a second result.

[0007] The first and second results are input into a multi-head cross-attention mechanism for adaptive adjustment, and the final prediction result is output via an FFN feedforward network.

[0008] Secondly, the present invention provides a dual-channel wind power generation prediction system, comprising:

[0009] The processing module is configured to acquire power load time-series data and process the power load time-series data according to a preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time-series data.

[0010] The output module is configured to input the target power load time-series data into a pre-built Mamba module and an LSTM module, respectively. The Mamba module outputs a first result, and the LSTM module outputs a second result.

[0011] The adjustment module is configured to input the first result and the second result into a multi-head cross-attention mechanism for adaptive adjustment, and output the final prediction result via an FFN feedforward network.

[0012] Thirdly, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of the dual-channel wind power prediction method of any embodiment of the present invention.

[0013] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor performs the steps of the dual-channel wind power generation prediction method of any embodiment of the present invention.

[0014] This application presents a dual-channel wind power prediction method and system. It introduces an adaptive gradient-aware EMA function, which significantly improves data smoothing and noise reduction by dynamically adjusting the smoothing coefficient, enhancing the model's robustness to noise. The Mamba module is improved by extracting short-, medium-, and long-term information from the data through convolution and performing feature fusion. Forward and reverse Mamba modules and a chaotic oscillation gating mechanism are also introduced to enhance the model's ability to capture temporal features and its dynamic feature fusion capabilities. The LSTM module is improved by using spatiotemporal head partitioning and frequency domain enhancement to improve the efficiency of spatiotemporal feature fusion and enhance the model's ability to capture periodic features using frequency domain information. Finally, a dual-channel model architecture is adopted, combining the advantages of the Mamba and LSTM modules to achieve more comprehensive feature extraction and fusion. A multi-head cross-attention mechanism is also introduced to further optimize feature weights, significantly improving prediction accuracy. Attached Figure Description

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

[0016] Figure 1A flowchart of a dual-channel wind power generation prediction method provided in an embodiment of the present invention;

[0017] Figure 2 A gradient-aware exponential moving average (EMA) function smoothing data flow diagram is provided for one embodiment of the present invention;

[0018] Figure 3 A flowchart of the Mamba module workflow of a specific embodiment of the present invention is provided;

[0019] Figure 4 A flowchart illustrating the structure of an LSTM module according to a specific embodiment of the present invention;

[0020] Figure 5 This is a structural block diagram of a dual-channel wind power generation prediction system provided in an embodiment of the present invention;

[0021] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0023] Please see Figure 1 The diagram shows a flowchart of a dual-channel wind power generation prediction method according to this application.

[0024] like Figure 1 As shown, the dual-channel wind power generation prediction method specifically includes the following steps:

[0025] Step S101: Obtain power load time series data, and process the power load time series data according to the preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time series data.

[0026] In this step, please refer to Figure 2 Obtain power load time series data, normalize the power load time series data, and scale the power load time series data to the [-1,1] interval;

[0027] The optimal smooth window size is determined by a window selection function, with the window range set to [3,5]. The information entropy of each window is calculated, and the window size with the minimum information entropy is selected as the final target window.

[0028] Calculate the standard deviation of the data within the target window and the gradient variance of the model parameters, and then calculate the dynamically adjusted smoothing coefficient based on the standard deviation of the data and the gradient variance of the model parameters. The expression is as follows:

[0029] ,

[0030] In the formula, The dynamic smoothing coefficient is the core parameter of the EMA. For time steps, The standard deviation of the data within the current window is used to measure data volatility. The gradient variance of the model parameters is used to measure the model's update state. As a sensitivity adjustment factor, This is a smoothing term used to prevent the denominator from being zero. It is the hyperbolic tangent function;

[0031] The smoothing coefficient is dynamically adjusted using the tanh function. Limiting the load to the interval [0, 0.96] and recursively calculating the EMA, the smoothed target power load time series data is obtained. The expression for recursively calculating the EMA is:

[0032] ,

[0033] In the formula, This is the exponential moving average calculated at time step t. This is the input value for the current time step, i.e., the raw data at time point t. This is the exponential moving average calculated at time step t-1, which is the exponential moving average of the previous time step.

[0034] In step S102, the target power load time series data is input into the pre-built Mamba module and LSTM module respectively. The Mamba module outputs a first result, and the LSTM module outputs a second result.

[0035] In this step, a dual-channel structure is adopted, consisting of an improved Mamba module and a spatiotemporally decoupled multi-head LSTM module, which are combined with a multi-head cross-attention mechanism to achieve adaptive fusion.

[0036] The Mamba module extracts multi-scale temporal features through three layers of depthwise separable convolutions with different dilation rates, and utilizes a learnable linear weighted fusion mechanism to dynamically adjust these features. The module employs bidirectional state-space mapping (forward and backward) and innovatively introduces a chaotic oscillation gating mechanism based on Lorenz dynamics to achieve time-step-level dynamic gating fusion, effectively capturing non-stationary dynamics and long-term dependencies. The fused features are further abstracted through residual convolutions and feedforward networks, supporting efficient temporal modeling and prediction.

[0037] The LSTM module first performs basic LSTM encoding on the input, then divides the features into temporal and spatial heads based on the number of heads, independently modeling temporal dependencies and feature interactions respectively. The temporal head dynamically strengthens local temporal correlations through an autocorrelation matrix combined with a learnable decay factor; the spatial head uses a gating mechanism to filter important feature interactions, improving spatial dependency modeling capabilities. This module also introduces frequency domain features, extracting periodic information through Fast Fourier Transform, and fusing spatiotemporal and frequency multi-domain features to enhance the capture of complex periodic and multi-scale changes.

[0038] The two-channel outputs are dynamically weighted and fused through a multi-head cross-attention mechanism module to achieve adaptive adjustment of the importance of features at different time steps.

[0039] Traditional Mamba modules typically rely on single-timescale features, making it difficult to effectively capture multi-scale dynamics and lacking adaptability to non-stationary sequences. Traditional LSTM modules are prone to gradient vanishing in long sequences and cannot adequately separate spatiotemporal features, resulting in insufficient modeling of short-term dependencies and spatial relationships. Traditional single-channel prediction methods struggle to balance long-term and short-term dependencies, have limited fusion capabilities, and affect prediction accuracy. This invention employs a dual-channel structure, combining an improved multi-scale Mamba module with chaotic gating to enhance long-term dependency capture and dynamic adaptation capabilities; simultaneously, The module employs a spatiotemporal decoupling multi-head design and frequency domain feature enhancement for short-term and spatial dependency modeling. Dual-channel collaborative fusion achieves complementary long-term and short-term features, adaptively adjusting weights to significantly improve the model's expressive power and predictive accuracy, overcoming the limitations of traditional single-channel methods.

[0040] Specifically, the improved Mamba module first performs three depthwise separable convolutions with different dilation rates on the input sequence to generate multi-scale features; then it utilizes learnable weights. Linear weighting of features at each scale is applied along the channel dimension to obtain a unified time-frequency fusion representation. Subsequently, the module computes the forward and reverse state-space mappings in parallel (implemented by forward and reverse Mamba sub-units, respectively) to simultaneously capture forward and reverse dependency information. To achieve adaptive trade-offs for non-stationary dynamics, this module introduces chaotic oscillation gating: a chaotic signal with a time step length is generated iteratively through the Lorenz dynamical system, projected into two gating coefficient sequences, achieving time-wise dynamic weighted fusion of forward and reverse features, and outputting the final long-range representation vector.

[0041] Please see Figure 3 The workflow is as follows:

[0042] Input data: The Mamba module receives data in the form of a three-dimensional array, with the following shape: (B batch size × T time step length × D feature dimension). That is, each input sample includes data from several time steps and multiple features (such as wind speed, temperature, etc.).

[0043] Multi-scale convolution for feature extraction: for input data with shape Three parallel depthwise Conv1D modules are employed, using kernels with dilation rates of 1, 2, and 4, respectively, with a fixed size of 3. By varying the dilation rate, these kernels can capture contextual dependencies at different scales in the time series, expanding the receptive field from 3 to 9, covering mid- to long-term sequence dynamics, while maintaining consistent computational complexity. Depthwise separable convolution allows each channel to operate independently, avoiding redundancy between channels and improving parameter efficiency. The feature tensor output by each convolution module, i.e., the shape of the output data, is... , representing the temporal features at the corresponding scale, to achieve efficient feature extraction at multiple scales.

[0044] Note: Each group corresponds to a different inflation rate (1, 2, 4), and the output of each convolutional group will generate a different feature tensor.

[0045] Learnable Scale Fusion: After completing multi-scale convolutional feature extraction, the model obtains three sets of feature tensors with different temporal receptive fields. The data shapes are [batch size, time step length, feature dimension (1, 2, 3)], representing short-term (dilation=1), medium-term (dilation=2), and long-term (dilation=4) temporal dependency information, respectively. Specifically, the model equips the output of each convolutional channel with two trainable scalar parameters: (Weighting coefficients) and (Bias term). The fusion process is as follows:

[0046] ,

[0047] In the formula, Indicates the first Feature maps obtained by convolution at each scale These are weighting coefficients, controlling their contribution during the fusion process. is the bias term, and It is obtained through automatic learning and optimization during the model training process;

[0048] all and The parameters are automatically optimized during training to minimize the final prediction error. Here is the output data. The shape is The feature dimension here =Feature Dimensions +Feature Dimension +Feature Dimension .

[0049] Bidirectional Mamba state mapping: After completing multi-scale feature fusion, the model obtains a unified time-series feature tensor shape. The forward path transforms the features at each time step through the Hierarchical Mamba submodule (implemented as a Dense layer) to capture the causal dependencies of the sequence.

[0050] Forward module calculation:

[0051] ,

[0052] In the formula, This represents the input features at the current time step. It is a weight matrix, which is learned. It's a bias term, learned. It is an activation function, using the GELU activation function to introduce a nonlinear transformation.

[0053] Therefore, the positive output form is: .

[0054] The reverse path first inverts the time dimension of the input sequence, then processes it through the Memory Efficient Mamba module (also a Dense layer), and finally inverts the output back to align it with the forward output. The reverse path models the current state from a future perspective, supplementing the lagged, anti-causal, and periodic information that the forward path struggles to capture, thus enhancing the model's ability to express complex temporal structures.

[0055] Reverse module calculation:

[0056] ,

[0057] In the formula, This represents the input features at the current time step after the reversal.

[0058] Therefore, the reverse output form is: .

[0059] A chaotic oscillator generates a gated signal: a Lorenz chaotic system is introduced to generate a dynamic gated signal for each time step, used for adaptive fusion of positive and negative features. First, a three-dimensional state vector is initialized for each sample. Here, we take the vector (1, 1, 1) as the initial state of the Lorenz system; then we use its discrete iterative equations:

[0060] ,

[0061] In the formula, , , For Lorenz system parameters, set them as hyperparameters or trainable parameters; The time step is typically 0.01; each sample iterates independently, generating a chaotic trajectory of length L, which is the total length of the samples. This generated chaotic trajectory of length L is the chaotic signal. Therefore, the output vector is... , (1, 2, ..., L), resulting in a total of L time series.

[0062] Gated projection and weighted decomposition:

[0063] After generating the chaotic signal in the previous step, this step introduces a lightweight gated projection mechanism to transform the signal into gated weights that can be used for fusion of forward and backward features. The model feeds it into a fully connected layer (DenseLayer), projecting the chaotic signal at each time step into a vector of length 2:

[0064]

[0065] in, and The sigmoid function, being a learnable parameter, restricts its output to the (0,1) interval to ensure its interpretability and stability as a weight coefficient. These two outputs represent the gating strengths of the forward and backward features at the current time step, respectively, thus yielding the corresponding values ​​for each time step. .

[0066] Time-step dynamic fusion: After generating the gating weights, this step is responsible for performing time-step adaptive fusion of the bidirectional features. At each time step... The model already has positive feature representations. Reverse feature representation and the corresponding gating coefficient , The fusion operation is as follows:

[0067] ,

[0068] In the formula, For element-wise multiplication, , These are the gating coefficients for the positive and negative features at time step t, respectively. The feature representation after fusion at time step t, For the positive features obtained by the Mamba module on the positive path at time step t, This represents the reverse characteristics obtained by the reverse path Mamba module at time step t.

[0069] This operation is performed over the entire sequence length, with independent computation at each time step, resulting in a unified, fused feature sequence with the following shape: .

[0070] The core advantage of this fusion strategy lies in its "time-step adaptiveness." Unlike traditional static weighting (such as 0.6 / 0.4) or fixed residual structures, this method can select the most reliable feature sources for different time steps based on changes in the chaotic state. For example, in abrupt change regions, it may rely more on forward features with short-term changes; while in stable regions, it may place greater emphasis on capturing periodic reverse features.

[0071] Outputting long-range representations: The fused temporal features are first fed into the MambaEncoder module, which includes a DepthwiseConv1D convolution layer to extract local patterns from adjacent time steps, and a two-layer Dense feedforward network (GELU activation) for nonlinear transformation. LayerNorm and residual connections ensure numerical stability. The processed features retain the original time-step structure. Subsequently, the model flattens the three-dimensional tensor into a two-dimensional vector and generates the prediction result through the Dense output layer, completing the transformation from feature fusion to the final output. At this point, the output dimension is the same as the input data dimension, so the shape of the output data is... This step enables in-depth processing of the fused features and alignment with the task objectives.

[0072] Furthermore, in the LSTM module, the data first undergoes basic temporal encoding, and then is decomposed into a temporal header and a spatial header through multi-head feature partitioning, performing temporal dependency modeling and spatial feature interaction modeling respectively. Simultaneously, the original input data undergoes frequency domain enhancement feature extraction, enhancing and capturing periodic features in the frequency domain. Finally, in the spatiotemporal frequency domain fusion processing step, the features obtained from the temporal header, spatial header, and frequency domain enhancement feature extraction are fused together to form a unified feature representation, which is then processed through output mapping to generate the final result.

[0073] Please see Figure 4 The workflow is as follows:

[0074] Basic temporal coding: This process receives input time-series data and performs preliminary feature extraction and encoding using a basic LSTM layer. The LSTM layer dynamically selects and retains key information from the input sequence through gating units, capturing short-term dependencies and local trends in the data. The output features at each time step contain encoded temporal information. The encoded output dimension is the single-head feature dimension (d) multiplied by the total number of heads (d). This product lays the foundation for subsequent processing. This step can be formally represented as: ,in (B batch size × T time step length × D feature dimension) is the input sequence. This is the encoded high-dimensional time-series feature data.

[0075] Multi-head feature partitioning: The features after basic encoding are subjected to structured processing. The total number of heads is... The single-head feature dimension is The total feature dimension is Divide it into A time modeling head and A spatial modeling head, satisfying In the last dimension of time-series feature data ( The temporal feature tensor is segmented on the data, which separates temporal information from feature interaction information. and spatial feature tensor .

[0076] Temporal head dependency modeling: First, convert the temporal head feature tensor into a... Remodeling Calculate the first-time autocorrelation matrix for each time step modeling head. This is to calculate the correlation between time steps. A learnable time decay factor vector is introduced. ,and Element-wise multiplication and summation yield the time-domain energy characteristics. , shape is ,in, For time feature tensor The result obtained after reshaping / rearranging (swapping the two middle dimensions), Represented as The transpose of express product, Represents matrix multiplication. Indicates all vector;

[0077] The decay factor vector is a learnable parameter used to control the dependencies between time steps. It helps the model assign different weights to the correlations between different time steps when modeling time series. By learning the decay factor, the model can flexibly determine which dependencies between time steps are more important and which can be ignored.

[0078] Interactive modeling of spatial head features: Modeling spatial head feature tensors Remodeled into For each spatial model head, calculate the autocorrelation matrix. , here Represented as The transpose of . In calculating the spatial energy tensor, this is to obtain spatial dependency information by calculating the correlation strength of each time head.

[0079] The calculation formula is ,in This indicates that a maximum value operation is performed on the last dimension, with the shape being... A gating network is introduced to process the original spatial head features. Perform dynamic gating weight prediction: ,in for Activation function , All parameters are learnable. Finally, the spatial energy tensor is multiplied element-wise with the gating weights to obtain the weighted spatial dependency features. , shape is This enables accurate modeling of the interactions between feature variables. Among them, and It will first be initialized with initial values ​​by the model.

[0080] Then, during the forward propagation of the model, the spatial head feature tensor It will pass by and A linear transformation is defined, and then the Sigmoid activation function is applied to generate the gated weights G.

[0081] Next, the model's output is compared with the true target value, and the prediction error or loss is calculated using the loss function.

[0082] Then, the backpropagation algorithm starts from the loss function and calculates the loss on all model parameters (including...). and The gradient of ).

[0083] Finally, the optimizer will adjust the gradient based on its direction and magnitude, as well as possible hyperparameters such as the learning rate. and The value of is determined to minimize the prediction error.

[0084] Frequency domain enhanced feature extraction: for high-dimensional time series feature data conduct Transformation yields the frequency domain. and take the frequency domain The real part is used as the frequency domain feature tensor ,in, Number of frequency components to be retained;

[0085] The frequency domain feature tensor is transformed through a linear projection layer. The feature dimension is transformed to a dimension consistent with the spatiotemporal feature output, resulting in... , This indicates a projection operation, which is about to begin. Projected to And segmented according to the multi-head division standard. Time-modeled frequency domain features are obtained and spatial modeling frequency domain features ;

[0086] Spatiotemporal frequency domain fusion processing: combining time-domain energy features Frequency domain features modeled with time Element-wise multiplication yields the time-enhanced features. and the spatial energy characteristics Frequency domain characteristics of spatial modeling Element-wise multiplication yields spatially enhanced features. Then, the temporal augmentation features and spatial augmentation features are concatenated along the feature dimension to form a fused feature tensor. The second result is obtained by outputting the result through a fully connected neural network.

[0087] Output mapping and result generation: First, the fused spatiotemporal frequency feature tensor... A fully connected neural network (FFN) is applied for nonlinear transformation and feature reconstruction. The first layer of the FFN is... ,in , For learnable parameters, Activation functions enhance the nonlinear expressive power of features. The second layer is... This further abstracts the features. Finally, a linear output layer maps the features to the target prediction dimension. Finally, the second result is output.

[0088] Step S103: Input the first result and the second result into the multi-head cross-attention mechanism for adaptive adjustment, and output the final prediction result through the FFN feedforward network.

[0089] In this step, the introduced multi-head cross-attention mechanism establishes an adaptive fusion mechanism between the outputs of different modules (e.g., the Mamba module and the LSTM module in this invention), which can dynamically adjust the weights of the outputs of different modules according to the data characteristics of each time step.

[0090] Multi-head cross-attention mechanism workflow:

[0091] Input data: The input data for the multi-head cross-attention mechanism comes from the outputs of two different modules: the Mamba module output S. This represents the feature that captures dependencies. The LSTM module outputs I. , representing the feature of capturing dependencies.

[0092] Feature Mapping and Spatial Transformation: The multi-head cross-attention mechanism first linearly maps the output features of the Mamba and LSTM modules to multiple different feature subspaces (called multiple "attention heads") to obtain Q, K, and V. Here, n1 attention heads are used to process the output of the Mamba module, and each head processes a feature dimension of m, so n1×m=D; similarly, n2 attention heads are used to process the output of the LSTM module, and each head processes a feature dimension of m, so n2×m=D.

[0093] Here, Q, K, and V are calculated as follows:

[0094] Q stands for Query, representing the query requirement of the current task. It comes from the output of the Mamba module and is calculated using the following formula: , The linear transformation for the query is of the form: .

[0095] K represents the key, used to calculate similarity with the query. It comes from the output of the LSTM module, and the calculation formula is: , For linear transformations of the bond, in the form of: .

[0096] V stands for Value, which is the feature associated with the key. It also comes from the output of the LSTM module and is used for weighted summation to generate the final output feature. The calculation formula is as follows: , A linear transformation of the value, in the form of: .

[0097] Note: The purpose of these linear projections is to align features from different modules so that they can interact effectively in the attention mechanism, calculate dynamic attention weights, and generate weighted output features.

[0098] Calculating query-key similarity: The similarity between a query and a key is calculated using a dot product. This step is central to the attention mechanism because it helps the model determine the strength of the relationship between the query at each time step and the keys at other time steps. The calculation formula is as follows:

[0099]

[0100] The shape of the calculated similarity matrix is: There are two T's here, representing the similarity between each query and the keys of all other time steps.

[0101] Note: Through the dot product operation, the higher the similarity score between the query and the key, the stronger the correlation between them. In this way, the model can determine which features at which time steps are more important to the current task by calculating the similarity between each query and all keys.

[0102] Normalized attention weights: through The function normalizes the calculated similarity scores, converting them into attention weights. This results in higher similarity scores receiving higher weights, and lower similarity scores receiving lower weights. Normalization formula:

[0103] ,

[0104] It is the normalized attention weight, representing the importance of each key to the query.

[0105] It is the similarity score between the query and the key.

[0106] Normalize all keys so that the sum of the weights is 1.

[0107] Normalized attention weight shape: This represents the weighted relationship between each query and all keys.

[0108] Calculate the weighted output: using normalized attention weights The values ​​are weighted and summed to obtain the final output feature. The calculation formula is: Weighted output shape: The results from each head will be pieced together to obtain a shape that is The output of multiple attention combinations is in the form of... .

[0109] It should be noted that FFN performs deep nonlinear transformations on the input data through multiple fully connected layers (Dense layers), helping the network learn complex feature representations. The FFN module maps in the feature space and can extract high-order features from the data through multi-level nonlinear activation functions, thereby enhancing the model's expressive power and improving prediction accuracy.

[0110] The first result and the second result are input into a multi-head cross-attention mechanism, which fuses the first result and the second result to obtain the target feature;

[0111] The target features are input into the first fully connected layer and mapped to a new feature space through a linear transformation, yielding the first output result after the linear transformation. The expression for the linear transformation mapping is as follows:

[0112] ,

[0113] In the formula, This is the first output result. This is the input data for the first fully connected layer. This is the weight matrix of the first fully connected layer. This is the bias vector of the first fully connected layer;

[0114] The first output result is processed After activation function processing, the result is input to the second fully connected layer, where a nonlinear transformation is performed on the first output to obtain the second output, expressed as:

[0115] ,

[0116] In the formula, This is the second output result. This is the weight matrix of the second fully connected layer. This is the bias vector for the second fully connected layer;

[0117] The second output is input into the third fully connected layer, and the second output is feature-mapped to obtain the final prediction result, expressed as:

[0118] ,

[0119] Where, This is the weight matrix of the third fully connected layer. This is the bias vector for the third fully connected layer.

[0120] Note: The first two fully connected layers of the FFN module not only perform non-linear processing on the input data but also feature compression. By adjusting the output dimension layer by layer, FFN can effectively compress redundant information and retain the most important features, thereby improving the model's generalization ability. The final output layer of FFN (dense3) compresses all feature information in the network into a single scalar value, which is the final prediction result. In time series prediction tasks, this layer converts the model's internal feature representation into actual predicted values, such as future wind power generation.

[0121] In summary, the method in this application improves prediction accuracy by using an improved LSTM module to capture short-range dependencies and an improved Mamba module to extract long-range dependencies, supplemented by a multi-head cross-attention mechanism for adaptive fusion, and combined with a gradient-aware exponential moving average (EMA) function to more effectively smooth the raw data during the data preprocessing stage. This significantly improves the accuracy and stability of wind power generation prediction.

[0122] Please see Figure 5 The diagram shows a structural block diagram of a dual-channel wind power generation prediction system according to this application.

[0123] like Figure 5 As shown, the dual-channel wind power generation prediction system 200 includes a processing module 210, an output module 220, and an adjustment module 230.

[0124] The processing module 210 is configured to acquire power load time series data and process the power load time series data according to a preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time series data; the output module 220 is configured to input the target power load time series data into a pre-built Mamba model and an LSTM model respectively, wherein the Mamba model outputs a first result and the LSTM model outputs a second result; the adjustment module 230 is configured to input the first result and the second result into a multi-head cross-attention mechanism for adaptive adjustment, and output the final prediction result via an FFN feedforward network.

[0125] It should be understood that Figure 5 The modules and references described in the document Figure 1The steps described in the text correspond to those in the method described above. Therefore, the operations, features, and corresponding technical effects described above also apply to the method described in the text. Figure 5 The various modules in the document will not be described in detail here.

[0126] In other embodiments, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the program instructions are executed by a processor, the processor performs the dual-channel wind power generation prediction method in any of the above method embodiments.

[0127] In one embodiment, the computer-readable storage medium of the present invention stores computer-executable instructions, which are configured as follows:

[0128] Acquire power load time-series data and process the power load time-series data according to the preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time-series data;

[0129] The target power load time series data is input into a pre-built Mamba model and an LSTM model, respectively. The Mamba model outputs a first result, and the LSTM model outputs a second result.

[0130] The first and second results are input into a multi-head cross-attention mechanism for adaptive adjustment, and the final prediction result is output via an FFN feedforward network.

[0131] Computer-readable storage media may include a stored program area and a stored data area, wherein the stored program area may store an operating system and an application program required for at least one function; the stored data area may store data created based on the use of the dual-channel wind power prediction system, etc. Furthermore, the computer-readable storage medium may include high-speed random access memory, and may also include memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the computer-readable storage medium may optionally include memory remotely disposed relative to a processor, which can be connected to the dual-channel wind power prediction system via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0132] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present invention, such as... Figure 6 As shown, the device includes a processor 310 and a memory 320. The electronic device may also include an input device 330 and an output device 340. The processor 310, memory 320, input device 330, and output device 340 can be connected via a bus or other means. Figure 6Taking a bus connection as an example, the memory 320 is the computer-readable storage medium described above. The processor 310 executes various server functions and data processing by running non-volatile software programs, instructions, and modules stored in the memory 320, thereby implementing the dual-channel wind power prediction method described in the above embodiment. The input device 330 can receive input digital or character information and generate key signal inputs related to user settings and function control of the dual-channel wind power prediction system. The output device 340 may include a display screen or other display device.

[0133] The aforementioned electronic device can execute the method provided in the embodiments of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the method provided in the embodiments of the present invention.

[0134] In one implementation, the above-described electronic device is applied to a dual-channel wind power prediction system for a client, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0135] Acquire power load time-series data and process the power load time-series data according to the preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time-series data;

[0136] The target power load time series data is input into a pre-built Mamba model and an LSTM model, respectively. The Mamba model outputs a first result, and the LSTM model outputs a second result.

[0137] The first and second results are input into a multi-head cross-attention mechanism for adaptive adjustment, and the final prediction result is output via an FFN feedforward network.

[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A dual-channel wind power generation prediction method, characterized in that, include: Acquire time-series power load data and process the power load time-series data according to a preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time-series data. The process of processing the power load time-series data according to the preset gradient-aware exponential moving average (EMA) algorithm to obtain the target power load time-series data includes: The power load time series data is normalized and scaled to the [-1,1] interval; The optimal smooth window size is determined by a window selection function, with the window range set to [3,5]. The information entropy of each window is calculated, and the window size with the minimum information entropy is selected as the final target window. Calculate the standard deviation of the data within the target window and the gradient variance of the model parameters, and then calculate the dynamically adjusted smoothing coefficient based on the standard deviation of the data and the gradient variance of the model parameters. The expression is as follows: , Where, The dynamic smoothing coefficient is the core parameter of the EMA. For time steps, The standard deviation of the data within the current window is used to measure data volatility. The gradient variance of the model parameters is used to measure the model's update state. As a sensitivity adjustment factor, This is a smoothing term used to prevent the denominator from being zero. It is the hyperbolic tangent function; The smoothing coefficient is dynamically adjusted using the tanh function. Limiting the load to the interval [0, 0.96] and recursively calculating the EMA, the smoothed target power load time series data is obtained. The expression for recursively calculating the EMA is: , Where, This is the exponential moving average calculated at time step t. This is the input value for the current time step, i.e., the raw data at time point t. This is the exponential moving average calculated at time step t-1, which is the exponential moving average of the previous time step. The target power load time series data is input into a pre-built Mamba module and an LSTM module, respectively. The Mamba module outputs a first result, and the LSTM module outputs a second result. The first and second results are input into a multi-head cross-attention mechanism for adaptive adjustment, and the final prediction result is output via an FFN feedforward network.

2. The dual-channel wind power generation prediction method according to claim 1, characterized in that, in, The target power load time-series data are input into a pre-built Mamba module, and the Mamba module outputs a first result, specifically including: Three layers of depthwise separable convolution operations with different expansion rates are performed on the target power load time series data to obtain three sets of feature tensors with different temporal receptive fields; Based on learnable weights, the feature tensors of each of the three groups with different temporal receptive fields are linearly weighted along the channel dimension to obtain the fused feature tensor, expressed as: , Where, Indicates the first Feature maps obtained by convolution at each scale These are weighting coefficients, controlling their contribution during the fusion process. For bias terms, and It is obtained through automatic learning and optimization during the model training process; The fused feature tensor is input into the forward path and the reverse path respectively. The forward path outputs the forward feature at each time step, and the reverse path outputs the reverse feature at each time step. A chaotic signal with the same time step length is generated iteratively through the Lorenz chaotic system, and the chaotic signal is projected into a first gating coefficient sequence and a second gating coefficient sequence. Based on the first and second gating coefficient sequences, the positive and negative features at each time step are dynamically weighted and fused time-by-time to output the final long-range representation vector, which is the first result. The expression for the time-by-time dynamic weighted fusion is as follows: , Where, For element-wise multiplication, , These are the gating coefficients for the positive and negative features at time step t, respectively. The feature representation after fusion at time step t, For the positive features obtained by the Mamba module on the positive path at time step t, This represents the reverse characteristics obtained by the reverse path Mamba module at time step t.

3. The dual-channel wind power generation prediction method according to claim 1, characterized in that, in, The target power load time-series data are input into a pre-built LSTM module, and the LSTM module outputs a second result, specifically including: Based on the LSTM layer, preliminary feature extraction and encoding of the target power load time-series data are performed to obtain high-dimensional time-series feature data, expressed as follows: , Where, For high-dimensional time-series feature data, d represents the feature dimension per head, and h represents the total number of heads. For target power load time series data, B is the batch size, T is the time step length, and D is the feature dimension. This indicates that all elements of the output tensor Y are real numbers; The high-dimensional time-series feature data is divided into... A time modeling head and A spatial modeling head, among which... And in the last dimension of high-dimensional time series feature data The time feature tensor is obtained by segmenting the data. and spatial feature tensor ; Calculate the first-time autocorrelation matrix for each time-modeling head. , for The dimensions are readjusted, i.e. reshaped, and a learnable time decay factor vector will be introduced. , with the first-time autocorrelation matrix By multiplying element by element and summing the results, we obtain the time-domain energy characteristics. ,in, Represented as The transpose of express product, Represents matrix multiplication. Indicates all vector; Calculate the second autocorrelation matrix for each spatial modeling head. And calculate the space energy tensor based on the second autocorrelation matrix. ,in, for The dimensions are readjusted, that is, reshaped. Represented as Transpose This indicates that the maximum value operation is performed on the last dimension; Space energy tensor With gate weights Multiplying element by element yields the weighted spatial energy characteristics. , ,in, for Activation function , All are learnable parameters; For high-dimensional time series feature data conduct Transformation yields the frequency domain. and take the frequency domain The real part is used as the frequency domain feature tensor ,in, Number of frequency components to be retained; The frequency domain feature tensor is transformed through a linear projection layer. The feature dimension is transformed to a dimension consistent with the spatiotemporal feature output, resulting in... , This indicates a projection operation, and the data is segmented according to a multi-head partitioning standard. Time-modeled frequency domain features are obtained and spatial modeling frequency domain features ; Time-domain energy characteristics Frequency domain features modeled with time Element-wise multiplication yields the time-enhanced features. and the spatial energy characteristics Frequency domain characteristics of spatial modeling Element-wise multiplication yields spatially enhanced features. ; Temporal and spatial augmentation features are concatenated along the feature dimension to form a fused feature tensor. The second result is obtained by outputting the result through a fully connected neural network.

4. The dual-channel wind power generation prediction method according to claim 1, characterized in that, The step of inputting the first and second results into a multi-head cross-attention mechanism for adaptive adjustment, and then outputting the final prediction result via an FFN feedforward network, includes: The first result and the second result are input into a multi-head cross-attention mechanism, which fuses the first result and the second result to obtain the target feature; The target features are input into the first fully connected layer and mapped to a new feature space through a linear transformation, yielding the first output result after the linear transformation. The expression for the linear transformation mapping is as follows: , Where, This is the first output result. This is the input data for the first fully connected layer. This is the weight matrix of the first fully connected layer. This is the bias vector of the first fully connected layer; The first output result is processed After activation function processing, the result is input to the second fully connected layer, where a nonlinear transformation is performed on the first output to obtain the second output, expressed as: , Where, This is the second output result. This is the weight matrix of the second fully connected layer. This is the bias vector for the second fully connected layer; The second output is input into the third fully connected layer, and the second output is feature-mapped to obtain the final prediction result, expressed as: , In the formula, This is the third output result. This is the weight matrix of the third fully connected layer. This is the bias vector for the third fully connected layer.

5. A dual-channel wind power generation prediction system, characterized in that, include: The processing module is configured to acquire power load time-series data and process the power load time-series data according to a preset gradient-aware exponential moving average (EMA) algorithm to obtain target power load time-series data. The process of processing the power load time-series data according to the preset gradient-aware exponential moving average (EMA) algorithm to obtain the target power load time-series data includes: The power load time series data is normalized and scaled to the [-1,1] interval; The optimal smooth window size is determined by a window selection function, with the window range set to [3,5]. The information entropy of each window is calculated, and the window size with the minimum information entropy is selected as the final target window. Calculate the standard deviation of the data within the target window and the gradient variance of the model parameters, and then calculate the dynamically adjusted smoothing coefficient based on the standard deviation of the data and the gradient variance of the model parameters. The expression is as follows: , Where, The dynamic smoothing coefficient is the core parameter of the EMA. For time steps, The standard deviation of the data within the current window is used to measure data volatility. The gradient variance of the model parameters is used to measure the model's update state. As a sensitivity adjustment factor, This is a smoothing term used to prevent the denominator from being zero. It is the hyperbolic tangent function; The smoothing coefficient is dynamically adjusted using the tanh function. Limiting the load to the interval [0, 0.96] and recursively calculating the EMA, the smoothed target power load time series data is obtained. The expression for recursively calculating the EMA is: , Where, This is the exponential moving average calculated at time step t. This is the input value for the current time step, i.e., the raw data at time point t. This is the exponential moving average calculated at time step t-1, which is the exponential moving average of the previous time step. The output module is configured to input the target power load time-series data into a pre-built Mamba module and an LSTM module, respectively. The Mamba module outputs a first result, and the LSTM module outputs a second result. The adjustment module is configured to input the first result and the second result into a multi-head cross-attention mechanism for adaptive adjustment, and output the final prediction result via an FFN feedforward network.

6. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.

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

Citation Information

Patent Citations

  • Power load prediction method based on dual-channel cross attention network

    CN119669732A