A short-term wind power forecasting method and system based on dynamic delay and hierarchical federated learning
Through dynamic delay and layered federal learning methods, the problems of poor adaptability and low prediction accuracy in new wind farms in wind power prediction are solved, achieving higher prediction accuracy and adaptability, while improving data privacy protection.
Patent Information
- Application Number
- CN202510180693.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-02-19
AI Technical Summary
The existing wind power power prediction methods have poor adaptability and low prediction accuracy when facing a new wind farm. The changes in wind speed between wind farms lead to difficulty in data alignment, affecting the prediction accuracy.
The short-term wind power power prediction method based on dynamic delay and stratified federal learning is adopted to dynamically adjust the historical wind power data timestamp by calculating the wind speed delay time, reduce the data alignment problem between wind farms, and train it through a multi-scale self-attention wind power power prediction model to improve prediction accuracy.
It improves the accuracy and adaptability of wind power power prediction, reduces the risk of data privacy leakage, and better meets the specific needs of different wind farms.
Smart Images

Figure CN119669740B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wind power prediction, and more specifically, to a short-term wind power prediction method and system based on dynamic delay and hierarchical federated learning. Background Art
[0002] With the growing global demand for renewable energy, wind power has been widely used around the world as a clean and sustainable form of energy. However, wind power is affected by many factors such as wind speed, wind direction, and temperature, and is highly volatile and uncertain. Especially when multiple wind farms are distributed in different regions, traditional wind power forecasting methods face many challenges in terms of forecast accuracy and timeliness due to wind speed delays and geographical distance differences between wind farms.
[0003] At present, wind power prediction methods are mainly divided into statistical model prediction methods based on event sequences, physical model prediction methods and data-driven machine learning model prediction methods. Among them, the statistical model prediction method based on event sequences mainly predicts future wind power by statistically analyzing historical wind power, wind speed, wind direction and other data and establishing a statistical model. It relies on the time series characteristics of the data, such as autocorrelation and trend. Common statistical prediction methods include time series analysis and Kalman filtering. The prediction method based on the physical model uses the atmospheric boundary layer dynamics and boundary layer meteorology theory to refine the basic data output by the numerical weather forecast system into a digital description of the wind turbines in the wind farm and the actual terrain, and converts it into the wind direction and wind speed at the height of the wind turbines in the wind farm, and finally obtains the wind farm power curve. This method relies on a deep understanding of the physical process and precise calculation. The prediction method based on the data-driven machine learning model mainly relies on a large number of data samples and machine learning algorithms. Through the learning and analysis of data samples, the machine learning model can automatically extract features and establish a prediction model. In wind power forecasting, common machine learning algorithms include artificial neural networks (ANN), support vector machines (SVM), etc.
[0004] In addition, deep learning methods such as long short-term memory (LSTM) and convolutional neural networks (CNN) have also made significant progress in processing time series data, but when faced with distributed wind farm data, they often face problems such as data fusion difficulties, low computing efficiency, and privacy leakage, and low prediction accuracy. In addition, due to the obvious spatiotemporal differences in wind speed changes between wind farms, existing deep learning models often cannot quickly adapt to the data characteristics of newly built wind farms, resulting in large differences in prediction accuracy between different wind farms. Summary of the invention
[0005] In order to solve the problems that the current wind power prediction method has poor adaptability to newly built wind farms and low wind power prediction accuracy, the present invention proposes a short-term wind power prediction method and system based on dynamic delay and hierarchical federated learning, which takes into account the wind speed propagation delay, reduces the data alignment problem caused by wind speed asynchrony between wind farms, ensures the accuracy of short-term wind power prediction, and uses a hierarchical federated learning method to train a multi-scale self-attention wind power prediction model, which improves data privacy protection while better meeting the specific needs of different wind farms, thereby improving the adaptability of the multi-scale self-attention wind power prediction model to newly built wind farms and the prediction accuracy of wind power.
[0006] In order to achieve the above technical effects, the technical solution of the present invention is as follows:
[0007] In a first aspect, the present application proposes a short-term wind power forecasting method based on dynamic delay and hierarchical federated learning, comprising the following steps:
[0008] S1: Based on the historical wind power data and geographic data of the target new wind farm and its surrounding wind farms, the wind speed delay time between the target new wind farm and each surrounding wind farm is calculated;
[0009] S2: Dynamically adjust the historical wind power data timestamps of each surrounding wind farm and the target new wind farm based on the wind speed delay time to align the historical wind power data;
[0010] S3: performing empirical mode decomposition on the aligned historical wind power data, and then obtaining component spectra through spectrum analysis, and performing component spectrum optimization to obtain optimized spectrum components;
[0011] S4: construct a feature matrix based on the optimized spectral components, perform multi-scale clustering on the feature matrix, and obtain multi-channel spectral component features after clustering; during clustering, optimize the initial clustering center;
[0012] S5: Input the clustered multi-channel spectral component features into the multi-scale self-attention wind power prediction model, and train the multi-scale self-attention wind power prediction model through hierarchical federated learning;
[0013] S6: The trained multi-scale self-attention wind power prediction model is used for wind power prediction of the target new wind farm.
[0014] Preferably, the historical wind power data includes: historical wind power data, historical wind speed data, historical wind direction data, and the geographical data includes: longitude and latitude data of the target newly built wind farm and its surrounding wind farms;
[0015] The historical wind power data and geographic data of the target new wind farm and its surrounding wind farms are preprocessed. The preprocessing includes: filling the missing values in the historical wind power data and geographic data, and then smoothing the noise using the local regression smoothing method; using min-max normalization to map the historical wind power data and historical wind speed data to [0,1] to obtain the processed wind power sequence P and wind speed sequence S; converting the historical wind direction data D raw They are converted into sine form and cosine form respectively to keep the directional information, and the wind direction sine sequence WS and wind direction cosine sequence WC are obtained.
[0016] Preferably, the process of calculating the wind speed delay time between the target newly built wind farm and each surrounding wind farm is as follows:
[0017] S11: Calculate the geographical distance between each surrounding wind farm and the target wind farm based on the latitude and longitude data of each surrounding wind farm and the target new wind farm , the calculation expression is:
[0018]
[0019] in, lon A , Respectively represent the longitude and latitude of the target new wind farm A; lon Bi , Respectively represent i Surrounding wind farms B i longitude and latitude; R represents the radius of the Earth;
[0020] S12: Based on geographical distance and surrounding wind farms B i Real-time wind speed S Bi , calculate the wind speed delay time between the target new wind farm and each surrounding wind farm, the calculation expression is:
[0021]
[0022] in, The wind speed from i Surrounding wind farms B i The delay time of propagating to the target new wind farm A.
[0023] Preferably, the process of dynamically adjusting the timestamp of the historical wind power data of each surrounding wind farm and the target newly built wind farm based on the wind speed delay time is as follows:
[0024] S21: Calculate the wind speed change rate of each surrounding wind farm. The calculation expression is:
[0025]
[0026] in, S Bi ( t ) indicates surrounding wind farms B i exist t Wind speed at the moment; S Bi ( t- 1) Indicates surrounding wind farms B i exist t -Wind speed at time 1; S Bi Indicates surrounding wind farms B i exist t Moment and t -1 wind speed difference at time;
[0027] S22: Dynamically adjust the time window, and the adjustment process satisfies the expression:
[0028]
[0029] in, represents the wind speed change rate threshold, represents the time window, if △SB i Less than , then shorten the time window; otherwise, expand the time window. represents the shortened minimum time window, Indicates the maximum time window after enlargement;
[0030] S23: In each time window, calculate the target new wind farm A and the surrounding wind farms B i The number of time windows that lag behind or advance between them is calculated as follows:
[0031]
[0032] in, Indicates the number of time window grids, is the conversion factor of time unit; △td Indicates the delay time;
[0033] S24: Compare the number of delayed or advanced time window grids with 0, and adjust the surrounding wind farms according to the comparison result. B iThe wind power data timestamp is expressed as:
[0034]
[0035] When the sliding window continues to move forward, the delay time is calculated again according to the real-time wind speed in the new window, and the timestamp of the wind power data in the next time window is adjusted.
[0036] According to the above technical means, considering the wind speed propagation delay can effectively reduce the data alignment problem caused by the asynchronous wind speed between wind farms, ensure the accuracy of short-term wind power forecasting, and dynamically adjust the data timestamp by combining the geographical distance and real-time wind speed, thus avoiding the negative impact of ignoring the wind speed delay on the forecasting results, which can significantly improve the accuracy and reliability of the forecast.
[0037] Preferably, the process of S3 is specifically as follows:
[0038] S31: Performing empirical mode decomposition on the aligned historical wind power data using an adaptive noise complete integrated empirical mode decomposition algorithm to obtain a number of modal components corresponding to different frequency characteristic components in the historical wind power data; the expression is:
[0039]
[0040] in, It represents the first order of different frequency characteristic components in the historical wind power data after decomposition. k modal components, represents the input signal, t represents the time variable;
[0041] S32: For each modal component Perform fast Fourier transform to realize spectrum analysis and obtain component spectrum and energy spectrum , the expressions of component spectrum and energy spectrum are:
[0042]
[0043]
[0044] By energy spectrum Variance calculation spectrum extension range bandwidth , the expression is:
[0045]
[0046] in, is the center frequency, which is the weighted average of the spectrum energy and is defined as:
[0047] ;
[0048] S33: Component spectrum Smoothing optimization is performed to remove noise, based on the center frequency of each component and bandwidth , construct a Gaussian filter , the expression is:
[0049]
[0050] S34: Using Gaussian filter Component spectrum Perform point multiplication to obtain the optimized spectral components , and then use the inverse fast Fourier transform to obtain the optimized spectral components , the expression is:
[0051]
[0052] .
[0053] Based on the above technical means, the adaptive noise complete integrated empirical mode decomposition method is used to decompose the historical power data, and the spectrum is optimized by Gaussian filter, which significantly improves the data processing effect, can capture more frequency characteristics, and improve the stability and accuracy of the prediction model.
[0054] Preferably, it is assumed that step S3 obtains n The optimized spectral components are denoted as , each x i Represents a component signal, construct n × n The similarity matrix A is:
[0055]
[0056] Among them, element A ij Indicates the amount x i and x j The similarity between elements A ij The calculation expression is:
[0057]
[0058] and Indicates the amount x i and x j The center frequency, is the similarity parameter;
[0059] Use the similarity matrix A to construct an undirected weighted graph G = (N, E), where N represents a node, each component is regarded as a node in the undirected weighted graph, E represents an edge, and the node y With Node j There is a weighted edge between them, with weight A yj and ;
[0060] Use the similarity matrix A to construct the degree matrix D, which is a diagonal matrix:
[0061]
[0062]
[0063] No. y diagonal elements D yy Representation Node y The degree of the node y Represents the total weight of the connected edges;
[0064] Constructing the Laplacian Matrix L , , the Laplacian matrix L To standardize:
[0065]
[0066] in, I represents the identity matrix, represents the inverse square root matrix of the degree matrix;
[0067] The normalized Laplacian matrix Perform eigendecomposition and calculate the eigenvectors corresponding to the first H minimum eigenvalues among the minimum eigenvalues obtained after eigendecomposition V y , forming the feature matrix V :
[0068]
[0069] The K-means algorithm is used to cluster the feature matrix V to obtain multi-channel spectral component features, including high-frequency spectral component features and low-frequency spectral component features. The spectral component features of each channel contain multiple IMF components with similar frequency characteristics.
[0070] Preferably, when the K-means algorithm is used to cluster the feature matrix V, the number of initial cluster centers is set to O, and the vertical and horizontal cross algorithm is used to optimize the O initial cluster centers to obtain the optimized initial cluster centers .
[0071] According to the above technical means, the initial clustering center of the spectrum clustering is optimized by using the vertical and horizontal cross algorithm, which improves the clustering effect of the decomposed modal components and makes the extraction of high-frequency and low-frequency components more accurate, thereby improving the quality of the multi-channel spectral component characteristics.
[0072] Preferably, the multi-scale self-attention wind power prediction model described in S5 includes: an input embedding layer, an encoder layer and an output layer; wherein the input embedding layer is composed of a feature embedding unit and a position encoding unit, the feature embedding unit adopts multi-channel convolution embedding, and the position encoding unit adopts sine-cosine position encoding; the encoder layer is composed of a one-dimensional convolution layer, a pooling layer, multiple multi-scale attention mechanism modules MSA, a summation and normalization layer, and a feedforward layer; the output layer is implemented by a fully connected layer;
[0073] The feature embedding unit maps the high-frequency spectral component features and low-frequency spectral component features of the wind farm to a unified feature dimension. In each multi-scale attention mechanism module MSA, self-attention is calculated for each scale feature, and the self-attention calculation results of different scales are fused to obtain the final multi-scale self-attention output. The calculation process is:
[0074]
[0075]
[0076]
[0077] in, d k represents the dimension of the key matrix, Represent the query, key, and value matrices of each scale respectively, Represents the scale fusion weight of the multi-scale attention mechanism;
[0078] The parameters of the multi-scale self-attention wind power prediction model are divided into a general layer and a personalized layer. The general layer contains the parameters commonly used by all clients in the multi-scale self-attention wind power prediction model, including the parameters of the input embedding layer and the parameters of the encoder layer, which are defined as:
[0079]
[0080] in, represents the weight matrix of feature embedding, represents the position encoding weight matrix, Represents the weight matrix and bias term of the feedforward neural network;
[0081] The individual layer parameters include the weight matrix of the output layer and the bias term , does not participate in the aggregation process of hierarchical federated learning, adapts to the specific needs of each wind farm, and is defined as:
[0082] .
[0083] Preferably, when the hierarchical federated learning method is used to train the hierarchical federated wind power prediction model, the newly built target wind farm and its surrounding wind farms are used as clients of the hierarchical federated learning. In each round of training, the general layer parameters of each client are uploaded to the central server for aggregation and update, and the individual layer parameters are retained locally and do not participate in the federated aggregation.
[0084] Each client uploads common layer parameters To the central server and calculate comprehensive indicators , dynamically adjust the upload frequency :
[0085]
[0086]
[0087]
[0088] in, is the data volatility indicator, It is the general layer parameter after the local training of the client is completed. and is the weight coefficient, satisfying: , is the amount of local data on the client, and are the upper and lower limits of the upload frequency, and g is the adjustment factor;
[0089] The central server calculates the global aggregation weight based on the common layer parameters and upload frequency uploaded by the client. And update the general layer parameters :
[0090]
[0091]
[0092] After the central server updates the general layer parameters, it sends them to each client, and each client receives the general layer parameters. After the update is completed, the next round of model training is started using local data to update all parameters. After all parameters are updated, the general layer parameters are uploaded to the central server until the training is completed.
[0093] According to the above technical means, a hierarchical federated learning method is adopted to process the parameters of the global layer and the individual layer separately, ensuring the effective combination of the individualized model and the global model of the target wind farm and the surrounding wind farms, improving data privacy protection, and making the specific needs of different wind farms better met. In addition, according to the volatility of local data of each wind farm, the upload frequency and aggregation weight of the federated learning model are dynamically adjusted, which improves the flexibility and efficiency of model training and ensures the rapid response and precision optimization of the model.
[0094] In the second aspect, the present application proposes a short-term wind power prediction system based on dynamic delay and hierarchical federated learning, comprising:
[0095] A delay time calculation unit, which calculates the wind speed delay time between the target new wind farm and each of the surrounding wind farms based on the acquired historical wind power data and geographic data of the target new wind farm and its surrounding wind farms;
[0096] The delay adjustment unit dynamically adjusts the historical wind power data timestamps of each surrounding wind farm and the target new wind farm based on the wind speed delay time to align the historical wind power data;
[0097] A spectrum analysis and optimization unit, used for performing empirical mode decomposition on the aligned historical wind power data, obtaining component spectra through spectrum analysis, and optimizing the component spectra to obtain optimized spectrum components;
[0098] The clustering unit constructs a feature matrix based on the optimized spectral components, performs multi-scale clustering on the feature matrix, and obtains multi-channel spectral component features after clustering; during clustering, the initial cluster center is optimized;
[0099] A training unit, used for inputting the clustered multi-channel spectral component features into a multi-scale self-attention wind power prediction model, and training the multi-scale self-attention wind power prediction model through a hierarchical federated learning method;
[0100] The prediction unit is used to use the trained multi-scale self-attention wind power prediction model for wind power prediction of a target newly built wind farm.
[0101] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0102] The present invention proposes a short-term wind power prediction method and system based on dynamic delay and hierarchical federated learning. First, by calculating the wind speed delay time between the target new wind farm and each surrounding wind farm, the historical wind power data timestamps of each surrounding wind farm and the target new wind farm are dynamically adjusted, effectively reducing the data alignment problem caused by the asynchronous wind speed between wind farms, and ensuring the accuracy of short-term wind power prediction. Then, empirical mode decomposition is performed, and the component spectrum is obtained and optimized through spectrum analysis to obtain the optimized spectrum components; a feature matrix is constructed based on the optimized spectrum components, and the feature matrix is multi-scale clustered. After clustering, multi-channel spectrum component features are obtained, which significantly improves the data processing effect, can capture more frequency features, and improves the stability and accuracy of the prediction model. The multi-channel features are input into the self-attention wind power prediction model, and the model is trained through hierarchical federated learning, which ensures the effective combination of the personalized model and the global model of the target wind farm and the surrounding wind farms, improves data privacy protection, and enables the specific needs of different wind farms to be better met, improves the adaptability to the new wind farm, and improves the wind power prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] Figure 1 A schematic diagram showing a flow chart of a short-term wind power prediction method based on dynamic delay and hierarchical federated learning proposed in an embodiment of the present invention;
[0104] Figure 2 A diagram showing the effect of short-term wind power prediction using the short-term wind power prediction method based on dynamic delay and hierarchical federated learning proposed in an embodiment of the present invention;
[0105] Figure 3 A structural diagram of a short-term wind power prediction system based on dynamic delay and hierarchical federated learning proposed in an embodiment of the present invention. DETAILED DESCRIPTION
[0106] The accompanying drawings are only used for illustrative purposes and are not to be construed as limiting the present application;
[0107] In order to better illustrate the present embodiment, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the actual size;
[0108] It is understandable to those skilled in the art that descriptions of certain well-known contents in the drawings may be omitted.
[0109] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0110] The positional relationships described in the drawings are only for illustrative purposes and should not be construed as limiting the present application;
[0111] Example 1
[0112] This embodiment proposes a short-term wind power prediction method based on dynamic delay and hierarchical federated learning. The implementation process diagram of this method is shown in Figure 1 ,like Figure 1 As shown, the following steps are included:
[0113] S1: Based on the acquired historical wind power data and geographic data of the target new wind farm and its surrounding wind farms, the wind speed delay time between the target new wind farm and each surrounding wind farm is calculated.
[0114] S2: Dynamically adjust the historical wind power data timestamps of each surrounding wind farm and the target new wind farm based on the wind speed delay time to align the historical wind power data.
[0115] S3: performing empirical mode decomposition on the aligned historical wind power data, obtaining component spectra through spectrum analysis, and optimizing the component spectra to obtain optimized spectrum components.
[0116] S4: construct a feature matrix based on the optimized spectral components, perform multi-scale clustering on the feature matrix, and obtain multi-channel spectral component features after clustering; during clustering, optimize the initial clustering center.
[0117] S5: The clustered multi-channel spectral component features are input into the multi-scale self-attention wind power prediction model, and the multi-scale self-attention wind power prediction model is trained through hierarchical federated learning.
[0118] S6: The trained multi-scale self-attention wind power prediction model is used for wind power prediction of the target new wind farm.
[0119] In this embodiment, the historical wind power data and geographic data of the target new wind farm and its surrounding wind farms are first obtained. By calculating the wind speed delay time between the target new wind farm and each surrounding wind farm, the historical wind power data timestamps of each surrounding wind farm and the target new wind farm are dynamically adjusted, effectively reducing the data alignment problem caused by the asynchronous wind speed between wind farms, and ensuring the accuracy of short-term wind power prediction. Then, empirical mode decomposition is performed, and the component spectrum is obtained and optimized through spectrum analysis to obtain the optimized spectrum components; a feature matrix is constructed based on the optimized spectrum components, and multi-scale clustering is performed on the feature matrix. After clustering, multi-channel spectrum component features are obtained, which significantly improves the data processing effect, can capture more frequency features, and improves the stability and accuracy of the prediction model. The multi-channel features are input into the self-attention wind power prediction model, and the model is trained through hierarchical federated learning, which ensures the effective combination of the personalized model and the global model of the target wind farm and the surrounding wind farms, improves data privacy protection, and enables the specific needs of different wind farms to be better met, improves the adaptability to the new wind farm, and improves the wind power prediction accuracy.
[0120] Example 2
[0121] In this embodiment, the historical wind power data includes: historical wind power data, historical wind speed data, and historical wind direction data, and the geographic data includes: longitude and latitude data of the target newly built wind farm and its surrounding wind farms;
[0122] The historical wind power data and geographic data of the target new wind farm and its surrounding wind farms are preprocessed. The preprocessing includes: filling the missing values in the historical wind power data and geographic data, and then smoothing the noise using the local regression smoothing method. The expression is:
[0123]
[0124] in, is a weighting factor to reduce the impact of high-frequency noise;
[0125] Using min-max normalization processing, the historical wind power data and historical wind speed data are mapped to [0,1] to obtain the processed wind power sequence P and wind speed sequence S, which are expressed as follows:
[0126]
[0127]
[0128] in, and Respectively represent the minimum and maximum values of wind power data, and Respectively represent the minimum and maximum values of wind speed data;
[0129] The historical wind direction data D raw Convert them into sine form and cosine form respectively to keep the directional information, and get the wind direction sine sequence WS and wind direction cosine sequence WC. The process is:
[0130]
[0131]
[0132] In this embodiment, the process of calculating the wind speed delay time between the target newly built wind farm and each surrounding wind farm is as follows:
[0133] S11: Calculate the geographical distance between each surrounding wind farm and the target wind farm based on the latitude and longitude data of each surrounding wind farm and the target new wind farm , the calculation expression is:
[0134]
[0135] in, lon A , Respectively represent the longitude and latitude of the target new wind farm A; lon Bi , Respectively represent i Surrounding wind farms B i longitude and latitude; R represents the radius of the Earth;
[0136] S12: Based on geographical distance and surrounding wind farms B i Real-time wind speed S Bi , calculate the wind speed delay time between the target new wind farm and each surrounding wind farm, the calculation expression is:
[0137]
[0138] in, The wind speed from i Surrounding wind farms B i The delay time of propagating to the target new wind farm A.
[0139] In order to ensure timely response to the impact of wind speed changes on delay time, the time window needs to be dynamically adjusted The process of dynamically adjusting the timestamp of historical wind power data of each surrounding wind farm and the target new wind farm based on the wind speed delay time is as follows:
[0140] S21: Calculate the wind speed change rate of each surrounding wind farm. The calculation expression is:
[0141]
[0142] in, S Bi ( t ) indicates surrounding wind farms B i exist t Wind speed at the moment; S Bi ( t- 1) Indicates surrounding wind farms B i exist t -Wind speed at time 1; S Bi Indicates surrounding wind farms B i exist t Moment and t -1 wind speed difference at time;
[0143] S22: Dynamically adjust the time window, and the adjustment process satisfies the expression:
[0144]
[0145] in, represents the wind speed change rate threshold, represents the time window, if △SB i Less than , then shorten the time window; otherwise, expand the time window. represents the shortened minimum time window, Indicates the maximum time window after enlargement;
[0146] S23: In each time window, calculate the target new wind farm A and the surrounding wind farms B i The number of time windows that lag or advance between them is used to align the target wind farm A and the surrounding wind farm B. i The wind power data timestamp between the two is calculated as:
[0147]
[0148] in, Indicates the number of time window grids, is the conversion factor of time unit; △tdIndicates the delay time;
[0149] S24: Compare the number of delayed or advanced time window grids with 0, and adjust the surrounding wind farms according to the comparison result. B i The wind power data timestamp is expressed as:
[0150]
[0151] When the sliding window continues to move forward, the delay time is calculated again according to the real-time wind speed in the new window, and the timestamp of the wind power data in the next time window is adjusted.
[0152] In this embodiment, the process of S3 is specifically as follows:
[0153] S31: Performing empirical mode decomposition on the aligned historical wind power data using an adaptive noise complete integrated empirical mode decomposition algorithm to obtain a number of modal components corresponding to different frequency characteristic components in the historical wind power data; the expression is:
[0154]
[0155] in, It represents the modal components corresponding to the different frequency characteristic components in the historical wind power data after decomposition, represents the input signal;
[0156] In this step, the aligned historical wind power data can be represented as a multi-dimensional spatiotemporal synchronization matrix , where T is the unified timestamp length, F is the total number of wind farms, and M is the feature dimension; the above matrix X is expanded into a multi-channel time series signal according to the wind farm dimension, and the adaptive noise complete integrated empirical mode decomposition algorithm is used to perform empirical mode decomposition on the data of each wind farm separately.
[0157] S32: For each modal component Perform fast Fourier transform to realize spectrum analysis and obtain component spectrum and energy spectrum , the expressions of component spectrum and energy spectrum are:
[0158]
[0159]
[0160] By energy spectrum Variance calculation spectrum extension range bandwidth , the expression is:
[0161]
[0162] in, is the center frequency, which is the weighted average of the spectrum energy and is defined as:
[0163] ;
[0164] S33: Component spectrum Smoothing optimization is performed to remove noise, based on the center frequency of each component and bandwidth , construct a Gaussian filter , the expression is:
[0165]
[0166] S34: Using Gaussian filter Component spectrum Perform point multiplication to obtain the optimized spectral components , and then use the inverse fast Fourier transform to obtain the optimized spectral components , the expression is:
[0167]
[0168] .
[0169] Based on the above technical means, the adaptive noise complete integrated empirical mode decomposition method is used to decompose the historical power data, and the spectrum is optimized by Gaussian filter, which significantly improves the data processing effect, can capture more frequency characteristics, and improve the stability and accuracy of the prediction model.
[0170] Preferably, it is assumed that step S3 obtains n The optimized spectral components are denoted as , each x i Represents a component signal, construct n × n The similarity matrix A is:
[0171]
[0172] Among them, element A ij Indicates the amount x i and x j The similarity between elements A ij The calculation expression is:
[0173]
[0174] and Indicates the amountx i and x j The center frequency, is the similarity parameter;
[0175] Use the similarity matrix A to construct an undirected weighted graph G = (N, E), where N represents a node, each component is regarded as a node in the undirected weighted graph, E represents an edge, and the node y With Node j There is a weighted edge between them, with weight A yj and ;
[0176] Use the similarity matrix A to construct the degree matrix D, which is a diagonal matrix:
[0177]
[0178]
[0179] No. y diagonal elements D ii Representation Node y The degree of the node y Represents the total weight of the connected edges;
[0180] Constructing the Laplacian Matrix L , , the Laplacian matrix L To standardize:
[0181]
[0182] in, I represents the identity matrix, represents the inverse square root matrix of the degree matrix;
[0183] The normalized Laplacian matrix Perform eigendecomposition and calculate the eigenvectors V corresponding to the first H minimum eigenvalues among the minimum eigenvalues obtained after eigendecomposition y , forming the feature matrix V:
[0184]
[0185] The K-means algorithm is used to cluster the feature matrix V to obtain multi-channel spectral component features, including high-frequency spectral component features and low-frequency spectral component features. The spectral component features of each channel contain multiple IMF components with similar frequency characteristics.
[0186] In this embodiment, the K-means algorithm is used to analyze the feature matrix VWhen clustering, the number of initial cluster centers is set to O, and the vertical and horizontal cross algorithm is used to optimize the O initial cluster centers to obtain the optimized initial cluster centers , the process is:
[0187] S401: Initialize the population and randomly select the feature matrix V Select K row vectors to generate each individual, denoted as:
[0188]
[0189] in is the feature matrix V The row vector of ;
[0190] S402: The fitness function is constructed as follows:
[0191]
[0192] Among them, Com is the compactness between clusters, Sep is the separation between clusters, Cov is the point coverage, and each clustering index is used to evaluate the clustering quality, which are defined as follows:
[0193]
[0194]
[0195]
[0196] Among them, K is the number of clusters, is the set of the i-th cluster, containing all data points assigned to this cluster, Cluster The number of data points in Belongs to cluster The characteristic vector of Cluster The cluster center of Cluster and The square of the Euclidean distance between the cluster centers, M is the total number of data points, =1 means is correctly assigned to a cluster C, otherwise it is 0;
[0197] S403: Randomly select two parent individuals from the population and , horizontal crossover generates new offspring individuals by combining the cluster centers of two different parent individuals. The horizontal crossover expression is:
[0198]
[0199] in, , For the parent and The k-th cluster center of and is a random number uniformly distributed in [0,1]. and is a random number uniformly distributed in [-1,1];
[0200] Mixing between different dimensions within the same parent individual, the vertical crossover expression is:
[0201]
[0202] in, is a random number uniformly distributed in [0,1];
[0203] S404: Through competition between the parent and the offspring, individuals with better fitness are retained to achieve population update. If the offspring fitness is greater than the parent, the parent is replaced by the offspring, otherwise the parent is retained; when the maximum number of iterations T is reached max Or the change in the fitness function value is less than the set threshold It is to terminate the iteration and obtain the optimized initial cluster center , and then perform K-means clustering on the feature matrix V and divide it into two categories: high frequency and low frequency. Each channel contains multiple IMF components with similar frequency characteristics.
[0204] In this embodiment, the multi-scale self-attention wind power prediction model described in S5 is a multi-scale self-attention mechanism MSA-transformer model, including: an input embedding layer, an encoder layer and an output layer; wherein the input embedding layer is composed of a feature embedding unit and a position encoding unit, the feature embedding unit adopts multi-channel convolution embedding, and the position encoding unit adopts sine-cosine position encoding; the encoder layer is composed of a one-dimensional convolution layer, a pooling layer, multiple multi-scale attention mechanism modules MSA, a summation and normalization layer, and a feedforward layer; the output layer is implemented by a fully connected layer;
[0205] The feature embedding unit maps the high-frequency spectral component features and low-frequency spectral component features of the wind farm to a unified feature dimension. In each multi-scale attention mechanism module MSA, self-attention is calculated for each scale feature separately, and the self-attention calculation results of different scales are fused to obtain the final multi-scale self-attention output. The calculation process is:
[0206]
[0207]
[0208]
[0209] in, d k represents the dimension of the key matrix, Represent the query, key, and value matrices of each scale respectively, Represents the scale fusion weight of the multi-scale attention mechanism;
[0210] The parameters of the multi-scale self-attention wind power prediction model are divided into a general layer and a personalized layer. The general layer contains the parameters commonly used by all clients in the multi-scale self-attention wind power prediction model, including the parameters of the input embedding layer and the parameters of the encoder layer, which are defined as:
[0211]
[0212] in, represents the weight matrix of feature embedding, represents the position encoding weight matrix, represents the weight matrix and bias term of the feedforward neural network,
[0213] The individual layer parameters include the weight matrix of the output layer and the bias term , does not participate in the aggregation process of hierarchical federated learning, adapts to the specific needs of each wind farm, and is defined as:
[0214] .
[0215] When training the hierarchical federated wind power prediction model using hierarchical federated learning, the data obtained in S1 is divided into a training set and a test set. The newly built target wind farm and its surrounding wind farms are used as clients of hierarchical federated learning. The hierarchical federated wind power prediction model is trained using the training set. In each round of training, the general layer parameters of each client are uploaded to the central server for aggregation and update, and the individual layer parameters are retained locally and do not participate in federated aggregation. The client in hierarchical federated learning refers to each device or institution participating in federated learning, which is responsible for local data processing and model training, and participates in communication with the central server. The client in this scenario is each wind farm, and each client uploads the general layer parameters. To the central server and calculate comprehensive indicators , dynamically adjust the upload frequency :
[0216]
[0217]
[0218]
[0219] in, is the data volatility indicator, It is the general layer parameter after the local training of the client is completed. and is the weight coefficient, satisfying: , is the amount of local data on the client, and are the upper and lower limits of the upload frequency, and g is the adjustment factor;
[0220] The central server calculates the global aggregation weight based on the common layer parameters and upload frequency uploaded by the client. And update the general layer parameters :
[0221]
[0222]
[0223] After the central server updates the general layer parameters, it sends them to each client, and each client receives the general layer parameters. After the update is completed, the next round of model training is started using local data to update all parameters. After all parameters are updated, the general layer parameters are uploaded to the central server until the training is completed.
[0224] Example 2
[0225] In order to verify the effectiveness of the short-term wind power prediction method based on dynamic delay and hierarchical federated learning proposed in the present invention, firstly, in step S1, the wind power data and wind speed data of a newly built wind farm in Inner Mongolia and its surrounding wind farms in the time period from 2019 / 1 / 1 / 0:00 to 2019 / 12 / 31 / 23:59 are obtained for preprocessing, and then the short-term wind power prediction method based on dynamic delay and hierarchical federated learning proposed in the present invention is used to obtain the following: Figure 2 The predicted effect of offshore wind power is shown in Figure 2 In the figure, the dotted trend line represents the actual value of wind power, and the solid trend line represents the predicted value of wind power. Figure 2 It can be seen from the curves corresponding to the two different values shown in that the error between the actual value of wind power and the predicted value of wind power is very small. The method proposed in the present invention can effectively improve the accuracy of wind power prediction.
[0226] Example 3
[0227] like Figure 3 As shown, the present application proposes a short-term wind power prediction system based on dynamic delay and hierarchical federated learning, including:
[0228] A delay time calculation unit, which calculates the wind speed delay time between the target new wind farm and each of the surrounding wind farms based on the acquired historical wind power data and geographic data of the target new wind farm and its surrounding wind farms;
[0229] The delay adjustment unit dynamically adjusts the historical wind power data timestamps of each surrounding wind farm and the target new wind farm based on the wind speed delay time to align the historical wind power data;
[0230] A spectrum analysis and optimization unit, used for performing empirical mode decomposition on the aligned historical wind power data, obtaining component spectra through spectrum analysis, and optimizing the component spectra to obtain optimized spectrum components;
[0231] The clustering unit constructs a feature matrix based on the optimized spectral components, performs multi-scale clustering on the feature matrix, and obtains multi-channel spectral component features after clustering; during clustering, the initial cluster center is optimized;
[0232] A training unit, used for inputting the clustered multi-channel spectral component features into a multi-scale self-attention wind power prediction model, and training the multi-scale self-attention wind power prediction model through a hierarchical federated learning method;
[0233] The prediction unit is used to use the trained multi-scale self-attention wind power prediction model for wind power prediction of a target newly built wind farm.
[0234] The embodiments are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A short-term wind power forecasting method based on dynamic delay and hierarchical federated learning, characterized in that: The following steps are involved: S1: Based on the historical wind power data and geographic data of the target new wind farm and its surrounding wind farms, the wind speed delay time between the target new wind farm and each surrounding wind farm is calculated; S2: Dynamically adjust the historical wind power data timestamps of each surrounding wind farm and the target new wind farm based on the wind speed delay time to align the historical wind power data; S21: Calculate the wind speed change rate of each surrounding wind farm. The calculation expression is: in, S Bi ( t ) indicates surrounding wind farms B i exist t Wind speed at the moment; S Bi ( t- 1) Indicates surrounding wind farms B i exist t -Wind speed at time 1; S Bi Indicates surrounding wind farms B i exist t Moment and t -1 wind speed difference at time; S22: Dynamically adjust the time window, and the adjustment process satisfies the expression: in, represents the wind speed change rate threshold, represents the time window, if △SB i Less than , then shorten the time window; otherwise, expand the time window. represents the shortened minimum time window, Indicates the maximum time window after enlargement; S23: In each time window, calculate the target new wind farm A and the surrounding wind farms B i The number of time windows that lag behind or advance between them is calculated as follows: in, Indicates the number of time window grids, is the conversion factor of time unit; △td Indicates the delay time; S24: Compare the number of delayed or advanced time window grids with 0, and adjust the surrounding wind farms according to the comparison result. B i The wind power data timestamp is expressed as: When the sliding window continues to move forward, the delay time is calculated again based on the real-time wind speed in the new window, and the timestamp of the wind power data in the next time window is adjusted; S3: performing empirical mode decomposition on the aligned historical wind power data, and then obtaining component spectra through spectrum analysis, and performing component spectrum optimization to obtain optimized spectrum components; S4: construct a feature matrix based on the optimized spectral components, perform multi-scale clustering on the feature matrix, and obtain multi-channel spectral component features after clustering; during clustering, optimize the initial clustering center; S5: Input the clustered multi-channel spectral component features into the multi-scale self-attention wind power prediction model, and train the multi-scale self-attention wind power prediction model through hierarchical federated learning; S6: The trained multi-scale self-attention wind power prediction model is used for wind power prediction of the target new wind farm.
2. The short-term wind power forecasting method based on dynamic delay and hierarchical federated learning according to claim 1 is characterized in that: The historical wind power data include: historical wind power data, historical wind speed data, historical wind direction data, and the geographical data include: longitude and latitude data of the target newly built wind farm and its surrounding wind farms; The historical wind power data and geographic data of the target new wind farm and its surrounding wind farms are preprocessed. The preprocessing includes: filling the missing values in the historical wind power data and geographic data, and then smoothing the noise using the local regression smoothing method; using min-max normalization to map the historical wind power data and historical wind speed data to [0,1] to obtain the processed wind power sequence P and wind speed sequence S; converting the historical wind direction data D raw They are converted into sine form and cosine form respectively to keep the directional information, and the wind direction sine sequence WS and wind direction cosine sequence WC are obtained.
3. The short-term wind power prediction method based on dynamic delay and hierarchical federated learning according to claim 2 is characterized in that: The process of calculating the wind speed delay time between the target new wind farm and each surrounding wind farm is as follows: S11: Calculate the geographical distance between each surrounding wind farm and the target wind farm based on the latitude and longitude data of each surrounding wind farm and the target new wind farm , the calculation expression is: in, lon A , Respectively represent the longitude and latitude of the target new wind farm A; lon Bi , Respectively represent i Surrounding wind farms B i longitude and latitude; R represents the radius of the Earth; S12: Based on geographical distance and surrounding wind farms B i Real-time wind speed S Bi , calculate the wind speed delay time between the target new wind farm and each surrounding wind farm, the calculation expression is: in, The wind speed from i Surrounding wind farms B i The delay time of propagating to the target new wind farm A.
4. The short-term wind power forecasting method based on dynamic delay and hierarchical federated learning according to claim 3 is characterized in that: The specific process of S3 is as follows: S31: Performing empirical mode decomposition on the aligned historical wind power data using an adaptive noise complete integrated empirical mode decomposition algorithm to obtain a number of modal components corresponding to different frequency characteristic components in the historical wind power data; the expression is: in, It represents the first order of different frequency characteristic components in the historical wind power data after decomposition. k modal components, represents the input signal, t represents the time variable; S32: For each modal component Perform fast Fourier transform to realize spectrum analysis and obtain component spectrum and energy spectrum , the expressions of component spectrum and energy spectrum are: By energy spectrum Variance calculation spectrum extension range bandwidth , the expression is: in, is the center frequency, which is the weighted average of the spectrum energy and is defined as: ; S33: Component spectrum Smoothing optimization is performed to remove noise, based on the center frequency of each component and bandwidth , construct a Gaussian filter , the expression is: S34: Using Gaussian filter Component spectrum Perform point multiplication to obtain the optimized spectral components , and then use the inverse fast Fourier transform to obtain the optimized spectral components , the expression is: 。 5. The short-term wind power forecasting method based on dynamic delay and hierarchical federated learning according to claim 4 is characterized in that: Assume that step S3 obtains n The optimized spectral components are denoted as , each x i Represents a component signal, construct n × n The similarity matrix A is: Among them, element A ij Indicates the amount x i and x j The similarity between elements A ij The calculation expression is: and Indicates the amount x i and x j The center frequency, is the similarity parameter; Use the similarity matrix A to construct an undirected weighted graph G = (N, E), where N represents a node, each component is regarded as a node in the undirected weighted graph, E represents an edge, and the node y With Node j There is a weighted edge between them, with weight A yj and ; Use the similarity matrix A to construct the degree matrix D, which is a diagonal matrix: No. y diagonal elements D yy Representation Node y The degree of the node y Represents the total weight of the connected edges; Constructing the Laplacian Matrix L , , the Laplacian matrix L To standardize: in, I represents the identity matrix, represents the inverse square root matrix of the degree matrix; The normalized Laplacian matrix Perform eigendecomposition and calculate the eigenvectors corresponding to the first H minimum eigenvalues among the minimum eigenvalues obtained after eigendecomposition V y , forming the feature matrix V : Using K-means algorithm to transform feature matrix V Clustering is performed to obtain multi-channel spectral component features, including high-frequency spectral component features and low-frequency spectral component features, and the spectral component features of each channel contain multiple IMF components with similar frequency characteristics.
6. The short-term wind power forecasting method based on dynamic delay and hierarchical federated learning according to claim 5 is characterized in that: Using K-means algorithm to transform feature matrix V When clustering, the number of initial cluster centers is set to O, and the vertical and horizontal cross algorithm is used to optimize the O initial cluster centers to obtain the optimized initial cluster centers .
7. A short-term wind power forecasting system based on dynamic delay and hierarchical federated learning, characterized in that: include: A delay time calculation unit, which calculates the wind speed delay time between the target new wind farm and each of the surrounding wind farms based on the acquired historical wind power data and geographic data of the target new wind farm and its surrounding wind farms; The delay adjustment unit dynamically adjusts the historical wind power data timestamps of each surrounding wind farm and the target new wind farm based on the wind speed delay time to align the historical wind power data; the execution process is: Calculate the wind speed change rate of each surrounding wind farm, and the calculation expression is: in, S Bi ( t ) indicates surrounding wind farms B i exist t Wind speed at the moment; S Bi ( t- 1) Indicates surrounding wind farms B i exist t -Wind speed at time 1; S Bi Indicates surrounding wind farms B i exist t Moment and t -1 wind speed difference at time; Dynamically adjust the time window, and the adjustment process satisfies the expression: in, represents the wind speed change rate threshold, represents the time window, if Less than , then shorten the time window; otherwise, expand the time window. represents the shortened minimum time window, Indicates the maximum time window after enlargement; In each time window, calculate the target new wind farm A and the surrounding wind farms B i The number of time windows that lag behind or advance between them is calculated as follows: in, Indicates the number of time window grids, is the conversion factor of time unit; △td Indicates the delay time; Compare the delayed or advanced time window grid number with 0, and adjust the surrounding wind farms according to the comparison result. B i The wind power data timestamp is expressed as: When the sliding window continues to move forward, the delay time is calculated again based on the real-time wind speed in the new window, and the timestamp of the wind power data in the next time window is adjusted; A spectrum analysis and optimization unit, used for performing empirical mode decomposition on the aligned historical wind power data, obtaining component spectra through spectrum analysis, and optimizing the component spectra to obtain optimized spectrum components; The clustering unit constructs a feature matrix based on the optimized spectral components, performs multi-scale clustering on the feature matrix, and obtains multi-channel spectral component features after clustering; during clustering, the initial cluster center is optimized; A training unit, used for inputting the clustered multi-channel spectral component features into a multi-scale self-attention wind power prediction model, and training the multi-scale self-attention wind power prediction model through a hierarchical federated learning method; The prediction unit is used to use the trained multi-scale self-attention wind power prediction model for wind power prediction of a target newly built wind farm.
Citation Information
Patent Citations
Method and system for predicting short-term wind power of newly-built wind power plant based on sample migration
CN117933363A
Ocean emergency scheduling method and system, computer equipment and storage medium
CN118540757A