Transform-LSTM wind power plant wind direction interval prediction method based on spatial-temporal feature fusion

By combining multi-scale temporal feature decomposition and graph convolutional networks with the Transformer-LSTM model, the problem of insufficient spatiotemporal feature fusion in traditional wind direction prediction methods is solved, achieving high-precision wind direction point prediction and interval prediction with multiple confidence levels, thus improving the operational reliability of wind farms.

CN121658858APending Publication Date: 2026-03-13CGN YUXI HUANING WIND POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511640495.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Traditional wind direction forecasting methods struggle to effectively capture the spatial and temporal dependencies between wind directions in wind farms and fail to achieve effective fusion of spatiotemporal characteristics, resulting in insufficient forecast accuracy. They also neglect the quantification of uncertainty in forecast results and cannot meet the requirements for safe and economical operation of wind farms.

Method used

Multi-scale temporal feature decomposition and graph convolutional network are used to extract spatial dependency features. The Transformer-LSTM model is combined to capture long-distance temporal dependencies and generate wind direction prediction intervals with multiple confidence levels. The error distribution is fitted by an adaptive bandwidth kernel density estimation method.

Benefits of technology

It achieves high-precision wind direction point prediction and interval prediction, improves the model's generalization ability and the reliability of prediction results, and meets the practical application needs of wind farms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658858A_ABST
    Figure CN121658858A_ABST
Patent Text Reader

Abstract

The invention discloses a Transform-LSTM wind power plant wind direction interval prediction method based on spatial-temporal feature fusion, and the method comprises the steps: firstly carrying out the multi-scale decomposition of a target wind direction sequence through variational mode decomposition, so as to extract the time sequence features of different frequencies; secondly, extracting spatial dependence characteristics among different horizontal distance wind directions by using a graph convolutional network, and solving the problem that a traditional method is insufficient in spatial correlation utilization; the spatial and temporal features are fused and then input into a Transform-LSTM model, the model realizes efficient representation of complex sequence data by fusing the modeling ability of a Transform self-attention mechanism to long-distance dependence and the capture advantage of LSTM to time sequence dynamic features, and then a high-precision wind direction point prediction result is generated; and finally, based on a training set prediction error, fitting error distribution by adopting an adaptive bandwidth kernel density estimation method, and generating a wind direction prediction interval with multiple confidence levels in combination with a target confidence quantile to realize quantitative representation of prediction uncertainty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wind direction prediction, and in particular to a method for predicting wind direction intervals in wind farms based on the Transformer-LSTM method of spatiotemporal feature fusion. Background Technology

[0002] Wind direction forecasting for wind farms is a crucial aspect of power system dispatching and risk control. Its core challenge lies in accurately capturing the spatiotemporal coupling characteristics of wind direction sequences and quantifying forecast uncertainties. Traditional wind direction forecasting methods primarily rely on time series modeling based on single historical wind direction data, making it difficult to effectively capture the spatial dependencies between wind directions within wind farms. As wind farms continue to expand, factors such as terrain and turbine layout make the spatial distribution of wind directions more complex, exacerbating the shortcomings of traditional methods in utilizing spatial correlations and resulting in forecast accuracy failing to meet practical requirements. Furthermore, existing research often treats spatial and temporal features separately, failing to effectively integrate spatiotemporal characteristics and thus failing to fully characterize the complex spatiotemporal properties of wind farm wind direction data.

[0003] Moreover, single prediction models have limited capabilities for processing long-term, non-stationary wind direction data. For example, Long Short-Term Memory (LSTM) networks, with their powerful ability to capture dynamic temporal features, have demonstrated advantages in time series prediction. However, traditional LSTM models, based on a chain-recursive network structure, are prone to gradient vanishing when processing long-distance temporal dependencies, leading to the decay or loss of historical information over long distances. Furthermore, their fixed gating mechanism struggles to adapt to dynamic changes in data distribution, further limiting the model's generalization ability in complex scenarios.

[0004] Furthermore, most existing wind direction forecasting methods focus on point predictions while neglecting the quantification of uncertainty in the forecast results. In practical engineering applications, wind farm operation decisions need to consider the uncertainty of wind direction forecasts in order to formulate reasonable scheduling plans and risk control strategies. Traditional forecast interval generation methods, such as fixed bandwidth kernel density estimation or linear quantile regression, cannot adaptively fit the local characteristics of the error distribution, resulting in low accuracy of the generated forecast intervals and failing to provide reliable uncertainty forecasting support for the safe and economical operation of wind farms. Summary of the Invention

[0005] To address the above problems, this invention proposes a Transformer-LSTM wind farm direction interval prediction method based on spatiotemporal feature fusion, the technical solution of which is as follows:

