Wind power prediction method, storage medium and electronic equipment

By using the Transformer model to subdivide wind power data and optimize dynamic loss in wind power prediction, the problem of information overload in model training is solved, and the prediction accuracy, robustness and ability to adapt to complex wind conditions are improved.

CN121726985APending Publication Date: 2026-03-24JIANGSU LONGYUAN NEW ENERGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing wind power prediction models face problems such as large parameter scale and high information storage load during training, resulting in insufficient model generalization ability and robustness, especially in short-term prediction.

Method used

The Transformer model is used for training. The historical and real-time wind power data are preprocessed and divided into multiple sub-domain series data in time series. The model is trained by combining mean squared error loss and weighted domain matching loss values, and the adaptive factor is dynamically adjusted to optimize the model parameters.

Benefits of technology

It improves the accuracy and robustness of wind power prediction, better adapts to complex wind conditions, reduces the impact of information overload, and enhances the model's generalization ability and prediction stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121726985A_ABST
    Figure CN121726985A_ABST
Patent Text Reader

Abstract

The invention discloses a wind power prediction method, a storage medium and electronic equipment, and the method comprises the steps: obtaining wind power historical power data and wind power plant historical meteorological features as wind power historical data, carrying out the preprocessing of the wind power historical data, and dividing the wind power historical data in a time sequence, and obtaining a plurality of sub-field sequence data; a Transform model is constructed, and training is carried out by utilizing the sequence data of the sub-fields; acquiring real-time meteorological characteristics as wind power real-time data, and completing preprocessing and time sequence division to form real-time sub-field sequence data; and inputting the real-time subfield sequence data into the Transform model to obtain a wind power prediction value. Through time sequence division based on distribution difference, non-stationary wind power time sequence data is disassembled into sub-fields with internal consistency and significant external distribution difference, so that the model can learn features under different conditions during training, and the problem caused by information overload of a deep model can be effectively relieved by combining Transform, so that the accuracy of the model is improved. And the precision and robustness of wind power prediction and the adaptability to complex wind conditions are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of wind power generation, and in particular to a wind power prediction method, storage medium, and electronic device. Background Technology

[0002] Wind energy, as a clean and renewable energy source, has been widely used and rapidly developed globally. However, due to the randomness and time-varying nature of environmental factors such as wind speed and direction, the output power of wind turbine generators and wind farms fluctuates significantly, causing wind power time-series data to exhibit non-stationarity and distributional differences.

[0003] Currently, wind power prediction models can be mainly divided into two categories: physical models and statistical models. Physical models do not rely on historical operating data and typically rely on complex numerical calculations to infer output power. They have certain advantages in medium- and long-term prediction scenarios, but perform poorly in short-term predictions. Statistical models, on the other hand, rely on historical meteorological data and wind farm operating data to construct a mapping relationship between input and output. Typical methods include Autoregressive Moving Average (ARMA), Artificial Neural Networks (ANN), and Support Vector Machines (SVM). In recent years, with the advancement of deep learning technology, models such as Convolutional Neural Networks (CNN) and Long Short-Term Memory Networks (LSTM) have been introduced into wind power prediction tasks, significantly improving prediction performance. However, these models often face problems such as large parameter scale and high information storage load during training, which can easily lead to information overload, thereby affecting the model's generalization ability and robustness. Summary of the Invention

[0004] The purpose of this application is to overcome the above-mentioned problems and provide a wind power prediction method, storage medium and electronic device.

[0005] The technical solution of this application provides a wind power prediction method, including: Historical wind power data and historical meteorological characteristics of wind farms are acquired as historical wind power data. The historical wind power data is preprocessed and divided into time series to obtain multiple sub-domain sequence data. Construct a Transformer model and train it using the sub-domain sequence data; Real-time meteorological characteristics of wind farms are acquired as real-time wind power data. The real-time wind power data is preprocessed and divided into time series to obtain multiple real-time sub-domain sequence data. The real-time subdomain sequence data is input into the trained Transformer model to obtain the wind power prediction value.

[0006] Furthermore, the construction of the Transformer model, which involves training the Transformer model using the sub-domain sequence data, specifically includes: Input the subdomain sequence data into the Transformer model to obtain the mean squared error loss value; Calculate the weighted neighborhood matching loss value among the sub-neighborhood sequence data; The total loss is calculated based on the mean squared error loss value and the neighborhood matching loss value; Based on the total loss, update the model parameters of the Transformer model until the number of updates reaches a preset number of iterations or the total loss converges.

[0007] Furthermore, the Transformer model includes an encoder and a decoder; The step of inputting the sub-domain sequence data into the Transformer model to obtain the mean squared error loss value specifically includes: The sub-domain sequence data is input into the encoder to obtain the output features; The output features are input into the decoder to obtain the predicted value; The mean square error loss value is calculated based on the predicted value and the historical wind power data.

[0008] Furthermore, the Transformer model includes an encoder; The calculation of the weighted neighborhood matching loss value between the sub-neighborhood sequence data specifically includes: Match any two of the subdomain sequence data, and the two matched subdomain sequence data are taken as a subdomain pair; Calculate the feature distribution distance of the output features extracted by the encoder from the output features of the two sub-domain sequence data in each sub-domain pair; An adaptive factor is configured for each sub-domain pair, and the corresponding feature distribution distance is weighted according to the adaptive factor; The weighted feature distribution distances are summed to obtain the weighted neighborhood matching loss value.

