Edge collaborative learning method of power negative control terminal based on power internet of things
By calculating the energy compensation and feasible contract mechanism of the power load control terminal, the optimal reward and sample size are determined. The differential privacy federated learning algorithm is adopted to solve the problem of insufficient energy compensation of the power load control terminal, thereby maximizing the benefits of federated learning and protecting data privacy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GLOBAL ENERGY INTERCONNECTION RES INST CO LTD
- Filing Date
- 2023-03-13
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies do not consider energy compensation from power load control terminals when designing incentives, resulting in a reduction in the overall efficiency of the server during federated learning.
By calculating the benefit functions of edge servers and power load control terminals, determining the optimal reward and the number of training samples based on the constraints of feasible contracts, and using a differential privacy federated learning algorithm for data training, federated learning is completed.
In situations of information asymmetry, we should consider the source-load-storage resource compensation of power load control terminals, optimize the incentive system, maximize the benefits of federated learning, and protect the privacy of terminal data.
Smart Images

Figure CN116450343B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of incentive mechanisms in federated learning, and more particularly to an edge collaborative learning method for power load control terminals based on the Internet of Things for electricity. Background Technology
[0002] With the widespread adoption of IoT devices such as smart home appliances and smart meters in smart grids, individual smart devices generate a large amount of energy data. Based on machine learning technology, this data can provide people with smart services.
[0003] Most existing machine learning methods employ centralized training, requiring terminal devices to centrally transmit data to servers, leading to significant transmission latency and privacy issues. To address this challenge, a distributed machine learning method called federated learning has been proposed. Federated learning allows power grid control terminals to store local data on their own devices and share only intermediate model parameters. While federated learning is a promising machine learning method, the participation of power grid control terminals consumes substantial private resources. Considering the self-interest of these terminals, they are often unwilling to sacrifice their resources to assist in federated learning training without rewards. Furthermore, these smart terminals in the power grid have locally stored "source-load-storage" resources that can compensate for energy consumption during federated learning. However, current technologies do not consider the energy compensation issue from power grid control terminals when designing incentives, reducing the overall efficiency of the server.
[0004] Therefore, how to design a federated learning incentive mechanism that takes into account the natural resource compensation of power load control terminals is an urgent problem to be solved. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide an edge collaborative learning method for power load control terminals based on the Internet of Things for power, in order to solve the technical problem that the lack of consideration for energy compensation of power load control terminals in the design of incentives in the prior art leads to a reduction in the total benefits of the server.
[0006] The technical solution proposed in this invention is as follows:
[0007] The first aspect of this invention provides an edge collaborative learning method for power load control terminals based on the power Internet of Things (IoT), comprising: calculating the benefit function of an edge server and the benefit function of the power load control terminal based on the energy compensation of the power load control terminal by source-load-storage resources; determining an expression for the optimal reward allocated by the edge server to the power load control terminal based on the constraint mechanism of feasible contracts and the benefit function of the power load control terminal; optimizing the benefit function of the edge server based on the expression for the optimal reward to obtain the optimal reward for each power load control terminal and the optimal number of training samples; sending the optimal reward for each power load control terminal and the optimal number of training samples to the edge server and each power load control terminal; controlling the edge server and each power load control terminal to perform data training using a differential privacy federated learning algorithm based on their respective optimal reward and optimal number of samples to complete the federated learning.
[0008] Optionally, the step of calculating the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation of the power load control terminal from source, load, and storage resources includes: calculating the total overhead consumed by the power load control terminal in the process of completing federated learning based on the number of samples to be trained and the marginal cost; calculating the benefit function of the power load control terminal based on the reward allocated to the power load control terminal by the edge server, the energy compensation of the power load control terminal from source, load, and storage resources, and the total overhead; and calculating the benefit function of the edge server based on the profit obtained by the edge server based on federated learning and the reward allocated to the power load control terminal.
[0009] Optionally, determining the expression for the optimal reward allocated by the edge server to the power load control terminal based on the feasible contract constraint mechanism and the benefit function of the power load control terminal includes: analyzing the benefit function of the power load control terminal based on the feasible contract constraint mechanism to obtain contract constraint conditions; and calculating the expression for the optimal reward allocated by the edge server to the power load control terminal based on the contract constraint conditions and the energy compensation of the power load control terminal by the source-load-storage resources.
[0010] Optionally, the step of solving and optimizing the benefit function of the edge server based on the expression of the optimal reward to obtain the optimal reward and the optimal number of training samples for each of the power load control terminals includes: summarizing the expression of the optimal reward; substituting the summarized expression of the optimal reward into the benefit function of the edge server to obtain an optimization model for maximizing the benefit of the edge server; and solving the optimization model to obtain the optimal reward and the optimal number of training samples for each of the power load control terminals.
[0011] Optionally, solving the optimization model to obtain the optimal reward and the optimal number of training samples for each of the power load control terminals includes: solving the optimization model to obtain the optimal number of training samples for each of the power load control terminals; and substituting the optimal number of training samples for each of the power load control terminals into the expression for the optimal reward to obtain the optimal reward for each of the power load control terminals.
[0012] Optionally, the control edge server and each of the power load control terminals train data using a differential privacy federated learning algorithm based on their respective optimal reward and optimal sample number to complete federated learning. This includes: sending the initial model parameters from the edge server to each of the power load control terminals; sending the updated model parameters to the edge server, wherein the updated model parameters are obtained by each power load control terminal iteratively training the initial model parameters using sample data selected based on the optimal sample number; sending the global model obtained by the edge server aggregating the updated model parameters to each of the power load control terminals; repeating the above steps until the number of repetitions reaches a preset number of iterations; and sending the corresponding optimal reward to each of the power load control terminals using the edge server to complete federated learning.
[0013] Optionally, sending the updated model parameters obtained by iteratively training the initial model parameters using sample data selected by each power load control terminal based on the optimal number of samples to the edge server includes: using the power load control terminal to perform one iterative training of the initial model parameters using sample data selected based on the optimal number of samples to obtain intermediate model parameters; controlling the power load control terminal to obtain Gaussian noise using a differential privacy method and adding the Gaussian noise to the intermediate model parameters before performing the next iterative training; repeating the above steps until a preset number of iterative training iterations are completed to obtain updated model parameters and controlling the power load control terminal to send the updated model parameters to the edge server.
[0014] A second aspect of this invention provides an edge collaborative learning device for power load control terminals based on the Internet of Things for electricity, comprising: a benefit calculation module, used to calculate the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation of the power load control terminal by source-load-storage resources; an expression acquisition module, used to determine the expression of the optimal reward allocated by the edge server to the power load control terminal based on the constraint mechanism of feasible contracts and the benefit function of the power load control terminal; an optimal contract item acquisition module, used to solve and optimize the benefit function of the edge server according to the expression of the optimal reward, to obtain the optimal reward of each power load control terminal and the optimal number of training samples; and a training module, used to send the optimal reward of each power load control terminal and the optimal number of training samples to the edge server and each power load control terminal, and control the edge server and each power load control terminal to perform data training using a differential privacy federated learning algorithm based on their respective optimal reward and optimal number of samples, to complete the federated learning.
[0015] Optionally, the benefit calculation module includes: a total cost calculation module, used to calculate the total cost consumed by the power load control terminal in completing the federated learning process based on the number of samples to be trained and the marginal cost; a first benefit function calculation module, used to calculate the benefit function of the power load control terminal based on the reward allocated to the power load control terminal by the edge server, the energy compensation of the power load control terminal by the source load storage resources, and the total cost; and a second benefit function calculation module, used to calculate the benefit function of the edge server based on the profit obtained by the edge server based on federated learning and the reward allocated to the power load control terminal.
[0016] Optionally, the expression acquisition module includes: an analysis module, used to analyze the benefit function of the power load control terminal according to the constraint mechanism of feasible contracts to obtain contract constraints; and a calculation module, used to calculate the expression of the optimal reward allocated to the power load control terminal by the edge server according to the contract constraints and the energy compensation of source-load-storage resources for the power load control terminal.
[0017] Optionally, the optimal contract item acquisition module includes: an induction module for inductively ...
[0018] Optionally, the solution module includes: a sample number module, used to solve the optimization model to obtain the optimal number of training samples for each of the power load control terminals; and a substitution module, used to substitute the optimal number of training samples for each of the power load control terminals into the expression for the optimal reward, to obtain the optimal reward for each of the power load control terminals.
[0019] Optionally, the training module includes: a sending module for sending initial model parameters from the edge server to each of the power load control terminals; an iteration module for sending updated model parameters to the edge server, wherein the updated model parameters are obtained by each power load control terminal iteratively training the initial model parameters using sample data selected based on the optimal number of samples; an aggregation module for sending the global model obtained by the edge server aggregating the updated model parameters to each of the power load control terminals; and a first repetition module for repeating the above steps until the number of repetitions reaches a preset number of iterations, using the edge server to send the corresponding optimal reward to each of the power load control terminals to complete federated learning.
[0020] Optionally, the iteration module includes: a first iteration module, used to perform one iteration training on the initial model parameters using sample data selected by the power load control terminal based on the optimal number of samples to obtain intermediate model parameters; a noise module, used to control the power load control terminal to obtain Gaussian noise using a differential privacy method and add the Gaussian noise to the intermediate model parameters before performing the next iteration training; and a second repetition module, used to repeat the above steps until a preset number of iteration trainings are completed to obtain updated model parameters and control the power load control terminal to send the updated model parameters to the edge server.
[0021] A third aspect of the present invention provides an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the edge collaborative learning method as described in any one of the first aspects of the present invention.
[0022] A fourth aspect of the present invention provides a computer-readable storage medium storing computer instructions for causing the computer to perform the edge collaborative learning method as described in any of the first aspects of the present invention.
[0023] As can be seen from the above technical solutions, the embodiments of the present invention have the following advantages:
[0024] This invention provides an edge collaborative learning method for power load control terminals based on the power Internet of Things (IoT). The method calculates the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation from source-load-storage resources. It determines the optimal reward allocation expression for each power load control terminal based on feasible contract constraints and the power load control terminal's benefit function. The method then optimizes the edge server's benefit function using this optimal reward expression, obtaining the optimal reward and the optimal number of training samples for each power load control terminal. The optimal reward and the optimal number of training samples for each power load control terminal are sent to the edge server and each power load control terminal. The edge server and each power load control terminal then use a differential privacy federated learning algorithm to train data based on their respective optimal reward and optimal number of training samples, completing the federated learning process. This allows the edge server to consider the compensation from the power load control terminal's own source-load-storage resources for energy consumption even under information asymmetry, and optimizes the optimal reward and optimal number of training samples for each power load control terminal, thus improving the federated learning incentive system and maximizing the benefits of federated learning. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart of the edge collaborative learning method for power load control terminals based on the Internet of Things in this invention.
[0027] Figure 2 This is a schematic diagram of the structure of the federated learning system in an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of the edge collaborative learning device in an embodiment of the present invention;
[0029] Figure 4 This is a schematic diagram of the structure of the electronic device in an embodiment of the present invention;
[0030] Figure 5 This is a schematic diagram of the structure of a computer-readable storage medium in an embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] This invention provides an edge collaborative learning method for power load control terminals based on the power Internet of Things, such as... Figure 1 As shown, the method includes:
[0033] Step S100: Calculate the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation of the source load storage resources to the power load control terminal.
[0034] Step S200: Determine the expression for the optimal reward payout allocated by the edge server to the power load control terminal based on the constraint mechanism of the feasible contract and the benefit function of the power load control terminal.
[0035] Step S300: Solve and optimize the benefit function of the edge server according to the expression of the optimal reward, and obtain the optimal reward and the optimal number of samples to be trained for each power load control terminal.
[0036] Step S400: Send the optimal reward and the optimal number of training samples for each power load control terminal to the edge server and each power load control terminal. The control edge server and each power load control terminal use the differential privacy federated learning algorithm to train the data based on their respective optimal reward and optimal number of samples to complete the federated learning.
[0037] Specifically, source-load-storage resources refer to the electricity resources collected and stored locally by the power load control terminal through renewable energy generation methods. Since the power load control terminal consumes a certain amount of electricity during the federated learning process, it can directly utilize the locally stored source-load-storage power resources, thus reducing the expenses incurred from purchasing electricity. The amount of compensation electricity is determined by factors such as the equipment model, performance, and power generation method of the power load control terminal. The energy compensation from the source-load-storage resources of each power load control terminal for federated learning can be obtained through parameters such as the equipment model, performance, and power generation method of the power load control terminal.
[0038] The independent variables of the benefit function of the power load control terminal are the contract term consisting of the reward allocated to the power load control terminal by the edge server and the number of samples to be trained, so as to solve the optimal contract term according to the benefit function, that is, the optimal reward and the number of samples to be trained for each power load control terminal.
[0039] After obtaining the optimal reward and the number of training samples for each power load control terminal, the data is sent to the edge server and each power load control terminal. The edge server then combines the optimal reward and the number of training samples for each power load control terminal into an optimal contract set. And the optimal contract group Send to each power load control terminal, the power load control terminal from the contract group By selecting the corresponding contract item to maximize their own benefits, multiple power load control terminals can be incentivized to participate in the federated learning task. Simultaneously, the power load control terminals employ a differential privacy federated learning algorithm for data training based on their optimal reward and optimal sample size, thus protecting the privacy of the local data of the power load control terminals.
[0040] This invention discloses an edge collaborative learning method for power load control terminals based on the Internet of Things (IoT). The method calculates the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation from source-load-storage resources. It then determines the optimal reward allocation expression for each power load control terminal based on feasible contract constraints and the power load control terminal's benefit function. The method optimizes the edge server's benefit function using this optimal reward expression, obtaining the optimal reward and the optimal number of training samples for each power load control terminal. The optimal reward and the optimal number of training samples for each power load control terminal are sent to the edge server and each power load control terminal. The edge server and each power load control terminal then use a differential privacy federated learning algorithm to train data based on their respective optimal reward and optimal number of training samples, completing the federated learning process. This allows the edge server to simultaneously consider the compensation from the power load control terminal's own source-load-storage resources for energy consumption even under information asymmetry, and optimizes the optimal reward and optimal number of training samples for each power load control terminal, thereby improving the federated learning incentive system and maximizing the effectiveness of federated learning.
[0041] Meanwhile, the power load control terminal uses a differential privacy federated learning algorithm for data training, which protects the privacy of the local data of the power load control terminal.
[0042] In one embodiment, step S100, calculating the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation of the source-load-storage resources to the power load control terminal, includes the following steps:
[0043] Step S110: Calculate the total overhead consumed by the power load control terminal during the federated learning process based on the number of training samples and the marginal cost. The total overhead consumed by the power load control terminal during the federated learning process includes privacy costs, computational energy consumed during iterations, and communication energy consumed during global iterations.
[0044] Specifically, the privacy cost of the power load control terminal i completing the federated learning process is:
[0045]
[0046] Where ε is the privacy budget, ε max For the ε constraint, v i D i This represents the number of samples required for local training.
[0047] The computational energy consumed by the power load control terminal i in one global iteration is:
[0048]
[0049] Where, N F This represents the number of floating-point operations required to process each sample, and E represents the number of times the power load control terminal traverses the local dataset in one global iteration. It is a constant, f i c It is the CPU clock frequency of the power load control terminal i, n i D is the number of floating-point operations that the CPU can perform per cycle. i This represents the number of samples required for local training.
[0050] The communication energy consumed by the power load control terminal i in one global iteration is:
[0051]
[0052] Among them, P cm For transmission power, T max Set time constraints for each round of global iteration for all power load control terminals on the edge server.
[0053] Therefore, the total cost for power load control terminal i to complete the federated learning process is:
[0054]
[0055] Where c is the unit cost of energy, and T is the number of global iterations in federated learning. The computational energy consumed by the power load control terminal i. The communication energy consumed by the power load control terminal i, l i This represents the privacy costs incurred by the power load control terminal i. η i =θ i -τ i +ρ i This represents the marginal cost incurred by the power load control terminal i for training one additional data sample locally. ζ is a constant.
[0056] Step S120: Calculate the benefit function of the power load control terminal based on the reward allocated to the power load control terminal by the edge server, the energy compensation from source-load-storage resources to the power load control terminal, and the total cost. Specifically, the benefit function of the power load control terminal is:
[0057]
[0058] Among them, u i Let η be the benefit function of the power load control terminal i. i θ represents the marginal cost incurred by the power load control terminal i for training one additional data sample locally. i This is a contract item (D) designed for the power load control terminal i. i ,R i ), R i D represents the incentive provided by the edge server to the power load control terminal i, i.e., the reward allocated by the edge server to the power load control terminal. i This refers to the number of samples that the power load control terminal i needs to train. The total overhead consumed during the federated learning process is η. i D i +ζ. This is to compensate the power load control terminal for energy from the source-load storage resources. c represents the unit cost of energy. The local storage resources for power load control terminal i can compensate for the power consumption incurred during the federated learning process.
[0059] Step S130: Calculate the benefit function of the edge server based on the profit obtained by the edge server through federated learning and the reward allocated to the power load control terminal. Specifically, the power load control terminal i is allocated according to its marginal cost η. i The index is used in ascending order, i.e., η1≥η2≥...≥η i ≥...≥η I The benefit function of the edge server is:
[0060]
[0061] Where I represents the total number of power load control terminals in the system, κ is the parameter that converts the performance of the federated learning model into profit, and a, b, and k are all freely chosen constants. The profit obtained by the edge server based on federated learning is based on the formula... calculate.
[0062] This invention, through calculating the privacy cost, computational energy consumed in iteration, and communication energy consumed in global iteration of the power load control terminal during the federated learning process, can accurately obtain the total overhead of the power load control terminal during the federated learning process. When calculating the benefit function of the edge server and the benefit function of the power load control terminal, by considering the energy compensation of the power load control terminal's own source load storage resources, the benefit of the power load control terminal can be accurately reflected, thereby enabling the edge server to maximize its own benefit under the condition of information asymmetry.
[0063] In one embodiment, step S200, determining the expression for the optimal reward allocated by the edge server to the power load control terminal based on the constraint mechanism of the feasible contract and the benefit function of the power load control terminal, includes:
[0064] Step S210: Analyze the benefit function of the power load control terminal based on the constraint mechanism of feasible contracts to obtain the contract constraint conditions.
[0065] Specifically, the restrictive mechanisms for feasible contracts include:
[0066] Individual rationality (IR): Each electricity load control terminal obtains a non-negative profit when it selects its corresponding terms. That is:
[0067] u i (θ i )≥0,1≤i≤I
[0068] Appropriate Incentive (IC): If the power load terminal selects a contract designed for its type, it will achieve maximum profit. Therefore, it will not be incentivized to select a contract designed for other types of power load terminals. That is:
[0069] u i (θ i )≥u i (θ j ), i≠j, 1≤i, j≤i
[0070] First, without considering energy compensation at the power load control terminal, a feasibility analysis of the optimal contract is performed. Based on IC and IR constraints, the following can be deduced:
[0071] 1. For any feasible contract, we have R i <R j With D i <D j They are both necessary and sufficient conditions, i≠j.
[0072] 2. Monotonicity: For any feasible contract, if η i ≥η j Then D i ≤Dj .
[0073] 3. If the IR constraint holds for the power load control terminal with the lowest profit, then the profits of other power load control terminals will also satisfy the IR constraint.
[0074] 4. (Reduce IC constraints): IC constraints can be reduced to pairwise stimulus compatibility constraints.
[0075] Therefore, a viable contract must meet the following contractual constraints:
[0076]
[0077] R I -η I D I -ζ≥0 (2)
[0078] R i -η i D i ≥R i+1 -η i D i+1 (3)
[0079] R i -η i D i ≥R i+1 -η i+1 D i+1 (4)
[0080] Step S220: Calculate the expression for the optimal reward allocated by the edge server to the power load control terminal based on the contractual constraints and the energy compensation from the source, load, and storage resources to the power load control terminal.
[0081] Specifically, without considering the power load storage resources at the terminal of the power load control system, from constraints (1), (2), (3) and (4), we can obtain: for a known set of D i And satisfying D1≥D2≥...≥D i ≥...≥D I In a feasible contract, the intermediate optimal reward The expression is:
[0082]
[0083] The true optimal reward after considering the energy compensation from power source, load, and storage resources to the power load control terminal. The expression is:
[0084]
[0085] in, This represents the minimum energy compensation provided by all source, load, and storage resources to the power load control terminal. It also represents the optimal reward obtained considering the energy compensation provided by source, load, and storage resources to the power load control terminal. The IC and IR restrictions of the contract are still met.
[0086] This invention analyzes the benefit function of the power load control terminal through a feasible contract constraint mechanism, and obtains the optimal reward under the consideration of energy compensation from source-load-storage resources for the power load control terminal. The expression for the optimal reward satisfies the IC and IR restrictions of the contract and is practical.
[0087] In one embodiment, step S300 involves solving and optimizing the benefit function of the edge server based on the expression for the optimal reward, to obtain the optimal reward for each power load control terminal and the optimal number of samples to be trained, including:
[0088] Step S310: Summarize the expression for the optimal reward. Regarding the above optimal reward... By inductively summarizing the expression, the optimal reward can be re-expressed as follows:
[0089]
[0090] Step S320: Substitute the inductive expression for the optimal reward into the benefit function of the edge server to obtain the optimization model for maximizing the benefit of the edge server. Specifically, the optimization model obtained after substituting the inductive expression for the optimal reward into the benefit function of the edge server is as follows:
[0091]
[0092]
[0093] Step S330: Solve the optimization model to obtain the optimal reward and the optimal number of training samples for each power load control terminal. Specifically, substitute the optimal number of training samples for each power load control terminal into the expression for the optimal reward to obtain the optimal reward for each power load control terminal.
[0094] In this embodiment of the invention, the reward and compensation of the power load control terminal and the number of samples required for training are the optimal contract set composed of several contracts. First, the intermediate optimal sample number is obtained by directly solving the optimization model. get:
[0095]
[0096] According to the above optimization model, the number of optimal training samples decreases as i increases. Therefore, the optimal number of samples for the i-th contract must be greater than the optimal number of samples for the (i+1)-th contract. The intermediate optimal number of samples obtained by solving the optimization model does not consider monotonicity. The optimal number of training samples for power load control terminal i is...
[0097] In this embodiment of the invention, the contract is solved starting from the I-th contract and then sequentially forward. Therefore, we first calculate the optimal number of samples for the (i+1)-th contract (i.e., the first term after MAX), and then compare this value with the convex optimization result (i.e., the second term after MAX) when solving for the optimal number of samples for the i-th contract. To satisfy the monotonicity condition, the optimal number of samples for the i-th contract is the larger of the two, that is, the true optimal number of samples is found.
[0098] Then the results Substitute the best reward The expression yields the optimal reward value in the contract.
[0099] In one embodiment, step S400 involves the control edge server and each power load control terminal training the data using a differential privacy federated learning algorithm based on their respective optimal reward and optimal sample number, thereby completing the federated learning process, including:
[0100] Step S410: Send the initial model parameters from the edge server to each power load control terminal;
[0101] Step S420: Send the updated model parameters to the edge server, wherein the updated model parameters are obtained by each power load control terminal through iterative training of the initial model parameters using sample data selected based on the optimal number of samples;
[0102] Step S430: Send the global model obtained by the edge server aggregating the updated model parameters to each power load control terminal;
[0103] Step S440: Repeat the above steps until the number of repetitions reaches the preset number of iterations. Use the edge server to send the corresponding optimal reward to each power load control terminal to complete the federated learning.
[0104] Specifically, the federated learning in this embodiment of the invention is achieved through, as follows: Figure 2 The federated learning system consisting of the edge server and I power load control terminals is completed as shown. The edge server first distributes the initial model parameters to each power load control terminal. The execution steps of each power load control terminal are the same. Taking the i-th power load control terminal as an example, power load control terminal i randomly selects from its own dataset. For each sample, the initial model parameters are updated through one iteration. Gaussian noise is added to the resulting model parameters before the next local iteration. After E local iterations, the updated model parameters are uploaded to the edge server. Here, E represents the number of times the power load control terminal traverses the training dataset in one global iteration, and B represents the batch size selected in the gradient descent algorithm.
[0105] The edge server receives updated model parameters from each power load control terminal, aggregates them to form a global model, and then sends the global model to each power load control terminal. The process of the edge server updating the global model is as follows:
[0106]
[0107] Among them, w t These are the global model parameters obtained in the t-th global iteration of the edge server.
[0108] Repeat the above steps T times, where T is a pre-set number of iterations, and then the edge server distributes a reward to the power load control terminal i. Complete model training.
[0109] By incentivizing each power load control terminal with the best reward, the goal of motivating multiple power load control terminals to participate in the federated learning task was achieved.
[0110] In one embodiment, step S420, sending the updated model parameters obtained by iteratively training the initial model parameters based on the sample data selected by each power load control terminal using the optimal number of samples to the edge server, includes:
[0111] Step S421: Using the power load control terminal, select sample data based on the optimal number of samples to perform one iteration of training on the initial model parameters to obtain intermediate model parameters;
[0112] Step S42: The control power load control terminal uses the differential privacy method to obtain Gaussian noise and adds the Gaussian noise to the intermediate model parameters before performing the next iteration of training;
[0113] Step S42: Repeat the above steps until the preset number of iterations of training are completed, obtain the updated model parameters, and control the power load control terminal to send the updated model parameters to the edge server.
[0114] Specifically, the training process in one iteration is as follows:
[0115] The goal of federated learning is to train a global model parameter vector w that minimizes the global loss function, i.e.:
[0116]
[0117] in f(w,x) represents the sum of training data from all participating power load control terminals in the system. il ,y iι Given a model w, the retraining data {x} iι ,y il The loss function F on} i (w) is the local loss function of power load control terminal i with local dataset.
[0118] The power load control terminal i performs local iterations using a mini-batch gradient descent method to obtain intermediate model parameters. The local update process is as follows:
[0119]
[0120] Where, w t,s-1 i The local model parameters are obtained by the power load control terminal i during the (s-1)th local iteration in the t-th global iteration. For F(w) in The gradient value at point B is λ, where λ is the learning rate and B is the batch size selected in the mini-batch gradient descent algorithm.
[0121] For each power load control terminal, after each local iteration, according to the differential privacy algorithm, the Gaussian noise added to the intermediate model parameters of power load control terminal i is... Where the standard deviation σ i for:
[0122]
[0123] Among them, I d Let be the identity matrix, and d be the dimension of the model parameters. E represents the number of times the training dataset is traversed in a single global iteration of the power load control terminal, T represents the total number of global iterations, δ represents the fault tolerance probability, and ε represents the privacy budget. The Gaussian noise is... Add these parameters to the intermediate model parameters to obtain the updated model parameters.
[0124] The embodiments of the present invention employ a differential privacy algorithm to protect the privacy of local data in the power load control terminal.
[0125] This invention also provides an edge collaborative learning device for a power load control terminal based on the power Internet of Things, such as... Figure 3 As shown, the device includes:
[0126] The benefit calculation module 301 is used to calculate the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation of the source-load-storage resources to the power load control terminal; for details, please refer to the corresponding part of the above method embodiment, which will not be repeated here.
[0127] The expression acquisition module 302 is used to determine the expression for the optimal reward payout allocated by the edge server to the power load control terminal based on the constraint mechanism of the feasible contract and the benefit function of the power load control terminal; for details, please refer to the corresponding part of the above method embodiment, which will not be repeated here.
[0128] The optimal contract item acquisition module 303 is used to solve and optimize the benefit function of the edge server according to the expression of the optimal reward, so as to obtain the optimal reward and the optimal number of samples to be trained for each power load control terminal; for details, please refer to the corresponding part of the above method embodiment, which will not be repeated here.
[0129] The training module 304 is used to send the optimal reward and the optimal number of training samples for each power load control terminal to the edge server and each power load control terminal. The control edge server and each power load control terminal use a differential privacy federated learning algorithm to train the data based on their respective optimal reward and optimal number of samples, thus completing the federated learning. For details, please refer to the corresponding section of the above method embodiment, which will not be repeated here.
[0130] This invention discloses an edge collaborative learning device for power load control terminals based on the Internet of Things (IoT). The device calculates the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation from source-load-storage resources. It determines the optimal reward allocation expression for the power load control terminal by the edge server based on the constraints of feasible contracts and the benefit function of the power load control terminal. The device then optimizes the benefit function of the edge server using this optimal reward expression, obtaining the optimal reward and the optimal number of training samples for each power load control terminal. The optimal reward and the optimal number of training samples for each power load control terminal are sent to the edge server and each power load control terminal. The device controls the edge server and each power load control terminal to perform data training using a differential privacy federated learning algorithm based on their respective optimal reward and optimal number of training samples, thus completing the federated learning process. This allows the edge server to simultaneously consider the compensation of the power load control terminal's energy consumption from its own source-load-storage resources, even under conditions of information asymmetry, and optimize the optimal reward and optimal number of training samples for each power load control terminal, thereby improving the federated learning incentive system and maximizing the benefits of federated learning.
[0131] Meanwhile, the power load control terminal uses a differential privacy federated learning algorithm for data training, which protects the privacy of the local data of the power load control terminal.
[0132] In one embodiment, the benefit calculation module 301 includes: a total cost calculation module, used to calculate the total cost consumed by the power load control terminal in completing the federated learning process based on the number of samples to be trained and the marginal cost; a first benefit function calculation module, used to calculate the benefit function of the power load control terminal based on the reward allocated to the power load control terminal by the edge server, the energy compensation of the power load control terminal by the source-load-storage resources, and the total cost; and a second benefit function calculation module, used to calculate the benefit function of the edge server based on the profit obtained by the edge server based on federated learning and the reward allocated to the power load control terminal.
[0133] In one embodiment, the expression acquisition module 302 includes: an analysis module, used to analyze the benefit function of the power load control terminal according to the constraint mechanism of feasible contracts to obtain contract constraint conditions; and a calculation module, used to calculate the expression of the optimal reward allocated to the power load control terminal by the edge server based on the contract constraint conditions and the energy compensation of the power load control terminal by the source-load-storage resources.
[0134] In one embodiment, the optimal contract item acquisition module 303 includes: an induction module for inductively ...
[0135] In one embodiment, the solution module includes: a sample number module, used to solve the optimization model to obtain the optimal number of samples to be trained for each power load control terminal; and a substitution module, used to substitute the optimal number of samples to be trained for each power load control terminal into the expression for the optimal reward, to obtain the optimal reward for each power load control terminal.
[0136] In one embodiment, the training module 304 includes: a sending module for sending initial model parameters from the edge server to each of the power load control terminals; an iteration module for sending updated model parameters to the edge server, wherein the updated model parameters are obtained by each power load control terminal through iterative training of the initial model parameters using sample data selected based on the optimal number of samples; an aggregation module for sending the global model obtained by the edge server through aggregation based on the updated model parameters to each of the power load control terminals; and a first repetition module for repeating the above steps until the number of repetitions reaches a preset number of iterations, wherein the edge server sends the corresponding optimal reward to each of the power load control terminals to complete federated learning.
[0137] In one embodiment, the iteration module includes: a first iteration module, used to perform one iteration training of the initial model parameters by selecting sample data based on the optimal number of samples from the power load control terminal to obtain intermediate model parameters; a noise module, used to control the power load control terminal to obtain Gaussian noise using a differential privacy method and add the Gaussian noise to the intermediate model parameters before performing the next iteration training; and a second repetition module, used to repeat the above steps until a preset number of iteration trainings are completed to obtain updated model parameters and control the power load control terminal to send the updated model parameters to the edge server.
[0138] This invention also provides an electronic device, such as... Figure 4As shown, the system includes a memory 420 and a processor 410, which are interconnected. The memory 420 stores computer instructions, and the processor 410 executes these computer instructions to perform the edge collaborative learning method described in the above embodiments of the present invention. The processor 410 and the memory 420 can be connected via a bus or other means. The processor 410 can be a central processing unit (CPU). The processor 410 can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof. The memory 420, as a non-transitory computer storage medium, can be used to store non-transitory software programs, non-transitory executable programs, and modules, such as the corresponding program instructions / modules in the embodiments of the present invention. The processor 410 executes various functional applications and data processing by running non-transitory software programs, instructions, and modules stored in the memory 420, thereby implementing the edge collaborative learning method in the above method embodiments. The memory 420 may include a program storage area and a data storage area. The program storage area may store applications required for operating the device and at least one function; the data storage area may store data created by the processor 410, etc. Furthermore, the memory 420 may include a high-speed random access memory 420, and may also include non-transitory memory 420, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 420 may optionally include remotely located memories 420 relative to the processor 410, which can be connected to the processor 410 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. One or more modules are stored in the memory 420 and, when executed by the processor 410, perform the edge collaborative learning method as described in the above method embodiments. Specific details of the above electronic device can be understood by referring to the corresponding descriptions and effects in the above method embodiments, and will not be repeated here.
[0139] This invention also provides a computer-readable storage medium, such as... Figure 5As shown, a computer program 510 is stored on the storage medium. When executed by a processor, this program implements the steps of the edge collaborative learning method described in the above embodiments. The storage medium also stores audio and video stream data, feature frame data, interactive request signaling, encrypted data, and a preset data size. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory. Those skilled in the art will understand that all or part of the processes in the methods described in the above embodiments can be implemented by a computer program instructing related hardware. The computer program 13 can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include a combination of the above types of memory.
[0140] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An edge collaborative learning method for power load control terminals based on the power Internet of Things, characterized in that, include: The benefit function of the edge server and the benefit function of the power load control terminal are calculated based on the energy compensation of the power load storage resources to the power load control terminal. The expression for the optimal reward allocated by the edge server to the power load control terminal is determined based on the constraint mechanism of the feasible contract and the benefit function of the power load control terminal. The benefit function of the edge server is solved and optimized according to the expression of the optimal reward, so as to obtain the optimal reward and the optimal number of samples to be trained for each power load control terminal. The optimal reward and the optimal number of training samples for each of the power load control terminals are sent to the edge server and each of the power load control terminals. The edge server and each power load control terminal are controlled to use a differential privacy federated learning algorithm to train the data based on their respective optimal reward and optimal number of samples, thus completing the federated learning. The calculation of the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation of the power load storage resources for the power load control terminal includes: The total overhead consumed by the power load control terminal during the federated learning process is calculated based on the number of samples to be trained and the marginal cost. The benefit function of the power load control terminal is calculated based on the reward allocated to the power load control terminal by the edge server, the energy compensation of the power load control terminal by the source load storage resources, and the total cost. The benefit function of the edge server is calculated based on the profit obtained by the edge server based on federated learning and the reward allocated to the power load control terminal. The expression for determining the optimal reward allocated by the edge server to the power load control terminal based on the constraint mechanism of the feasible contract and the benefit function of the power load control terminal includes: The benefit function of the power load control terminal is analyzed based on the constraint mechanism of feasible contracts to obtain the contract constraint conditions; The expression for calculating the optimal reward allocated by the edge server to the power load control terminal is based on the contractual constraints and the energy compensation from source load storage resources to the power load control terminal. The step of solving and optimizing the benefit function of the edge server based on the expression for the optimal reward, to obtain the optimal reward and the optimal number of samples to be trained for each of the power load control terminals, includes: The expression for the optimal reward is summarized; Substituting the summarized expression for the optimal reward into the benefit function of the edge server, we obtain an optimization model for maximizing the benefit of the edge server. Solving the optimization model yields the optimal reward and the optimal number of training samples for each of the power load control terminals.
2. The edge collaborative learning method for power load control terminals based on the power Internet of Things as described in claim 1, characterized in that, Solving the optimization model to obtain the optimal reward and the optimal number of training samples for each power load control terminal includes: Solve the optimization model to obtain the optimal number of training samples for each of the power load control terminals; Substituting the optimal number of training samples for each of the power load control terminals into the expression for the optimal reward, the optimal reward for each of the power load control terminals is obtained.
3. The edge collaborative learning method for power load control terminals based on the power Internet of Things as described in claim 1, characterized in that, The control edge server and each of the power load control terminals are trained on data using a differential privacy federated learning algorithm based on their respective optimal reward and optimal sample size, to complete the federated learning process, including: The initial model parameters in the edge server are sent to each of the power load control terminals; The updated model parameters are sent to the edge server, wherein the updated model parameters are obtained by each power load control terminal through iterative training of the initial model parameters based on the optimal number of samples selected from the sample data. The edge server sends the global model obtained by aggregating the updated model parameters to each of the power load control terminals; Repeat the above steps until the number of repetitions reaches the preset number of iterations, and then use the edge server to send the corresponding optimal reward to each of the power load control terminals to complete the federated learning.
4. The edge collaborative learning method for power load control terminals based on the power Internet of Things as described in claim 3, characterized in that, The step of sending the updated model parameters obtained by iteratively training the initial model parameters using sample data selected by each power load control terminal based on the optimal sample size to the edge server includes: The power load control terminal selects sample data based on the optimal number of samples to perform one iteration of training on the initial model parameters to obtain intermediate model parameters; The control power load control terminal uses a differential privacy method to obtain Gaussian noise and adds the Gaussian noise to the intermediate model parameters before performing the next iteration of training; Repeat the above steps until the preset number of iterations of training are completed, obtain the updated model parameters, and control the power load control terminal to send the updated model parameters to the edge server.
5. An edge collaborative learning device for power load control terminals based on the power Internet of Things, characterized in that, include: The benefit calculation module is used to calculate the benefit function of the edge server and the benefit function of the power load control terminal based on the energy compensation of the power load storage resources to the power load control terminal. The expression acquisition module is used to determine the expression of the optimal reward payout allocated by the edge server to the power load control terminal based on the constraint mechanism of the feasible contract and the benefit function of the power load control terminal; The optimal contract item acquisition module is used to solve and optimize the benefit function of the edge server according to the expression of the optimal reward, so as to obtain the optimal reward and the optimal number of samples to be trained for each of the power load control terminals. The training module is used to send the optimal reward and the optimal number of training samples for each of the power load control terminals to the edge server and each of the power load control terminals, and control the edge server and each power load control terminal to use a differential privacy federated learning algorithm to train the data based on their respective optimal reward and optimal number of samples, thereby completing the federated learning; The benefit calculation module includes: a total cost calculation module, used to calculate the total cost consumed by the power load control terminal in completing the federated learning process based on the number of samples to be trained and the marginal cost; a first benefit function calculation module, used to calculate the benefit function of the power load control terminal based on the reward allocated to the power load control terminal by the edge server, the energy compensation of the power load control terminal by the source load storage resources, and the total cost; and a second benefit function calculation module, used to calculate the benefit function of the edge server based on the profit obtained by the edge server based on federated learning and the reward allocated to the power load control terminal. The expression acquisition module includes: an analysis module, used to analyze the benefit function of the power load control terminal according to the constraint mechanism of feasible contracts, and obtain the contract constraint conditions; and a calculation module, used to calculate the expression of the optimal reward allocated to the power load control terminal by the edge server according to the contract constraint conditions and the energy compensation of the power load control terminal by the source load storage resources. The optimal contract item acquisition module includes: an induction module for inductively ...
6. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the edge collaborative learning method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the edge collaborative learning method as described in any one of claims 1 to 4.