[0006] Step (1): Multi-scale temporal feature decomposition. The target wind direction sequence of the wind farm is subjected to variational mode decomposition, and the original wind direction sequence is decomposed into subsequences with different frequency components. The temporal features of each subsequence are extracted.

[0007] Step (2): Spatial dependency feature extraction. For wind direction locations at different horizontal distances, a spatial location map based on distance association is constructed. The wind direction subsequences corresponding to each horizontal distance location are used as graph node features. A graph convolutional network is used to perform convolution operations on the graph model to extract the spatial dependency features between wind directions at different horizontal distances.

[0008] Step (3): Spatiotemporal feature fusion and point prediction using Transformer-LSTM. The temporal features obtained in step (1) are fused with the spatial dependency features obtained in step (2), and the fused spatiotemporal features are input into the Transformer-LSTM model. The self-attention mechanism of the Transformer is used to capture long-distance temporal dependencies, and the gating mechanism of the LSTM is used to capture temporal dynamic features, and the point prediction result of wind direction is output.

[0009] Step (4): Generate interval prediction results. Based on the point prediction error sequence of the training set, the error distribution probability density function is fitted using the adaptive bandwidth kernel density estimation method. The corresponding quantiles are calculated according to the target confidence level, and the wind direction prediction intervals with multiple confidence levels are generated by combining the point prediction results.

[0010] The acquired wind direction data from the wind farm includes the target wind direction sequence and wind direction sequences at different horizontal distances. Preprocessing of the wind direction data is required, including outlier removal, missing value interpolation, and normalization of the input features and output wind direction data.

[0011] In step (1), the specific steps of variational mode decomposition are as follows:

[0012] Constructing a variational model: Decomposing the original signal into K modal components u k (t), where each mode corresponds to the center frequency ω. k The goal is to minimize the sum of the bandwidths of all modes, and a constrained variational problem is constructed as follows:

[0013]

[0014] Where δ(t) is the Dirac function, To find the partial derivative with respect to t, j is the imaginary sign, and x(t) is the input target wind direction sequence.

[0015] Introducing a penalty term and Lagrange multipliers: By introducing a quadratic penalty term α and Lagrange multipliers λ(t), the constrained problem is transformed into an unconstrained optimization problem, and the augmented Lagrange function is constructed:

[0016]

[0017] Alternating iterative solution: By alternately updating the mode u k Frequency domain expression and center frequency ω k Until it converges.

[0018]

[0019] The original wind direction sequence is decomposed into K subsequences IMF1, IMF2, ..., IMFk with different frequency components through the above process, and the temporal features of each subsequence are extracted.

[0020] In step (2), the process of the graph convolutional network extracting spatial features is as follows:

[0021] Let G = (V, E) be an undirected graph composed of locations at different horizontal distances, where V represents the set of locations and E represents the connectivity. The relationship between wind directions at different horizontal distances is represented by an adjacency matrix A, where A... ij ≠0 indicates a spatial correlation between positions i and j. The GCN forward propagation process is as follows:

[0022] Among them, H (l) This represents the feature matrix of the nodes in the l-th layer; Let I represent the adjacency matrix containing self-loops, where I is the identity matrix; for The degree matrix; σ(·) represents the activation function; W (l) This represents the weight function of the l-th layer.

[0023] Through the above operations, the wind direction characteristics at each location not only depend on itself but also aggregate information from surrounding wind directions, thus achieving spatial feature extraction. To construct an adjacency matrix suitable for wind direction prediction, this invention employs a weighted method based on Euclidean distance:

[0024] Where, d ij represents the horizontal distance between positions i and j; s represents the normalization parameter.

[0025] In addition, an adjacency matrix is ​​defined using a method based on wind direction correlation:

[0026] Among them, X i X j Let i and j represent the wind direction time series at positions i and j, respectively.

[0027] In step (3), the alpha evolution algorithm is used to optimize the parameters of the Transformer-LSTM model. The process is as follows:

[0028] Parameter space construction: The number of self-attention heads h, the number of LSTM hidden layer nodes n, the initial learning rate l, and the L2 regularization coefficient r are taken as the parameters to be optimized. The parameter space is represented as: X = [h, n, l, r] T A random initialization strategy is adopted to uniformly sample and generate an initial population P0: P0={X1,X2,…,X...} within the parameter space. N}, where each solution vector X i This corresponds to a set of Transformer-LSTM parameter combinations.

[0029] Dual-path evolutionary search mechanism: through dual evolutionary paths P a and P b Generate candidate solutions.

[0030]

