Wind power data privacy protection completion method based on federated learning
By building a sequence-to-sequence model based on federated learning and attention mechanism, the privacy and security risks and high communication overhead problems caused by missing data in wind farms are solved, and efficient data completion is achieved in complex missing data scenarios. The generated data is highly consistent with the real data.
Patent Information
- Application Number
- CN202510976828.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-10-17
AI Technical Summary
In wind farms, data missing leads to privacy and security risks, data silos, and high communication overhead. Especially in complex missing data scenarios, it is difficult to complete missing data. At the same time, traditional methods cannot effectively handle mixed missing data.
Masking is used to simulate complex missing scenarios, and a sequence-to-sequence model with a bidirectional long short-term memory network and attention mechanism is constructed. Federated learning is combined with local training and model parameter aggregation to complete the missing data of wind farms.
It effectively reduces communication overhead and improves the security and accuracy of data completion, especially in mixed missing scenarios, where the generated data is highly consistent with the real data, thus protecting user data privacy.
Smart Images

Figure CN120805186A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of wind farm missing data processing, and is a method for completing wind farm missing data under uncertain environment considering privacy protection. BACKGROUND
[0002] Developing and utilizing renewable energy is an inevitable choice to solve environmental pollution and greenhouse gas emission problems. However, due to its inherent uncertainty and intermittency, the introduction of renewable energy brings great challenges to the planning and operation of the current power system. At present, wind power is the most mature, largest scale and most promising commercial development form of power generation in the development and utilization of renewable energy. With the continuous development of wind power technology, due to the randomness, volatility and intermittency of wind power, the influence of large-scale grid-connected wind power on the power system is becoming more and more obvious. Wind farm historical operation data is the basis for studying wind power fluctuation characteristics, wind power prediction, wind power influence assessment and control strategy, wind power curve calculation, testing and correction. Therefore, the recording of wind farm historical operation data is particularly important.
[0003] During the whole process of wind power data acquisition, transmission and conversion, failures and data loss may occur. Especially in wind farms at the edge of the network, due to sensor failures, data transmission loss and noise interference, data loss often cannot be avoided. Data loss not only affects the quality of measurement data, but also makes subsequent data analysis unable to proceed smoothly, thereby affecting the operation of power grid business. With the gradual expansion of wind farms from remote areas to offshore, from single site to multiple sites, the types and quantities of collected data have become more diversified and complex. This leads to obvious disadvantages of traditional centralized learning methods in dealing with wind farms at the edge of the power system network. The main problems include:
[0004] (1) Privacy and security risks: centralized data collection and processing increase the risk of data leakage and privacy, especially when data from multiple wind farms needs to be aggregated, data security becomes a major problem.
[0005] (2) Data island problem: due to the use of different communication protocols and technical standards by wind farm operators, data integration and sharing between different wind farms is very difficult, thus forming a data island.
[0006] (3) Large communication overhead: wind farms are usually distributed in remote geographical locations, and transmitting a large amount of data to the central server will result in high bandwidth and cost overhead.
[0007] To address these issues, federated learning, as an emerging distributed machine learning technology, provides an effective solution. However, there is currently no report on the application of federated learning technology to wind farm data completion. In previous studies on wind power data completion, data missing is usually considered to have two main forms: continuous and completely random. However, the actual situation is usually more complex, for example, under a certain missing rate, continuous and completely random missing may be mixed at different proportions. SUMMARY
[0008] The main purpose of the present application is to save communication overhead and improve the security and accuracy of wind farm missing wind power data completion. Especially in the face of complex missing scenarios, how to effectively fill in the missing wind power while preventing the leakage of user sensitive data.
[0009] The purpose of the present application is achieved by the following technical solutions: first, using the way of mask to simulate the actual various complex missing scenarios, second, constructing a sequence to sequence (Attn-Seq2Seq) model composed of a bidirectional long short-term memory (Bi-LSTM) encoder and an LSTM decoder with attention mechanism; then, on the basis of this model, realizing data completion by combining local training and federated learning, and finally generating efficient and secure completion effect. The specific steps include:
[0010] 1) Missing scenario simulation.
[0011] 2) Constructing a sequence to sequence model.
[0012] 3) Constructing a federated learning framework and combining it with the model.
[0013] 4) Selecting clients for local training and aggregating and broadcasting model parameters on the server.
[0014] 5) Realizing missing data completion of each client (wind farm).
[0015] The specific process of step 1) is as follows:
[0016] Suppose there is a multivariate time series data X = {x1, x2,..., x t ,...,x T} ∈ R T×D . Define a mask matrix M to indicate which data in the time series data is missing. Where 1 represents missing data and 0 represents complete data. Md Discrete missing mask matrix M c Continuous missing mask matrix M, which is spliced according to a set proportion to obtain a hybrid mask matrix M h pValue represents the placeholder value of missing data, which aims to distinguish between artificially set missing data and true value 0 data. After using pValue instead of the missing part, the data after artificial degradation is obtained The mathematical definition of the mask matrix and the mathematical expression of the degradation process are as follows:
[0017]
[0018] The model of step 2) is composed of two parts: an encoder (Encoder) and a decoder (Decoder). The encoder is composed of a bidirectional long short-term memory network, which is responsible for receiving the input time series and converting it into a fixed dimension semantic vector containing global context information. The decoder combines attention mechanism and LSTM layer, and gradually constructs the target sequence according to the semantic vector output by the encoder, the previous output and its internal state. Attention mechanism plays a key role in this process, which enables the decoder to dynamically adjust the focus point according to the correlation between the generated output and the features in the input sequence, to generate each target time series element.
[0019] Long short-term memory network is an improved recurrent neural network, which solves the problem that recurrent neural network (RNN) is difficult to handle long distance dependence in practical application, overcomes the shortcoming of RNN that is easy to produce gradient disappearance, and slows down the possibility of gradient explosion. LSTM uses forget gate, input gate and output gate to control the flow of information to solve the gradient disappearance problem existing in traditional RNN
[0020] f t =σ(W f ·[h t-1 ,x t ]+b f ) (3)
[0021] i t =σ(W i ·[h t-1 ,x t ]+b i ) (4)
[0022] o t =σ(W o ·[h t-1 ,x t ]+b o ) (5)
[0023] C t = tanh(W c [h t-1 ,x t ]+b c ) (6)
[0024] C t = f t C t-1 +i t C t (7)
[0025] h t = o t tanh(C t ) (8)
[0026] In the formula, f t , i t , o t represent the forget gate, the input gate and the output gate respectively; C t and C t represent the cell vector and the temporary cell vector respectively; σ represents the sigmoid function; W f , W i , W o , W c represent the weight matrix of the forget gate, the input gate and the output gate respectively; b f , b i , b o , b c represent the learnable bias vector.
[0027] Bi-LSTM extends LSTM. It uses previous and future contexts to process input data sequences from two directions with two separate LSTMs. Since the wind power missing data completion problem at t time has strong correlation with the sequence after t time, in order to obtain the information of the sequence before and after t time, the encoder selected in this paper is a bidirectional single-layer LSTM. In the encoding process, Bi-LSTM processes the time series from both forward and backward directions at the same time, and according to the calculation rule of LSTM, the forward and backward hidden states of each time are calculated respectively For bidirectional LSTM, the forward and backward hidden states at t time can be obtained:
[0028]
[0029] The Seq2Seq with attention mechanism is different from the traditional Seq2Seq model. It does not rely on the single fixed semantic vector c generated by the decoder, that is, the last hidden state h Tbut make full use of the whole sequence of hidden states {h1, h2,..., h T} produced by the encoder to generate dynamic attention context vectors that vary with time In the decoding process, information is dynamically extracted according to real-time needs, and the calculation is as follows:
[0030]
[0031] In the formula, c t is the weighted sum of the attention weight vector a t,i and the encoder hidden state h i , which will be used as the input of the current time step of the decoder, together with the current hidden state s t of the encoder, to generate the next output. a t,i represents the i-th element of the attention weight vector at time step t, indicating the degree of attention of the decoder at the current time step to the i-th hidden state h i of the encoder. a t,i is normalized by the attention score vector e t,i :
[0032]
[0033] a t,i = softmax(e t,i ) (12)
[0034] In the formula, [h i ; s t-1 ] represents the i-th hidden state h i of the encoder and the hidden state s t-1 of the decoder at time step t-1, f is a nonlinear activation function, W a and V a are the learnable attention weight matrix and attention weight vector respectively, and b a is the learnable attention bias vector.
[0035] The hidden layer and output layer of the LSTM in the decoder are expressed as:
[0036]
[0037] Y i = Dense(Ws t +b) (14)
[0038] Step 3) involves multiple local clients and a central server. In the federated learning process, the central server first distributes the initial global model parameters to each client through the communication system. Each client uses these global parameters with the local data collected by itself to train its own model in the local environment. After training, each client uploads the updated model parameters to the central server. After receiving the model parameters uploaded by the client, the server updates and optimizes the global model using the federated averaging algorithm (Federated Averaging, FedAvg). Finally, the server distributes the updated model parameters to each client through the communication system. Such a cycle process can be repeated until the performance of the global model reaches the predetermined optimization goal or meets the specific iteration number. The process of model aggregation on the server is as follows: c g Then update and optimize the global model. Finally, the server distributes the updated model parameters to each client through the communication system. Such a cycle process can be repeated until the performance of the global model reaches the predetermined optimization goal or meets the specific iteration number. The process of model aggregation on the server is as follows:
[0039]
[0040] Where N e represents the number of selected clients;
[0041] Step 4) introduces the client selection rate E, which is the proportion of the number of selected clients to the total number of clients in each round of training, and the communication interval K, which is the global model parameter aggregation after K rounds of local training. By selecting part of the clients to participate in training and reducing the frequency of global model parameter aggregation, the communication overhead can be effectively reduced and the privacy protection can be increased;
[0042] Step 5) realizes the missing data completion of each client (wind farm).
[0043] The present application is a kind of wind farm wind power missing data completion method combining federated learning and attention mechanism based sequence to sequence model, called Fed-Attn-Seq2Seq. First, the complete wind energy features containing wind power are taken as the input of the local Attn-Seq2Seq model containing decoder encoder architecture, integrate information in the encoding stage, extract necessary information through dynamic context vector of attention mechanism when decoding, and gradually generate complete wind power sequence. The federated learning framework collects and aggregates the model parameters of network edge devices on the central server, rather than transmitting complete data, thereby effectively protecting data privacy and reducing communication cost. The method has the advantages of scientific rationality, strong applicability, good effect, etc. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 is the algorithm flowchart of the proposed Fed-Attn-Seq2Seq;
[0045] Figure 2 is a schematic diagram of using mask to simulate missing scenarios;
[0046] Figure 3 is a structural schematic diagram of Attn-Seq2Seq model;
[0047] Figure 4 is a schematic diagram of federated learning framework;
[0048] Figure 5 is the loss trend in the local client and server training process;
[0049] Figure 6 is a missing completion effect diagram of randomly selected clients;
[0050] Figure 7 The performance of the method of the present study and other traditional data completion methods under different mixed missing scenarios is compared. DETAILED DESCRIPTION
[0051] The preferred embodiments will be described in detail below with reference to the accompanying drawings. It should be emphasized that the following description is merely exemplary and is not intended to limit the scope of the present application and its applications.
[0052] Referring to Figure 1 A privacy-protected wind farm wind power missing data completion method considering complex missing scenarios with mixed discrete and continuous missing. The specific steps are as follows:
[0053] 1) First, according to Figure 2 The mask is used to simulate the real data missing scenario. A mask matrix M is defined to indicate which data in the time series data is missing. Where 1 represents missing data and 0 represents complete data. M d represents the discrete missing mask matrix, M c represents the continuous missing mask matrix, which is spliced according to the set proportion to obtain the mixed mask matrix M h . pValue represents the placeholder value of missing data, which is used to distinguish between artificially set missing data and true value 0 data. After using pValue to replace the missing part, the artificially degraded data The mathematical definition of the mask matrix and the mathematical expression of the degradation process are as follows:
[0054]
[0055] The missing scenarios of continuous and discrete missing data are obtained in different proportions. After obtaining the missing data, a central server is set up to form a federated learning framework, and each wind farm is used as a local client of federated learning. Each client uses the Attn-Seq2Seq model as a medium for local training, and obtains the model parameters after local training. Each client uploads the model parameters to the central server, the central server selects the client combination to participate in model parameter aggregation through the federated average algorithm, and distributes the aggregated model parameters to all clients, and repeats the training process. Finally, the complete wind power data after completion is output through the trained model;
[0056] 2) Construct the Attn-Seq2Seq model:
[0057] Reference Figure 3 , the application studies a sequence-to-sequence model with an encoder and a decoder structure. The model consists of two parts of encoder and decoder: the encoder is composed of a bidirectional long short-term memory network, which is responsible for receiving the input time series and converting it into a fixed dimension semantic vector containing global context information; the decoder combines attention mechanism and LSTM layer, and the LSTM layer is composed of:
[0058] f t =σ(W f ·[h t-1 ,x t ]+b f ) (18)
[0059] i t =σ(W i ·[h t-1 ,x t ]+b i ) (19)
[0060] o t =σ(W o ·[h t-1 ,x t ]+b o ) (20)
[0061] C t =tanh(W c [h t-1 ,x t ]+b c ) (21)
[0062] C t =f t C t-1 +i t C t (22)
[0063] ht = o t tanh(C t ) (23)
[0064] where f t , i t , o t represent the forget gate, input gate and output gate, respectively; C t and C t denote the cell vector and temporary cell vector, respectively; σ denotes the sigmoid function; W f , W i , W o , W c represent the learnable weight matrix of the forget gate, input gate and output gate, respectively; b f , b i , b o , b c represent the learnable bias vector.
[0065] Bi-LSTM extends LSTM. It uses previous and future contexts to process input data sequences from two directions with two separate LSTMs. Since the wind power missing data completion problem at time t has strong correlation with the sequence after time t, in order to obtain the information of the sequence before and after time t, the encoder selected is a bidirectional single-layer LSTM. In the encoding process, Bi-LSTM processes the time series from both forward and backward directions at the same time, and according to the calculation rule of LSTM, the forward and backward hidden states at each time t are calculated respectively For bidirectional LSTM, the forward and backward hidden states at time t can be obtained:
[0066]
[0067] The Seq2Seq model with attention mechanism is different from the traditional Seq2Seq model. It does not rely on the single fixed semantic vector c generated by the decoder, that is, the last hidden state h T of the output of the encoder, but makes full use of the entire hidden state sequence {h1, h2, …, h T} generated by the encoder to generate a dynamic attention context vector that depends on the change of time In the decoding process, information is dynamically extracted according to real-time needs, and the calculation is as follows:
[0068]
[0069] where c t is the attention weight vector α t,i and the encoder hidden state h iThe weighted sum of the attention scores, which will be used as the input of the Decoder at the current time step, together with the current hidden state s t of the Encoder to generate the next output. t,i represents the i-th element of the attention weight vector, which represents the degree of attention of the Decoder to the i-th hidden state h i of the Encoder at the current time step. t,i The attention score vector e t,i is normalized to obtain:
[0070]
[0071] α t,i = softmax(e t,i ) (27)
[0072] where [h i ; s t-1 ] represents the i-th hidden state h i of the Encoder and the hidden state s t-1 of the Decoder at time step t-1, f is a nonlinear activation function, W a and V a are the learnable attention weight matrix and attention weight vector, respectively, and b a is the learnable attention bias vector.
[0073] The hidden layer and output layer of the LSTM in the Decoder, whose analytical expressions are:
[0074]
[0075] Y i = Dense(Ws t +b) (29)
[0076] In order to maintain the consistency and integrity of the data, the present application simultaneously considers the correction of the missing part and the non-missing part in the output sequence, and defines the loss function L(·) as the regression loss MAE of the entire sequence:
[0077]
[0078] The gradient is calculated using the backpropagation algorithm during model training, and the Adam optimizer is used for parameter update, with the goal of minimizing the loss function. The update process of the Encoder and the Decoder in the model can be represented as:
[0079]
[0080] where a represents the learning rate; β1, β2 represent the momentum parameters; Gradient of the model represents; Adam optimizer of the model represents
[0081] 3) Implement Fed-Attn-Seq2Seq method:
[0082] Reference Figure 4 The application uses Attn-Seq2Seq as a model for local training in a federated learning framework, sets it as a global model for a central server, uses a federated averaging algorithm to realize aggregation and issue of local client parameters, and introduces a client selection rate E and a communication cycle K to control the number of local clients participating in communication and the number of communications each time to reduce communication overhead.
[0083] ①Federal learning client part
[0084] At the local end, the wind farm serves as the carrier of the local client, and the data of the wind farm serves as the input. Attn-Seq2Seq is used as a local model for training and is coordinated with the central server. When the nth local client receives the global model parameter θ e,d g at the kth communication round, its own model parameter θ d,e c is replaced by θ e,d g . Then each local client performs i separate local training processes in parallel, and when the communication round k meets the set communication interval K, the model parameter obtained by the last training is stored and uploaded to the central server.
[0085] The training goal of each client is to minimize the loss function, so as to maximize the fitting of the generated missing data to the real data. The reconstruction problem of the measured missing data can be fundamentally transformed into a context-consistent prediction problem, that is, a deep learning model that can generate measured data is trained, and then according to the un-missing measured data, the generated data with the smallest difference from the actual situation is selected as the filling.
[0086] ②Federal learning server part
[0087] The process of the server end is mainly concentrated on the selection of the client, the aggregation and broadcast of the model parameter. The system first initializes the global network model parameter θ e,d g on the server, and then broadcasts it to each client. This step ensures that each client can be based on the same initial model state when performing local training, thereby maintaining the consistency of the model. Subsequently, the client uses the local data to train according to the received model parameter. After the training is completed, the client uploads the updated model parameter θ d,e c to the server for aggregation processing:
[0088]
[0089] After aggregation, the server will send the aggregated model parameters to the selected clients based on the set client selection rate E and communication interval K:
[0090]
[0091] Where N e Indicates the number of clients after selection;
[0092] 4) The client performs local training and the server selects the client to aggregate and broadcast the model parameters;
[0093] 5) Complete the missing data of each client (wind farm).
[0094] Figure 5 The figure represents the loss value of the federated server and a randomly selected client throughout the training process. Other clients show similar trends. At regular global intervals, the local client's loss value first rises sharply to a peak and then rapidly decreases. Meanwhile, the server's loss value stabilizes after dropping to a certain level. This phenomenon occurs because, at each communication interval, the server aggregates the model parameters of the selected clients and then distributes them to all clients. After receiving these parameters, the client must restart local training, causing its loss value to surge. The server is only responsible for parameter aggregation and distribution throughout the process and does not participate in the entire training process, resulting in a step-by-step change in its loss value. Ultimately, the global loss value of the client and server approaches zero, indicating that the generated simulated data is highly consistent with the real data.
[0095] Figure 6 Figure 1 shows the effects of using the present invention to complete missing data for a wind farm under a mixed-missing data model. This model includes both continuous and discrete missing data, and includes a zoomed-in image of the missing data. Clearly, under this mixed-missing model, the imputed data generated by the Fed-Attn-Seq2Seq method closely matches the real data, demonstrating the effectiveness of the method.
[0096] Figure 7The method is compared with other conventional data completion methods, and the comparison methods include: mean interpolation method MEAN, expectation maximization algorithm (Expectation-Maximization, EM), random forest algorithm Missforest, k-nearest neighbor algorithm (K-Nearest Neighbor, kNN), generative adversarial network algorithm (Generative Adversarial Network, GAIN), and performance comparison of bidirectional long short-term memory network (Bidirectional Long Short-Term Memory, Bi-LSTM) under different mixed missing scenarios. Overall, as the proportion of continuous missing in the mixed missing mode gradually rises, the performance of all methods including: mean absolute error (Mean Absolute Error, MAE), root mean square error (Root Mean Square Error, RMSE), and mean arctangent absolute percentage error (Mean Arctangent Absolute Percentage Error, MAAPE) all have different degrees of decline. Compared with other methods, Fed-Attn-Seq2Seq has the best performance indicators and the best robustness to different proportions of mixed missing modes. The higher the proportion of continuous missing means the fewer adjacent data points available for prediction or interpolation around the missing value, so the continuous missing has higher completion difficulty. The proportion of continuous missing has less effect on statistical methods, mainly because these methods consider the overall statistical characteristics of the data when designed rather than relying on local adjacent values. The superior performance of Fed-Attn-Seq2Seq is due to the attention mechanism that can utilize the context information of the entire input sequence, allowing it to view the information of any part of the sequence and help the model better capture long-term dependencies, which is particularly effective for continuous missing data processing. This reflects the superiority of the method and its robustness to different proportions of mixed missing modes from another perspective.
[0097] The above is only the preferred embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for completing missing data of wind power by combining federated learning and a sequence-to-sequence model based on an attention mechanism, characterized by: It includes the following steps: See Figure 1 for a privacy-preserving wind farm wind power missing data completion method that considers a complex missing scenario involving a mixture of discrete and continuous missing data. The specific steps are as follows: 1) First, refer to Figure 2 and use masks to simulate the real data missing scenario. Define a mask matrix M to indicate which data in the time series data is missing. Where 1 indicates missing data and 0 indicates complete data. d Represents the discrete missing mask matrix, M c Represents the continuous missing mask matrix, which is spliced according to the set ratio to obtain the mixed mask matrix M h pValue represents the placeholder value of the missing data, and its purpose is to distinguish the artificially set missing data from the data with the true value of 0. After using pValue to replace the missing part, the artificially degraded data X is obtained. The mathematical definition of the mask matrix and the mathematical expression of the degradation process are as follows: X=X⊙(1-M h )+X⊙M h ×pValue (2) Obtain missing scenarios in which continuous and discrete missing data are mixed in different proportions. After obtaining the missing data, a central server is set up to form a federated learning framework, with each wind farm as a local client of the federated learning. Each client uses the Attn-Seq2Seq model as the medium for local training. After the local training is completed, the model parameters are obtained. Each client uploads the model parameters to the central server. The central server selects a client combination to participate in the model parameter aggregation through the federated averaging algorithm, and sends the aggregated model parameters to all clients, repeating the training process. Finally, the trained model outputs the complete wind power data after completion. The specific steps include: 2) Build the Attn-Seq2Seq model: Referring to Figure 3, this paper studies a sequence-to-sequence model with an encoder-decoder structure. The model consists of two parts: an encoder and a decoder. The encoder is composed of a bidirectional long short-term memory network, which is responsible for receiving the input time series and converting it into a fixed-dimensional semantic vector containing global context information. The decoder combines an attention mechanism with an LSTM layer. The LSTM layer consists of the following: f t =σ(W f ·[h t-1 ,x t ]+b f ) (3) i t =σ(W i ·[h t-1 ,x t ]+b i ) (4) the t =σ(W o ·[h t-1 ,x t ]+b o ) (5) C t =tanh(W c [h t-1 ,x t ]+b c ) (6) C t =f t C t-1 +i t C t (7) h t =o t fishy(C) t ) (8) Where, f t 、i t 、o t Represent the forget gate, input gate and output gate respectively; C t and C t Represent cell vector and temporary cell vector respectively; σ represents sigmoid function; W f 、W i 、W o 、W c Represents the learnable weight matrices of the forget gate, input gate, and output gate respectively; b f 、b i 、b o 、b c Represents the learnable bias vector. Bi-LSTM extends LSTM. It uses previous and future contexts to process input data sequences from two directions with two separate LSTMs. Since the missing wind power data completion problem at time t is strongly correlated with the sequence after time t, in order to simultaneously obtain information before and after the sequence, the encoder in this paper is selected as a bidirectional single-layer LSTM. During the encoding process, Bi-LSTM processes the time series simultaneously from both the forward and backward directions, and calculates the forward and backward hidden states at each moment according to the calculation rules of LSTM. For a bidirectional LSTM, its forward and backward hidden states at time t can be obtained: Seq2Seq with the introduction of the attention mechanism is different from the traditional Seq2Seq model. It does not rely on the single fixed semantic vector c generated by the decoder, that is, the last hidden state h of the encoder's output. T , but makes full use of the entire hidden state sequence {h1,h2,...,h T }, generating a dynamic attention context vector that depends on the moment-to-moment changes During the decoding process, information is dynamically extracted according to real-time requirements and calculated as follows: Where c t is the attention weight vector α t,i and Encoder hidden state h i The weighted sum of , which will be used as the input of the Decoder current time step, and the current hidden state s of the Encoder t Together they are used to generate the next output. t,i The i-th element of the attention weight vector represents the i-th hidden state h of the Encoder at the current time step by the Decoder i The degree of attention. t,i By the attention score vector e t,i Normalized to get: a t,i =softmax(e t,i ) (12) In the formula, [h i ;s t-1 ] represents the i-th hidden state h of the encoder i and the decoder’s hidden state s at time step t-1 t-1 Connect them, f is a nonlinear activation function, W a and V a are the learnable attention weight matrix and attention weight vector, b a is a learnable attention bias vector. The hidden layer and output layer of the LSTM in the decoder are expressed analytically as follows: Y i =Dense(Ws t +b) (14) In order to maintain the consistency and integrity of the data, the present invention considers the correction of both the missing and non-missing parts in the output sequence, and defines the loss function L(·) as the regression loss MAE of the entire sequence: During model training, the backpropagation algorithm is used to calculate the gradient, and the Adam optimizer is used to update the parameters with the goal of minimizing the loss function. The update process of the encoder and decoder in the model can be expressed as: Where α represents the learning rate; β1 and β2 represent momentum parameters; ▽ represents the gradient of the model; Adam represents the optimizer of the model; 3) Implement the Fed-Attn-Seq2Seq method: Referring to Figure 4, the present invention uses Attn-Seq2Seq as the local training model in the federated learning framework, and sets it as the global model of the central server. It uses the federated averaging algorithm to aggregate and distribute local client parameters, and introduces the client selection rate E and communication cycle K to control the number of local clients participating in each communication and the number of communications to reduce communication overhead. ① Federated learning client part At the local end, the wind farm acts as the carrier of the local client, and the data of the wind farm is used as input. Attn-Seq2Seq is used as the local model for training and cooperates with the central server. When the nth local client receives the global model parameters θ in the kth communication round e,d g When its own model parameter θ d,e c Replace with θ e,d g Then each local client executes i separate local training processes in parallel, and when the communication round k meets the set communication interval K, the model parameters obtained from the last training are stored and uploaded to the central server. The training objective for each client is to minimize the loss function, thereby ensuring that the generated missing data best approximates the real data. The problem of reconstructing missing measurement data can be fundamentally transformed into a context-consistent prediction problem. This involves training a deep learning model that generates measurement data, and then selecting the generated data that minimizes the difference from the actual data as filler based on the remaining measurement data. ② Federated learning server part The server-side participation process mainly focuses on the client selection, aggregation and broadcast of model parameters. The system first initializes the global network model parameters θ on the server. e,d g , and then broadcast it to each client. This step ensures that each client can be based on the same initial model state when performing local training, thereby maintaining model consistency. Subsequently, the client uses local data to train based on the received model parameters. After training is completed, the client will update the model parameters θ d,e c Upload to the server for aggregation processing: After aggregation, the server will send the aggregated model parameters to the selected clients based on the set client selection rate E and communication interval K: Where N e Indicates the number of clients after selection; 4) The client performs local training and the server selects the client to aggregate and broadcast the model parameters; 5) Complete the missing data of each client (wind farm).
Citation Information
Cited By
Wind power random missing value interpolation method and system
CN122241032A
Wind power random missing value imputation method and system
CN122241032B