[0009] Furthermore, the model parameters include the corresponding adaptive factor for each of the sub-domain pairs; The updating of the model parameters of the Transformer model specifically includes: Calculate the change in distribution distance for each subdomain between the current training round and the previous training round; If the change in the distribution distance is greater than or equal to zero, then the corresponding adaptive factor for the sub-neighborhood is increased; If the change in the distribution distance is less than zero, then the corresponding adaptive factor for the sub-neighborhood is maintained or decreased.

[0010] Furthermore, the step of preprocessing the historical wind power data and dividing it into time series segments specifically includes: The historical wind power data was initially screened based on the wind turbine cut-in wind speed and wind turbine cut-out wind speed. The interquartile range method was used to remove outliers from the preliminary screened historical wind power data. Linear interpolation is performed on the wind power historical data after outlier removal to fill in the gaps, resulting in preprocessed wind power historical data. Based on the distribution distance metric, the preprocessed wind power historical data is divided into multiple sub-domain sequence data in the time series.

[0011] Furthermore, the preprocessed historical wind power data is divided into multiple sub-domain sequence data in the time series, specifically including: Candidate split points are determined sequentially on the time series, and the initial distribution distance between the sub-domain sequence data formed at each candidate split point is calculated. With the goal of maximizing the initial distribution distance, the optimal segmentation point is determined from the candidate segmentation points; Multiple sub-domain sequence data are obtained based on the optimal segmentation point.

[0012] The technical solution of this application also provides a storage medium that stores computer instructions, which, when executed by a computer, are used to perform a wind power prediction method as described above.

[0013] The technical solution of this application also provides an electronic device, including at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform a wind power prediction method as described above.

[0014] The technical solution of this application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements a wind power prediction method as described above.

[0015] The above technical solution has the following beneficial effects: This application discloses a wind power prediction method, storage medium, and electronic device, comprising: acquiring historical wind power data and historical meteorological characteristics of wind farms as historical wind power data; preprocessing and dividing the data into multiple sub-domain sequence data based on time series; constructing a Transformer model and training it using the sub-domain sequence data; acquiring real-time meteorological characteristics as real-time wind power data, completing preprocessing and time series division to form real-time sub-domain sequence data; and inputting the real-time sub-domain sequence data into the Transformer model to obtain the predicted wind power value. By dividing the time series based on distribution differences, non-stationary wind power time series data is decomposed into sub-domains with internal consistency and significant external distribution differences, enabling the model to learn features under different conditions during training. Combined with the Transformer, this effectively alleviates the problem of information overload caused by deep models, improving the accuracy, robustness, and adaptability to complex wind conditions in wind power prediction. Attached Figure Description

[0016] The disclosure of this application will become more readily understood with reference to the accompanying drawings. It should be understood that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this application. In the drawings: Figure 1 This is a flowchart of the wind power prediction method in one embodiment of this application; Figure 2 This is a software algorithm flowchart of a wind power prediction method according to another embodiment of this application; Figure 3 This is a flowchart illustrating the process of obtaining multiple sub-domain sequence data in a wind power prediction method according to one embodiment of this application; Figure 4 This is a flowchart illustrating the training process of a Transformer model in a wind power prediction method according to one embodiment of this application. Figure 5 This is a schematic diagram of the hardware structure of an electronic device in one embodiment of this application. Detailed Implementation

[0017] The specific embodiments of this application will be further described below with reference to the accompanying drawings.

[0018] It is readily understood that, based on the technical solution of this application, various structural and implementation methods can be interchanged by those skilled in the art without altering the essential spirit of this application. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this application and should not be considered as the entirety of this application or as limitations or restrictions on the technical solution of the application.

[0019] The directional terms such as up, down, left, right, front, back, front, back, top, and bottom mentioned or possibly used in this specification are defined relative to the structures shown in the accompanying drawings. These are relative concepts and may therefore vary depending on their location and usage. Therefore, these or other directional terms should not be interpreted as restrictive. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0020] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meanings of the above in this application according to the specific circumstances.

[0021] like Figure 1 As shown, a flowchart of a wind power prediction method according to an embodiment of this application is presented, including: Step S101: Obtain historical wind power data and historical meteorological characteristics of wind farms as historical wind power data. Perform data preprocessing on the historical wind power data and divide it into multiple sub-domain sequence data. Step S102: Construct a Transformer model and train it using sub-domain sequence data; Step S103: Obtain real-time wind power data and real-time wind farm meteorological characteristics as real-time wind power data. Perform data preprocessing on the real-time wind power data and divide it into time series to obtain multiple real-time sub-domain sequence data. Step S104: Input the real-time subdomain sequence data into the trained Transformer model to obtain the wind power prediction value.

[0022] Specifically, in step S101, historical wind power data and historical meteorological characteristics of wind farms are first acquired as historical wind power data. The historical wind power data includes historical power values ​​as real labels, and the historical meteorological characteristics of wind farms include meteorological characteristics such as historical wind speed, historical wind direction, or historical temperature. The two are used as components of historical wind power data, and data preprocessing is performed on the historical wind power data. After the data preprocessing is completed, the data is divided in time series to obtain multiple sub-domain sequence data.