[0031] Where A and B represent the historical solution matrix, c a ,c b ∈[0,1] represents the adaptive weight function, and ω represents the scaling factor.

[0032] Search step size using nonlinear decay factor α: And generate a random step size vector Δr, and update the candidate solutions:

[0033] Where P represents the basis vector, W i and L i These represent the historical best and worst solutions, respectively, and θ represents the adaptive adjustment coefficient.

[0034] Boundary constraints and selection mechanisms: Correcting solutions that exceed the parameter space.

[0035] Preserve the better solution through a deterministic optimization strategy:

[0036] Fit(X) represents the fitness function with the goal of minimizing prediction error, and includes a prediction error term and a model complexity penalty term.

[0037] Optimization termination condition: The optimization process terminates when the preset maximum number of iterations T is reached or when the change in the fitness function is less than the threshold ε in k consecutive iterations.

[0038] In step (3), the prediction process of the Transformer-LSTM model is as follows: the fused spatiotemporal feature information is input into the model input layer. First, time position encoding is added through the position embedding layer. The long-distance dependence of the temporal features is modeled through two self-attention layers. The first self-attention layer uses a causal mask to avoid future information leakage, while the second layer enhances the interaction between global features. Then, the output feature sequence is fed into the LSTM layer. The short-term temporal dynamic features are captured through the gating mechanism, and the overfitting phenomenon is suppressed by the dropout layer. Finally, the hidden state of the last time step of the LSTM is extracted, and the wind direction prediction value is output after processing by the fully connected layer.

[0039] In step (4), the adaptive bandwidth kernel density estimation (ABKDE) step for generating the prediction interval includes:

[0040] Calculate error data and estimation points: Calculate prediction error If the point to be estimated is not given in advance, then it is based on the error data range [min(∈ t ),max(∈ t The point to be estimated is generated by linear interpolation at equal intervals; if the point to be estimated is already given, the given value is directly used as the target estimated position.

[0041] Initialize bandwidth search range: WIN = logexp(linspace(ilogexp(5Δt),ilogexp(T),M)).

[0042] Where Δt is the minimum data interval, T = max(t) - min(t) is the length of the estimation interval, and M = 80 is the number of bandwidth optimization iterations; for each bandwidth ω∈WIN, the kernel density estimate y is calculated using Fast Fourier Transform (FFT). h =fftkernel(y hist (w / Δt), and construct a local loss function. y hist These are histogram statistics based on error data.

[0043] Golden Section Bandwidth Optimization: The golden section search method is used for global bandwidth optimization, with an initial search interval [a,b] =

[10] . -12 [1], tolerance tol = 10 -5 The loss function C(g) = ∑(c) is calculated iteratively. g ·Δt), where c g To optimize the local loss under the bandwidth, the interval is gradually narrowed until |ba|≤tol(|c1|+|c2|), thereby determining the optimal bandwidth optw.

[0044] Constructing Bootstrap Sampling Intervals: Perform Bootstrap sampling on the error data, generating a subsample x in each sampling. b And calculate the corresponding kernel density estimate y b ; All y b After sorting, the 5% and 95% quantiles are used as the upper and lower bounds of the confidence interval, thus generating the prediction interval [y]. 95b ,y 95u ], where y 95b =quantile(y b ,0.05), y 95u =quantile(y b ,0.95).

[0045] Constructing the optimal kernel density function: Constructing a Gaussian kernel density function based on the optimal bandwidth optw. The estimation results are mapped to the original prediction points using interpolation, and the final output is the probability density estimate y and the corresponding 95% confidence interval boundary confb95=[y]. 95b ,y 95u This allows for the quantitative characterization of wind direction prediction uncertainty, providing multi-confidence level prediction range support for wind farm operation.

[0046] During the optimization of Transformer-LSTM model parameters, it is necessary to set the optimization range for four optimization parameters: number of self-attention heads h, number of LSTM hidden layer nodes n, initial learning rate l, and L2 regularization coefficient r.

[0047] The present invention uses the following evaluation indicators to evaluate the prediction effect:

[0048] Point prediction evaluation metrics include mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). The closer R² is to 1, the better the model fit.

[0049]

[0050] Among them, y i This represents the actual wind direction. denoted as wind direction prediction, and n as the sample size.

[0051] Interval prediction evaluation metrics include the Predicted Interval Coverage Probability (PICP) and the Continuous Probability Score (CRPS). PICP represents the proportion of the predicted interval that contains the true value, while CRPS is a core indicator measuring the consistency between the probabilistic prediction and the actual value, and is particularly suitable for the comprehensive evaluation of interval prediction models. Essentially, it represents the expected difference between the predicted distribution and the true value. The smaller the CRPS value, the more compact the predicted interval and the higher the probability that the true value falls within the interval, indicating better model prediction performance.

