A federated learning method and system for regional distributed power generation prediction
By employing federated learning and Bayesian game theory algorithms, the security and efficiency issues of data trading in regional distributed generation forecasting were addressed. This enabled efficient sharing and secure interaction of distributed power source data, incentivized data-providing nodes to participate, and promoted the sustainable use of data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHEAST UNIV
- Filing Date
- 2023-06-21
- Publication Date
- 2026-04-28
AI Technical Summary
In regional distributed generation forecasting, how can we achieve secure and efficient trading of historical distributed generation datasets, increase the enthusiasm of various data users to provide real data, and solve the centralization risks and privacy issues in data exchange?
By employing a federated learning approach, a distributed power data interaction center is constructed through data partitioning, cost calculation, and parameter training steps. The training cost is calculated using privacy cost, computational cost, and data cost. The reward is allocated using Shapley value, and the data supply nodes are incentivized and securely shared by combining Bayesian game theory and Fedavg algorithms.
It improves data utilization efficiency and economic benefits, ensures data privacy and security, and promotes the sharing and sustainable development of distributed power data.
Smart Images

Figure CN116720574B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power forecasting technology, specifically to a federated learning method and system for regional distributed generation forecasting. Background Technology
[0002] In the process of regional distributed generation forecasting, historical datasets are a crucial data resource for prediction and optimization. However, data protection and privacy issues have always been bottlenecks in data exchange. Currently, the conventional method for data exchange is through centralized data centers. However, this regional approach carries risks of centralization and data privacy concerns. How to achieve secure and efficient trading of historical datasets for distributed generation and how to increase the incentive for data users to provide authentic data are problems that need to be addressed. Summary of the Invention
[0003] (a) Technical problems to be solved
[0004] To address the shortcomings of existing technologies, this invention provides a federated learning method and system for regional distributed generation prediction, solving the problems of how to achieve secure and efficient trading of historical datasets of distributed generation and increasing the enthusiasm of various data users to provide real data.
[0005] (II) Technical Solution
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] Firstly, a federated learning method for regional distributed generation prediction is provided, comprising the following steps:
[0008] The data partitioning step involves constructing federated learning initialization model nodes based on the partitioned data demand nodes and data supply nodes. The data demand nodes and data supply nodes are partitioned centrally according to demand data or supply data based on the historical dataset of each distributed generation node.
[0009] The cost calculation steps are as follows: calculate the data training cost of the data supply node, and determine whether the data supply node participates in the data interaction: if the data training cost is less than the data training portion of the reward provided by the demand node, then the data supply node participates in the data interaction; if the data training cost is greater than the data training portion of the reward provided by the demand node, then the data supply node does not participate in the data interaction.
[0010] The parameter training step involves uploading the gradient parameters of the data supply node to the data interaction node for training, and then uploading the trained gradient parameters to the local gradient request node.
[0011] Preferably, the node that issues the data demand notification is called the data demand node, and the remaining regions are called data supply nodes. The N data supply nodes can be represented as P = {P1, P2, ..., P...} n The M data demand nodes can be represented as R = {R1, R2, ..., R}. m The data includes, but is not limited to, training costs, rewards received, and data on temperature, light, air humidity, and output.
[0012] Preferably, the data training cost of the data supply node consists of privacy cost, computation cost, and data cost. The computation cost is used to calculate the resources consumed by the model itself during training; the privacy cost is used to calculate the cost of reducing the additional leakage of privacy information when the local model is uploaded, and by using different gradient parameters, the risk of privacy leakage can be reduced to the greatest extent; the data cost is the cost incurred when acquiring local data from different regions; the training cost is obtained by quantifying the privacy cost, computation cost, and data cost.
[0013] Preferably, the steps for calculating the training cost are as follows:
[0014] The calculation cost is expressed as follows:
[0015] C unit (P i )=αζc i s i f i 2
[0016] Where α is the cost control factor, ζ is the cost incurred in acquiring data, and c i s represents the number of CPU cycles required for the i-th round of data processing; i Let f be the sample size for the i-th iteration. i CPU clock frequency;
[0017] The gradient parameters after differential privacy processing are expressed as follows:
[0018]
[0019] Where μ and b represent the location and scale parameters of the distribution in Laplace, Δf represents the local noise sensitivity, and ∈ is the differential privacy budget;
[0020]
[0021] In the calculation of privacy costs, the privacy budget i is the primary reference.
[0022] After quantifying the aforementioned privacy and computation costs, and adding the data costs, we obtain the final training cost; the training cost is expressed as:
[0023]
[0024] Preferably, the parameter training step specifically includes:
[0025] During the first round of data interaction, each node uses an LSTM neural network to train on the local data, generates and uploads local model parameters, and the trained model parameters are as follows:
[0026]
[0027] Where w k,t The weights of the neurons at node k after t rounds of training with the LSTM neural network are referred to as model parameters. For gradient descent during training, η is the learning rate during the training of the Lstm neural network;
[0028] The global model parameters w are obtained using the Fedavg algorithm. G,t The Fedavg algorithm generates the global model parameters w in the t-th round. G,t The formula is as follows:
[0029]
[0030] Where n is the total number of all participating data supply nodes; K is the number of nodes selected.
[0031] After receiving the gradient parameters, the data request node R i Payment of Remuneration B i Through Shapley value The contribution of the data supply node to the data interaction in the r-th round of the federated learning model, v(P) i r (to distribute compensation) Incentivize data supply. Simultaneously, penalize data supply nodes that repeatedly have a contribution rate less than 0 by prohibiting them from participating in transactions.
[0032] Preferably, the data demand node allocates the data supply utility of the data supply node according to the Shapley value. During the federated learning training process, P i It has the right to participate in and withdraw from data supply at any time, and the cumulative utility of each round of supply ultimately reaches the data supply node P. i Shapley value when participating in federal learning Distribution, allocating transaction rewards according to their contribution value. The calculation formula is:
[0033]
[0034]
[0035]
[0036] in, It is a subset of the nodes participating in data supply in the r-th round, i.e. S represents r P-free i The set of data supply nodes, where N is the number of data supply nodes, v(P) i r ) is the data supply node P i The contribution of each node to the model performance improvement in the r-th training round after participation in training, where k1 and k2 are the time and accuracy weight parameters of each distributed node, respectively. For P i The rth round of training time, The average training time for all data in round r to supply nodes in round r is Provide the average data standard deviation of all data nodes in the r-th round. For P i The mean squared error of the training data in the rth round, k1<0 indicates that the training time of each distributed region data should be short, and k2<0 indicates that the mean squared error of each distributed region data should also be low.
[0037] If the data is supplied to node P i If the contribution to the improvement in model performance is 0, then its ξ i If the contribution of a data supply node to improving model performance is negative, it can pay a certain reward to obtain higher quality model parameters and complete the update of its own parameters. After each round of transactions, the contribution of each data supply node is recorded. If any data supply node has a negative contribution three times in a row, it is determined that it provides false data and is prohibited from participating in all remaining rounds of data interaction, thereby incentivizing data supply nodes to provide real data.
[0038] Preferably, during the training step, the action strategy is represented as follows: For the number of iterations, Training costs, training costs The strategy selection is The optimal solution for the number of iterations and action strategy is obtained by playing a game of controlling the number of iterations until the parameter training step is completed.
[0039] In action strategy Bayesian game theory is defined as follows: Where P represents the data supply node P i Ω represents the state space, specifically representing P. i Training cost C cos (Pi ), Indicates the action strategy of the data supply node μ represents the data supply node P. i choose The prior probability at time P, the utility function ≥ , represents the action preference; i In P BG By referring to P i In addition to other data supply nodes μ, the action strategy can be optimized. Thus, the Bayesian Nash equilibrium can be solved. To obtain the optimal solution for the action strategy of the data supply nodes and maximize the sum of the utilities of each region.
[0040] Preferably, when solving for the Bayesian Nash equilibrium solution of the optimal action strategy, the following constraints should be satisfied:
[0041] Only when P i ∈P and satisfy At that time, all action strategies involved in federated learning It is a Bayesian Nash equilibrium solution in the game:
[0042]
[0043] Where, P\{P i} indicates that the data supply node does not contain P. i The set, This indicates that at data supply node P i Other data supply nodes P\{P i When performing Bayesian games, P i The expected benefits;
[0044] Only when the reward function satisfy The game can reach a Nash equilibrium. in The action strategy is to The probability, Indicates when the action strategy is The costs incurred during this time;
[0045] In solving for the optimal action strategy for each distributed region, the profit that each data supply node Pi should obtain during r rounds of training is represented as... Training cost is The total revenue of the data demand node is Therefore, the problem of maximizing the total revenue of each region can be expressed as: Cost constraints are expressed as
[0046]
[0047]
[0048]
[0049] The problem of maximizing the total revenue in each region is constructed using the Lagrange multiplication method, with the function being:
[0050]
[0051] According to the Lagrange multiplication formula, the function... The first-order partial derivatives of λ and λ respectively yield:
[0052]
[0053] get optimal solution for:
[0054]
[0055]
[0056] When the training strategy of the data supply node is At this point, the sum of the revenue supplied by the distributed data supply nodes is maximized, and the training strategy is inconvenient, so a Nash equilibrium state is taken. At this time, by using a method based on... The convex function properties are proven;
[0057] According to the Slater condition, maximizing total payoff satisfies the strong duality condition, which in turn satisfies... in for The Lagerlän saddle point, at the same time The KKT conditions under the constraint of maximizing total regional revenue are:
[0058]
[0059]
[0060]
[0061] Secondly, a federated learning system for regional distributed generation prediction is provided, comprising the following modules:
[0062] The data partitioning module is used to construct federated learning initialization model nodes based on the partitioned data demand nodes and data supply nodes. The data demand nodes and data supply nodes are partitioned centrally according to demand data or supply data based on the historical dataset of each distributed generation node.
[0063] The cost calculation module is used to calculate the data training cost of the data supply node and determine whether the data supply node participates in the data interaction: if the data training cost is less than the data training portion of the reward provided by the demand node, the data supply node participates in the data interaction; if the data training cost is greater than the data training portion of the reward provided by the demand node, the data supply node does not participate in the data interaction.
[0064] The parameter training module is used to upload the gradient parameters of the data supply nodes participating in data interaction and train them, and then upload the trained gradient parameters to the local gradient request nodes.
[0065] Thirdly, a computing device is provided, comprising:
[0066] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for performing any of the methods described.
[0067] (III) Beneficial Effects
[0068] This invention presents a federated learning method and system for regional distributed generation forecasting. By constructing a distributed generation data exchange center, it enables the interaction and sharing of historical data from distributed generation sources, thereby improving data utilization efficiency and economic benefits. Simultaneously, the use of a federated learning model and a Bayesian game algorithm ensures data privacy and security, improving the efficiency and accuracy of data interaction. Furthermore, the allocation of data interaction rewards incentivizes data-providing nodes to participate in data interaction, promoting the sharing and sustainable development of distributed generation data. Attached Figure Description
[0069] Figure 1 This is a schematic diagram of the federated learning method for regional distributed generation prediction according to the present invention. Detailed Implementation
[0070] The technical solutions in the embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0071] Example
[0072] like Figure 1 As shown, this embodiment of the invention provides a federated learning method for regional distributed generation prediction, including the following steps:
[0073] The data partitioning step involves constructing federated learning initialization model nodes based on the partitioned data demand nodes and data supply nodes. The data demand nodes and data supply nodes are partitioned based on the historical datasets of each distributed power generation node according to demand data or supply data. Several distributed power generation nodes are constructed based on the scenario of incomplete information. Each node has its own dataset and the data is not transparent. Its data includes, but is not limited to, training costs, rewards obtained, and local data such as temperature, light intensity, air humidity, and power output data.
[0074] The cost calculation steps are as follows: calculate the data training cost of the data supply node, and determine whether the data supply node participates in the data interaction: if the data training cost is less than the data training portion of the reward provided by the demand node, then the data supply node participates in the data interaction; if the data training cost is greater than the data training portion of the reward provided by the demand node, then the data supply node does not participate in the data interaction.
[0075] The parameter training step involves uploading the gradient parameters of the data supply nodes participating in data interaction and training them. The trained gradient parameters are then uploaded to the local gradient request nodes. The Shapley value is used to measure the contribution of each data supply node to the model performance improvement, and utility is allocated based on the Shapley value to incentivize each data supply node to provide data. When the contribution of a data supply node is negative, it can pay a certain reward in exchange for higher quality model parameters to update its own parameters. Local training at each data supply node uses the Nd-Lstm neural network algorithm. After receiving the gradient parameters fitted by the Nd-Fedavg algorithm, the Nd-Lstm neural network algorithm performs distributed prediction based on the Lstm neural network algorithm. During the data interaction process in federated learning, a Bayesian optimization algorithm is used to solve for the optimal number of iterations of the federated learning model based on the cost function, maximizing the sum of net utilities in each region. The optimality of the interaction rounds is proven through the Slater and KKT conditions. During training, the number of interactions of local parameters is determined using a Bayesian optimization algorithm to obtain the optimal data interaction rounds, maximizing the net comprehensive utility of each data supply node. The optimality of the data interaction rounds is also proven through the Slater and KKT conditions.
[0076] Furthermore, the node that issues the data demand notification is called the data demand node, and the remaining regions are called data supply nodes. The N data supply nodes can be represented as P = {P1, P2, ..., P...} n The M data demand nodes can be represented as R = {R1, R2, ..., R}. m The data includes, but is not limited to, training costs, rewards received, and data on temperature, light, air humidity, and output.
[0077] Furthermore, the data training cost of a data supply node consists of privacy cost, computational cost, and data cost. Computational cost is used to calculate the resources consumed by the model itself during training; privacy cost is used to calculate the cost of reducing the additional leakage of privacy information during local model uploads, achieved by using different gradient parameters to minimize the risk of privacy leakage; data cost is the cost incurred when acquiring local data from different regions. The training cost is obtained by quantifying privacy cost, computational cost, and data cost. Specifically, the computational cost of the data supply node is represented by the training cost C. cos (P i This indicates that its unit cost C is calculated. unit (P i Privacy Costs C pr and data cost C da The training cost C is obtained by quantifying the three parts. cos (P i The unit calculation cost C unit (P i ) represents the computing resources (memory, CPU, GPU, etc.) used during local iteration; privacy cost C pr The cost incurred to enhance data privacy during data interaction; data cost refers to the cost incurred when acquiring local data in different regions, including equipment procurement costs, data processing costs, etc.; in federated learning, each node is based on the aforementioned training cost C. cos (P i Decide whether to participate in data interaction.
[0078] Furthermore, the calculation steps for the training cost are as follows:
[0079] The calculation cost is expressed as follows:
[0080] C unit (P i )=αζc i s i f i 2
[0081] Where α is the cost control factor, ζ is the cost incurred in acquiring data, and c i s represents the number of CPU cycles required for the i-th round of data processing; i Let f be the sample size for the i-th iteration. i CPU clock frequency;
[0082] The gradient parameters after differential privacy processing are expressed as follows:
[0083]
[0084] Where μ and b represent the location and scale parameters of the distribution in Laplace, Δf represents the local noise sensitivity, and ∈ is the differential privacy budget;
[0085]
[0086] In the calculation of privacy costs, the privacy budget i is the primary reference.
[0087] After quantifying the aforementioned privacy and computation costs, and adding the data costs, we obtain the final training cost; the training cost is expressed as:
[0088]
[0089] Furthermore, the parameter training step specifically includes:
[0090] During the first round of data interaction, each node uses an LSTM neural network to train on the local data, generates and uploads local model parameters, and the trained model parameters are as follows:
[0091]
[0092] Where w k,t The weights of the neurons at node k after t rounds of training with the LSTM neural network are referred to as model parameters. For gradient descent during training, η is the learning rate during the training of the Lstm neural network;
[0093] The global model parameters w are obtained using the Fedavg algorithm. G,t The Fedavg algorithm generates the global model parameters w in the t-th round. G,t The formula is as follows:
[0094]
[0095] Where n is the total number of all participating data supply nodes; K is the number of nodes selected.
[0096] After receiving the gradient parameters, the data request node R i Payment of Remuneration B i Through Shapley value The contribution of the data supply node to the data interaction in the r-th round of the federated learning model, v(P) i r (to distribute compensation) Incentivize data supply. Simultaneously, penalize data supply nodes that repeatedly have a contribution rate less than 0 by prohibiting them from participating in transactions.
[0097] Furthermore, the data demand node allocates the data supply utility of the data supply node according to the Shapley value. During the federated learning training process, P... i It has the right to participate in and withdraw from data supply at any time, and the revenue from each round of supply ultimately accumulates to the data supply node P. i Shapley value when participating in federal learning Distribution, allocating transaction rewards according to their contribution value. The calculation formula is:
[0098]
[0099]
[0100]
[0101] in, It is a subset of the nodes participating in data supply in the r-th round, i.e. S represents r P-free i The set of data supply nodes, where N is the number of data supply nodes, v(P) i r ) is the data supply node P i The contribution of each node to the model performance improvement in the r-th training round after participation in training, where k1 and k2 are the time and accuracy weight parameters of each distributed node, respectively. For P i The rth round of training time, The average training time for all data in round r to supply nodes in round r is Provide the average data standard deviation of all data nodes in the r-th round. For P i The mean squared error of the training data in the rth round, k1<0 indicates that the training time of each distributed region data should be short, and k2<0 indicates that the mean squared error of each distributed region data should also be low.
[0102] If the data is supplied to node P i If the contribution to the improvement in model performance is 0, then its ξ i If the contribution of a data supply node to improving model performance is negative, it can pay a certain reward to obtain higher quality model parameters and complete the update of its own parameters. After each round of transactions, the contribution of each data supply node is recorded. If any data supply node has a negative contribution three times in a row, it is determined that it provides false data and is prohibited from participating in all remaining rounds of data interaction, thereby incentivizing data supply nodes to provide real data.
[0103] Furthermore, during the training steps, the action strategy is represented as follows: For the number of iterations, Training costs, training costs The strategy selection is The optimal solution for the number of iterations and action strategy is obtained by playing a game of controlling the number of iterations until the parameter training step is completed.
[0104] In action strategy Bayesian game theory is defined as follows: Where P represents the data supply node P i Ω represents the state space, specifically representing P. i Training cost C cos (P i ), Indicates the action strategy of the data supply node μ represents the data supply node P. i choose The prior probability at time P, the utility function ≥ , represents the action preference; i In P BG By referring to P i In addition to other data supply nodes μ, the action strategy can be optimized. Thus, the Bayesian Nash equilibrium can be solved. To obtain the optimal solution for the action strategy of the data supply nodes and maximize the sum of the utilities of each region.
[0105] Furthermore, when solving for the Bayesian Nash equilibrium solution of the optimal action strategy, the following constraints should be satisfied:
[0106] Only when P i ∈P and satisfy At that time, all action strategies involved in federated learning It is a Bayesian Nash equilibrium solution in the game:
[0107]
[0108] Where, P\{P i} indicates that the data supply node does not contain P. i The set, This indicates that at data supply node P i Other data supply nodes P\{P i When performing Bayesian games, P i The expected benefits;
[0109] Only when the reward function satisfy The game can reach a Nash equilibrium. in The action strategy is to The probability, Indicates when the action strategy is The costs incurred during this time;
[0110] In the process of solving the optimal action strategy for each distributed region, each data is supplied to node P. i The utility that should be obtained during r rounds of training is represented as: Training cost is The total utility of the data demand node is Therefore, the problem of maximizing total utility in each region can be expressed as: Cost constraints are expressed as
[0111]
[0112]
[0113]
[0114] The problem of maximizing total utility in each region is constructed using the Lagrange multiplication method, with the function being:
[0115]
[0116] According to the Lagrange multiplication formula, the function... The first-order partial derivatives of λ and λ respectively yield:
[0117]
[0118] get optimal solution for:
[0119]
[0120]
[0121] When the training strategy of the data supply node is At this point, the sum of the revenue supplied by the distributed data supply nodes is maximized, and the training strategy is inconvenient, so a Nash equilibrium state is taken. At this time, by using a method based on... The convex function properties are proven;
[0122] According to the Slater condition, maximizing total payoff satisfies the strong duality condition, which in turn satisfies... in for The Lagerlän saddle point, at the same time The KKT conditions under the constraint of maximizing total regional revenue are:
[0123]
[0124]
[0125]
[0126] It can be proven that in λ * ≠0 condition It can satisfy the following simultaneously:
[0127]
[0128]
[0129]
[0130] From this we can obtain for If the Lagrange saddle point is a Nash equilibrium solution of the Bayesian optimization algorithm, then it is also a solution of the Bayesian optimization algorithm.
[0131] Another embodiment of the present invention provides a federated learning system for regional distributed generation prediction, comprising the following modules:
[0132] The data partitioning module is used to construct federated learning initialization model nodes based on the partitioned data demand nodes and data supply nodes. The data demand nodes and data supply nodes are partitioned centrally according to demand data or supply data based on the historical dataset of each distributed generation node.
[0133] The cost calculation module is used to calculate the data training cost of the data supply node and determine whether the data supply node participates in the data interaction: if the data training cost is less than the data training portion of the reward provided by the demand node, the data supply node participates in the data interaction; if the data training cost is greater than the data training portion of the reward provided by the demand node, the data supply node does not participate in the data interaction.
[0134] The parameter training module is used to upload the gradient parameters of the data supply nodes participating in data interaction and train them, and then upload the trained gradient parameters to the local gradient request nodes.
[0135] Embodiments of this application may be provided as methods or computer program products. Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application may be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0136] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0138] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0139] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A federated learning method for regional distributed generation prediction, characterized in that, Includes the following steps: The data partitioning step involves constructing federated learning initialization model nodes based on the partitioned data demand nodes and data supply nodes. The data demand nodes and data supply nodes are partitioned centrally according to demand data or supply data based on the historical dataset of each distributed generation node. The cost calculation steps are as follows: calculate the data training cost of the data supply node, and determine whether the data supply node participates in the data interaction: if the data training cost is less than the data training portion of the reward provided by the demand node, then the data supply node participates in the data interaction; if the data training cost is greater than the data training portion of the reward provided by the demand node, then the data supply node does not participate in the data interaction. The parameter training step involves uploading the gradient parameters of the data supply node to the data interaction node and training them. The trained gradient parameters are then uploaded to the local gradient-requiring node. The node that issues the data demand notification is called the data demand node, and the remaining regions are called data supply nodes. The N data supply nodes are represented as P = {P1, P2, ..., P...} n The M data requirement nodes are represented as R = {R1, R2, ..., R}. m The data includes, but is not limited to, training costs, rewards received, and data on temperature, light intensity, air humidity, and output. The data training cost of a data supply node consists of privacy cost, computation cost, and data cost. The computation cost is used to calculate the resources consumed by the model itself during training; the privacy cost is used to calculate the cost of reducing the additional leakage of privacy information when the local model is uploaded, and by using different gradient parameters, the risk of privacy leakage can be reduced to the greatest extent; the data cost is the cost incurred when acquiring local data from different regions; the training cost is obtained by quantifying the privacy cost, computation cost, and data cost. The steps for calculating the training cost are as follows: The calculation cost is expressed as follows: in, As a cost control factor, The cost incurred in the process of acquiring data, Let be the CPU cycles required for the i-th round of data processing; Let be the sample size for the i-th iteration. CPU clock frequency; The gradient parameters after differential privacy processing are expressed as follows: in, This represents the location and scale parameters of the distribution in Laplace. Indicates local sensitivity to noise. It is differential privacy budget; Privacy costs are calculated with reference to the privacy budget. i ; After quantifying the privacy cost and computational cost, and adding the data cost, we obtain the final training cost; the training cost is expressed as: The parameter training steps specifically include: During the first round of data interaction, each node uses an LSTM neural network to train on the local data, generates and uploads local model parameters, and the trained model parameters are as follows: in For nodes After training with an LSTM neural network The neuron weights after each round, or simply model parameters, For gradient descent during training, The learning rate during the training of the Lstm neural network; Global model parameters are obtained using the Fedavg algorithm. The Fedavg algorithm generates the first Round global model parameters The formula is as follows: Where n is the total number of all participating data supply nodes; K is the number of nodes selected. After receiving the gradient parameters, the data request node R i Payment of remuneration B i Through Shapley value Contribution of data supply nodes to the r-th round of data interaction in the federated learning model Distribute compensation This incentivizes data supply; at the same time, data supply nodes with a contribution rate of less than 0 for multiple consecutive times are prohibited from participating in transactions.
2. The federated learning method for regional distributed generation prediction according to claim 1, characterized in that: The data demand node allocates data supply utility to the data supply node based on the Shapley value during the federated learning training process. They have the right to participate in and withdraw from data supply at any time, and the rewards for each round ultimately accumulate to the data supply nodes. Shapley value when participating in federal learning Distribution, allocating transaction rewards according to their contribution value. The calculation formula is: in, It is a subset of the nodes participating in data supply in the r-th round, i.e. express Not included The set of data supply nodes, where N is the number of data supply nodes. For data supply nodes The contribution of participating in training to the improvement of model performance in the r-th training round, among which These are the time and accuracy weight parameters for each distributed node. for The rth round of training time, The average time for training nodes to provide all data in round r. Provide the average data standard deviation of all data nodes in the r-th round. for The mean squared error of the data in the r-th training round This indicates that shorter training times are preferable for data in each distributed region. This indicates that a lower mean square error is preferred for data in each distributed region. If the data supply node If the contribution to the improvement of model performance is 0, then its If the contribution of a data supply node to improving model performance is negative, it can pay a certain reward to obtain higher quality model parameters and complete the update of its own parameters. After each round of transactions, the contribution of each data supply node is recorded. If any data supply node has a negative contribution three times in a row, it is determined that it provides false data and is prohibited from participating in all remaining rounds of data interaction, thereby incentivizing data supply nodes to provide real data.
3. The federated learning method for regional distributed generation prediction according to claim 2, characterized in that: During the training process, the action strategy is represented as follows: , For the number of iterations, Training costs, training costs The strategy selection is The optimal solution for the number of iterations and action strategy is obtained by playing a game of controlling the number of iterations until the parameter training step ends. In action strategy Bayesian game theory is defined as follows: Where P represents the data supply node P i Ω represents the state space, specifically representing P i Training costs , Indicates the action strategy of the data supply node , Indicates data supply node P i choose The prior probability at that time, Action preferences of nodes; exist China through reference Other data supply nodes To achieve optimized action strategies Thus, the Bayesian Nash equilibrium can be solved. In order to obtain the optimal solution for the action strategy of the data supply nodes and maximize the sum of the utilities of each region.
4. The federated learning method for regional distributed generation prediction according to claim 3, characterized in that: When solving for the Bayesian Nash equilibrium of the optimal action strategy, the following constraints should be satisfied: Only when and satisfy At that time, all action strategies involved in federated learning It is a Bayesian Nash equilibrium solution in the game: in, This indicates that the data supply nodes do not contain The set, This indicates the data supply node. Other data supply nodes When performing Bayesian game theory, The expected benefits; Only when the reward function satisfy The game can reach a Nash equilibrium. ,in The action strategy is to The probability, Indicates when the action strategy is The costs incurred during the process; In the process of finding the optimal action strategy for each distributed region, data is supplied to the nodes. The utility that should be obtained during r rounds of training is represented as: The training cost is The total utility of the data demand node is Therefore, the problem of maximizing total utility in each region can be expressed as: , Cost constraints are expressed as: The problem of maximizing total utility in each region is constructed using the Lagrange multiplication method, with the function being: : According to the Lagrange multiplication formula, the function... and We can obtain the following from the first-order partial derivatives: get optimal solution for: When the training strategy of the data supply node is At this point, the sum of the revenue supplied by the distributed data supply nodes is maximized and the training strategy remains unchanged, reaching a Nash equilibrium state. Then, based on... The convex function properties are proven; According to the Slater condition, maximizing total payoff satisfies the strong duality condition, which in turn satisfies... ,in for The Lagrange saddle point, at the same time The KKT conditions under the constraint of maximizing total regional revenue are: 。 5. A federated learning system for regional distributed generation prediction, characterized in that, The system is used to implement the federated learning method for regional distributed generation prediction as described in claim 4, and the system includes the following modules: The data partitioning module is used to construct federated learning initialization model nodes based on the partitioned data demand nodes and data supply nodes. The data demand nodes and data supply nodes are partitioned centrally according to demand data or supply data based on the historical dataset of each distributed generation node. The cost calculation module is used to calculate the data training cost of the data supply node and determine whether the data supply node participates in the data interaction: if the data training cost is less than the data training portion of the reward provided by the demand node, the data supply node participates in the data interaction; if the data training cost is greater than the data training portion of the reward provided by the demand node, the data supply node does not participate in the data interaction. The parameter training module is used to upload the gradient parameters of the data supply nodes participating in data interaction and train them, and then upload the trained gradient parameters to the local gradient request nodes.
6. A computing device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing any of the methods according to claims 1-4.
Citation Information
Patent Citations
Federated learning reliability evaluation method and device for electric energy data
CN112732470A