A short-term load forecasting method based on federated learning

By introducing mobile edge computing nodes and federated learning architecture into the smart grid, and combining multi-weight node selection and clustering algorithms, the problems of data privacy protection for power suppliers and grid users and the accuracy of load forecasting are solved, achieving efficient and accurate short-term load forecasting.

CN116029455BActive Publication Date: 2026-01-27NORTHEASTERN UNIV AT QINHUANGDAO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310134475.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2026-01-27
Estimated Expiration
2043-02-20

AI Technical Summary

Technical Problem

Existing technologies in smart grids present a contradiction between protecting the data privacy of power suppliers and grid users and ensuring the accuracy of load forecasting. Existing load forecasting methods are inefficient and have slow model training speeds, failing to meet the real-time and accuracy requirements of smart grids.

Method used

A federated learning-based architecture is adopted, which uses mobile edge computing nodes (MECs) to assist smart meters (SMs) in data signing and aggregation. The multi-weight node selection algorithm and clustering-based federated update algorithm are combined to improve training efficiency and accuracy, and Diffie-Hellman key negotiation is used to protect data privacy.

Benefits of technology

It achieves efficient and accurate short-term load forecasting, protects the data privacy of power grid users, reduces communication delays and resource waste, and improves the speed and accuracy of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004084990030000034
    Figure BDA0004084990030000034
  • Figure BDA0004084990030000083
    Figure BDA0004084990030000083
  • Figure BDA0004084990030000084
    Figure BDA0004084990030000084
Patent Text Reader

Abstract

The present application provides a kind of short-term load forecasting method based on federal learning, first design a kind of based on federal learning framework, include five entities: intelligent electric meter SM, mobile edge computing node MEC, cloud server Cloud, power supplier PS and certificate authority CA;Based on this architecture design a node selection algorithm based on multiple weight, cloud server CS before each round of federal learning training model starts, select the most suitable computing node group, to achieve the purpose of maximum training efficiency;In order to improve accuracy, also designed based on clustering federal update algorithm, on the common federal update algorithm Fed-Avg, consider the different MEC under the computing node group of power grid user residential type is different, CS is distributed in the process of initialization and update different;In order to realize privacy protection, the present application designs data aggregation protocol, adopts the DH key negotiation mode to protect the data privacy of SM, batch verifiable signature accelerates the verification of SM data integrity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, and specifically to a short-term load forecasting method based on federated learning. Background Technology

[0002] In a smart grid environment, power suppliers need to design accurate and efficient short-term load forecasting solutions to maintain the security and stability of the smart grid and maximize their value and benefits. First, short-term load forecasting is a problem requiring rapid and high-precision analysis; accuracy and efficiency play a crucial role in the interests of power suppliers and the security and stability of the smart grid. Second, in addition to accuracy and efficiency, two issues need to be considered: one, load forecasting methods, such as machine learning and deep learning, require a large amount of fine-grained electricity consumption data from smart grid users; two, this fine-grained data can leak users' behavioral privacy, potentially leading to safety issues. Therefore, there is a certain conflict between power suppliers and users: power suppliers need user data, while users, due to privacy concerns, are unwilling to hand over their data. Thus, designing a privacy-preserving, accurate, and efficient load forecasting solution for the smart grid is of great significance for its security and stability.

[0003] To address the privacy concerns of power grid users, there are two main solutions for resolving conflicts between power suppliers and users. One is a load forecasting method based on data aggregation, which uses encryption to ensure the privacy of power grid users' behavior. This approach involves uploading power grid user data collected by smart meters (SMs) to mobile edge computing nodes (MECs) using homomorphic encryption. After aggregation by the MEC, the data is uploaded to a cloud server, where it is decrypted before machine learning training. This computational paradigm is inefficient for the following reasons: First, communication latency during the SM's upload of electricity data to the cloud is unavoidable, making it unsuitable for real-time applications like load forecasting. Second, SMs can only aggregate one type of data at a time, such as the power consumption of power grid users within a specific time period. This limits the training methods for specific machine learning models in load forecasting, and transmitting multiple types of data implies significant communication bandwidth usage. Finally, the high frequency of short-term load forecasting data means that the communication process of edge nodes uploading encrypted data to the cloud server consumes substantial wide area network resources.

[0004] Another approach is to research load forecasting schemes based on federated learning. This scheme uses a smart meter (SM) as the client node in the federated learning architecture and a cloud server as the model update node. It leverages the fact that federated learning data doesn't leave the local machine to ensure the privacy of grid users' behavior. However, this approach also has certain shortcomings. First, smart meters have limited computing and storage capabilities, making it difficult to train machine learning and deep learning models quickly and efficiently. This leads to slow global model convergence on the cloud server, affecting model training efficiency. Deploying computing and storage resources on the smart grid user side results in significant waste of physical resources. Second, the model trained by an SM for a single smart grid user can only predict the load of that single user. However, the load of a single user is related to user behavior, exhibiting significant fluctuations and unpredictability. This results in low accuracy for power suppliers. Summary of the Invention