[0052]

[0053] Among them, [L i U i ] represents the prediction interval for the i-th sample; F(x) j,i ) is the predicted distribution in x j.i The empirical cumulative distribution function at x indicates that the predicted value is less than or equal to x. j.i The probability; I(·) is the indicator function, which takes the value 1 when the condition is met and 0 otherwise; C is the number of quantiles.

[0054] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0055] 1. This invention decomposes the target wind direction sequence into subsequences containing different frequency components through variational mode decomposition, achieving efficient extraction of multi-scale temporal features. Simultaneously, it utilizes a graph convolutional network to construct spatial location maps based on different horizontal distances, thereby accurately capturing the spatial features between wind direction data. The combination of these two methods achieves effective fusion of spatiotemporal features, enabling the model to more accurately characterize the spatiotemporal coupling patterns of wind direction under complex meteorological conditions, laying a feature foundation for high-precision prediction.

[0056] 2. The Transformer-LSTM model captures long-distance temporal dependencies through the Transformer's self-attention mechanism and extracts dynamic features of wind direction by combining the LSTM gating mechanism. This design overcomes the limitations of a single model in modeling capabilities when dealing with long-term, non-stationary data. Furthermore, the Alpha Evolution algorithm is used to globally optimize key parameters such as the number of self-attention heads and the number of hidden layer nodes, avoiding the uncertainty of manual parameter tuning and improving the model's generalization ability and prediction accuracy.

[0057] 3. This invention dynamically optimizes the kernel density estimation bandwidth based on the golden section search and combines it with Bootstrap sampling to construct prediction intervals with multiple confidence levels, thus solving the problem of insufficient fitting of local error features by traditional fixed bandwidth methods. By adaptively characterizing the dynamic changes in the error distribution, it provides wind farms with reliable prediction intervals covering different confidence levels, meeting the requirements of reliability and flexibility of prediction results in practical applications. Attached Figure Description

[0058] Figure 1 This is a flowchart of the Transformer-LSTM wind direction interval prediction method for wind farms based on spatiotemporal feature fusion, as described in this invention.

[0059] Figure 2 Network structure diagram of Transformer-LSTM model

[0060] Figure 3 This is a diagram showing the point prediction results of the present invention.

[0061] Figure 4 This is a graph showing the interval prediction results of the present invention. Detailed Implementation

[0062] Reference Figure 1 This invention proposes a method for predicting wind direction intervals in wind farms based on the Transformer-LSTM method using spatiotemporal feature fusion, comprising the following steps:

[0063] Step (1): Multi-scale temporal feature decomposition. Variational mode decomposition (VMD) is performed on the target wind direction sequence of the wind farm to decompose the original wind direction sequence into subsequences with different frequency components, and the temporal features of each subsequence are extracted;

[0064] Step (2): Spatial dependency feature extraction. For different horizontal distance locations, a spatial location map based on distance association is constructed. The wind direction subsequence corresponding to each horizontal distance location is used as the graph node feature. The graph convolutional network (GCN) is used to perform convolution operation on the graph model to extract the spatial dependency features between wind directions at different horizontal distances.

[0065] Step (3): Spatiotemporal feature fusion and point prediction using Transformer-LSTM. The temporal features obtained in step (1) are fused with the spatial dependency features obtained in step (2), and the fused spatiotemporal features are input into the Transformer-LSTM model. The self-attention mechanism of the Transformer is used to capture long-distance temporal dependencies, and the gating mechanism of the LSTM is used to capture temporal dynamic features, and the point prediction result of wind direction is output.

[0066] Step (4): Generate interval prediction results. Based on the point prediction error sequence of the training set, the adaptive bandwidth kernel density estimation (ABKDE) method is used to fit the error distribution probability density function. The corresponding quantiles are calculated according to the target confidence level, and the wind direction prediction intervals with multiple confidence levels are generated by combining the point prediction results.

[0067] In this embodiment, measured wind direction data from a wind farm in Yunnan Province from January to February 2024 were selected. The data obtained included the average wind direction at seven different horizontal distances: 200 meters, 190 meters, 170 meters, 150 meters, 130 meters, 110 meters, and 90 meters. The data collection interval for each data point was 10 minutes. After data preprocessing, a total of 6,000 collection points were obtained. The first 70% were selected as the training set, and the last 30% were selected as the test set.

[0068] Reference Figure 1 and Figure 2In this embodiment, the wind direction data range covers two intervals: 0° to 180° and -180° to 0°, forming a complete circumferential angle coverage (i.e., a continuous angle range from -180° to 180°).

