Power data privacy protection and recovery method and device based on federated learning
By combining a federated learning framework and linear bias, the problem of privacy-preserving data recovery in power grid DWDN was solved, achieving accurate data recovery across different power grid operators and ensuring privacy and security.
Patent Information
- Application Number
- CN202410763821.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-09
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-06-09
AI Technical Summary
How can we achieve accurate representation and data recovery of dynamically weighted directed networks (DWDNs) for power grids while protecting privacy, especially when different power grid operators are unwilling to share raw data?
The design employs a federated learning framework, which uses a globally shared LFT model for collaborative training and combines linear bias and hybrid padding strategies to achieve data recovery from distributed nodes.
While protecting privacy, accurate recovery of power data was achieved, eliminating individual biases and local fluctuations, and improving the accuracy of data recovery.
Smart Images

Figure CN118779149B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of incomplete power data recovery in power grids, and is particularly applicable to a method and device for restoring power data privacy based on federated learning. Background Art
[0002] In the era of big data, large-scale dynamic weighted directed networks (DWDN) are prevalent in many applications, involving time-dynamic interactions between a large number of nodes. With the promotion and application of distribution automation, automatic collection of electricity consumption information, and automatic meteorological monitoring equipment, the generation of data has exploded. In order to reduce the burden of data storage and the cost of monitoring, it is necessary to enable and disable certain algorithms for the sensors of monitoring data. At the same time, due to different levels of automated monitoring, monitoring equipment failures, data privacy and security, and even human factors, data are usually missing; therefore, power grid power-related data has the characteristics of incompleteness.
[0003] Generally, DWDN contains rich and valuable hidden knowledge. Since the interaction relationship of many power grid nodes over time cannot be fully perceived, the generated DWDN may have extremely high dimensions and a large number of missing links. Therefore, it is crucial to accurately represent DWDN to extract this knowledge. Latent Factorization of Tensors (LFT) is an effective typical representation learning method for extracting knowledge from DWDN. It models the target DWDN as a high-dimensional and incomplete tensor, and uses the principle of tensor decomposition to obtain a low-rank approximation of the resulting tensor.
[0004] At the same time, people are increasingly concerned about privacy issues. The European Union proposed the General Data Protection Regulation, which prohibits commercial entities from collecting, sharing, or processing user data without the user's explicit consent. Considering data security and resources, different power grid operators are reluctant to share raw data directly. In this case, the discreteness and locality of DWDN make the centralized modeling principle of existing LFT methods no longer applicable. Therefore, a hot but thorny problem arises, that is, how to perform accurate representation learning on DWDN from the perspective of privacy protection. Federated Learning (FL) is an effective method for privacy protection in big data related applications. FL builds a shared model on distributed data so that the shared model contains the required information from all distributed raw data while protecting its privacy and security. FL technology has been used in many applications. However, existing FL-based learning models are designed for static scenarios and cannot capture the dynamic patterns of DWDN.
[0005] In summary, how to achieve accurate representation of the DWDN of the power grid and protect privacy is a key challenge in current power grid detection data recovery. Summary of the invention
[0006] In view of this, in response to the problems of the prior art, the present invention provides a method and device for privacy protection and recovery of power data based on federated learning, aiming to design an LFT model that is globally shared by different distributed nodes under the FL framework, to achieve privacy protection of the original data, and at the same time incorporate linear deviations into the modeling of each distributed power grid node to eliminate personalized deviations or local fluctuations; ultimately achieving data recovery of distributed power grid nodes under privacy protection.
[0007] In order to achieve the above-mentioned object, the present invention provides a power data privacy protection and recovery method based on federated learning, combined with Figure 1 , including the following steps:
[0008] S1: The server federated learning module in the server initializes some latent feature matrix data, linear deviation and federated learning parameters, and stores them in the server data storage module;
[0009] S2: The client device initializes the latent feature vector and the local linear deviation, and stores them in the recovery data storage unit;
[0010] S3: The server data storage module sends part of the latent feature matrix data and the linear deviation to all client devices and stores them in the server data storage unit;
[0011] S4: The power data receiving module receives the incomplete power load data fed back by the power data acquisition equipment installed in the power grid in the jurisdiction, and stores it in the power data storage unit in the power data module;
[0012] S5: The data recovery module calculates the approximate power load data matrix using the tensor latent eigendecomposition method and stores it in the recovery data storage unit;
[0013] S6: the data recovery module repeatedly uses the mixed filling method to fill in part of the incomplete power load data according to a certain probability, and stores it in the recovery data storage unit;
[0014] S7: Based on the power load data matrix and the filled incomplete power load data, the data recovery module updates the latent feature vector and the local linear deviation, and calculates the federated learning gradient data;
[0015] S8: The server data storage unit sends the federated learning gradient data to the server;
[0016] S9: The server uses the federated learning gradient data to update some latent feature matrix data and linear deviations;
[0017] S10: Repeat steps S3 to S9 until the maximum number of iterations, at which point all client devices have completed data recovery under privacy protection.
[0018] Further, the partial latent feature matrix data described in step S1 is a spatial matrix S=[s jr ] 1≤j≤|J|,1≤r≤R and the time matrix T = [t kr ] 1≤k≤|K|,1≤r≤R , which is randomly generated during initialization; J is the set of power data acquisition devices within the jurisdiction of the client device; K is the set of sampling time slots; |·| is the number of elements in the set; R is the set rank, which is a positive integer.
[0019] Furthermore, the linear deviation is the spatial linear deviation b=[b j ] 1≤j≤|J| and time linear deviation c = [c k ] 1≤k≤|K| , which is randomly generated by small perturbations during initialization.
[0020] Furthermore, the federated learning parameters include: maximum number of iterations N m , learning rate η, and latent feature regularization coefficient λ, bias regularization coefficient λ b .
[0021] Further, the hidden feature vector corresponding to client i in step S2 is u i =(u ir ) 1≤r≤R and the local linear deviation is a i ; Randomly generated initially.
[0022] Preferably, the latent feature vector and the local linear deviation described in step S2 can be iteratively updated using known data on the basis of random generation to generate more accurate latent feature vectors and local linear deviations to improve the stability and rapidity of the method. The specific iterative update formula is:
[0023] S201: Calculate the gradient, in, The data measured by the power data acquisition device j corresponding to the client i in the k-time interval;
[0024] S202: Traverse all measurement data, update latent feature vectors and local linear deviations
[0025] S203: Repeat multiple times until the latent feature vector and the local linear deviation change are within the set threshold range.
[0026] Further, the tensor implicit eigendecomposition method described in step S5 calculates the approximate power load data matrix in,
[0027] Furthermore, for client i, its data matrix X i is |J|×|K| dimensional, where the measured data constitutes the set Λ i , the unknown data constitutes a set Γ i , the step S6 is specifically as follows:
[0028] S601: According to the probability ρ, from Γ i Select ρ·|Λ i | elements constitute the set Λ′ i ;
[0029] S602: for x′ ijk ∈Λ′ i , mix and fill according to the following formula:
[0030]
[0031] Among them, x ijk ∈Λ i , n is the number of repeated iterations, N predict is a pre-set threshold.
[0032] Further, the step S7 is specifically as follows:
[0033] S701: Calculate client gradient
[0034] S702: traverse r=1~R, and use the client gradient to update the hidden feature vector and the local linear deviation
[0035] S703: Traverse r=1~R and calculate the federated learning gradient data for:
[0036]
[0037] Further, the updating of some latent feature matrix data and linear deviation described in step S9 is as follows: traverse r=1~R, according to to update.
[0038] A power data privacy protection and recovery device based on federated learning, combined with Figure 2, consisting of a server and N client devices, which communicate data with each other through a network connection; the server includes: a server data storage module and a server federated learning module; one of the client devices includes: a power data receiving module, a power data module, a data recovery module, and a client federated learning module; the power data module includes a power data storage unit, a recovery data storage unit, and a server data storage unit, wherein N is a positive integer greater than 1.
[0039] Preferably, the server data storage module is used to receive and store the federated learning gradient data sent by the server data storage unit in the client device, and to store and send to the client device part of the latent feature matrix data calculated by the server federated learning module.
[0040] Preferably, the server federated learning module updates part of the latent feature matrix data in the server according to the federated learning gradient data, and stores it in the server data storage module.
[0041] Preferably, the power data receiving module is used to receive incomplete power load data fed back by a power data acquisition device installed in the power grid in the jurisdiction of the client device, and instruct the power data storage unit in the power data module to store the incomplete power load data.
[0042] Preferably, the data recovery module utilizes the power data storage unit in the power data module to store incomplete power load data and part of the latent feature matrix data stored in the server data storage unit, executes the incomplete power load data recovery process of the power grid, and stores the recovered data into the recovery data storage unit in the power data module.
[0043] Preferably, the client federated learning module utilizes incomplete power load data, partial latent feature matrix data and recovery data in the power data module to calculate the federated learning gradient data and store it in the server data storage unit.
[0044] The beneficial effects of the present invention are as follows: the present invention provides a method and device for power data privacy protection and recovery based on federated learning. First, a federated learning framework of the power grid DWDN is designed to enable different distributed nodes to perform efficient collaborative training through a globally shared LFT model while maintaining the privacy of the original data; then, linear deviations are incorporated into the modeling of each distributed node to eliminate personalized deviations or local fluctuations; finally, an effective hybrid filling strategy is proposed to further protect the private original data of each distributed node. The present invention can ensure accurate power data recovery under privacy protection. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to make the purpose and technical solution of the present invention, the present invention provides the following drawings for explanation:
[0046] Figure 1 It is a flow chart of the power data privacy protection and recovery method based on federated learning of the present invention;
[0047] Figure 2 This is a framework diagram of federated learning in Example 1 of the present invention;
[0048] Figure 3 This is a schematic diagram of the power supply system in the substation area in Example 1 of the present invention;
[0049] Figure 4 This is a framework diagram of a power data privacy protection and recovery device based on federated learning in Example 1 of the present invention;
[0050] Figure 5 This is a schematic diagram of the working principle of data recovery of a single client device in Example 2 of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose and technical solution of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0052] Example 1: Combination Figure 3 , the power supply system in a certain area is monitored by the master station system, which has k=8 substations under its jurisdiction, and each substation supplies power to several users. |J| electric energy meters are installed in each substation, and data is uploaded to the collector through RS485 communication, and then uploaded to the concentrator of the substation using power line carrier communication. Data is exchanged between substations and between substations and the master station system through wireless communication.
[0053] Due to the asynchronous collection time and communication frequency, the electric energy meter data collected in each substation in the time slot is missing, but considering the privacy and security of users, the substation data is no longer shared between each substation and the server. In order to complete the recovery of missing data in the substation under privacy protection, the present invention provides a "power data privacy protection recovery device based on federated learning".
[0054] Combination Figure 2 The device specifically consists of a server (1) and eight client devices (2), wherein the server (1) corresponds to the main station system and the client device (2) corresponds to the concentrator of the substation; data communication is performed between them through a wireless communication network connection.
[0055] Combination Figure 4The server (1) comprises: a server data storage module (11) and a server federated learning module (12); a client device comprises: a power data receiving module (21), a power data module (22), a data recovery module (23), and a client federated learning module (24); the power data module (22) comprises a power data storage unit (221), a recovery data storage unit (222), and a server data storage unit (223).
[0056] Preferably, the server data storage module (11) is used to receive and store the federated learning gradient data sent by the server data storage unit (223) in the client device (2), and to store and send to the client device (2) part of the latent feature matrix data calculated by the server federated learning module (12).
[0057] The server federated learning module (12) updates part of the latent feature matrix data in the server according to the federated learning gradient data, and stores it in the server data storage module (11).
[0058] The power data receiving module (21) is used to receive incomplete power load data fed back by a power data acquisition device installed in the power grid in the jurisdiction of the client device (2), and to instruct the power data storage unit (221) in the power data module (22) to store the incomplete power load data.
[0059] The data recovery module (23) uses the power data storage unit (221) in the power data module (22) to store incomplete power load data and part of the latent feature matrix data stored in the server data storage unit (223) to perform a power grid incomplete power load data recovery process, and stores the recovered data in the recovery data storage unit (222) in the power data module (22).
[0060] The client federated learning module (24) uses the incomplete power load data, partial latent feature matrix data and recovery data in the power data module (22) to calculate the federated learning gradient data and store it in the server data storage unit (223).
[0061] Example 2: Based on the device of Example 1, the present invention also provides a "power data privacy protection and recovery method based on federated learning" to achieve the recovery of missing data in the substation under privacy protection.
[0062] Combination Figure 1 , which specifically includes the following steps:
[0063] Step 1: The server federated learning module (12) in the server (1) initializes part of the latent feature matrix data, linear deviation and federated learning parameters, and stores them in the server data storage module (11).
[0064] The partial latent feature matrix data is a space matrix S = [s jr ] 1≤j≤|J|,1≤r≤R and the time matrix T = [t kr ] 1≤k≤|K|,1≤r≤R , randomly generated during initialization; wherein, J is the set of power data acquisition devices within the jurisdiction of the client device (2); K is the set of sampling time slots; |·| is the number of elements in the set; and R is the set rank, which is a positive integer.
[0065] The linear deviation is the spatial linear deviation b = [b j ] 1≤j≤|J| and time linear deviation c = [c k ] 1≤k≤|K| , which is randomly generated by small perturbations during initialization.
[0066] The federated learning parameters include: maximum number of iterations N m , learning rate η, and latent feature regularization coefficient λ, bias regularization coefficient λ b .
[0067] Step 2: The client device (2) initializes the latent feature vector and the local linear deviation, and stores them in the recovery data storage unit (222).
[0068] Among them, the hidden feature vector corresponding to client i is u i =(u ir ) 1≤r≤R and the local linear deviation is a i ; Randomly generated initially.
[0069] The latent feature vector and local linear deviation are iteratively updated using known data on the basis of random generation to generate more accurate latent feature vectors and local linear deviations to improve the stability and rapidity of the method. The specific iterative update formula is:
[0070] S201: Calculate the gradient, in, x ijk The data measured by the power data acquisition device j corresponding to the client i in the k-time interval;
[0071] S202: Traverse all measurement data, update latent feature vectors and local linear deviations
[0072] S203: Repeat multiple times until the latent feature vector and the local linear deviation change are within the set threshold range or the maximum number of iterations N local .
[0073] Step 3: The server data storage module (11) sends part of the latent feature matrix data and the linear deviation to all client devices (2) and stores them in the server data storage unit (223).
[0074] Step 4: The power data receiving module (21) receives the incomplete power load data fed back by the power data acquisition equipment installed in the power grid in the jurisdiction, and stores it in the power data storage unit (221) in the power data module (22).
[0075] Step 5: The data recovery module (23) calculates the approximate power load data matrix using the tensor latent eigendecomposition method and stores it in the recovery data storage unit (222).
[0076] The tensor implicit eigendecomposition method described herein calculates the approximate power load data matrix in,
[0077] Step 6: The data recovery module (23) repeatedly uses the mixed filling method to fill in part of the incomplete power load data according to a certain probability, and stores it in the recovery data storage unit (222).
[0078] Furthermore, for client i, its data matrix X i is |J|×|K| dimensional, where the measured data constitute the set Λi and the unknown data constitute the set Γ i , the step six is specifically as follows:
[0079] S601: According to the probability ρ, from Γ i Select ρ·|Λ i | elements constitute the set Λ′ i ;
[0080] S602: for x′ ijk ∈Λ′ j , mix and fill according to the following formula:
[0081]
[0082] Among them, x ijk ∈Λ i , n is the number of repeated iterations, N predict is a pre-set threshold.
[0083] Step 7: Combination Figure 5Based on the power load data matrix and the filled incomplete power load data, the data recovery module (23) updates the latent feature vector and the local linear deviation, and calculates the federated learning gradient data.
[0084] Specifically:
[0085] S701: Calculate client gradient
[0086] S702: traverse r=1~R, and use the client gradient to update the hidden feature vector and the local linear deviation
[0087] S703: Traverse r=1~R and calculate the federated learning gradient data for:
[0088]
[0089] Step 8: The server data storage unit (223) sends the federated learning gradient data to the server (1);
[0090] Step 9, the server (1) updates part of the latent feature matrix data and linear deviation using the federated learning gradient data;
[0091] The updating of some latent feature matrix data and linear deviation is as follows: traverse r = 1 to R, according to to update.
[0092] Step 10: Repeat steps S3 to S9 until the maximum number of iterations is reached. At this point, all client devices (2) have completed data recovery under privacy protection.
[0093] In order to facilitate the demonstration of the method of the present invention, the pseudo codes of the operating procedures of the server (1) and the client device (2) are provided as shown in Tables 1 and 2 below.
[0094] Table 1 Server corresponding operations
[0095]
[0096]
[0097] Table 2 Client device corresponding operations
[0098]
[0099] Furthermore, based on the monthly power load consumption dataset of 8 corresponding substations in Zhenjiang City, Jiangsu Province in 2015, some data were artificially missing, and a data recovery experiment was conducted according to this embodiment. The root mean square error (RMSE) and mean absolute error (MAE) accuracy comparison experiment was conducted with the FedPerGNN method in the prior art document [1]. The results are shown in Table 3. It can be seen that the method of the present invention has a high accuracy in recovering data under privacy protection.
[0100] [1].Yongfeng Huang, Chuhan Wu, Fangzhao Wu et al.A Federated GraphNeural Network Framework for Privacy-Preserving Personalization, 11January2022, PREPRINT (Version 1) available at Research Square [https: / / doi.org / 10.21203 / rs.3.rs-1191595 / v1]
[0101] Table 3 Comparative experimental results
[0102] FedPerGNN Method of the present invention RMSE 1.5591 1.3053 MAE 0.9208 0.6486
[0103] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.
Claims
1. A method for restoring power data privacy based on federated learning, characterized in that: The method comprises the following steps: S1: The server federated learning module (12) in the server (1) initializes part of the latent feature matrix data, linear deviation and federated learning parameters, and stores them in the server data storage module (11); S2: The client device (2) initializes the latent feature vector and the local linear deviation, and stores them in the recovery data storage unit (222); S3: The server data storage module (11) sends part of the latent feature matrix data and the linear deviation to all client devices (2) and stores them in the server data storage unit (223); S4: The power data receiving module (21) receives the incomplete power load data fed back by the power data acquisition equipment installed in the power grid in the jurisdiction, and stores it in the power data storage unit (221) in the power data module (22); S5: The data recovery module (23) calculates the approximate power load data matrix using the tensor latent eigendecomposition method and stores it in the recovery data storage unit (222); S6: the data recovery module (23) repeatedly uses a mixed filling method to fill in part of the incomplete power load data according to probability, and stores it in the recovery data storage unit (222); S7: Based on the power load data matrix and the filled incomplete power load data, the data recovery module (23) updates the latent feature vector and the local linear deviation, and calculates the federated learning gradient data; S8: The server data storage unit (223) sends the federated learning gradient data to the server (1); S9: The server (1) updates part of the latent feature matrix data and linear deviation using the federated learning gradient data; S10: repeating steps S3 to S9 until the maximum number of iterations is reached, at which point all client devices (2) have completed data recovery under privacy protection; Among them, the partial latent feature matrix data is the space matrix S=[s jr ] 1≤j≤|J|,1≤r≤R and the time matrix T = [t kr ] 1≤k≤|K|,1≤r≤R, Randomly generated during initialization; wherein J is the set of power data acquisition devices within the jurisdiction of the client device (2); The federated learning parameters include: maximum number of iterations N m , learning rate η, and latent feature regularization coefficient λ, bias regularization coefficient λ b ; K is the set of sampling time intervals; |·| is the number of elements in the set; R is the set rank, which is a positive integer; For client i, its data matrix X i is |J|×|K| dimensional, where the measured data constitutes the set Λ i , the unknown data constitutes a set Γ i ; The step S6 is specifically: S601: According to the probability ρ, from Γ i Select ρ·|Λ i | elements constitute the set Λ′ i ; S602: For x′ ijk ∈Λ′ i , mix and fill according to the following formula: Among them, x ijk ∈Λ i , n is the number of repeated iterations, N predict is a pre-set threshold; Further, the step S7 is specifically as follows: S701: Calculate client gradient Among them, the hidden feature vector corresponding to client i is u i =(u ir ) 1≤r≤R ; S702: traverse r=1~R, and use the client gradient to update the hidden feature vector and the local linear deviation S703: Traverse r=1~R and calculate the federated learning gradient data for: Further, the updating of some latent feature matrix data and linear deviation described in step S9 is as follows: traverse r=1~R, according to to update.
2. According to the method for power data privacy protection and recovery based on federated learning in claim 1, it is characterized in that: The linear deviation described in step S1 is the spatial linear deviation b=[b j ] 1≤j≤|J| and time linear deviation c = [c k ] 1≤k≤|K| , randomly generated during initialization.
3. According to the method for power data privacy protection and recovery based on federated learning in claim 1, it is characterized in that: The hidden feature vector corresponding to client i in step S2 is u i =(u ir ) 1≤r≤R and the local linear deviation is a i ; Randomly generated during initialization.
4. According to the method for power data privacy protection and recovery based on federated learning in claim 1, it is characterized in that: The latent feature vector and the local linear deviation described in step S2 are iteratively updated using known data on the basis of random generation to generate more accurate latent feature vectors and local linear deviations to improve the stability and rapidity of the method. The specific iterative update formula is: S201: Calculate the gradient, in, x ijk The data measured by the power data acquisition device j corresponding to the client i in the k-time interval; S202: Traverse all measurement data, update latent feature vectors and local linear deviations S203: Repeat multiple times until the latent feature vector and the local linear deviation change are within the set threshold range.
5. A device for executing a method for power data privacy protection and recovery based on federated learning as described in any one of claims 1 to 4, characterized in that: The invention comprises a server (1) and N client devices (2), which communicate data with each other through a network connection; the server (1) comprises: a server data storage module (11) and a server federated learning module (12); one of the client devices comprises: a power data receiving module (21), a power data module (22), a data recovery module (23), and a client federated learning module (24); the power data module (22) comprises a power data storage unit (221), a data recovery unit (222), and a server data storage unit (223), wherein N is a positive integer greater than 1.
6. The device according to claim 5, characterized in that The server data storage module (11) is used to receive and store the federated learning gradient data sent by the server data storage unit (223) in the client device (2), and to store and send to the client device (2) part of the latent feature matrix data calculated by the server federated learning module (12).
7. The power data privacy protection and recovery device based on federated learning according to claim 5 is characterized in that: The server federated learning module (12) updates part of the latent feature matrix data in the server according to the federated learning gradient data, and stores it in the server data storage module (11).
8. The device according to claim 5, characterized in that The power data receiving module (21) is used to receive incomplete power load data fed back by a power data acquisition device installed in the power grid in the jurisdiction of the client device (2), and to instruct the power data storage unit (221) in the power data module (22) to store the incomplete power load data.
9. The device according to claim 5, characterized in that The data recovery module (23) uses the power data storage unit (221) in the power data module (22) to store incomplete power load data and part of the latent feature matrix data stored in the server data storage unit (223) to perform a power grid incomplete power load data recovery process, and stores the recovered data in the recovery data storage unit (222) in the power data module (22).
10. The device according to claim 5, characterized in that The client federated learning module (24) uses the incomplete power load data, partial latent feature matrix data and recovery data in the power data module (22) to calculate the federated learning gradient data and store it in the server data storage unit (223).
Citation Information
Patent Citations
Power load sensing data recovery method and device
CN115599598A
Secret sharing-based federated unmanned aerial vehicle group data security sharing method
CN115859344A