[0005] To address the shortcomings of the existing technologies, this invention provides a short-term load forecasting method based on federated learning.

[0006] A short-term load forecasting method based on federated learning is proposed. First, a federated learning architecture is defined, which includes five entities: smart meter (SM), mobile edge computing node (MEC), cloud server (Cloud), power supplier (PS), and certificate authority (CA).

[0007] The smart meter SM is maintained by PS. The SM is responsible for continuously collecting fine-grained data from grid users. The SM is defined to perform cryptographic operations but cannot perform machine learning model training operations.

[0008] The Mobile Edge Computing Server (MEC) is provided by the ISP and used for aggregating SM data and training models as a federated learning client node; typically, the MEC is provided by a gateway connecting each SM.

[0009] The cloud server Cloud is provided by a third-party cloud service provider. Cloud is a third-party cloud computing platform with powerful computing and storage capabilities, serving as the server for updating the federated learning model. Cloud is trustworthy.

[0010] The power supplier PS is responsible for supplying electricity to grid users and publishing short-term load forecasts.

[0011] The Certificate Authority (CA) is a trusted digital certificate issuing entity responsible for a series of operations during the initialization of MEC and SM.

[0012] A short-term load forecasting method based on federated learning, implemented using the aforementioned federated learning architecture, specifically includes the following steps:

[0013] Step 1: The MEC periodically collects power data from the SM, and this process occurs continuously between the SM and MEC. Based on the PS's short-term load forecasting needs, the SM periodically uploads data to the MEC node. However, because the MEC node is honest and curious, and untrusted link transmission can lead to the leakage of SM's fine-grained data behavior privacy, and even the forgery and tampering of signatures, the SM needs to implement a predefined privacy protection scheme to process power data. The process of data collection between the SM and MEC is as follows:

[0014] Step 1.1: SM initialization, performed when the SM is used for the first time, PS allocates SM to grid users. i With smart meter serial number ID SMi CA is for each SM i Perform cryptographic key distribution, including public and private key pairs {SK} SMi PK SMi}, of which SK SMi For SM i Private key, PK SMi For SM i The public key; all SMs under each MEC form a group, and for each newly added SMi and the existing SMs j Using secure channels based on ID SMi With ID SMj Key negotiation is performed based on the size of the SM. i With SM j The key negotiation process is as follows:

[0015] SM Entertainment i With SM j Use their respective private keys SK SMi AK SMj Generate, together with the large prime number P in the G group, respectively SM i With AM j Will The key is transmitted to the other party via a secure channel, and the negotiated key is calculated using each party's private key. Where S ij =S ji ;