[0023] In step S102, a wind power prediction model with Transformer as its main structure is constructed. Multiple sub-domain sequence data obtained in step S101 are used as training inputs. The Transformer model models the long-term dependencies of the time series through an encoder and decoder structure. During the encoding stage, the temporal features of each sub-domain sequence are extracted, and during the decoding stage, the corresponding power prediction output is generated based on the learned features. Since the training data has been divided into multiple sub-domain sequence data with significant distribution differences according to the distribution distance metric, the model can fully engage with feature distributions from different operating conditions, meteorological states, or equipment operating conditions during training, thereby improving the model's adaptability and generalization ability to multi-source heterogeneous time series data.

[0024] In step S103, real-time wind farm meteorological characteristics are acquired and used as real-time wind power data. The same preprocessing method as in step S101 is used for processing, including preliminary screening, outlier removal, and interpolation completion, to ensure that the quality of the real-time meteorological data is consistent with that of the training phase data. Subsequently, the preprocessed real-time wind power data is divided into time series based on the distribution distance metric to generate multiple real-time sub-domain sequence data, so that the structure of the real-time input is consistent with the data format during model training, thereby ensuring that the model can correctly understand the distribution characteristics of the real-time data.

[0025] In step S104, the real-time sub-domain sequence data obtained in step S103 is input into the Transformer model trained in step S102. The encoder part extracts and aligns the features of each real-time sub-domain, and the decoder part generates the wind power prediction value at the corresponding time based on the current time step and historical dependencies. Since the model has been trained with multi-sub-domain sequence data, it has the ability to adapt to cross-distribution samples. In the real-time prediction stage, it can more stably handle feature distribution drift caused by sudden changes in wind conditions, changes in meteorological conditions, or changes in the operating status of wind farms, thereby improving prediction accuracy and robustness.

[0026] This embodiment of a wind power prediction method includes acquiring historical wind power data and historical meteorological characteristics of wind farms as historical wind power data, preprocessing them, and dividing them into multiple sub-domain sequence data based on time series; constructing a Transformer model and training it using the sub-domain sequence data; acquiring real-time meteorological characteristics as real-time wind power data, completing preprocessing and time series division to form real-time sub-domain sequence data; and inputting the real-time sub-domain sequence data into the Transformer model to obtain the predicted wind power value. By dividing the time series based on distribution differences, non-stationary wind power time series data is decomposed into sub-domains with internal consistency and significant external distribution differences, enabling the model to learn features under different conditions during training. Combined with Transformer, this effectively alleviates the problem of information overload caused by deep models, improving the accuracy, robustness, and adaptability to complex wind conditions in wind power prediction.

[0027] In one embodiment, a Transformer model is constructed and trained using sub-domain sequence data, specifically including: Input the subdomain sequence data into the Transformer model to obtain the mean squared error loss value; Calculate the weighted neighborhood matching loss between sub-neighborhood sequence data; The total loss is calculated based on the mean squared error loss value and the weighted neighborhood matching loss value. Based on the total loss, update the model parameters of the Transformer model until the number of updates reaches the preset number of iterations or the total loss converges.

[0028] In this embodiment, a Transformer model is constructed and trained using sub-domain sequence data. This includes adding a domain adaptive matching module to the Transformer model and inputting the sub-domain sequence data into the Transformer model to calculate the mean squared error loss. Subsequently, a weighted domain matching loss is calculated between the sub-domain sequence data. Specifically, any two sub-domain sequence data are paired, and the weighted domain matching loss between the paired sub-domain sequence data is calculated. Then, the total loss is calculated based on the mean squared error loss and the weighted domain matching loss. Finally, the model parameters of the Transformer model are updated based on the total loss to maintain the model's predictive performance. As the number of iterations increases, the model continuously adjusts its representation in the feature space to gradually align data from different domains. Training is completed when the preset number of iterations or the total loss converges.

[0029] The mean squared error loss value refers to the MSE loss value, which is a commonly used regression loss function. It measures the prediction accuracy of the model by averaging the squared differences between the predicted and actual values.

[0030] This embodiment introduces a domain adaptive matching module and implements the above training, endowing the model with the ability to dynamically perceive and actively eliminate the influence of data distribution offsets, thereby significantly improving its prediction robustness in complex and variable environments. Domain matching loss is calculated by pairwise weighted matching of all sub-domain sequence data. During training, the model not only focuses on the traditional mean squared error loss but also dynamically perceives and adjusts the distribution differences between different sub-domains. This allows the model to gradually align data from different domains in the feature space, enhancing its learning ability for combinations of sub-domains with large distribution differences, thus effectively improving prediction accuracy and generalization ability. Compared with traditional training methods that rely solely on mean squared error, this embodiment can reduce prediction bias caused by inconsistent historical data distributions. Especially when wind farm meteorological characteristic data exhibits non-stationarity and random fluctuations, the model can still maintain stable and high-precision prediction performance. Subsequently, by iteratively optimizing the total loss function, the model parameters are adaptively adjusted during training, achieving effective representation of complex time-series data, thereby improving the reliability and robustness of short-term wind power prediction.

[0031] The number of updates reaching the preset number of iterations means that the model parameters are continuously updated through backpropagation. Each complete forward and backward calculation of the training data is counted as one update round. When the number of training rounds accumulates to the preset maximum number of iterations, parameter updates will stop even if the total loss has not yet fully converged, in order to prevent overtraining or infinite loops.

[0032] Total loss convergence refers to the total loss value stabilizing as the number of training epochs increases, no longer showing a significant decrease. This indicates that the model parameters have reached a local or global optimum, and the model's predictive performance on the training data and its feature alignment ability between sub-domains are basically stable. Total loss convergence also signifies the completion of the model's learning process, meaning that further iterations to optimize the loss function can no longer bring significant performance improvements. At this point, training can be stopped, and the trained Transformer model can be used for subsequent real-time wind power prediction.