[0069] In this embodiment, the wind direction data is preprocessed, which includes removing outliers, interpolating missing values, and normalizing the input features and output wind direction data.

[0070] In step (1), the specific steps of VMD are as follows:

[0071] The target wind direction sequence (i.e., the 90-meter wind direction sequence) is decomposed into K modal components u k (t), where each mode corresponds to the center frequency ω. k The goal is to minimize the sum of the bandwidths of all modes, and a constrained variational problem is constructed as follows:

[0072]

[0073] Where δ(t) is the Dirac function, To find the partial derivative with respect to t, j is the imaginary sign, and x(t) is the input target wind direction sequence.

[0074] By introducing a quadratic penalty term α and Lagrange multipliers λ(t), the constrained problem is transformed into an unconstrained optimization problem, and the augmented Lagrange function is constructed:

[0075]

[0076] By alternating the update of mode u k Frequency domain expression and center frequency ω k Until it converges.

[0077]

[0078] The original wind direction sequence is decomposed into K subsequences IMF1, IMF2, ..., IMFk with different frequency components through the above process, and the temporal features of each subsequence are extracted.

[0079] In this embodiment, in step (1), the target wind direction sequence is decomposed into 6 modal components by VMD.

[0080] In step (2), the GCN process for extracting spatial features is as follows:

[0081] An undirected graph G = (V, E) is formed by different horizontal distances between locations, where V represents the set of locations and E represents the connectivity. The relationship between wind directions at different horizontal distances is represented by an adjacency matrix A, where A... ij≠0 indicates a spatial correlation between positions i and j. The GCN forward propagation process is as follows:

[0082] Among them, H (l) This represents the feature matrix of the nodes in the l-th layer; Let I represent the adjacency matrix containing self-loops, where I is the identity matrix; for The degree matrix; σ(·) represents the activation function; W (l) This represents the weight function of the l-th layer.

[0083] Through the above operations, the wind direction characteristics at each location not only depend on itself but also aggregate information from surrounding wind directions, thus achieving spatial feature extraction. To construct an adjacency matrix suitable for wind direction prediction, this invention employs a weighted method based on Euclidean distance:

[0084] Where, d ij represents the horizontal distance between positions i and j; s represents the normalization parameter.

[0085] In addition, an adjacency matrix is ​​defined using a method based on wind direction correlation:

[0086] Among them, X i X j Let i and j represent the wind direction time series at positions i and j, respectively.

[0087] In step (3), the alpha evolution algorithm is used to optimize the parameters of the Transformer-LSTM model. The process is as follows:

[0088] The number of self-attention heads h, the number of LSTM hidden layer nodes n, the initial learning rate l, and the L2 regularization coefficient r are taken as parameters to be optimized. The parameter space is represented as: X = [h, n, l, r] T A random initialization strategy is adopted to uniformly sample and generate an initial population P0: P0={X1,X2,...,X...} within the parameter space. N}, where each solution vector X i This corresponds to a set of Transformer-LSTM parameter combinations.

[0089] Through the dual evolutionary path P a and P b Generate candidate solutions:

[0090] Where A and B represent the historical solution matrix, c a ,c b ∈[0,1] represents the adaptive weight function, and ω represents the scaling factor.

[0091] Search step size using nonlinear decay factor α: And generate a random step size vector Δr, and update the candidate solutions:

[0092] Where P represents the basis vector, W i and L i These represent the historical best and worst solutions, respectively, and θ represents the adaptive adjustment coefficient.

[0093] Correct solutions that are outside the parameter space:

[0094] Preserve the better solution through a deterministic optimization strategy:

[0095] Fit(X) represents the fitness function with the goal of minimizing prediction error, and includes a prediction error term and a model complexity penalty term.

[0096] The optimization process terminates when the preset maximum number of iterations T is reached or when the change in the fitness function is less than the threshold ε in k consecutive iterations.

[0097] In this embodiment, in step (3), the maximum number of iterations is set to 10, and the optimization ranges of each parameter are as follows: number of self-attention heads h∈[2,10], number of LSTM hidden layer nodes n∈[10,100], initial learning rate l∈[10,100]. -5 10 -2 ], L2 regularization coefficient λ∈[10 -6 10 -3 ].