[0016] Step 1.2: The Smart Grid (SM) collects and encrypts the electricity consumption data of smart grid users over a certain period of time, and this occurs throughout the entire existence of the smart grid users; SM i Every t minutes, the electricity consumption information of the power grid user is encoded into binary using a predefined encoding method, denoted as B(x). i (For use, time t is set by PS, then all SMs under the MEC group) iThe seed is generated through negotiation between the parties, and finally all SMs are encrypted using B(x). i ) is denoted as x i and for x i Signature σ i , will {ID SMi x i , σ i Send to MEC;

[0017] Step 1.2.1: In order for MEC to aggregate multiple types of power data at once, the power data is encoded;

[0018] Step 1.2.1.1: For the summation of numerical data Num, directly convert it to binary encoding, and pay attention to B. Num > log2(sum(Num)), where B Num The number of bits represents the binary representation, and sum(Num) represents the maximum sum of the region Num.

[0019] Step 1.2.1.2: For frequency statistics of device status data, first, based on the total number of devices in the area as N, then calculate b = log2N, and then perform b-bit encoding;

[0020] Step 1.2.2: The SM negotiates the pseudo-random number generator (PRG) seed for all SMs under MEC on the binary encoded power data. Then, the SM... i For B(x) i Encrypt to x i And signed as σ i , will {ID SMi x i , σ i Send to MEC;

[0021] Step 1.2.2.1: Negotiate random numbers; all SMs under MEC output the same value when they pass through a secure channel and have the same PRG seed.

[0022] Step 1.2.2.2: Data encryption; SMi calculation Where i and j represent SM i Serial number ID SMi With SM j ID SMj , PRG(A i,j ) represents the negotiated key S i,j Produce pseudo-random output;

[0023] Step 1.2.2.3: Data Signature; SM i For x i Sign to obtain σ i =SKSMi *H(x i ), will {ID SMi x i , σ i Send to MEC;

[0024] Step 1.3: The MEC aggregates and decrypts the power data and signature sent by the SM. This occurs when the MEC receives the SM. i After processing the data, MEC first performs batch verification of the signatures. If the verification is successful, it aggregates all x... i If verification fails, a binary search is used to find the erroneous signature σ. k and other SM i If i≠k, query the decryption factor, and then re-aggregate the power data after decryption;

[0025] Step 1.3.1: The MEC aggregates the power data sent by the SMs; the MEC receives all the power data from the SMs. i Data {ID SMi x i , σ i After that, use Perform batch verification of signatures, where e(Π) i σ i (g) represents a bilinear mapping based on BLS, where g is a point on the G group; if the verification is successful, the aggregated power data is

[0026] Step 1.3.2: When signature verification fails, use a binary search to find the erroneous signature σ. k and other SM i , i≠k, query the decryption factor PRG(S) i,k Aggregate the remaining power data X = ∑ i,i≠k x i -(PRG(S i,k ))=∑ i B(x i,i≠k );

[0027] Step 1.3.3: Dataset Generation. After the MEC aggregates the SM power data in step 1.3.1 above, it combines all h previously aggregated SM data received by the MEC into a new dataset D. t =[X t-h X t-h+1 X t-h+2 , ..., X t-3 X t-2 X t-1 :X t ], where X tThis represents the power data of all SMs aggregated within the current time period, as the model output. [X] t-h , ..., X t-1 [] represents historical data from time th to time t-1;

[0028] Step 2: Model training tasks occur intermittently between MEC and CS. After receiving the model training task from PS, CS trains the federated learning model. To improve efficiency, a multi-weighted node selection algorithm is proposed. To further improve accuracy, a clustering-based federated update algorithm is proposed on top of the original Fed-Avg update algorithm. The interaction process between MEC and the cloud server for model training is as follows:

[0029] Step 2.1: MEC node selection occurs after CS receives the training task from PS. First, based on the training requirements and MEC training intentions, a multi-weighted node selection algorithm is used to comprehensively evaluate each MEC and select a suitable edge computing node group. Then, different models and parameters are initialized for each type of residential group according to the proposed clustering-based federated update algorithm. Finally, each edge computing node group uses the model parameters to train the local model.

[0030] Step 2.1.1: The multi-weight node selection algorithm specifically involves evaluating D respectively. j S j P j D j Represents the j-th edge computing node (MEC) i The amount of data possessed, S i Represents the j-th edge computing node (MEC) i In this iteration, the estimated training time, P j Represents the j-th edge computing node (MEC) i Historical training accuracy for edge computing nodes (MEC) j Comprehensive numerical evaluation This indicates that it represents the edge computing node (MEC). j The contribution capability when training the local model using the local dataset in round t, therefore. It can be represented as: α+β+γ=1;

[0031] Step 2.1.1.1: Initialization; Before the start of the t-th training round, the server sends initialization information to all MECs. j Broadcast model training task and message M t = {w0, E}, where parameter w0 represents the initial model parameters and E represents the number of training iterations required by the server for the local training node; MEC jUpon receiving the broadcast, the node decides whether to join the current federated learning task based on its own resource status.

[0032] If current resources are sufficient, the target training accuracy can be estimated using local training data and model w0. Time S j ,in Where C j MEC j The number of periods to process a sample of size B, D j MEC j The size of the dataset, where E represents MEC. j The number of local training iterations, f j MEC j CPU frequency is allocated when processing this task; MEC j Calculate S j Then, M t ={w1, S j D j} is sent to Cloud, where w1 represents the pre-trained model;

[0033] Step 2.1.1.2: Comprehensive Data Evaluation; Cloud utilizes a portion of its own data to evaluate each MEC. j The pre-trained model w1 is used for prediction evaluation to obtain the training accuracy. Where H(P) j ) indicates MEC j The historical training precision array, len(H(P) j )) represents H(P j The length of the array, avg(∑H(P)) represents all MECs. j The average historical training accuracy, avg(H(P) j )) indicates MEC j The average historical training accuracy; Cloud's accuracy is based on its own understanding of D. j S j P j Different preferences lead to different calculations of MECj. According to training needs, MEC j After sorting in descending order, select a certain number of MECs and group them according to the federated update algorithm;

[0034] Step 2.1.2: Cloud uses a clustering-based federated update algorithm to group interested MEC nodes. The clustering-based federated update algorithm works as follows: First, the MEC calculates the percentage of residential types belonging to the SMs under its current MEC and assigns residential labels. MECs with the same label are assigned to the same MEC group. Based on training needs, according to... MEC j After sorting in descending order, a certain number of MECs are selected, and these MECs form a MEC node group. Finally, initial models and parameters are distributed to different computing node groups. in Let A represent the node group of a type of housing, which distributes the model in the t-th round. Let A represent other parameters required for training.

[0035] Step 2.2: Model training occurs after MEC receives the initial model. It uses its own data to train the model using gradient descent. After training for a certain number of iterations E or reaching the local model training accuracy threshold, the model parameters are returned to the Cloud.

[0036] Step 2.3: Model Update and Reward. This occurs after the cloud server receives the model trained by MEC. It first processes the model using local data on a test set to obtain the accuracy P of the MEC model in this round of training for each compute node group. j This information is recorded for use in the next round of the node selection algorithm in 2.1.1, and rewards are given to the MEC under the computation node group in this round of model training. Then, steps 2.1 and 2.2 are iterated until the global model converges or reaches the accuracy predefined by PS, at which point model training ends.

[0037] Step 3: Load forecasting task, which continuously occurs between MEC and PS. PS subscribes to and pays for MEC services for short-term load forecasting; MEC periodically uses trained model parameters and historical data D based on fine-grained data aggregated in SM for PS. t =[X t-h X t-h+1 X t-h+2 , ..., X t-3 X t-2 X t-1 Short-term load forecasting is performed, and the final forecast value Y is obtained. t And send the predicted value Y to PS t Compared with the true value X t If PS affects the accuracy of prediction If unsatisfied, restart step 2 to train the model.

[0038] Beneficial technical effects of the present invention:

[0039] This invention introduces edge computing nodes into existing federated learning-based load forecasting methods, designing a federated learning architecture based on edge computing. The Mobile Edge Computing (MEC) server assists the SM (Service Provider) in calculating data signatures; the MEC server is referred to as MEC below. It is assumed that the MEC is provided by an Internet gateway connected to each SM and maintained by an Internet Service Provider (ISP). To achieve high efficiency, the following strategies are designed: a multi-weighted node selection algorithm where the Cloud Server (CS) selects the most suitable group of computing nodes before each round of federated learning model training to maximize training efficiency. To improve accuracy, a clustering-based federated update algorithm is designed. Based on the common Fed-Avg federated update algorithm, considering the different types of residential grid users under different MECs, the CS assigns different models during initialization and update. To protect privacy, this invention designs a data aggregation protocol that uses Diffie-Hellman (DH) key negotiation to protect the data privacy of the SM and employs batch verifiable signatures to accelerate the verification of SM data integrity. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the federated learning system architecture based on edge computing in this embodiment;

[0041] Figure 2 This is a schematic diagram illustrating the specific process of the short-term load forecasting method based on federated learning in this embodiment. Detailed Implementation

[0042] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.

[0043] A short-term load forecasting method based on federated learning is proposed. First, a federated learning-based architecture is designed, as shown in the attached diagram. Figure 1 As shown, it includes five entities: Smart Meter (SM), Mobile Edge Computing Node (MEC), Cloud Server (Cloudserver, Cloud), Power Supplier (PS), and Certificate Authority (CA);

[0044] The smart meter SM is maintained by PS. The SM is responsible for continuously collecting fine-grained data of grid users (such as the current, voltage, frequency, and power of a certain appliance during a certain period of time, and the total electricity consumption of all grid users within a certain period of time). The SM is defined to perform cryptographic operations but cannot perform machine learning model training operations.

[0045] The Mobile Edge Computing Server (MEC) is provided by the ISP and used for aggregating SM data and training models as a federated learning client node; typically, the MEC is provided by a gateway connecting each SM.

[0046] The cloud server Cloud is provided by a third-party cloud service provider. Cloud is a third-party cloud computing platform with powerful computing and storage capabilities, serving as the server for updating the federated learning model. Cloud is trustworthy.

[0047] The power supplier PS is responsible for supplying electricity to grid users and publishing short-term load forecasts.

[0048] The Certificate Authority (CA) is a trusted digital certificate issuing entity responsible for a series of operations during the initialization of MEC and SM.

[0049] A short-term load forecasting method based on federated learning, as shown in the appendix. Figure 2 As shown, based on the above-mentioned federated learning architecture, the specific implementation includes the following steps:

[0050] Step 1: The MEC periodically collects power data from the SM, and this process occurs continuously between the SM and MEC. Based on the PS's short-term load forecasting needs, the SM periodically uploads data to the MEC node, for example, every 15 minutes. However, because the MEC node is honest and curious, and untrusted link transmission could lead to the leakage of SM's fine-grained data behavior privacy or even signature forgery and tampering, the SM needs to implement a predefined privacy protection scheme to process power data. The process of data collection between the SM and MEC is as follows:

[0051] Step 1.1: SM initialization, performed when the SM is used for the first time, PS allocates SM to grid users. i With smart meter serial number ID SMi CA is for each SM i Perform cryptographic key distribution, including public and private key pairs {SK} SMi PK SMi}, of which SK SMi For SM i Private key, PK SMi For SM i The public key; all SMs under each MEC form a group, and for each newly added SMi and the existing SMs j Using secure channels based on ID SMi With ID SMj Key negotiation is performed based on the size of the SM. i With SM jThe key negotiation process is as follows:

[0052] SM Entertainment i With SM j Use their respective private keys AK SMi SK SMj Generate, together with the large prime number P in the G group, respectively SM i With SM j Will The key is transmitted to the other party via a secure channel, and the negotiated key is calculated using each party's private key. Where S ij =S ji ;

[0053] Step 1.2: The Smart Grid (SM) collects and encrypts the electricity consumption data of smart grid users over a certain period of time, and this occurs throughout the entire existence of the smart grid users; SM i Every t minutes, the electricity consumption information of the power grid user is encoded into binary using a predefined encoding method, denoted as B(x). i (For use, time t is set by PS, then all SMs under the MEC group) i The seed is generated through negotiation between the parties, and finally all SMs are encrypted using B(x). i ) is denoted as x i and for x i Signature σ i , will {ID SMi x i , σ i Send to MEC;

[0054] Step 1.2.1: In order for MEC to aggregate multiple types of power data at once, the power data is encoded;

[0055] Step 1.2.1.1: For the summation of numerical data Num, directly convert it to binary encoding, and pay attention to B. Num > log2(sum(Num)), where B Num The number of bits in the binary representation is represented by sum(Num), which represents the maximum value of the sum of Num in the region. For example, if the electricity consumption e = 35 in a certain time period, and the total electricity consumption sum(e) in the region at that moment does not exceed 2000, then the electricity consumption e is encoded as B(e) = 0000010011.

[0056] Step 1.2.1.2: For frequency statistics of device status data, first, based on the total number of devices in the area as N, then calculate b = log2N, and then perform b-bit encoding;

[0057] Example: If the refrigerator is in the "on" state during a certain time period, and the total number of devices in that area is 1000, then the code is B(S). r ) = 000000001;

[0058] Step 1.2.1.3: A portion of the electricity consumption information of users within a certain period (refrigerator: on, power 2kWh, current 2A; rice cooker: off, power 0, current 0; ...; indoor temperature: 27℃; total electricity consumption: 35kWh) is represented as 000000001 0000000010 000000010 00000000 000000000 000000000 ... 00000110110000010011; After summing, we obtain the fine-grained data B(x) of how many users in the area turned on their refrigerators, total power, average power, ..., average temperature, and total electricity consumption. i );