[0033] In one embodiment, the Transformer model includes an encoder and a decoder; Input the subdomain sequence data into the Transformer model to obtain the mean squared error loss value, specifically including: The subdomain sequence data is input into the encoder to obtain the output features; The output features are input into the decoder to obtain the predicted value; The mean square error loss value is calculated based on the predicted value and historical wind power data.

[0034] In this embodiment, historical wind power data serves as the true label. The true label refers to the historical wind power data that is actually measured and corresponds one-to-one with the historical meteorological characteristics of the wind farms included in each sub-domain sequence data. It is the benchmark answer used to measure the prediction accuracy during model training. The encoder is the first half of the Transformer model's neural network, whose core function is to analyze and understand the input time series data and convert it into a set of feature vectors rich in temporal dependencies. The decoder is the second half of the Transformer model's network. It receives the feature representation output by the encoder and, based on this information, gradually generates predicted values ​​for future wind power in time steps.

[0035] The process involves inputting sub-domain sequence data into the Transformer model to obtain the mean squared error loss value. This includes inputting the sub-domain sequence data into the encoder to obtain output features, and then inputting the output features into the decoder. The decoder combines the encoder features to generate a predicted value for wind power. Finally, based on the predicted value and the true label, i.e., the predicted value and historical wind power data, the mean squared error loss value is calculated. This directly and objectively reflects the model's prediction accuracy on the current batch of data and serves as a signal driving the optimization of model parameters towards improving prediction accuracy.

[0036] (1) Where LMSE is the mean squared error loss value, and n is the number of samples. It is the true label of the i-th sample, which is the historical power data of wind power. It is the predicted value of the i-th sample.

[0037] This embodiment uses the encoder and decoder of the Transformer model to calculate the mean squared error loss, which can effectively model the complex spatiotemporal relationship between meteorological and operational parameters such as wind speed and power, thereby obtaining more accurate preliminary predictions than traditional recurrent neural networks. Using MSE as the prediction loss provides a clear and stable gradient signal for model optimization, ensuring that the model can learn the basic physical mapping relationship from input features to output power.

[0038] In one embodiment, the Transformer model includes an encoder; Calculating the weighted neighborhood matching loss between sub-neighborhood sequence data specifically includes: Match any two subdomain sequence data, and the two matched subdomain sequence data are taken as a subdomain pair; Calculate the feature distribution distance of the output features extracted by the encoder from the output features of the two sub-domain sequence data in each sub-domain pair; Configure adaptive factors for each subdomain, and weight the corresponding feature distribution distances according to the adaptive factors; The weighted feature distribution distances are summed to obtain the weighted neighborhood matching loss value.

[0039] In this embodiment, calculating the weighted domain matching loss between sub-domain sequence data includes matching any two sub-domain sequence data, with the matched two sub-domain sequence data as a sub-domain pair, which is the basic comparison unit for calculating distribution differences; calculating the feature distribution distance between the two sub-domain sequence data in each sub-domain pair, where the feature distribution distance is a quantitative indicator used to measure the difference in the statistical distribution of the internal feature representations of the two data in a sub-domain pair after model mapping, for example, using the CORAL distance function; then configuring a dynamically learnable adaptive factor for each sub-domain pair to weight the corresponding feature distribution distance, so that sub-domain pairs with larger distribution differences occupy higher weights in the loss function, thereby prompting the model to pay more attention to these difficult alignment tasks; finally, summing the weighted feature distribution distances of all sub-domain pairs to obtain the weighted domain matching loss value, which is used as part of the total training loss.

[0040] Specifically, for any two domains i and j, the distribution distance of their internal feature representations is calculated using the CORAL distance function: (2) in, and These represent the feature representations of the two sub-domain sequence data in the sub-domain pair after passing through the Transformer encoder. and Let each feature be its covariance matrix. As the feature dimension, this distance function measures the difference in feature distribution between two subdomains; the larger the value, the greater the difference in distribution.

[0041] (3) in, It is a weighted domain matching loss value, used to quantify the distribution differences of all sub-domain pairs in the feature space, and is used as part of the total training loss function; and Let represent the feature representations of the i-th and j-th sub-domain sequence data after being encoded, respectively. The difference in feature distribution between the two sub-domains is calculated using the CORAL distance function. δ is an adaptive factor used to adjust the weights of different sub-domain pairs in the total loss. Formula (3) sums the weighted feature distribution distances of all sub-domain pairs to obtain the weighted domain matching loss value for the entire training batch. By adding the adaptive factor δ, the model will pay more attention to sub-domain pairs with large distribution differences during training, thereby effectively aligning the feature distributions of different sub-domains, improving the model's generalization ability and prediction accuracy on multi-source wind power data.

[0042] This embodiment enables the model to adaptively concentrate more learning resources on the data domains with the most difficult-to-align distribution differences, thereby more efficiently improving its overall generalization robustness. Traditional methods, which simply minimize the average difference between all domains, are prone to being dominated by aligned domains and neglecting those difficult domain pairs. By configuring adaptive factors for each domain pair and performing weighted summation, the matching difficulty of each domain pair can be dynamically evaluated during training. Difficult-to-match domain pairs will receive higher weights and occupy a larger proportion in the loss function, forcing the model to invest resources in subsequent iterations to narrow down their feature distributions.

