Federal learning-based power load data generation method
By adopting federated learning and generative adversarial network methods in non-invasive power load monitoring, new power load data is generated, and the problems of insufficient data volume and data privacy and security are solved, and efficient and precise load decomposition and model training are achieved.
Patent Information
- Application Number
- CN202410194312.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-21
- Publication Date
- 2025-04-18
AI Technical Summary
In the non-invasive power load monitoring, it is difficult to achieve efficient and accurate load decomposition in the prior art due to insufficient data volume in non-invasive power load monitoring, and data privacy and security issues are difficult to solve.
Using a generative adversarial network (GAN) method based on federated learning, we use training on a generative adversarial network to generate new power load data, expand sample size, and achieve high-quality model training and prediction while protecting data privacy and security.
It realizes the generation of high-quality power load data while protecting data privacy and security, solves the problem of insufficient data volume and improves the efficiency and accuracy of model training and prediction.
Smart Images

Figure CN119849280A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data generation, and in particular to a method for generating power load data based on federated learning. Background Art
[0002] Energy is an important material basis for the survival and development of human society. In the face of energy supply pressure, we should adhere to the principle of giving equal importance to development and conservation, with conservation as the priority. Power load monitoring is the basis for carrying out energy-saving work. It enables energy units to fully grasp the energy consumption and usage of various equipment, and use this to formulate reasonable energy-saving plans and purchase energy-saving equipment in a targeted manner. At the same time, power load monitoring can also be used to test the energy-saving effect, thereby reducing energy consumption and energy expenses. Therefore, accurate power load monitoring has important practical significance for improving my country's energy utilization efficiency, achieving sustainable energy development, building a conservation-oriented society, and alleviating energy pressure.
[0003] There are two main methods for achieving load monitoring: intrusive methods and non-intrusive methods. Intrusive methods are to monitor power loads by installing measuring instruments on every electrical device in the home environment. Although this type of method can provide very accurate load energy consumption data, the implementation cost is very high and it is difficult to popularize on a large scale. At the same time, the installation method that invades the home makes users not very accepting.
[0004] Compared with intrusive load monitoring, non-intrusive load monitoring (Non-Intrusive Load Monitoring) only requires adding NILM modules to the user's electricity meter to achieve online monitoring and decomposition of all loads of a user. NILM does not require the installation of a large number of sensors and measuring devices, thereby reducing the cost of purchasing, installing and maintaining NILM system hardware, and is one of the development hotspots of load decomposition in the future.
[0005] In order to improve the efficiency and accuracy of the NILM method in non-invasive load decomposition, researchers at home and abroad have proposed various decomposition methods. However, since the non-invasive power load monitoring model is relatively complex, in order to ensure the generalization ability of the model, the training data must be increased accordingly. The current artificial intelligence applications based on machine learning or deep learning that have made breakthroughs in the industry have quantitative requirements for training samples. The design of power data for national security, without leaking the power data of each substation, the training model and the massive training data samples required for the training model are difficult to obtain. It has become a common problem for further in-depth research on non-invasive power load monitoring. Therefore, by expanding the sample size and ensuring the distribution and consistency of the sample, protecting data privacy is an important key link that cannot be ignored in the era of big data to solve the problem of insufficient data. To expand the sample size, the most direct way is to re-acquire more sample data. Commonly used methods include data acquisition and data generation. The data collection method is that the experimenters enter the load users and use the electric meter to collect the load data. However, data collection is a very wasteful task of financial, material, human and time resources. In addition, when the load types are complete enough, it is difficult to enumerate the multi-load data under different scenarios. At the same time, a large amount of data of different lengths is also required, which brings great difficulty to the data collection work. Summary of the invention
[0006] The purpose of the embodiment of the present application is to provide a method for generating power load data based on federated learning, which uses a generative adversarial network based on federated learning to perform data expansion, solves the problems of small data volume due to data privacy and security issues in the past, and massively expands the power load data, while protecting national privacy and data security, achieving high-quality model training and prediction.
[0007] To achieve the above objectives, this application provides the following technical solutions:
[0008] The present application embodiment provides a method for generating power load data based on federated learning, comprising the following steps:
[0009] S1: Obtain substation power load data;
[0010] S2: Load processing of the original data and training on the generative adversarial network;
[0011] S3: Based on the weights of the generative adversarial network model trained by the substation, upload it to the central server for aggregate training, and send the final training results to the independent generative network model on the substation;
[0012] S4: The generator generates new power load data using the weight information sent by the central server.
[0013] In step S1, the substation power load data is obtained, and the specific steps include:
[0014] 1) Obtain the power load data captured in the substation within a preset time period;
[0015] 2) Evenly distribute the preset time period to each time period throughout the year to ensure that the acquired power load data is evenly distributed as much as possible;
[0016] 3) All the acquired samples are called the data set of power load data in the substation.
[0017] In step S2, the original data is subjected to load processing and trained on a generative adversarial network. The specific steps include:
[0018] 1) Based on the generator in the generative adversarial network model, the generator is used to generate power load data for the randomly generated noise z;
[0019] 2) Based on the load data generated by the generator, the real power load data set acquired by the substation and the power load data generated by the generator are input into the discriminator for judgment;
[0020] 3) Based on the output result of the discriminator, the loss is calculated according to the loss function, and the weight parameters of the generator and the discriminator are adjusted according to the function loss. That is, the generating network needs to continuously update the parameters according to the gradient returned by the discriminant model D to complete the error transmission.
[0021] In step S3, based on the model weights trained by the substation, the model weights are uploaded to the central server for aggregate training and sent to the substation. The specific steps include:
[0022] 1) The grid edge device downloads the global model Wt-1 from the central server;
[0023] 2) The grid edge device trains the local command data to obtain the local model Wt,k, and the local model of the Kth grid edge device in the tth round of communication is updated;
[0024] 3) Each grid edge device uploads the local confidential model update to the central server;
[0025] 4) After receiving the encrypted weights of each grid edge device, the central server first performs a decryption operation, and then performs a weighted aggregation operation to obtain the global model Wt, and the global model of the tth round of communication is updated;
[0026] 5) The model weights trained by the central server are sent to the substation GAN model.
[0027] Compared with the prior art, the beneficial effects of the present application are: protecting data privacy and security based on federated learning, using a generative adversarial network model method to generate load data, and verifying through experiments the ability of this method in retaining the temporal and spatial regularity characteristics of the original data samples, and proving the necessity of federated learning in protecting data security and the feasibility of the generative adversarial network method in generating load data. It can generate a large amount of load data that meets the requirements, and compared with the traditional scenario modeling method, the generative adversarial network can better reflect the superiority of unsupervised neural networks, reduce the impact of human factors, reduce training time, and reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0029] Figure 1 Generate a flow chart of the adversarial network in the present invention;
[0030] Figure 2 Flow chart of the method in the present invention. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0032] The terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0033] The terms "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and should not be understood as indicating or implying relative importance, nor should they be understood as requiring or implying any such actual relationship or order between these entities or operations.
[0034] like Figure 1-2As shown, the method for generating power load data based on federated learning described in the present invention includes the following steps:
[0035] S1: Obtain substation power load data;
[0036] S2: Load processing of the original data and training on the generative adversarial network;
[0037] S3: Based on the weights of the generative adversarial network model trained by the substation, upload it to the central server for aggregate training, and send the final training results to the independent generative network model on the substation;
[0038] S4: The generator generates new power load data using the weight information sent by the central server;
[0039] The input data of the generative model is noise data, and the output is generated data. The input of the generative model is random noise z, which is sampled from a simple probability distribution p(z) (such as Gaussian distribution), that is, z~p(z), and z is transformed through nonlinear transformation to obtain G(z; θg), that is, G(z)~pg
[0040] The purpose of the generative model is to generate fake data that can be mistaken for real data.
[0041] The input is a noise with random distribution. Here we use Gaussian noise as the input of the generative model. The input data of the discriminative model includes both the false data generated by the generative model and the real data. The output is the discrimination result of these two types of data.
[0042] Among them, the input data of the discriminant model includes both false data generated by the generative model and real data, and the output is the discrimination result of these two types of data. The specific architecture of the model includes an input layer, an output layer and multiple hidden layers, and the final output result is generated data with the same size of each dimension as the real sample. This generated data is one-dimensional current data.
[0043] The number of hidden layers in the discriminant model is set to 2. The sample data or generated data enters the network through the input layer, and the data obtained through the two hidden layers is mapped to a data between 0 and 1 through the output layer. This data is the discriminant result. In the discriminant model, the input layer and the hidden layer use the Leaky ReLU function as the activation function, and the output layer uses
[0044] The sigmoid function is used as an activation function. The sigmoid activation function is more suitable for binary classification models, and the output result is the discrimination result.
[0045] The number of hidden neural networks in the generative model is designed to be 3, and Gaussian noise enters the network through the input layer.
[0046] The network is mapped to the new data space through the hidden layer, and the dimension of the data is transformed into the same as the real data space through the final output layer.
[0047] The dimensions of the samples are the same, and the final result is the generated data. In the generative model, the input layer and the hidden layer use the ReLU function as the activation function, and the output layer uses the tanh function as the activation function. The main purpose is to normalize the output data of the generative model to the [-1,1] interval, so that the output data is not easy to diverge.
[0048] Among them, the purpose of the discriminant model D is to determine whether the input data comes from the data generated by the generative model G or from the real
[0049] The real data is used to update the parameters of the model and the generated model alternately by outputting the results until the two models reach the optimal state.
[0050] The discriminant model D has two inputs: one is the sample x from the real data, and the other is the generated sample G(z) generated by the generative model. When G(z) is used as input data, it is mapped by the discriminant model and outputs a scalar between 0 and 1.
[0051] The generative adversarial network model composed of the generative model G and the discriminative model D will eventually reach a Nash equilibrium after a sufficient number of training times, that is, the discriminative model D cannot distinguish whether the input data comes from real data or generated data.
[0052] Further, S3 is based on the weights of the generative adversarial network model trained by the substation, uploaded to the central server for aggregate training, and the final training results are sent to the substation. The grid edge device downloads the global model Wt-1 from the central server, and the grid edge device trains the local instruction data to obtain the local model Wt,k (the local model update of the Kth grid edge device in the tth round of communication). Each grid edge device uploads the local confidential model update to the central server. After the central server receives the encrypted weights of each grid edge device, it first performs a decryption operation and then performs a weighted aggregation operation to obtain the global model Wt (the global model update of the tth round of communication). The objective function of the central server is as follows:
[0053]
[0054] Where m is the total number of grid edge devices participating in the training, n is all grid edge devices, Nk is the amount of data of the Kth edge device, and Fk(w) is the local objective function of the kth device:
[0055]
[0056] Where dk is the local data set of the kth edge device, and f(w) = a(x, y, w) is the loss function generated by the model with parameter W for the instance (x, y) in the data set dk. The loss function generated by all instances in dk is then divided by the total amount of data of the power grid edge device K to obtain the average loss function of the edge device. The loss function is inversely proportional to the model accuracy. The model weight of the edge device is updated as follows:
[0057]
[0058] The model aggregation update of the communication center server in round t is as follows:
[0059]
[0060] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for generating power load data based on federated learning, characterized in that: The following steps are involved: S1: Obtain substation power load data; S2: Load processing of the original data and training on the generative adversarial network; S3: Based on the weights of the generative adversarial network model trained by the substation, upload it to the central server for aggregate training, and send the final training results to the independent generative network model on the substation; S4: The generator generates new power load data using the weight information sent by the central server.
2. The method for generating power load data based on federated learning according to claim 1, characterized in that: In step S1, the substation power load data is obtained, and the specific steps include: 1) Obtain the power load data captured in the substation within a preset time period; 2) Evenly distribute the preset time period to each time period throughout the year to ensure that the acquired power load data is evenly distributed as much as possible; 3) All the acquired samples are called the data set of power load data in the substation.
3. The method for generating power load data based on federated learning according to claim 1, characterized in that: In step S2, the original data is subjected to load processing and trained on a generative adversarial network. The specific steps include: 1) Based on the generator in the generative adversarial network model, the generator is used to generate power load data for the randomly generated noise z; 2) Based on the load data generated by the generator, the real power load data set acquired by the substation and the power load data generated by the generator are input into the discriminator for judgment; 3) Based on the output result of the discriminator, the loss is calculated according to the loss function, and the weight parameters of the generator and the discriminator are adjusted according to the function loss. That is, the generating network needs to continuously update the parameters according to the gradient returned by the discriminant model D to complete the error transmission.
4. The method for generating power load data based on federated learning according to claim 1, characterized in that: In step S3, based on the model weights trained by the substation, the model weights are uploaded to the central server for aggregate training and sent to the substation. The specific steps include: 1) The grid edge device downloads the global model Wt-1 from the central server; 2) The grid edge device trains the local command data to obtain the local model Wt,k, and the local model of the Kth grid edge device in the tth round of communication is updated; 3) Each grid edge device uploads the local confidential model update to the central server; 4) After receiving the encrypted weights of each grid edge device, the central server first performs a decryption operation, and then performs a weighted aggregation operation to obtain the global model Wt, and the global model of the tth round of communication is updated; 5) The model weights trained by the central server are sent to the substation GAN model.
Citation Information
Patent Citations
Power grid industrial control protocol intrusion detection method and system based on federated learning
CN116260617A