[0098] Reference Figure 2 The prediction process of the Transformer-LSTM model is as follows: The fused spatiotemporal feature information is input into the model input layer. First, a temporal location encoding is added through a location embedding layer. Then, two self-attention layers are used to model the long-distance dependence of temporal features. The first self-attention layer uses a causal mask to avoid the leakage of future information, while the second layer enhances the interaction between global features. Subsequently, the output feature sequence is fed into the LSTM layer. A gating mechanism is used to capture short-term temporal dynamic features, and a dropout layer is used to suppress overfitting. Finally, the hidden state of the last time step of the LSTM is extracted, processed by a fully connected layer, and the predicted wind direction value is output.

[0099] In step (4), the ABKDE process for generating prediction intervals includes:

[0100] Calculate prediction error If the point to be estimated is not given in advance, then it is based on the error data range [min(∈ t ),max(∈ tThe point to be estimated is generated by linear interpolation at equal intervals; if the point to be estimated is already given, the given value is directly used as the target estimated position.

[0101] Initialize bandwidth search range: WIN = logexp(linspace(ilogexp(5Δt),ilogexp(T),M)).

[0102] Where Δt is the minimum data interval, T = max(t) - min(t) is the length of the estimation interval, and M = 80 is the number of bandwidth optimization iterations; for each bandwidth ω∈WIN, the kernel density estimate y is calculated using Fast Fourier Transform (FFT). h =fftkernel(y hist (w / Δt), and construct a local loss function. y hist These are histogram statistics based on error data.

[0103] The golden section search method is used for global bandwidth optimization, and the initial search interval [a,b] =

[10] is set. -12 [1], tolerance tol = 10 -5 The loss function C(g) = ∑(c) is calculated iteratively. g ·Δt), where c g To optimize the local loss under the bandwidth, the interval is gradually narrowed until |ba|≤tol(|c1|+|c2|), thereby determining the optimal bandwidth optw.

[0104] Perform B = 100 Bootstrap samplings on the error data, with each sampling generating a subsample x. b And calculate the corresponding kernel density estimate y b ; All y b After sorting, the 5% and 95% quantiles are used as the upper and lower bounds of the confidence interval, thus generating the prediction interval [y]. 95b ,y 95u ], where y 95b =quantile(y b ,0.05), y 95u =quantile(y b ,0.95).

[0105] Construct a Gaussian kernel density function based on the optimal bandwidth optw. The estimation results are mapped to the original prediction points using interpolation, and the final output is the probability density estimate y and the corresponding 95% confidence interval boundary confb95=[y]. 95b ,y 95u This allows for the quantitative characterization of wind direction prediction uncertainty, providing multi-confidence level prediction range support for wind farm operation.

[0106] In this embodiment, the prediction confidence intervals are selected as 5%, 10%, 25%, 50%, 75%, 90%, and 95%.

[0107] In this embodiment, the Adam optimizer is used during training, and the maximum number of training iterations is set to 100.

[0108] Reference Figure 3 and Figure 4 The following evaluation indicators were used to evaluate the model's predictive performance, and the results are shown in Table 1.

[0109] Point prediction evaluation metrics include mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). The closer R² is to 1, the better the model fit.

[0110]

[0111] Among them, y i This represents the actual wind direction. denoted as wind direction prediction, and n as the sample size.

[0112] Interval prediction evaluation metrics include the Predicted Interval Coverage Probability (PICP) and the Continuous Probability Score (CRPS). PICP represents the proportion of the predicted interval that contains the true value, while CRPS is a core indicator measuring the consistency between the probabilistic prediction and the actual value, and is particularly suitable for the comprehensive evaluation of interval prediction models. Essentially, it represents the expected difference between the predicted distribution and the true value. The smaller the CRPS value, the more compact the predicted interval and the higher the probability that the true value falls within the interval, indicating better model prediction performance.

[0113]

[0114] Among them, [L i U i ] represents the prediction interval for the i-th sample; F(x) j,i ) is the predicted distribution in x j.i The empirical cumulative distribution function at x indicates that the predicted value is less than or equal to x. j.i The probability; I(·) is the indicator function, which takes the value 1 when the condition is met and 0 otherwise; C is the number of quantiles.

[0115] Table 1 Model Evaluation Indicators

[0116]

[0117] As shown in Table 1, the MAE and RMSE of the prediction method proposed in this invention are only 1.21 and 1.45, respectively. Under the 95% confidence interval, the PICP reaches 96.39% and the CRPS is 0.179. All indicators have achieved good results, which proves the effectiveness of the proposed method.

[0118] The above embodiments are merely illustrative of the principles and effects of the present invention, as well as some examples of its application, and are not intended to limit the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these modifications and improvements are all within the scope of protection of the present invention.

Claims