[0043] In another embodiment, the model parameters include a corresponding adaptive factor for each sub-domain pair; Updating the model parameters of the Transformer model specifically includes: Calculate the change in distribution distance for each subdomain between the current training epoch and the previous training epoch; If the change in distribution distance is greater than or equal to zero, then increase the corresponding adaptive factor for that sub-domain. If the change in distribution distance is less than zero, then maintain / reduce the corresponding adaptive factor for that sub-neighborhood.

[0044] In this embodiment, the model parameters include the corresponding adaptive factor for each sub-domain pair. Updating the Transformer model parameters includes calculating the change in distribution distance between the current training epoch and the previous training epoch for each sub-domain pair. Specifically, during Transformer model training, the feature distribution distance is calculated for each pair of sub-domain sequence data. The deviation between the distribution distance in the current training epoch and the distribution distance in the previous training epoch is the change in distribution distance. After being weighted by the adaptive factor, it participates in the calculation of the total loss. In order to make the model more focused on difficult-to-align sub-domain pairs during training, the adaptive factor needs to be dynamically updated: First, the change in distribution distance ΔQ between the current training epoch and the previous training epoch is calculated. If ΔQ≥0, it means that the feature distribution difference of the sub-domain pair has not decreased or has even increased, which is a case of difficult alignment. Therefore, its adaptive factor is increased, so that its weight in the total loss is increased, thereby forcing the model to pay more attention to the alignment task of the sub-domain pair. If ΔQ<0, it means that the feature distribution difference of the sub-domain pair is decreasing or remains stable. The adaptive factor can be maintained or appropriately reduced to avoid over-focusing on aligned sub-domain pairs.

[0045] Specifically, the adaptive factor is determined and updated according to the following formula: (4) Where, δ (n) δ represents the adaptive factor for the current training round. (n+1) ΔQ represents the adaptive factor for the next training round, and ΔQ represents the change in distribution distance between the current training round and the previous round. Sigmoid The definition of ) is: (5) Where e is the natural base, and ΔQ represents the change in the distribution distance between the current training round and the previous round.

[0046] This embodiment achieves dynamic weight adjustment for different sub-domain pairs during training through the aforementioned adaptive factor update mechanism. When the feature distribution distance of a certain sub-domain pair does not decrease or even increases (ΔQ≥0), the adaptive factor δ is increased, thereby increasing the contribution of that sub-domain pair to the total loss function. This forces the model to focus more on sub-domain pairs that are difficult to align, enhancing the model's generalization ability to complex and extreme data. For sub-domain pairs whose feature distribution differences decrease or remain stable (ΔQ<0), the adaptive factor remains unchanged or is appropriately reduced to avoid the model over-focusing on aligned data, saving training resources and accelerating convergence. Through this dynamic adjustment strategy, the model can gradually optimize the feature space representation in multiple rounds of iterative training, achieving effective alignment of sequence data from different sub-domains and improving the accuracy and stability of wind power prediction.

[0047] In one preferred embodiment, the model parameters of the Transformer model are updated using a gradient descent algorithm.

[0048] In this preferred embodiment, backpropagation is first used to calculate the partial derivatives of the total loss L with respect to each parameter in the model, starting from the total loss L. This yields a complete gradient vector, which quantifies the impact of small changes in each parameter on the total loss. Subsequently, the algorithm subtracts the corresponding gradient values ​​from the existing parameter values ​​according to a predetermined learning rate, i.e., the step size. This operation allows all parameters to adjust collaboratively by a small step along the descent direction of the loss surface, resulting in smaller prediction errors and less domain-specific differences for the same batch of data under the new parameters.

[0049] This embodiment employs the gradient descent algorithm, enabling the Transformer model to learn a representation that better aligns with the distribution characteristics of multi-subdomain data during the optimization of mean squared error loss and weighted neighborhood matching loss. In multi-domain historical wind power data with distributional offsets, the gradient descent algorithm can facilitate more effective adjustment of the model's internal parameters, allowing the model to continuously improve its prediction performance during iterative training and achieve dynamic alignment with data from different subdomains, thereby enhancing the model's robustness and generalization ability.

[0050] In another preferred embodiment, Dropout is added within the Transformer model.

[0051] In this preferred embodiment, Dropout is added to the Transformer model. Dropout randomly masks the output of some neurons with a certain probability in each training iteration, so that these neurons do not participate in forward and backward propagation in that iteration. This breaks the high dependence between neurons, enhances the generalization ability of the model, and by randomly dropping some neurons, the model does not rely solely on certain specific features for prediction, but learns more robust feature representations. This enables the model to capture key features more stably when facing sequence data from different subdomains, further prevents overfitting, and improves the model's adaptability to differences in historical data distribution and the prediction accuracy of real-time wind power data.

[0052] In another embodiment, the historical wind power data is preprocessed and divided into time series segments, specifically including: The historical wind power data were initially screened based on the wind speed at which the turbines entered and exited the wind turbines. The interquartile range method was used to remove outliers from the initial screening of historical wind power data. Linear interpolation is performed on the wind power historical data after outlier removal to fill in the gaps, resulting in preprocessed wind power historical data. Based on the distribution distance metric, the preprocessed historical wind power data is divided into multiple sub-domain sequence data in the time series.

