Wind power prediction system and method based on chaos-homomorphic encryption and federated learning
By using chaos-homomorphic encryption technology in the wind power prediction system, generating a fourth-order key matrix for key distribution, and performing multi-layer encryption and decryption operations in the federated learning process, the security problem of model leakage in the wind power prediction system is solved. It achieves the accuracy of wind power prediction and the protection of data privacy, and promotes efficient grid connection and data sharing of wind farms and energy systems.
Patent Information
- Application Number
- CN202410816042.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-06-24
AI Technical Summary
There are model leak security issues in existing wind power prediction systems. Sensitive data is easily leaked during the federated learning process, damaging local privacy and data security, and affecting the efficient grid connection of wind farms and data sharing in energy systems.
A wind power prediction system based on chaos-homomorphic encryption is used to generate a fourth-order key matrix for key distribution, and use multi-layer encryption and decryption operations in the federated learning process to ensure that data is transmitted and aggregated in a ciphertext state, preventing Sensitive information leaked.
It achieves the accuracy of wind power prediction and the protection of data privacy, ensures the security and privacy of local data, and promotes efficient grid connection of wind farms and data sharing of modern energy systems.
Smart Images

Figure CN118381674B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of wind power generation, and in particular to a wind power prediction system and method based on chaos-homomorphic encryption and federated learning. Background Art
[0002] Wind energy has become one of the most popular renewable energy sources due to its environmental protection, abundant resources, and affordability. However, on the one hand, some uncertainties in the use of wind resources and the randomness of wind speed can reduce the use of wind energy in some cases. Accurate prediction of wind power and wind speed is considered to be a reliable and low-cost solution to these problems, which can accelerate the connection of wind farms to the grid. On the other hand, the lack of access to data in different regions and the security of existing data in the modern energy system, the lack of meteorological stations in different business areas, and the importance of maintaining the security of existing data are also one of the main challenges today. With the continuous improvement of people's awareness of privacy protection, how to achieve privacy protection of user data and models while ensuring the performance of prediction models has become a key issue.
[0003] With the development of science and technology, federated learning has been gradually applied to wind power and wind power forecasting, protecting local data and alleviating communication pressure while making accurate predictions. However, federated learning still faces serious threats because the update of the communication model during the entire training process may leak sensitive information. From the shared model update, attackers can steal training data or infer "unintended" information. Any device involved in training may pose a threat to data leakage by observing and analyzing these updates. These threats may damage local privacy and cause unpredictable economic and property losses, while seriously hindering the efficient grid connection of wind farms and the efficient use and sharing of data in modern energy systems. In summary, there is a model leakage security problem in the current wind power forecasting system based on federated learning, and in-depth research and improvement are needed to ensure accurate prediction in wind power forecasting while protecting the privacy and security of local wind power data. Summary of the invention
[0004] The purpose of the present invention is to provide a wind power prediction system and method based on chaos-homomorphic encryption and federated learning to overcome the risks of sensitive data privacy leakage and insufficient security in existing wind power prediction systems, and help stakeholders jointly build a wind power prediction system based on local clients and cloud servers, which will help promote the efficient grid connection of wind farms and the efficient use and sharing of data in modern energy systems. At the same time, the system will not leak local data, providing stakeholders with a safe and reliable cooperation platform.
[0005] In a first aspect, the present invention provides a wind power prediction method based on chaos-homomorphic encryption and federated learning, comprising the following steps:
[0006] Step 1: The key generation end generates a four-order key matrix and distributes the processed key matrix to the server, proxy, and corresponding local client. P j , j= 1,2,3,..., l , l is the total number of local clients; then exit the system and destroy all key-related information. At the same time, the server initializes the global model parameters in the federated learning model and specifies the number of communication rounds T ;
[0007] Step 2: Random selection on the server n The local clients participate in the modeling task of federated learning. During the initial communication, the server distributes the initialized and unencrypted global model parameters to the local clients participating in the federated learning modeling through the proxy and marks them as N j , j= 1,2,3,..., n ;
[0008] Step 3: Local Client N j After receiving the model parameters, load the local wind farm dataset, and then use the distributed model parameters for local training. Train the local data according to the pre-defined number of iterations, and use the local key to K ’ j Perform the initial encryption and upload to the agent; the agent will upload the model parameters after the initial encryption Use the corresponding proxy key K ’’ j Encrypt the model parameters again and send the encrypted model parameters to Upload to the server;
[0009] Step 4: The server confirms that it has collected n Encryption model parameters for local clients , use the corresponding service key for each encrypted model parameter K ’’’ j Encrypt again; and perform homomorphic operations on the encrypted model parameters encrypted by the server key without knowing the real parameters to obtain the ciphertext aggregation parameters, and update the obtained ciphertext aggregation parameters to the global model parameters of the server;
[0010] Step 5: The server will aggregate the ciphertext global model parameters Through the corresponding service key K’’’ j Decrypted and sent to the proxy, and randomly selected again m local clients;
[0011] Step 6: The agent receives the encrypted model parameters from the server Then, use the corresponding proxy key K ’’ j For model parameters Decrypt and decrypt the model parameters Sent to the corresponding local client respectively N j ;
[0012] Step 7: Local Client N j After receiving the decrypted model parameters sent by the agent , using a local key K ’ j The decrypted model parameters Perform the decryption operation again, load the local wind farm dataset, and then use the decrypted model parameters Perform local training and train local data according to a predefined number of iterations, and use the local key to train the trained model parameters. K ’ j Encrypt and upload to the agent; then the agent uses the corresponding agent key to encrypt the model parameters after the initial encryption K ’’ j The model parameters are encrypted again and uploaded to the server.
[0013] Step 8: The server reconfirms that it has collected m Encryption model parameters for local clients , use the corresponding service key for each encrypted model parameter K ’’’ j Encrypt again, and without knowing the real parameters, perform aggregation operation on the encrypted model parameters encrypted by the server key to obtain ciphertext aggregation parameters, and at the same time update the obtained ciphertext aggregation parameters to the global model parameters of the server;
[0014] Step 9: Execute steps 5 to 8 T times in a predefined loop to generate a trained global model; the server distributes the trained global model to each local client through the proxy end. P j , then the local clientP j Update the local model, input the collected wind power data parameters such as wind force and wind direction into the trained model, and complete the wind power forecast. The present invention can use the model to perform more accurate wind power forecasting tasks, while also overcoming the risk of privacy leakage in wind power forecasting scenarios, and helping stakeholders to jointly build a wind power forecasting system based on local clients and cloud servers without leaking local data.
[0015] Furthermore, step 1 specifically includes the following steps:
[0016] Step 1.1: The key generation end first determines the system parameters of the mixed-order complex Lorenz chaotic system r , r , b , q 1. q 2 and initial value x 1. x 2. x 3. y 1. y 2; The mixed-order complex Lorenz chaotic system is:
[0017] ;
[0018] in, r , r , b、q 1 、q 2 are system parameters, and r , r , b All are greater than 0; state variables oh i = x i + you i is a complex variable, x i 、y i is a real variable, j is the imaginary unit, i = 1,2; express oh i of q i Derivatives, They are oh 1. oh The conjugate variable of 2, x ’ 3 means x 3 first-order derivative; the complex variable oh i Expand to:
[0019] ;
[0020] Step 1.2: Use the prediction-correction method to solve the expanded mixed-order complex Lorenz chaotic system and generate a n Chaotic sequence of elements X =[ x 1 , x 2 , x 3 ,…, x n ], then from X Randomly intercept a chaotic sequence X ’ and convert it into a key sequence key j ,Right now key j = X ’ =[ x z+16×j+1 , x z+16×j+2 ,…, x z+16×(j+1) ],in, j = 1,2..., l , z is the initial value randomly selected, l Indicates the total number of local clients;
[0021] Step 1.3, select the scaling factor γ, integer N=∏ j=1 2l n j , and the integer N As the modulus in the modulo operation, where n j are all prime numbers, j = 1,2,...,2 l ;
[0022] Step 1.4: Each key sequence key j Multiply by the scaling factor γ and perform a modulo operation to generate key ’ j ,in j =1,2..., l , then key ’ j Reorganize into a 4-order square matrix k j, called the key matrix; finally, the key matrix k j Store in keystore keys middle;
[0023] Step 1.5: Randomly retrieve the key from the keystore keys Select the key matrix K , for each local client P j Construct local keys separately K ’ j , Proxy Key K ’’ j and service key K ’’’ j :
[0024] K ’ j = K mod n i , K ’’ j = K mod n j , K ’’’ j = K ’’ j -1 K ’ j -1 K ;
[0025] in, n i , n j Is a constructed integer N The prime number of i ≠ j , i,j = 1,2,..,2 l ; K ’ j -1 , K ’’ j -1 Local key K ’ j and the proxy key K ’’ j The inverse matrix ofK ’’’ j There is an inverse matrix K ’’’ j -1 ;
[0026] Step 1.6: Local key K ’ j , Proxy Key K ’’ j and service key K ’’’ j Send to local client separately P j , the agent and the server, then exit the system and destroy all key-related information.
[0027] Furthermore, in step 3, the local client N j The specific process of using local data for local training is as follows:
[0028] Step 3.1: Local Client N j Determine the number of local training times E;
[0029] Step 3.2: As a participant in the current round, the local client N j The global model parameters in plain text need to be obtained from the proxy i , and the proximal term is calculated according to the following formula pr And update the local model parameters:
[0030] ;
[0031] in, m represents the coefficient of the proximal term;
[0032] Step 3.3: Local Client N j Perform local training iterations E times and calculate the output of each iteration out j i , loss function L i j and gradient degree i j :
[0033] out i j = fp ( x j , i j );
[0034] L i j = loss ( y j , out i j ) + pr ;
[0035] degree i j = bpf ( L i j , x j , i j );
[0036] in, i =1,.., E , x j , y j Respectively represent the local client N j Local training data and its labels, fp represents the forward propagation function, loss represents the loss function, bpf represents the backpropagation function; then the local model parameters are updated i j :
[0037] i j =θ j - lr × degree i j .
[0038] Furthermore, in step 3, the specific process of the local client initially encrypting the trained model parameters and uploading them to the proxy is as follows:
[0039] First, the model parameters i j Convert to the 4th-order matrix required for encryption :
[0040] ;
[0041] in, N2M () means constructing the numbers into a fourth-order matrix, and , a , b Integer domain Z N The random numbers in B and C is a random square matrix of order 2, and 0 is a square matrix of all zeros of order 2.
[0042] Second, use the local client key K ’ j To encrypt the parameters:
[0043] ;
[0044] in, Enc () indicates encryption operation;
[0045] Finally, the local client N j The model parameters Send to the agent.
[0046] Furthermore, in step 3, the agent sends the model parameters Use the corresponding client N j Proxy Key K ’’ j The model parameters are obtained by performing encryption operations through the following formula :
[0047] .
[0048] Furthermore, in step 4, the server performs model parameter Use the client N j Service Key K ’’’ j , perform encryption operations according to the following formula to obtain model parameters :
[0049] .
[0050] Furthermore, in step 4, the server performs an aggregation operation to obtain the aggregated ciphertext global model parameters :
[0051] .
[0052] Further, in step 5, the server side selects the local client N j , j =1,2,3..., m , using the corresponding service key K ’’’ j Decrypt the updated global model parameters separately to obtain the decrypted model parameters :
[0053] ;
[0054] in, Dec () indicates the execution of decryption operation.
[0055] Further, in step 7, the local client N j The specific process of using local data for local training is as follows:
[0056] Step 7.1: Local Client N j Determine the number of local training times E;
[0057] Step 7.2: As a participant in the current round, the local client N j First, the decrypted model parameters Convert to i j , calculate the proximal term pr And update the local model parameters:
[0058] ;
[0059] ;
[0060] ;
[0061] in, M2N () means getting the upper left corner element of a 4-order matrix;
[0062] Step 7.3, local client N j Perform local training iterations E times and calculate the output of each iteration out j i , loss function L i j and gradient degree i j :
[0063] out i j = fp ( x j , i ’ j );
[0064] L i j = loss ( y j , out i j ) + pr ;
[0065] degree i j = bpf ( L i j , x j , i ’ j );
[0066] in, i = 1,.., E , x j , y j Respectively represent the local client N j Local training data and its labels, fp represents the forward propagation function, loss represents the loss function, bpf represents the back propagation function; and updates the local model parameters according to the following formula i ’ j :
[0067] i ’ j =θ ’ j - lr × degree i j .
[0068] In a second aspect, the present invention provides a wind power prediction system based on chaos-homomorphic encryption and federated learning, comprising:
[0069] The key generation end includes a key generation submodule and a key distribution submodule; the key generation submodule is responsible for generating and registering the keys required by the system, and the key distribution submodule is responsible for distributing the keys; the function of this module is to ensure the security and credibility of system communications, laying the foundation for subsequent data transmission and processing.
[0070] The agent side includes a communication submodule and an encryption submodule; the communication submodule is responsible for coordinating the communication between local clients and between local clients and the server side, and is also responsible for collecting and distributing model parameters; at the same time, the encryption submodule is responsible for performing encryption and decryption operations on the received model parameters to ensure the security and privacy of the data.
[0071] The server includes an encryption submodule, a security aggregation submodule and a communication submodule; the encryption submodule is responsible for performing encryption and decryption operations on the received model parameters, and the main task of the security aggregation submodule is to perform aggregation operations in the ciphertext state and update the global model parameters; through homomorphic encryption technology, this module can process the encrypted model parameters to ensure the privacy and security of the data, and then optimize and update the global model; at the same time, the communication submodule is responsible for distributing and collecting model parameters for subsequent processing;
[0072] The local client includes an encryption submodule, a training submodule and a communication submodule; the encryption submodule is responsible for performing encryption and decryption operations on the received model parameters, the training submodule is responsible for performing model training tasks based on local wind farm data, and the communication submodule is responsible for distributing and collecting model parameters; this modular design ensures the locality and privacy of the data.
[0073] The present invention has the following advantages:
[0074] (1) Accurate execution of wind power forecasting tasks: The present invention adopts federated learning technology to achieve highly accurate wind power forecasting, which helps to improve the utilization efficiency of wind power energy;
[0075] (2) Privacy protection: The present invention uses chaos-homomorphic encryption technology to strictly protect local data, prevent the leakage of sensitive information, and ensure the security and privacy of data on the local client;
[0076] (3) Creating opportunities for cooperation: The present invention encourages cooperation among stakeholders and jointly builds a wind power prediction system between the local client and the cloud service end, which helps promote the efficient grid connection of wind farms and the efficient use and sharing of data in modern energy systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 This is a schematic diagram of the server-client collaboration process of the present invention;
[0078] Figure 2 It is a schematic diagram of a wind power prediction system based on chaos-homomorphic encryption and federated learning of the present invention;
[0079] Figure 3 It is a schematic diagram of the wind power prediction method based on chaos-homomorphic encryption and federated learning of the present invention. DETAILED DESCRIPTION
[0080] The technical solutions in the specific embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the specific embodiments of the present invention.
[0081] Aiming at the model leakage security problem existing in the wind power prediction system based on federated learning, the present invention designs a multi-key chaos-homomorphic encryption scheme, and proposes a new wind power prediction method in combination with federated learning.
[0082] Embodiment 1:
[0083] Figure 1 This is a schematic diagram of the server-client collaboration process. Federated learning involves a server and n The collaboration between multiple clients, where data is scattered among the clients. Each client is responsible for using the data it holds to perform local training and optimization of the neural network model. Based on the support of homomorphic encryption technology, the client will encrypt the model weights generated during the training process, and then upload these encrypted weights to the server step by step until they are finally aggregated on the server. After the server completes the aggregation of weights, the aggregated model is sent to each client for the next round of training, and the local model is updated according to the new weights. This process may go through multiple rounds of iterations, or end when specific conditions are met, and finally the latest model is obtained and saved on the server. All these operations are performed under ciphertext to ensure data privacy and security.
[0084] like Figure 2 As shown, this embodiment proposes a wind power prediction system based on chaos-homomorphic encryption and federated learning, including a key generation end, an agent end, a server end and a local client end.
[0085] Specifically, the key generation end includes a key generation submodule and a key distribution submodule. The key generation submodule is responsible for generating and registering the keys required by the system, while the key distribution submodule is responsible for securely distributing the keys to other modules. The role of this module is to ensure the security and credibility of system communication, laying the foundation for subsequent data transmission and processing.
[0086] Specifically, the proxy terminal includes an encryption submodule and a communication submodule. The communication submodule is responsible for coordinating the communication between local clients and between local clients and the server, and is also responsible for collecting and distributing model parameters. At the same time, the encryption submodule is responsible for performing encryption and decryption operations on the received model parameters to ensure the security and privacy of the data.
[0087] Specifically, the server is the core of the whole system, including an encryption submodule, a security aggregation submodule and a communication submodule. The encryption submodule is responsible for performing encryption and decryption operations on the received model parameters, and the main task of the security aggregation submodule is to perform aggregation operations in the ciphertext state and update the global model parameters. Through homomorphic encryption technology, this module can process the encrypted model parameters, ensure the privacy and security of the data, and then optimize and update the global model. At the same time, the communication submodule is responsible for distributing and collecting model parameters for subsequent processing.
[0088] Specifically, the local client is the basic component of the system, and each local client represents an independent wind farm. The local client includes an encryption submodule, a training submodule, and a communication submodule. The encryption submodule is responsible for performing encryption and decryption operations on the received model parameters, the training submodule is responsible for performing model training tasks based on local wind farm data, and the communication submodule is responsible for distributing and collecting model parameters. This modular design ensures the locality and privacy of data.
[0089] It is important to note that each local client is assigned a unique identifier, usually P j Indicates that j The number representing the client, ranging from 1 to l ,and l This numbering method helps to identify and manage each client, enabling the system to work together efficiently, thus achieving high efficiency and privacy protection of wind power forecasting.
[0090] Embodiment 2:
[0091] This embodiment provides a wind power prediction method based on chaos-homomorphic encryption and federated learning. Figure 3 As shown, the specific workflow is as follows:
[0092] Step 1: The key generation end generates a four-order key matrix and distributes the processed key matrix to the server, proxy, and corresponding local client. P j , then exit the system and destroy all key-related information. At the same time, the server initializes the global model parameters and specifies the number of communication rounds. T .
[0093] Specifically, the specific process of the key generation end generating the fourth-order key matrix and the subsequent processing steps described in step 1 is as follows.
[0094] Step 1.1: The key generation end first determines the system parameters of the mixed-order complex Lorenz chaotic system p,r,b,q 1 ,q 2 and initial value x 1 ,x 2, x 3 ,y 1 ,y 2 ; The mixed-order complex Lorenz chaotic system is:
[0095] ;
[0096] in, p,r,b,q 1 ,q 2 are all system parameters in the Lorenz system, and p,r,b are greater than 0, the state variable oh i = x i + you i is a complex variable, x i ,y i is a real variable, j is the imaginary unit, express oh i of q i Derivatives, They are oh 1. oh The conjugate variable of 2, x ’ 3 express x 3 first derivative; the complex variable oh i = x i + you i After expansion, we get:
[0097] .
[0098] Step 1.2: Use the prediction-correction method to solve the expanded mixed-order complex Lorenz chaotic system and generate a n Chaotic sequence of elements X =[ x 1 , x 2 , x 3 ,…, x n ], then from X Randomly intercept a chaotic sequence X ’ And convert it into a series of key sequences key j ,Right now key j = X ’ =[ x z+16×j+1 , x z+16×j+2 ,…, x z+16×(j+1) ],in j = 1,2..., l , z is the initial value randomly selected, l Indicates the total number of local clients.
[0099] Step 1.3, select the scaling factor γ, integer N= ∏ j=1 2l n j ,in, n j are all prime numbers, j = 1,2,...,2 l , and the integer N As the modulus in a modulo operation.
[0100] Step 1.4: Each key sequence key j ( i=1,…,l ) is multiplied by the scaling factor γ and then modulo-operated to generate key ’ j , then key ’ j Reorganize into a 4-order square matrix k j , which is called the key matrix. Finally, the key matrix k j Store in keystore keys middle.
[0101] Step 1.5: Randomly retrieve the key from the keystore keys Select the key matrix K , for each local client P j Construct local keys separately K ’ j , Proxy Key K ’’ j and service key K ’’’ j , where the key K ’ j , K ’’ j , K ’’’ j is constructed as follows:
[0102] K ’ j = K mod n i , K ’’ j = K mod n j , K ’’’ j = K ’’ j -1 K ’ j -1 K ;
[0103] in, n i , n j ( i ≠ j , i,j = 1,2,..,2 l ) is a constructed integer N The prime number of K ’ j -1 , K ’’ j -1 Local key K ’ jand the proxy key K ’’ j The inverse matrix of K ’’’ j There is an inverse matrix K ’’’ j -1 .
[0104] Step 1.6: Local key K ’ j , Proxy Key K ’’ j and service key K ’’’ j Send to local client separately P j , the agent and the server, then exit the system and destroy all key-related information.
[0105] Furthermore, the server-side initialized global model parameters mentioned in step 1 are model parameters in a federated learning model based on an LSTM neural network, and the federated learning model allows multiple clients to jointly train using local data.
[0106] Step 2: Random selection on the server n indivual( n ≤ l )Local clients participate in the modeling task of federated learning. During the initial communication, the server distributes the initialized and unencrypted global model parameters to the local clients participating in the federated learning modeling through the proxy.
[0107] More specifically, the server will l Select from local clients n local clients, and these selected clients are marked as N j , j= 1,2,3,..., n .
[0108] Step 3: Local Client N j After receiving the model parameters, load the local wind farm dataset, and then use the distributed model parameters for local training. Train the local data according to the pre-defined number of iterations and use the local key to train the trained model parameters. K ’ jThe model parameters are encrypted for the first time and uploaded to the agent. The agent then uses the corresponding agent key to K ’’ j The model parameters are encrypted again and uploaded to the server.
[0109] Local client as described in step 3 N j The randomly selected n Client. Local key K ’ j The local key sent by the key generator to the local client in step 1, the proxy key K ’’ j The proxy key sent by the key generator to the proxy in step 1.
[0110] Specifically, the local client N j The specific process of using local data for local training is as follows.
[0111] Step 3.1: Local Client N j Determine the number of local training times E.
[0112] Step 3.2: As a participant in the current round, the local client N j The global model parameters in plain text need to be obtained from the proxy i , and the proximal term is calculated according to the following formula pr And update local model parameters;
[0113] ;
[0114] in, m represents the proximal term coefficient.
[0115] Step 3.3: Local Client N j Perform local training iterations E times and calculate the output of each iteration out j i , loss function L i j and gradient degree i j ( i =1,…,E):
[0116] outi j = fp ( x j , i j );
[0117] L i j = loss ( y j , out i j ) + pr ;
[0118] degree i j = bpf ( L i j , x j , i j );
[0119] in, x j , y j Respectively represent the local client N j Local training data and its labels, fp represents the forward propagation function, loss represents the loss function, bpf represents the backpropagation function; then the local model parameters are updated i j :
[0120] i j =θ j - lr × degree i j .
[0121] The specific process of the local client initially encrypting the trained model parameters and uploading them to the proxy is as follows:
[0122] First, the model parameters i j Convert to the 4th-order matrix required for encryption :
[0123] ;
[0124] in, N2M () means constructing the numbers into a fourth-order matrix, and , a,b Integer domain Z N The random numbers in B and C is a random square matrix of order 2, and 0 is a square matrix of all zeros of order 2.
[0125] Second, use the local client key K ’ j To encrypt the parameters:
[0126] ;
[0127] in, Enc () indicates encryption operation; finally the local client N j The model parameters Send to the agent.
[0128] Finally, the proxy will come from the local client N j Model parameters The specific encryption operation is to use the corresponding client N j Proxy Key K ’’ j The model parameters are obtained by performing encryption operations through the following formula :
[0129] .
[0130] Step 4: The server confirms that it has collected n Encryption model parameters for local clients , use the corresponding service key for each encrypted model parameter K ’’’ j ( j =1,2,3,… , n ) and encrypt it again; and without knowing the real parameters, perform aggregation operation on the encrypted model parameters encrypted by the server key to obtain ciphertext aggregation parameters, and update the obtained ciphertext aggregation parameters to the global model parameters of the server.
[0131] Specifically, the service key described in step 4 K ’’’ j is the service key sent by the key generator to the server in step 1, and the model parameter The model parameters sent by the agent to the server in step 3 ( j =1,2,3,…, n ). The server side controls the model parameters The specific encryption operation is to use the client corresponding N j Service Key K ’’’ j Perform encryption operations according to the following formula to obtain model parameters :
[0132] ;
[0133] The specific operation of the server-side aggregation operation is as follows: the server performs an aggregation operation on the collected model parameters to obtain the aggregated ciphertext global model parameters :
[0134] .
[0135] Step 5: The server will aggregate the ciphertext global model parameters Through the corresponding service key K ’’’ j Decrypted and sent to the proxy, and randomly selected again m A local client.
[0136] Specifically, the server randomly selects m The local clients are named N j ( j =1,2,3,…, m ), m is the number of clients randomly selected this time, and the service key described in step 5 K ’’’ j It is the service key sent by the key generator to the server in step 1. The specific operation of the server to decrypt the global model parameters is as follows:
[0137] The server selects the local client. N j , using the corresponding service key K ’’’ j Decrypt the updated global model parameters to obtain the model parameters :
[0138] ;
[0139] in, Dec Indicates the execution of decryption operation. Indicates that the server uses the service key K ’’’ j Decrypted global model parameters.
[0140] Step 6: The agent receives the encrypted model parameters from the server Then, use the corresponding proxy key K ’’ j For model parameters After decryption, the model parameters are obtained Sent to the corresponding local client respectively N j .
[0141] Specifically, the local client described in step 6 N j The randomly selected m Client, Proxy Key K ’’ j The proxy key sent by the key generator in step 1 to the proxy. The proxy has encryption model parameters The specific decryption operation is: the proxy uses the corresponding local client N j Proxy Key K ’’ j Perform the decryption operation according to the following formula to obtain the model parameters :
[0142] ;
[0143] in, Indicates that the agent uses the agent key K ’’ j Decrypted model parameters.
[0144] Step 7: Local Client N j After receiving the model parameters sent by the agent Then, use the local key K ’ j For model parameters Perform the decryption operation, load the local wind farm dataset, and then use the decrypted model parameters Perform local training and train local data according to a predefined number of iterations, and use the local key to train the trained model parameters. K’ j The model parameters are encrypted and uploaded to the agent. The agent then uses the corresponding agent key to K ’’ j The model parameters are encrypted again and uploaded to the server.
[0145] Specifically, the local client described in step 7 N j The randomly selected m Client, Proxy Key K ’’ j The proxy key sent by the key generator in step 1 to the proxy. The local client has encryption model parameters The specific decryption operation is: the local client uses the local key K ’ j Perform the decryption operation according to the following formula to obtain the model parameters :
[0146] .
[0147] Local Client N j The specific process of local training using local datasets is as follows.
[0148] Step 7.1: Local Client N j Determine the number of local training times E.
[0149] Step 7.2: As a participant in the current round, the local client N j The decrypted model parameters Convert to i j , calculate the proximal term pr And update the local model parameters:
[0150] ;
[0151] ;
[0152] ;
[0153] in, M2N () means getting the upper left corner element of a 4-order matrix.
[0154] Step 7.3, local client N jPerform local training iterations E times and calculate the output of each iteration out j i , loss function L i j and gradient degree i j :
[0155] out i j = fp ( x j , i ’ j );
[0156] L i j = loss ( y j , out i j ) + pr ;
[0157] degree i j = bpf ( L i j , x j , i ’ j );
[0158] And update the local model parameters according to the following formula i ’ j :
[0159] i ’ j =θ ’ j - lr × degree i j ;
[0160] The specific process of the local client initially encrypting the trained model parameters and uploading them to the proxy is as follows:
[0161] First, the model parameters i’ j Convert to the 4th-order matrix required for encryption :
[0162] ;
[0163] in , a,b Integer domain Z N The random numbers in B and C is a random square matrix of order 2, and 0 is a square matrix of all zeros of order 2.
[0164] Second, use the local client key K ’ j To encrypt the parameters:
[0165] .
[0166] Finally, the local client N j The model parameters Send to the agent.
[0167] The proxy will come from the local client N j Model parameters The specific encryption operation is to use the client corresponding N j Proxy Key K ’’ j Perform encryption operations according to the following formula to obtain model parameters :
[0168] .
[0169] Step 8: The server reconfirms that it has collected m Encryption model parameters for local clients , use the corresponding service key for each encrypted model parameter K ’’’ j Encrypt again. And without knowing the real parameters, perform aggregation operation on the encrypted model parameters encrypted by the server key to obtain the ciphertext aggregation parameters, and at the same time update the obtained ciphertext aggregation parameters to the global model parameters of the server.
[0170] Step 9: Execute steps 5 to 8 T times according to the predefined loop to generate a trained global model. The server distributes the trained global model to each local client through the proxy end. Pj , then the local client P j Update the local model, input the collected wind power data parameters such as wind force and wind direction into the trained model, and complete the wind power forecast. The present invention can use the model to perform more accurate wind power forecasting tasks, while also overcoming the risk of privacy leakage in wind power forecasting scenarios, and helping stakeholders to jointly build a wind power forecasting system based on local clients and cloud servers without leaking local data.
[0171] The wind power prediction system and method based on chaos-homomorphic encryption and federated learning provided by the present invention can effectively overcome the risks of sensitive data privacy leakage and insufficient security in existing wind power prediction systems, and is conducive to stakeholders to jointly build a wind power prediction network based on local clients and cloud servers, which helps to promote the efficient grid connection of wind farms and the efficient use and sharing of data in modern energy systems. At the same time, the system will not leak local data, providing stakeholders with a safe and reliable cooperation platform.
Claims
1. A wind power prediction method based on chaos-homomorphic encryption and federated learning, characterized in that: The following steps are involved: Step 1: The key generation end generates a four-order key matrix and distributes the processed key matrix to the server, proxy, and corresponding local client. P j , j= 1,2,3,..., l , l is the total number of local clients; then exit the system and destroy all key-related information. At the same time, the server initializes the global model parameters in the federated learning model and specifies the number of communication rounds T ; Step 2: Random selection on the server n The local clients participate in the federated learning modeling task. During the initial communication, the server distributes the initialized and unencrypted global model parameters to the local clients participating in the federated learning modeling through the proxy and marks them as N j , j= 1,2,3,..., n ; Step 3: Local Client N j After receiving the model parameters, load the local wind farm dataset, and then use the distributed model parameters for local training. Train the local data according to the pre-defined number of iterations, and use the local key to K ’ j Perform initial encryption and upload to the agent; The agent will be the model parameters after the initial encryption Use the corresponding proxy key K ’’ j Encrypt the model parameters again and send the encrypted model parameters to Upload to the server; Step 4: The server confirms that it has collected n Encryption model parameters for local clients , use the corresponding service key for each encrypted model parameter K ’’’ j Encrypt again; and perform homomorphic operations on the encrypted model parameters encrypted by the server key without knowing the real parameters to obtain the ciphertext aggregation parameters, and update the obtained ciphertext aggregation parameters to the global model parameters of the server; Step 5: The server will aggregate the ciphertext global model parameters Through the corresponding service key K ’’’ j Decrypted and sent to the proxy, and randomly selected again m local clients; Step 6: The agent receives the encrypted model parameters from the server Then, use the corresponding proxy key K ’’ j For model parameters Decrypt and decrypt the model parameters Sent to the corresponding local client respectively N j ; Step 7: Local Client N j After receiving the decrypted model parameters sent by the agent Then, use the local key K ’ j The decrypted model parameters Perform the decryption operation again, load the local wind farm dataset, and then use the decrypted model parameters Perform local training and train local data according to a predefined number of iterations, and use the local key to train the trained model parameters. K ’ j Encrypt and upload to the agent; then the agent uses the corresponding agent key to encrypt the model parameters after the initial encryption K ’’ j Encrypt the model parameters again and upload the encrypted model parameters to the server; Step 8: The server reconfirms that it has collected m Encryption model parameters for local clients , use the corresponding service key for each encrypted model parameter K ’’’ j Encrypt again, and aggregate the encrypted model parameters encrypted by the server key without knowing the real parameters to obtain ciphertext aggregate parameters, and update the obtained ciphertext aggregate parameters to the global model parameters of the server; Step 9: Execute steps 5 to 8 T times in a predefined loop to generate a trained global model; the server distributes the trained global model to each local client through the proxy end. P j , then the local client P j Update the local model, input the collected wind power data parameters into the trained model to complete the wind power prediction, wherein the wind power data parameters include wind force and wind direction; Step 1 specifically includes the following steps: Step 1.1: The key generation end first determines the system parameters of the mixed-order complex Lorenz chaotic system ρ , r , b , q 1. q 2 and initial value x 1. x 2. x 3. y 1. y 2; The mixed-order complex Lorenz chaotic system is: ; in, ρ , r , b、q 1 、q 2 are system parameters, and ρ , r , b All are greater than 0; state variables ω i = x i + jy i is a complex variable, x i 、y i is a real variable, j is the imaginary unit, i = 1,2; express ω i of q i Derivatives, They are ω 1. ω The conjugate variable of 2, x ’ 3 means x 3 first derivative; the complex variable ω i Expand to: ; Step 1.2: Use the prediction-correction method to solve the expanded mixed-order complex Lorenz chaotic system and generate a n Chaotic sequence of elements X =[ x 1 , x 2 , x 3 ,…, x n ], then from X Randomly intercept a chaotic sequence X ’ and convert it into a key sequence key j ,Right now key j = X ’ =[ x z+16×j+1 , x z+16×j+2 ,…, x z+16×(j+1) ],in, j = 1,2..., l , z is the initial value randomly selected, l Indicates the total number of local clients; Step 1.3, select the scaling factor γ, integer N=∏ j=1 2l n j , and the integer N As the modulus in the modulo operation, where n j are all prime numbers, j = 1,2,...,2 l ; Step 1.4: Each key sequence key j Multiply by the scaling factor γ and perform a modulo operation to generate key ’ j ,in j = 1,2..., l , then key ’ j Reorganize into a 4-order square matrix k j , called the key matrix; finally, the key matrix k j Store in keystore keys middle; Step 1.5: Randomly select from the keystore keys Select the key matrix K , for each local client P j Construct local keys separately K ’ j , Proxy Key K ’’ j and service key K ’’’ j : K ’ j = K mod n i , K ’’ j = K mod n j , K ’’’ j = K ’’ j -1 K ’ j -1 K ; in, n i , n j Is a constructed integer N The prime number of i ≠ j , i,j = 1,2,..,2 l ; K ’ j -1 , K ’’ j -1 Local key K ’ j and the proxy key K ’’ j The inverse matrix of K ’’’ j There is an inverse matrix K ’’’ j -1 ; Step 1.6: Local key K ’ j , Proxy Key K ’’ j and service key K ’’’ j Send to local client separately P j , the agent and the server, then exit the system and destroy all key-related information; In step 3, the local client N j The specific process of using local data for local training is as follows: Step 3.1: Local Client N j Determine the number of local training times E; Step 3.2: As a participant in the current round, the local client N j The global model parameters in plain text need to be obtained from the proxy θ , and the proximal term is calculated according to the following formula pr And update the local model parameters: ; in, μ represents the coefficient of the proximal term; Step 3.3: Local Client N j Perform local training iterations E times and calculate the output of each iteration out j i , loss function L i j and gradient grad i j : out i j =fp ( x j , θ j ); L i j = loss ( y j , out i j ) + pr ; grad i j = bpf ( L i j , x j , θ j ); in, i = 1,..., E , x j , y j Respectively represent the local client N j Local training data and its labels, fp represents the forward propagation function, loss represents the loss function, bpf represents the back propagation function; then the local model parameters are updated θ j : θ j =θ j - lr × grad i j ; In step 3, the local client encrypts the trained model parameters for the first time and uploads them to the proxy. The specific process is as follows: First, the model parameters θ j Convert to the 4th-order matrix required for encryption : ; in, N2M () means constructing the numbers into a fourth-order matrix, and , a , b Integer domain Z N The random numbers in B and C is a random square matrix of order 2, and 0 is a square matrix of all zeros of order 2; Second, use the local client key K ’ j To encrypt the parameters: ; in, Enc () indicates encryption operation; Finally, the local client N j The model parameters Send to the agent; In step 3, the agent sends the model parameters Use the corresponding client N j Proxy Key K ’’ j The model parameters are obtained by performing encryption operations through the following formula : , In step 4, the server performs model parameter Use the client N j Service Key K ’’’ j , perform encryption operations according to the following formula to obtain model parameters : 。 2. The wind power prediction method based on chaos-homomorphic encryption and federated learning according to claim 1, characterized in that: In step 4, the server performs an aggregation operation to obtain the aggregated ciphertext global model parameters : 。 3. The wind power prediction method based on chaos-homomorphic encryption and federated learning according to claim 1, characterized in that: In step 5, the server side selects the local client N j , j =1,2,3..., m , using the corresponding service key K ’’’ j Decrypt the updated global model parameters separately to obtain the decrypted model parameters : ; in, Dec () indicates the execution of decryption operation.
4. The wind power prediction method based on chaos-homomorphic encryption and federated learning according to claim 1, characterized in that: In step 7, the local client N j The specific process of using local data for local training is as follows: Step 7.1: Local Client N j Determine the number of local training times E; Step 7.2: As a participant in the current round, the local client N j First, the decrypted model parameters Convert to θ j , calculate the proximal term pr And update the local model parameters: ; ; ; in, M2N () means getting the upper left corner element of a 4-order matrix; Step 7.3, local client N j Perform local training iterations E times and calculate the output of each iteration out j i , loss function L i j and gradient grad i j : out i j =fp ( x j , θ ’ j ); L i j = loss ( y j , out i j ) + pr ; grad i j = bpf ( L i j , x j , θ ’ j ); in, i = 1,.., E , x j , y j Respectively represent the local client N j Local training data and its labels, fp represents the forward propagation function, loss represents the loss function, bpf represents the back propagation function; and updates the local model parameters according to the following formula θ ’ j : θ ’ j =θ ’ j - lr × grad i j 。 5. A wind power prediction system based on chaos-homomorphic encryption and federated learning, characterized in that: For implementing the wind power prediction method based on chaos-homomorphic encryption and federated learning as claimed in claim 1, the wind power prediction system comprises: The key generation end includes a key generation submodule and a key distribution submodule; the key generation submodule is responsible for generating and registering the keys required by the system, and the key distribution submodule is responsible for distributing the keys; The agent end includes a communication submodule and an encryption submodule; the communication submodule is responsible for coordinating the communication between the local clients and between the local clients and the server end, and is also responsible for collecting and distributing the model parameters; the encryption submodule is responsible for performing encryption and decryption operations on the received model parameters; The server side includes an encryption submodule, a security aggregation submodule, and a communication submodule; the encryption submodule is responsible for performing encryption and decryption operations on the received model parameters, and the security aggregation submodule is responsible for performing aggregation operations in the ciphertext state and updating the global model parameters; The local client includes an encryption submodule, a training submodule and a communication submodule; the encryption submodule is responsible for performing encryption and decryption operations on the received model parameters, the training submodule is responsible for performing model training tasks based on local wind farm data, and the communication submodule is responsible for distributing and collecting model parameters.
Citation Information
Patent Citations
Compound chaos image encryption method with initial secret keys built through plaintext
CN104050625A
Federal learning method based on differential privacy and chaotic encryption
CN113239404A
Adaptive personalized federated learning method supporting heterogeneous model
WO2024027164A1