[0059] Step 1.2.2: The SM negotiates the pseudo-random number generator (PRG) seed for all SMs under MEC on the binary encoded power data. Then, the SM... i For B(x) i Encrypt to x i And signed as σ i , will {ID SMi x i , σ i Send to MEC;

[0060] Step 1.2.2.1: Negotiate random numbers; all SMs under MEC output the same value when they pass through a secure channel and have the same PRG seed.

[0061] Step 1.2.2.2: Data encryption; SM i calculate Where i and j represent SM i Serial number ID SMi With SM j ID SMj , PRG(A i,j ) represents the negotiated key S i,j Produce pseudo-random output;

[0062] Step 1.2.2.3: Data Signature; SM i For x i Sign to obtain σ i =SK SMi *H(X t ), will {ID SMi x i, σi Send to MEC;

[0063] Step 1.3: The MEC aggregates and decrypts the power data and signature sent by the SM. This occurs when the MEC receives the SM. i After processing the data, MEC first performs batch verification of the signatures. If the verification is successful, it aggregates all x... i If verification fails, a binary search is used to find the erroneous signature σ. k and other SM i If i≠k, query the decryption factor, and then re-aggregate the power data after decryption;

[0064] Step 1.3.1: The MEC aggregates the power data sent by the SMs. The MEC receives all the power data from the SMs. i Data {ID SMi x i , σ i After that, use Perform batch verification of signatures, where e(Π) i σ i (g) represents a bilinear mapping based on BLS, where g is a point on the G group; if the verification is successful, the aggregated power data is

[0065] Step 1.3.2: When signature verification fails, use a binary search to find the erroneous signature σ. k and other SM i , i≠k, query the decryption factor PRG(S) i,k Aggregate the remaining power data X = ∑ i,i≠k x i -(PRG(S i,k ))=∑ i B(x i,i≠k );

[0066] Step 1.3.3: Dataset Generation. After the MEC aggregates the SM power data in step 1.3.1 above, it combines all h previously aggregated SM data received by the MEC into a new dataset D. t =[X t-h X t-h+1 X t-h+2 , ..., X t-3 X t-2 X t-1 :X t ], where X t This represents the power data of all SMs aggregated within the current time period, as the model output. [X] t-h , ..., X t-1[] represents historical data from time th to time t-1;

[0067] Step 2: Model training tasks occur intermittently between MEC and CS. After receiving the model training task from PS, CS trains the federated learning model. To improve efficiency, a multi-weighted node selection algorithm is proposed. To further improve accuracy, a clustering-based federated update algorithm is proposed on top of the original Fed-Avg update algorithm. The interaction process between MEC and the cloud server for model training is as follows:

[0068] Step 2.1: MEC node selection occurs after CS receives the training task from PS. First, based on the training requirements and MEC training intentions, a multi-weighted node selection algorithm is used to comprehensively evaluate each MEC and select a suitable edge computing node group. Then, different models and parameters are initialized for each type of residential group according to the proposed clustering-based federated update algorithm. Finally, each edge computing node group uses the model parameters to train the local model.

[0069]

[0070]

[0071] Step 2.1.1: The multi-weight node selection algorithm specifically involves evaluating D respectively. j S j P j D j Represents the j-th edge computing node (MEC) j The amount of data possessed, S j Represents the j-th edge computing node (MEC) j In this iteration, the estimated training time, P j Represents the j-th edge computing node (MEC) j Historical training accuracy for edge computing nodes (MEC) j Comprehensive numerical evaluation This indicates that the edge computing node MECj contributes to the training of the local model using the local dataset in round t. Therefore, It can be represented as: α+β+γ=1;

[0072] Step 2.1.1.1: Initialization; Before the start of the t-th training round, the server sends initialization information to all MECs. j Broadcast model training task and message M t = {w0, E}, where parameter w0 represents the initial model parameters and E represents the number of training iterations required by the server for the local training node; MEC jUpon receiving the broadcast, the node decides whether to join the current federated learning task based on its own resource status.

[0073] If current resources are sufficient, the target training accuracy can be estimated using local training data and model w0. Time S j ,in Where C j MEC j The number of periods to process a sample of size B, D j MEC j The size of the dataset, where E represents MEC. j The number of local training iterations, f j MEC j CPU frequency is allocated when processing this task; MEC j Calculate S j Then, M t ={w1, S j D j} is sent to Cloud, where w1 represents the pre-trained model;

[0074] Step 2.1.1.2: Comprehensive Data Evaluation; Cloud utilizes a portion of its own data to evaluate each MEC. j The pre-trained model w1 is used for prediction evaluation to obtain the training accuracy. Where H(P) j ) indicates MEC j The historical training precision array, len(H(P) j )) represents H(P j The length of the array, avg(∑H(P)) represents all MECs. j The average historical training accuracy, avg(H(P) j )) indicates MEC j The average historical training accuracy; Cloud's accuracy is based on its own understanding of D. j S j P j Different preferences lead to different MEC calculations j of According to training needs, MEC j After sorting in descending order, select a certain number of MECs and group them according to the federated update algorithm;

[0075] Step 2.1.2: The Cloud uses a clustering-based federated update algorithm to group interested MEC nodes. Specifically, the clustering-based federated update algorithm works as follows: First, the MEC calculates the percentage of residential types belonging to the SM (Residential Building) within the current MEC. For example, if a certain community in a city is a residential building, the Cloud assigns the residential building label to that MEC. MECs with the same label are assigned to the same MEC group. Based on training needs, according to... After sorting MECj in descending order, a certain number of MECs are selected, forming a MEC node group. Finally, initial models and parameters are distributed to different computing node groups. in Let A represent the number of housing types, the number of node groups, and the model in round t. Let A represent other parameters required for training, such as the number of model iterations, E, etc.

[0076] Step 2.2: Model training occurs after MEC receives the initial model and uses its own data to train the model using gradient descent. The training algorithm is not specified. For example, the Long Short-Term Memory (LSTM) algorithm, which is suitable for time series, can be used as the model training algorithm of this invention. After training for a certain number of times E or reaching the local model training accuracy threshold, the model parameters are returned to the Cloud.

[0077] The following introduces a simple training algorithm:

[0078] Step 2.2.1: Data preprocessing, which occurs before model training in MEC, is a further processing of the dataset from Step 1.3.3. First, data is preprocessed according to requirements. t The set is normalized and regularized, where t represents time, including the set of all SM data received by MEC from the start to the current time.

[0079] Step 2.2.2: MEC performs local model training. MEC trains the model by constructing an LSTM neural network from the model.

[0080] Step 2.2.2.1: MEC adds m neurons to the model, adds corresponding activation functions, such as the Rectified Linear Unit (ReLU), and adds a DropOut layer to prevent overfitting;

[0081] Step 2.2.2.2: Add o LSTM layers to the MEC model, add ReLU as the activation function, and add DropOut layers to prevent overfitting;

[0082] Step 2.2.2.3: MEC adds p fully connected Dense layers to the model, adds ReLU as the activation function, and adds DropOut layers to prevent overfitting;

[0083] Step 2.2.2.4: MEC sets the batch size, number of iterations E, feedback function, etc. for the model according to the Cloud settings.

[0084] The parameters o, p, ReLU activation function, DropOut layer ratio, number of LSTM layers, number of Dense layers, BatchSize, and E need to be adjusted according to the actual situation. After E iterations, the model parameters are sent to the Cloud, and the training round ends.

[0085] Step 2.3: Model Update and Reward. This occurs after the cloud server receives the model trained by MEC. It first processes the model using local data on a test set to obtain the accuracy P of the MEC model in this round of training for each compute node group. j This information is recorded for use in the next round of the node selection algorithm in 2.1.1, and rewards are given to the MEC under the computation node group in this round of model training. Then, steps 2.1 and 2.2 are iterated until the global model converges or reaches the accuracy predefined by PS, at which point model training ends.

[0086] Step 3: Load forecasting task, which continuously occurs between MEC and PS. PS subscribes to and pays for MEC services for short-term load forecasting; MEC periodically uses trained model parameters and historical data D based on fine-grained data aggregated in SM for PS. t =[X t-h X t-h+1 X t-h+2 , ..., X t-3 X t-2 X t-1 Short-term load forecasting is performed, and the final forecast value Y is obtained. t And send the predicted value Y to PS t Compared with the true value X t If PS affects the accuracy of prediction If unsatisfied, restart step 2 to train the model.

Claims

1. A short-term load forecasting method based on federated learning, characterized in that, First, a federated learning-based architecture was designed, which includes five entities: smart meter (SM), mobile edge computing node (MEC), cloud server (Cloud), power supplier (PS), and certificate authority (CA). The smart meter SM is maintained by PS. The SM is responsible for continuously collecting fine-grained data from grid users. The SM is defined to perform cryptographic operations but cannot perform machine learning model training operations. The Mobile Edge Computing Server (MEC) is provided by the ISP and used for aggregating SM data and training models as a federated learning client node; typically, the MEC is provided by a gateway connecting each SM. The cloud server Cloud is provided by a third-party cloud service provider. Cloud is a third-party cloud computing platform with powerful computing and storage capabilities, serving as the server for updating the federated learning model. Cloud is trustworthy. The power supplier PS is responsible for supplying electricity to grid users and publishing short-term load forecasts. The Certificate Authority (CA) is a trusted digital certificate issuing entity responsible for a series of operations during the initialization of MEC and SM. A federated learning architecture is used to implement the following steps: Step 1: The MEC collects power data from the SM periodically, and this process continues between the SM and the MEC. The SM periodically uploads the data to the MEC node according to the short-term load forecasting needs of the PS. However, since the MEC node is honest and curious, and untrusted link transmission can lead to the leakage of the SM's fine-grained data behavior privacy or even the forgery and tampering of signatures, the SM needs to implement a predefined privacy protection scheme to process the power data. Step 2: Model training task, which occurs intermittently between MEC and CS; After receiving the model training task from PS, CS trains the federated learning model. To improve efficiency, a node selection algorithm based on multi-weight is proposed. To further improve accuracy, a clustering-based federated update algorithm is proposed on the basis of the original Fed-Avg update algorithm. Step 3: Load forecasting task, which continuously occurs between MEC and PS. PS subscribes to and pays for MEC services for short-term load forecasting; MEC periodically uses trained model parameters and historical data from fine-grained data aggregated in SM to forecast load for PS. Short-term load forecasting is performed to obtain the final forecast value. And send the predicted values ​​to PS Compared with the true value If PS affects the accuracy of prediction If unsatisfied, restart step 2 to train the model.

2. The short-term load forecasting method based on federated learning according to claim 1, characterized in that, Step 1 involves the following process for collecting data on the interaction between SM and MEC: Step 1.1: SM initialization, performed when the SM is used for the first time, PS allocates power grid users With smart meter serial number CA for each Perform cryptographic key distribution, including public and private key pairs. ,in for private key, for The public key; All SMs under each MEC form a group. For each newly joined... With the original Using secure channels and Key negotiation is conducted based on the size of the key. and The key negotiation process is as follows: Participants and Use their respective private keys Generate, together with the large prime number P in the G group, respectively , and Will The key is transmitted to the other party via a secure channel, and the negotiated key is calculated using each party's private key. ,in ; Step 1.2: SM collects and encrypts the electricity consumption data of smart grid users within a certain period of time, and this occurs throughout the entire period of the existence of smart grid users; Every t minutes, the electricity consumption information of the power grid user is encoded into binary using a predefined encoding method and denoted as follows: For future use, time t is set by PS, then all under the MEC group The seed is generated through negotiation between the parties, and finally all SM encryption is performed. Recorded as and to Signature as ,Will Send to MEC; Step 1.3: The MEC aggregates and decrypts the power data and signature sent by the SM. This occurs when the MEC receives... After processing the data, MEC first performs batch verification of the signatures. If the verification is successful, it aggregates all the signatures. If verification fails, a binary search is used to find the erroneous signature. and to others The system queries the decryption factor and then re-aggregates the power data after decryption.

3. The short-term load forecasting method based on federated learning according to claim 2, characterized in that, Step 1.2 specifically involves: Step 1.2.1: In order for MEC to aggregate multiple types of power data at once, the power data is encoded; Step 1.2.1.1: For the summation of numerical data Num, directly convert it to binary encoding, and note... ,in Represents the number of bits in binary. This represents the maximum sum of Num in the region; Step 1.2.1.2: For frequency statistics of device status data, first, based on the total number of devices in the area as N, then calculate... Then, b-bit encoding is performed; Step 1.2.2: The SM negotiates the pseudo-random number generator (PRG) seed for all SMs under MEC on the binary encoded power data. Then... right Encryption And signed as ,Will Send to MEC; Step 1.2.2.1: Negotiate random numbers; all SMs under MEC output the same value when they pass through a secure channel and have the same PRG seed. Step 1.2.2.2: Data encryption; calculate where i and j represent Serial number and of , This indicates the negotiated key. Produce pseudo-random output; Step 1.2.2.3: Data signing; right Obtain by signing ,Will Send to MEC.

4. The short-term load forecasting method based on federated learning according to claim 2, characterized in that, Step 1.3 specifically involves: Step 1.3.1: The MEC aggregates the power data sent by the SM; the MEC receives all... Data After that, use Perform batch verification of signatures, where This represents a bilinear mapping based on BLS, where g is a point on the G group; if the verification is successful, the aggregated power data is... ; Step 1.3.2: When signature verification fails, use a binary search to find the erroneous signature. and to others Inquire about the decryption factor Aggregate the remaining power data ; Step 1.3.3: Dataset Generation. After the MEC aggregates the SM power data in step 1.3.1 above, it combines all h previously aggregated SM data received by the MEC into a new dataset. ,in This represents the power data of all SMs aggregated within the current time period, as the model output. This represents historical data from time th to time t-1.

5. The short-term load forecasting method based on federated learning according to claim 1, characterized in that, Step 2 describes the interaction process between MEC and the cloud server for model training: Step 2.1: MEC node selection occurs after CS receives the training task from PS. First, based on the training requirements and MEC training intentions, a multi-weighted node selection algorithm is used to comprehensively evaluate each MEC and select a suitable edge computing node group. Then, different models and parameters are initialized for each type of residential group according to the proposed clustering-based federated update algorithm. Finally, each edge computing node group uses the model parameters to train the local model. Step 2.2: Model training occurs after MEC receives the initial model. It uses its own data to train the model using gradient descent. After training for a certain number of iterations E or reaching the local model training accuracy threshold, the model parameters are returned to the Cloud. Step 2.3: Model Update and Reward. This occurs after the cloud server receives the model trained by MEC. It first processes the model using local data on a test set to obtain the accuracy of the MEC model trained in this round for each compute node group. The results are recorded for use in the next round of the node selection algorithm in 2.1.1, and the MEC under the computation node group for this round of model training is rewarded. Then, steps 2.1 and 2.2 are iterated step by step until the global model converges or reaches the accuracy predefined by PS and the model training ends.

6. The short-term load forecasting method based on federated learning according to claim 5, characterized in that, Step 2.1 specifically involves: Step 2.1.1: The multi-weight node selection algorithm specifically involves evaluating each node. ,in Represents the j-th edge computing node The amount of data possessed Represents the j-th edge computing node Predict the training time in this iteration. Represents the j-th edge computing node Historical training accuracy for edge computing nodes Comprehensive numerical evaluation It represents an edge computing node. The contribution capability when training the local model using the local dataset in round t, therefore. It can be represented as: ; Step 2.1.1.1: Initialization; Before the start of the t-th training round, the server sends data to all... Broadcast model training task and messages , where parameters Indicates the initial model parameters, This indicates the number of training iterations the server requires from the local training node. Upon receiving the broadcast, the node decides whether to join the current federated learning task based on its own resource status. If current resources are sufficient, utilize local training data and models. Predicting the achievement of training accuracy time ,in ,in express The number of periods to process a sample of size B. express The size of the dataset, E represents The number of local training iterations, express CPU frequency is allocated when processing this task; calculate Afterwards, Send to Cloud, where This represents a pre-trained model; Step 2.1.1.2: Comprehensive Data Evaluation; Cloud utilizes a portion of its own data to evaluate each... pre-trained model Perform prediction and evaluation to obtain training accuracy. ,in express The historical training accuracy array, express Array length, Indicates all The average historical training accuracy, express The average historical training accuracy; Cloud, based on its own... Different preferences lead to different calculations of According to training needs, right After sorting in descending order, select a certain number of MECs and group them according to the federated update algorithm; Step 2.1.2: Cloud uses a clustering-based federated update algorithm to group interested MEC nodes. The clustering-based federated update algorithm works as follows: First, the MEC calculates the percentage of residential types belonging to the SMs under its current MEC and assigns residential labels. MECs with the same label are assigned to the same MEC group. Based on training needs, according to... right After sorting in descending order, a certain number of MECs are selected, and these MECs form a MEC node group. Finally, initial models and parameters are distributed to different computing node groups. ,in Let A represent the node group of a type of housing, which is used to generate the model in round t. Let A represent other parameters required for training.

Citation Information

Patent Citations

  • Federal learning load prediction method based on dynamic weighted aggregation

    CN114707765A

  • Power terminal multi-task federal learning method for power internet of things

    CN115049522A