[0053] In this embodiment, historical wind power data is preprocessed and divided into time series segments. First, the historical wind power data is initially screened based on the physical parameters of the wind turbines, namely the turbine cut-in wind speed and the turbine cut-out wind speed. The turbine cut-in wind speed is the lowest wind speed at which the turbine begins to generate power, and the turbine cut-out wind speed is the maximum wind speed at which the turbine safely stops generating power. These two parameters are used to initially screen for abnormal or invalid data. Then, the interquartile range method is used to remove outliers from the initially screened historical wind power data to reduce the interference of extreme data on model training. After processing outliers, missing data in the time series is filled in by linear interpolation to make the data continuous and complete, which is convenient for the model to learn time series features.

[0054] Specifically, the interquartile range (IMR) is a statistical method used to identify outliers in data. It determines the outlier threshold by calculating the difference between the upper and lower quartiles of the data. When a data point is less than the difference between the lower quartile and 1.5 times the IMR, or greater than the sum of the upper quartile and 1.5 times the IMR, it can be identified as an outlier and removed. This effectively removes samples that deviate extremely from the normal distribution, making subsequent model learning more stable.

[0055] Linear interpolation is a method for filling in missing data. It extrapolates missing values ​​by using the linear relationship between adjacent known data points. It extrapolates the missing values ​​for the missing points in between. Assuming that the data changes smoothly in a short period of time, it completes the interpolation by constructing a simple linear function, so that the time series remains complete and continuous, which can meet the requirements of subsequent time series models for continuous input.

[0056] Finally, based on the distribution distance metric, the preprocessed historical wind power data is divided into multiple sub-domain sequence data in the time series. Specifically, the characteristic distribution distance between each time segment is calculated, and the optimal split point is selected through a greedy strategy to make the data distribution within each sub-domain as consistent as possible, while maximizing the distribution difference between different sub-domains. This helps to capture potential environmental change patterns or operational status changes in historical data and improves the model's adaptability to different data domains.

[0057] This embodiment, through the aforementioned data preprocessing and partitioning methods, enables the model to learn stable temporal patterns within each subdomain during training. Simultaneously, the distribution distance between different subdomains enhances the model's domain adaptability, improving prediction accuracy and generalization performance. Outlier removal and missing value imputation ensure the continuity and reliability of input data, reducing the negative impact of noise on model training. Subdomain partitioning also helps the model maintain prediction stability when facing sudden changes in environmental factors such as wind speed, wind direction, or temperature.

[0058] In one embodiment, based on a distribution distance metric, the preprocessed historical wind power data is divided into multiple sub-domain sequence data in a time series, specifically including: Candidate split points are determined sequentially on the time series, and the initial distribution distance between the sub-domain sequence data formed at each candidate split point is calculated. The optimal split point is determined from the candidate split points with the goal of maximizing the initial distribution distance. Multiple sub-domain sequence data are obtained based on the optimal split point.

[0059] In this embodiment, based on the distribution distance metric, the preprocessed historical wind power data is divided into multiple sub-domain sequence data in the time series. First, candidate split points are determined sequentially on the time series. Then, the sequence is divided into two segments at each point. Feature representations of the two segments are extracted, and the initial distribution distance between them is calculated. This distance reflects the degree of difference between the two sides after the split at that location and can be calculated using the CORAL distance function. Then, with the goal of maximizing the initial distribution distance, the optimal split point is selected from the candidate split points. In the scenario of multi-segment division, this selection can be performed sequentially, for example, using a greedy strategy to sequentially select the point that maximizes the current splitting effect until the division strategy or the number of segments is satisfied. Finally, the entire time series is divided into several sub-domain sequence data according to the determined optimal split point.

[0060] The confirmation of candidate segmentation points can be generated based on time rules, changes in wind turbine operating status, etc. Candidate segmentation points can not only be obtained by presetting fixed time intervals, but can also be automatically identified by combining the changing trends of key features such as wind speed, wind direction, and air pressure. For example, when the wind direction changes significantly, the average wind speed changes abruptly, or the unit enters a new operating range, these time locations can be marked as potential candidate segmentation points by detecting local changes in feature distribution.

[0061] This embodiment evaluates candidate split points and ensures that the sub-domains with the greatest distribution differences are divided based on the principle of maximizing the initial distribution distance. This ensures that each sub-domain sequence data represents a unique distribution pattern in the historical data, and the set of all sub-domains covers the distribution diversity in the observed data. The resulting sub-domains are statistically significantly different but relatively consistent internally, reducing the mixing of samples from different working conditions or meteorological conditions. This reduces feature conflicts and information interference caused by the mixing of multiple distributions during model training, making subsequent sub-domain-based learning and alignment more targeted, thereby improving the model's generalization ability and prediction stability.

[0062] One approach is to maximize the initial distribution distance while employing a greedy strategy. This strategy involves selecting the segmentation point that maximizes the distribution distance optimization effect from all candidate segmentation points during the partitioning process. In other words, it selects the optimal solution within a local range to gradually approach the overall optimal sequence partitioning structure. This strategy can achieve good distribution difference partitioning results without significantly increasing computational complexity, thereby improving the accuracy of sub-domain partitioning and the quality of model training.

[0063] In one embodiment, real-time wind power data and real-time wind farm meteorological characteristics are acquired as real-time wind power data. The real-time wind power data is preprocessed and divided into time series to obtain multiple real-time sub-domain sequence data, which are consistent with the multiple sub-domain sequence data obtained based on historical wind power data mentioned above.