1. A method for predicting wind direction intervals in wind farms based on Transformer-LSTM fusion of spatiotemporal features, characterized in that, Includes the following steps: Step (1): Multi-scale temporal feature decomposition; Variational mode decomposition is performed on the target wind direction sequence of the wind farm to decompose the original wind direction sequence into subsequences with different frequency components, and the temporal features of each subsequence are extracted. Step (2): Spatial dependency feature extraction; For wind direction locations at different horizontal distances, construct a spatial location map based on distance association, use the wind direction subsequences corresponding to each horizontal distance location as graph node features, and use a graph convolutional network to perform convolution operations on the graph model to extract the spatial dependency features between wind directions at different horizontal distances. Step (3): Spatiotemporal feature fusion and point prediction using Transformer-LSTM; The temporal features obtained in step (1) are fused with the spatial dependency features obtained in step (2), and the fused spatiotemporal features are input into the Transformer-LSTM model. The long-distance temporal dependency is captured through the self-attention mechanism of Transformer, and the temporal dynamic features are captured by combining the gating mechanism of the Long Short-Term Memory Network (LSTM), and the point prediction result of wind direction is output. Step (4): Generate interval prediction results; Based on the point prediction error sequence of the training set, the error distribution probability density function is fitted by the adaptive bandwidth kernel density estimation ABKDE method, the corresponding quantile is calculated according to the target confidence level, and the wind direction prediction interval with multiple confidence levels is generated by combining the point prediction results.

2. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that, The wind direction data acquired from the wind farm includes the target wind direction sequence and wind direction sequences at different horizontal distances.

3. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that, The wind direction data needs to be preprocessed, including removing outliers, interpolating missing values, and normalizing the input features and output wind direction data.

4. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that, In step (1), the specific steps of variational mode decomposition are as follows: (4.1) Decompose the original signal into K modal components u k (t), where each mode corresponds to the center frequency ω. k The goal is to minimize the sum of the bandwidths of all modes, and a constrained variational problem is constructed as follows: Where δ(t) is the Dirac function, To find the partial derivative with respect to t, j is the imaginary sign, and x(t) is the target wind direction sequence; (4.2) By introducing a quadratic penalty term α and a Lagrange multiplier λ(t), the constrained problem is transformed into an unconstrained optimization problem, and the augmented Lagrange function is constructed: (4.3) By alternating updates of mode u k Frequency domain expression and center frequency ω k until convergence; The target wind direction sequence is decomposed into K subsequences IMF1, IMF2, ..., IMFk with different frequency components through the above process, and the temporal features of each subsequence are extracted.

5. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that, In step (2), the process of the graph convolutional network extracting spatial features is as follows: Let G = (V, E) be an undirected graph composed of locations at different horizontal distances, where V represents the set of locations and E represents the connectivity. The relationship between wind directions at different horizontal distances is represented by the adjacency matrix A, where A... ij ≠0 indicates that there is spatial correlation between positions i and j; the forward propagation process of the graph convolutional network GCN is as follows: Among them, H (l) This represents the feature matrix of the nodes in the l-th layer; Let I represent the adjacency matrix containing self-loops, where I is the identity matrix; for The degree matrix; σ(·) represents the activation function; W (l) This represents the weight function of the l-th layer; Through the above operations, the wind direction characteristics of each location not only depend on itself, but also aggregate information from the surrounding wind directions, thus achieving spatial feature extraction. To construct an adjacency matrix suitable for wind direction prediction, this invention employs a weighted method based on Euclidean distance. Where, d ij The horizontal distance between positions i and j is represented by s; s represents the normalization parameter. In addition, an adjacency matrix is ​​defined using a method based on wind direction correlation: Among them, X i X j Let i and j represent the wind direction time series at positions i and j, respectively.

6. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that, In step (3), the Alpha Evolutionary Algorithm (AE) is used to optimize the parameters of the Transformer-LSTM model. The process is as follows: (6.1) The number of self-attention heads h, the number of LSTM hidden layer nodes n, the initial learning rate l, and the L2 regularization coefficient r are taken as the parameters to be optimized. The parameter space is represented as: X=[h,n,l,r] T A random initialization strategy is adopted to uniformly sample and generate an initial population P0: P0={X1,X2,...,X...} within the parameter space. N }, where each solution vector X i Corresponding to a set of Transformer-LSTM parameter combinations; (6.2) Through the dual evolutionary path P a and P b Generate candidate solutions: Where A and B represent the historical solution matrix, c a ,c b ∈[0,1] represents the adaptive weight function, and ω represents the scaling factor; Search step size using nonlinear decay factor α: And generate a random step size vector Δr, and update the candidate solutions: Where P represents the basis vector, W i and L i These are the historical best and worst solutions, respectively, and θ represents the adaptive adjustment coefficient. (6.3) Correcting solutions that exceed the parameter space: Preserve the better solution through a deterministic optimization strategy: Where Fit(X) represents the fitness function with the goal of minimizing prediction error, and includes a prediction error term and a model complexity penalty term; (6.4) The optimization process is terminated when the preset maximum number of iterations T is reached or the change in fitness function is less than the threshold ε in k consecutive iterations.

7. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that: In step (3), the prediction process of the Transformer-LSTM model is as follows: the fused spatiotemporal feature information is input into the model input layer. First, time-location encoding is added through the location embedding layer. The long-distance dependence of the temporal features is modeled through two self-attention layers. The first self-attention layer uses a causal mask to avoid future information leakage, while the second layer enhances the interaction between global features. Then, the output feature sequence is fed into the Long Short-Term Memory (LSTM) network layer. The short-term temporal dynamic features are captured through the gating mechanism, and the overfitting phenomenon is suppressed by the dropout layer. Finally, the hidden state of the last time step of the LSTM network is extracted, and the wind direction prediction value is output after processing by the fully connected layer.

8. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that: In step (4), the step of generating the prediction interval by the adaptive bandwidth kernel density estimation ABKDE includes: (8.1) Calculate the prediction error If the point to be estimated is not given in advance, then it is based on the error data range [min(∈ t ),max(∈ t The system generates equally spaced points to be estimated through linear interpolation; if the points to be estimated are already given, the given values ​​are directly used as the target estimated location. (8.2) Define the bandwidth search range: WIN = logexp(linspace(ilogexp(5Δt),ilogexp(T),M)); Where Δt is the minimum data interval, T = max(t) - min(t) is the length of the estimation interval, and M = 80 is the number of bandwidth optimization iterations; for each bandwidth ω∈WIN, the kernel density estimate y is calculated using the Fast Fourier Transform. h =fftkernel(y hist (w / Δt), and construct a local loss function. y hist These are histogram statistics based on error data; (8.3) The golden section search method is used for global bandwidth optimization. The initial search interval is set as [a,b] = [10]. -12 [1], tolerance tol = 10 -5 The loss function C(g) = ∑(c) is calculated iteratively. g ·Δt), where c g To optimize the local loss under the bandwidth, the interval is gradually narrowed until |ba|≤tol(|c1|+|c2|) is satisfied, thereby determining the optimal bandwidth optw; (8.4) Perform Bootstrap sampling on the error data, generating a subsample x for each sampling. b And calculate the corresponding kernel density estimate y. b ; All y b After sorting, the 5% and 95% quantiles are used as the upper and lower bounds of the confidence interval, thus generating the prediction interval [y]. 95b ,y 95u ], where y 95b =quantile(y b ,0.05), y 95u =quantile(y b ,0.95); (8.5) Constructing a Gaussian kernel density function based on the optimal bandwidth optw The estimation results are mapped to the original prediction points using interpolation, and the final output is the probability density estimate y and the corresponding 95% confidence interval boundary confb95=[y]. 95b ,y 95u This allows for the quantitative characterization of wind direction prediction uncertainty, providing multi-confidence level prediction range support for wind farm operation.

9. The parameter optimization process according to claim 5, characterized in that: The optimization range needs to be set for four optimization parameters: number of self-attention heads h, number of LSTM hidden layer nodes n, initial learning rate l, and L2 regularization coefficient r.

10. The method for predicting wind direction intervals in wind farms based on spatiotemporal feature fusion according to claim 1, characterized in that: After the point prediction and interval prediction results are generated, an evaluation step is also included; Point prediction evaluation metrics include mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (R²). The closer the coefficient of determination (R²) is to 1, the better the model fit. Among them, y i This represents the actual wind direction. Here, n represents the predicted wind direction value, and n is the sample size. Interval prediction evaluation metrics include the Predicted Interval Coverage Probability (PICP) and the Continuous Probability Score (CRPS). PICP represents the proportion of the predicted interval that contains the true value, while CRPS is the core indicator for measuring the consistency between the probability prediction and the actual value, and is especially suitable for the comprehensive evaluation of interval prediction models. Its essence is the expected difference between the predicted distribution and the true value. The smaller the CRPS value, the more compact the predicted interval and the higher the probability that the true value falls into the interval, and the better the model's prediction performance. Among them, [L i U i ] represents the prediction interval for the i-th sample; F(x) j,i ) is the predicted distribution in x j.i The empirical cumulative distribution function at x indicates that the predicted value is less than or equal to x. j.i The probability; I(·) is the indicator function, which takes the value 1 when the condition is met and 0 otherwise; C is the number of quantiles.