[0064] Specifically, firstly, based on the operating thresholds of the wind turbines, including the wind speeds at which they enter and exit the turbines, the real-time wind power data is initially screened to exclude abnormal operating conditions. Then, the interquartile range method is used to remove outliers from the real-time data, and missing data is filled in using linear interpolation to maintain the stability and continuity of the real-time wind power sequence. Next, the real-time wind power data is further divided into time series based on the distribution distance metric. By sequentially determining candidate segmentation points and calculating the initial distribution distance of each real-time sub-domain formed at each candidate segmentation point, the optimal segmentation point is selected based on maximizing the distribution difference, thereby obtaining multiple real-time sub-domain sequence data corresponding to the model training process.

[0065] In one embodiment, real-time subdomain sequence data is input into the trained Transformer model to obtain wind power prediction values.

[0066] Specifically, after preprocessing and time series partitioning based on distribution distance, the real-time sub-domain sequence data maintains the same feature organization as the sub-domain sequence data during model training, thus it can be directly used as input for the model inference stage. The trained Transformer model has learned the feature differences and correlations between different sub-domains based on multi-domain inputs. The model first inputs real-time wind farm meteorological features such as wind speed, wind direction, air pressure, humidity, and temperature into the encoder. The encoder generates feature representations, which are then input into the decoder. Combined with the sequence patterns learned in the previous training phase and the alignment information between sub-domains, the corresponding real-time wind power prediction value is generated.

[0067] like Figure 2 As shown, a software algorithm flowchart of a wind power prediction method according to another embodiment of this application includes: The Transformer model receives feature sequence data from multiple different subdomains (Domain 1, Domain 2, ..., Domain n), and outputs corresponding output features H and prediction results y. Each subdomain contains wind power time series features with different statistical properties. Based on the deviation between the prediction result y and the historical wind power data, the prediction loss L1, also known as LMSE (mean squared error loss), is calculated. Using the deep feature representation H output by the Transformer module as input, the distribution distance Q between features in different subdomains is calculated, and the change in this distribution distance ΔQ is monitored. The adaptive factor δ is updated according to the change. If ΔQ ≥ 0, the corresponding δ is increased; otherwise, δ remains unchanged. Finally, the distribution distance is weighted using the updated adaptive factor δ to generate the domain matching loss L2. The prediction loss L1 and the domain matching loss L2 are then added to obtain the total loss L. Based on this total loss L, the parameters of the Transformer module and related adaptive factors are updated using the backpropagation algorithm.

[0068] like Figure 3 As shown, a flowchart illustrating the workflow of obtaining multiple sub-domain sequence data in a wind power prediction method according to one embodiment of this application includes: S301: Obtain historical wind power data and historical meteorological characteristics of wind farms as historical wind power data; S302: Perform preliminary screening of historical wind power data based on wind turbine cut-in wind speed and wind turbine cut-out wind speed; S303: Use the interquartile range method to remove outliers from the initial screening of historical wind power data; S304: Linear interpolation is performed on the wind power historical data after outlier removal to fill in the gaps and obtain the wind power historical data with data preprocessing completed; S305: Sequentially determine candidate split points on the time series, and calculate the initial distribution distance between the sub-domain sequence data formed by splitting at each candidate split point; S306: Determine the optimal split point from the candidate split points with the goal of maximizing the initial distribution distance; S307: Obtain multiple sub-domain sequence data based on the optimal split point.

[0069] like Figure 4 As shown, a flowchart illustrating the training process of a Transformer model in a wind power prediction method according to one embodiment of this application includes: S401: Input the sub-domain sequence data into the encoder to obtain the output features; S402: Input the output features into the decoder to obtain the predicted value; S403: Calculate the mean square error loss value based on the predicted value and historical wind power data; S404: Match any two subdomain sequence data, and the two matched subdomain sequence data are taken as a subdomain pair; S405: Calculate the feature distribution distance of the output features extracted by the encoder from the output features of the two sub-domain sequence data in each sub-domain pair; S406: Configure an adaptive factor for each subdomain pair, and weight the corresponding feature distribution distances according to the adaptive factor; S407: Sum the weighted feature distribution distances to obtain the weighted neighborhood matching loss value; S408: Calculate the total loss based on the mean squared error loss value and the neighborhood matching loss value; S409: Based on the total loss, update the model parameters of the Transformer model until the number of updates reaches the preset number of iterations or the total loss converges; S410: Calculate the change in distribution distance for each subdomain between the current training round and the previous training round; S411: If the change in distribution distance is greater than or equal to zero, then increase the corresponding adaptive factor for that sub-neighborhood; S412: If the change in distribution distance is less than zero, then maintain / reduce the corresponding adaptive factor for that sub-neighborhood.

[0070] Embodiments of this application also provide a storage medium that stores computer instructions, which, when executed by a computer, are used to perform a wind power prediction method as described in any of the preceding embodiments.

[0071] Figure 5 An electronic device according to this application is shown, comprising: At least one processor 501; and, Memory 502 is communicatively connected to at least one processor 501; wherein, The memory 502 stores instructions that can be executed by at least one processor 501, which enables the at least one processor 501 to perform all the steps of a wind power prediction method in any of the foregoing method embodiments.

[0072] Figure 5 Taking a processor 501 as an example: The electronic device may also include an input device 503 and an output device 504.

[0073] The processor 501, memory 502, input device 503 and output device 504 can be connected by a bus or other means. The figure shows an example of connection by bus.

[0074] The memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to a wind power prediction method in an embodiment of this application. Figure 1-4 The method flow is shown. The processor 501 executes various functional applications and data processing by running non-volatile software programs, instructions, and modules stored in the memory 502, thereby realizing a wind power prediction method in the above embodiment.

[0075] Memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application program required for at least one function; the data storage area may store data created based on the use of a wind power prediction method, etc. Furthermore, memory 502 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 502 may optionally include memory remotely located relative to processor 501, and these remote memories may be connected via a network to the apparatus performing a wind power prediction method. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0076] The input device 503 can receive user clicks and generate signal inputs related to user settings and function control of the real-time zone dimming method of the vehicle lighting system. The output device 504 may include a display device such as a display screen.

[0077] One or more modules are stored in memory 502, and when run by one or more processors 501, a wind power prediction method in any of the above method embodiments is executed.

[0078] Embodiments of this application also provide a computer program product, including a computer program / instructions that, when executed by a processor, implement a wind power prediction method as described in any of the preceding embodiments.

[0079] As needed, the above technical solutions can be combined to achieve the best technical effect.

[0080] The above description is merely the principle and preferred embodiment of this application. It should be noted that for those skilled in the art, implementation methods obtained by appropriately combining the technical solutions disclosed in different embodiments are also included within the technical scope of this invention. Based on the principle of this application, several other modifications can also be made, which should also be considered within the protection scope of this application.

Claims

1. A method for predicting wind power output, characterized in that, include: Historical wind power data and historical meteorological characteristics of wind farms are acquired as historical wind power data. The historical wind power data is preprocessed and divided into time series to obtain multiple sub-domain sequence data. Construct a Transformer model and train it using the sub-domain sequence data; Real-time meteorological characteristics of wind farms are acquired as real-time wind power data. The real-time wind power data is preprocessed and divided into time series to obtain multiple real-time sub-domain sequence data. The real-time subdomain sequence data is input into the trained Transformer model to obtain the wind power prediction value.

2. The wind power prediction method according to claim 1, characterized in that, The construction of the Transformer model, which involves training the Transformer model using the sub-domain sequence data, specifically includes: Input the subdomain sequence data into the Transformer model to obtain the mean squared error loss value; Calculate the weighted neighborhood matching loss value among the sub-neighborhood sequence data; The total loss is calculated based on the mean squared error loss value and the neighborhood matching loss value; Based on the total loss, update the model parameters of the Transformer model until the number of updates reaches a preset number of iterations or the total loss converges.

3. The wind power prediction method according to claim 2, characterized in that, The Transformer model includes an encoder and a decoder; The step of inputting the sub-domain sequence data into the Transformer model to obtain the mean squared error loss value specifically includes: The sub-domain sequence data is input into the encoder to obtain the output features; The output features are input into the decoder to obtain the predicted value; The mean square error loss value is calculated based on the predicted value and the historical wind power data.

4. The wind power prediction method according to claim 2, characterized in that, The Transformer model includes an encoder; The calculation of the weighted neighborhood matching loss value between the sub-neighborhood sequence data specifically includes: Match any two of the subdomain sequence data, and the two matched subdomain sequence data are taken as a subdomain pair; Calculate the feature distribution distance of the output features extracted by the encoder from the output features of the two sub-domain sequence data in each sub-domain pair; An adaptive factor is configured for each sub-domain pair, and the corresponding feature distribution distance is weighted according to the adaptive factor; The weighted feature distribution distances are summed to obtain the weighted neighborhood matching loss value.

5. The wind power prediction method according to claim 2, characterized in that, The model parameters include the corresponding adaptive factors for each of the sub-domain pairs; The updating of the model parameters of the Transformer model specifically includes: Calculate the change in distribution distance for each subdomain between the current training round and the previous training round; If the change in the distribution distance is greater than or equal to zero, then the corresponding adaptive factor for the sub-neighborhood is increased; If the change in the distribution distance is less than zero, then the corresponding adaptive factor for the sub-neighborhood is maintained or decreased.

6. The wind power prediction method according to claim 1, characterized in that, The process of preprocessing and dividing the historical wind power data into time series segments specifically includes: The historical wind power data was initially screened based on the wind turbine cut-in wind speed and wind turbine cut-out wind speed. The interquartile range method was used to remove outliers from the preliminary screened historical wind power data. Linear interpolation is performed on the wind power historical data after outlier removal to fill in the gaps, resulting in preprocessed wind power historical data. Based on the distribution distance metric, the preprocessed wind power historical data is divided into multiple sub-domain sequence data in the time series.

7. The wind power prediction method according to claim 6, characterized in that, The method of dividing the preprocessed historical wind power data into multiple sub-domain sequence data based on the distribution distance metric specifically includes: Candidate split points are determined sequentially on the time series, and the initial distribution distance between the sub-domain sequence data formed at each candidate split point is calculated. With the goal of maximizing the initial distribution distance, the optimal segmentation point is determined from the candidate segmentation points; Multiple sub-domain sequence data are obtained based on the optimal segmentation point.

8. A storage medium, characterized in that, The storage medium stores computer instructions, which, when executed by the computer, are used to perform a wind power prediction method as described in any one of claims 1-7.

9. An electronic device, characterized in that, Includes at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform a wind power prediction method as described in any one of claims 1-7.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement a wind power prediction method as described in any one of claims 1-7.