A hierarchical federated learning method, apparatus, device, and storage medium for electricity data
By using hierarchical federated learning and blockchain technology, we have optimized asynchronous training and reward mechanisms, solved the problem of low participant motivation in electricity consumption data analysis scenarios, and improved the efficiency of electricity consumption data model training.
Patent Information
- Application Number
- CN202411427613.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In electricity consumption data analysis scenarios, there is a lack of mutual trust among participants. Existing federated learning frameworks suffer from problems such as high time overhead for synchronous aggregation and inapplicable reward mechanisms, resulting in poor participant motivation.
A hierarchical federated learning approach is adopted, which involves asynchronous training and local aggregation through home energy management systems and load integrators. Combined with blockchain technology, a master-slave game model is established to distribute rewards, evaluate the contributions of participants, and set the optimal reward coefficient.
Asynchronous aggregation between load integrators was achieved, reducing training time overhead, increasing participant motivation, reducing the number of lazy clients, and improving the efficiency of electricity data model training.
Smart Images

Figure CN119443307B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated learning technology, and in particular to a method, apparatus, device and storage medium for hierarchical federated learning of electricity data. Background Technology
[0002] With the accelerated pace of smart grid construction, electricity information collection systems, represented by smart meters, collect and generate a large amount of user electricity consumption data every day. This data can be used to train machine learning models to meet the application needs of smart grid intelligent analysis, help the power grid formulate power generation plans, implement precise scheduling, and ensure the stable operation of the power system.
[0003] However, electricity consumption data contains user privacy or corporate confidential information, and the direct use of user data is strictly limited under privacy protection constraints. Furthermore, because electricity consumption data collection terminals are scattered in different locations, and the collected data belongs to different organizations, user data mining and analysis also face the problem of data silos. Federated learning technology can enable model training using user data without leaving the local device, solving the privacy protection and data silo problems faced by user data analysis. However, in electricity consumption data analysis scenarios, participating entities usually belong to different operators and lack mutual trust. Existing research has proposed using blockchain to solve the trust problem in federated learning, but it still has the following shortcomings:
[0004] 1. Existing blockchain-based federated learning frameworks use synchronous aggregation. Due to the different computing capabilities and communication conditions among the participants in the electricity data analysis scenario, the training time of local models varies, resulting in a large time overhead for synchronous aggregation.
[0005] 2. Existing reward mechanisms for federated learning typically use a single factor to evaluate node performance, resulting in incomplete evaluation metrics. The reward strategies are not specific, only providing reward allocation strategies for federated learning participants without considering the strategies and benefits of the task issuer (reward allocator). Therefore, the reward format is not suitable for electricity consumption data analysis scenarios.
[0006] There is currently no effective solution to the problem of low participant engagement in existing related technologies. Summary of the Invention
[0007] This invention provides a hierarchical federated learning method, apparatus, device, and storage medium for electricity data, which addresses the shortcomings of poor participant engagement in existing technologies.
[0008] In a first aspect, the present invention provides a hierarchical federated learning method for electricity consumption data, comprising:
[0009] Participants acquire initial model parameters and begin training based on these parameters; the participants include home energy management systems and load integrators.
[0010] The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates the local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding region.
[0011] The load aggregator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, and then sends the local aggregation parameters to the corresponding regional home energy management system and uploads them to the blockchain.
[0012] The power distribution system operator performs global aggregation based on the local aggregation parameters to obtain global aggregation parameters, and distributes rewards to the participants based on the current global aggregation parameters;
[0013] The load aggregator updates the parameters based on the current global aggregation parameters.
[0014] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, the load aggregator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, including:
[0015] Determine the local model parameter weights and the global model parameter weights; the sum of the local model parameter weights and the global model parameter weights is 1;
[0016] Based on the proportion of the current home energy management system to all participating home energy management systems, local aggregation parameters are determined.
[0017] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, rewards are distributed to the participants based on the current global aggregation parameters, including:
[0018] Based on the current global aggregation parameters and the training effect and training cost of the participants, the contribution of the participants is evaluated, and the set of participants to participate in the reward distribution is determined according to the evaluation results.
[0019] Establish a master-slave game model, and determine the optimal reward coefficient for maximizing the utility of each participant based on the master-slave game model;
[0020] Based on the optimal reward coefficient, a reward is allocated to each participant in the participant set.
[0021] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, based on the current global aggregation parameters and the training effect and training cost of the participants, the contribution of the participants is evaluated, and the set of participants participating in reward allocation is determined according to the evaluation results, including:
[0022] The training performance of each participant is evaluated based on the current global model parameters;
[0023] The training cost of the participant is determined based on the size of the dataset of the local data used for training.
[0024] The contribution of each participant is determined by combining the training effectiveness and training cost.
[0025] The contributions of the participants are normalized, and the participants are ranked based on the normalized contributions to determine the participant set.
[0026] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, a master-slave game model is established, and the optimal reward coefficient for maximizing the utility of each participant is determined based on the master-slave game model, including:
[0027] A master-slave game model is established; in the master-slave game model, the power distribution system operator is the reward budget allocator, the load integrator is the leader, and the home energy management system is the follower.
[0028] Determine the training costs of the home energy management system and the load integrator; the training costs include energy consumption for local training and communication costs for model parameter transmission;
[0029] An evaluation function is set based on the deviation between the local model parameters and the global model parameters;
[0030] The utility functions of the home energy management system and the load integrator are determined based on the valuation function.
[0031] Based on the master-slave game model, a game strategy is formulated between the home energy management system and the load integrator, and the utility functions of the home energy management system and the load integrator are maximized.
[0032] An initial value for the reward coefficient is set, and the reward coefficient is adjusted and updated based on the training cost and the evaluation function until the training cost and the evaluation function meet a preset termination condition. The current reward coefficient is then taken as the optimal reward coefficient.
[0033] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, a reward allocation is performed for each participant in the participant set, incorporating the optimal reward coefficient, including:
[0034] The reward allocated to the home energy management system in the participant set is determined based on the total amount of rewards provided by the power distribution system operator and the sum of the participants' contributions.
[0035] The corresponding reward allocated to the load integrator is determined based on the reward allocated to the home energy management system.
[0036] According to the hierarchical federated learning method for electricity consumption data provided by the present invention, the rewards allocated to the home energy management system and the load integrator meet the pre-set reward mechanism.
[0037] Secondly, the present invention also provides a power data hierarchical federated learning device, comprising:
[0038] A training module is used to provide participants with initial model parameters and to begin training based on these initial model parameters; the participants include home energy management systems and load integrators;
[0039] The data acquisition module is used to provide real-time electricity consumption data to the home energy management system, perform local training based on the real-time electricity consumption data, update the local model parameters of the home energy management system, and submit the local model parameters to the load integrator in the corresponding region.
[0040] The local aggregation module is used to asynchronously aggregate local parameters based on the local model parameters and the current global model parameters to obtain local aggregation parameters, and then distribute the local aggregation parameters to the home energy management system of the corresponding region and upload them to the blockchain.
[0041] The global aggregation module is used to perform global aggregation based on the local aggregation parameters to obtain global aggregation parameters, and to distribute rewards to the participants based on the current global aggregation parameters;
[0042] The update module is used to update the parameters of the load integrator based on the current global aggregation parameters.
[0043] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the electricity data hierarchical federated learning method as described in the first aspect above.
[0044] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the electricity data hierarchical federated learning method as described in the first aspect above.
[0045] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the electricity data hierarchical federated learning method as described in the first aspect above.
[0046] Compared with the prior art, the present invention has the following beneficial effects:
[0047] The electricity consumption data hierarchical federated learning method provided by this invention realizes asynchronous aggregation between load integrators through a blockchain-based hierarchical framework design, reducing the time overhead required for training. Moreover, it rewards each participant, reducing the number of lazy clients and improving the overall efficiency of federated learning. It solves the problem of poor participant motivation in existing related technologies and achieves efficient electricity consumption data model training results. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0049] Figure 1 This is a flowchart of the hierarchical federated learning method for electricity consumption data provided by the present invention;
[0050] Figure 2 This is a schematic diagram of the blockchain-based hierarchical federated learning framework in this invention;
[0051] Figure 3 This is a structural block diagram of the electricity data hierarchical federated learning device provided by the present invention;
[0052] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0054] This invention provides a hierarchical federated learning method for electricity consumption data. Figure 1 This is a flowchart of the hierarchical federated learning method for electricity consumption data provided by the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0055] Step S101: Participants obtain initial model parameters and begin training based on these parameters; participants include home energy management systems and load integrators.
[0056] Step S102: The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates the local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding region.
[0057] In step S103, the load aggregator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, sends the local aggregation parameters to the corresponding regional home energy management system, and uploads them to the blockchain.
[0058] In step S104, the power distribution system operator performs global aggregation based on local aggregation parameters to obtain global aggregation parameters, and distributes rewards to participants based on the current global aggregation parameters.
[0059] Step S105: The load aggregator updates the parameters based on the current global aggregation parameters.
[0060] For example, Figure 2 This is a schematic diagram of the blockchain-based hierarchical federated learning framework in this invention, as shown below. Figure 2 As shown, the set of load integrators (LA) is denoted as . Load integrator l The collection of Home Energy Management Systems (HEMS) within the jurisdiction is First, the federated learning task issuer distributes initial model parameters to each participant. Participants begin training based on the initial model parameters, i.e. , .in, This represents the local model parameters of the home energy management system. This represents the local aggregation parameters for the load aggregator. (Home energy management system) Continuously collect real-time electricity consumption data from users, construct a local dataset based on this data, and use this local dataset to train a Long Short-Term Memory (LSTM) network locally, continuously updating the local model parameters. The calculation formula is as follows:
[0061]
[0062] in, Indicates local model parameters, Indicates the learning rate. This represents the gradient of the local model parameters. Then, the home energy management system... Regularly update local model parameters Submitted to the load aggregator in the corresponding region Each load aggregator asynchronously aggregates local parameters based on its local model parameters and the current global model parameters to obtain locally aggregated parameters. These locally aggregated parameters are then distributed to the corresponding regional home energy management systems and uploaded to the blockchain for consensus by the blockchain committee. The distribution system operator (DSO) periodically retrieves parameter updates from the blockchain and performs global aggregation to obtain globally aggregated parameters. The global aggregation parameters are then distributed and broadcast across the blockchain. Furthermore, the power distribution system operator distributes rewards to participants based on the current global aggregation parameters. Finally, the load aggregator updates the parameters according to the current global aggregation parameters. It is worth noting that the above process only demonstrates the training process of federated learning once. In practical applications, the above process can be repeated for iterative training, and the number of training iterations can be set according to actual needs.
[0063] In this method, a blockchain-based hierarchical framework design enables asynchronous aggregation among load integrators, reducing the time overhead required for training. Furthermore, rewards are distributed to each participant, reducing the number of lazy clients and improving the overall efficiency of federated learning. This solves the problem of poor participant motivation in existing related technologies and achieves efficient training results for electricity consumption data models.
[0064] In some embodiments, step S103 involves the load aggregator asynchronously aggregating local parameters based on local model parameters and current global model parameters to obtain local aggregation parameters, including: determining the weights of local model parameters and global model parameters; ensuring that the sum of the weights of local model parameters and global model parameters is 1; and determining the local aggregation parameters based on the proportion of the current home energy management system to all home energy management systems participating in the training.
[0065] For example, the formula for calculating the local aggregation parameter is as follows:
[0066]
[0067] in, Represents local aggregation parameters. Indicates home energy management system The percentage of all home energy management systems participating in the training, For local model parameter weights, These are the global model parameter weights, and they satisfy... , M This indicates the total number of home energy management systems. i This indicates the serial number of the home energy management system.
[0068] Based on this embodiment, the formula for calculating the global aggregation parameter is as follows:
[0069]
[0070] in, This represents the global aggregation parameter. Indicates load integrator The proportion of all load integrators participating in training Represents local aggregation parameters. N This indicates the total number of load aggregators. l This indicates the serial number of the load integrator.
[0071] In some embodiments, step S104, which distributes rewards to participants based on the current global aggregation parameters, includes: evaluating the participants' contributions based on the current global aggregation parameters and the participants' training performance and training costs, and determining the set of participants to participate in the reward allocation based on the evaluation results; establishing a master-slave game model, and determining the optimal reward coefficient when each participant's utility is maximized based on the master-slave game model; and allocating rewards to each participant in the participant set based on the optimal reward coefficient.
[0072] For example, firstly, after each round of global aggregation, the power distribution system operator implements a reward mechanism. Based on the global model parameters and the model training effects and training costs uploaded by participants, the operator fairly evaluates the contributions of each participant, normalizes the evaluation results, and selects the set of household energy management systems to participate in the reward distribution based on the contribution ranking. Then, considering the distribution system operator as the reward budget allocator, the load aggregator as the leader, and the home energy management system as the follower, a master-slave game model is established. By maximizing the utility functions of the load aggregator and the home energy management system, the optimal reward coefficient is obtained. Finally, the home energy management system is integrated. The home energy management system calculates and distributes rewards. At the same time, rewards are calculated and allocated to the load integrators to which these home energy management systems belong. .
[0073] In this embodiment, the contribution of each participant is evaluated based on the current global aggregation parameters and the training effect and training cost of the participants. The set of participants to participate in the reward allocation is determined based on the evaluation results. This includes: evaluating the training effect of each participant based on the current global model parameters; determining the training cost of each participant based on the size of the local data dataset used by the participant for training; determining the contribution of each participant by combining the training effect and training cost; normalizing the contribution of each participant; and ranking the participants based on the normalized contribution to determine the set of participants.
[0074] Specifically, each load aggregator uses the global model parameters issued by the power distribution system operator to configure each participant. i The model training performance is evaluated using the following formula:
[0075]
[0076] in, j Indicates the round of contribution evaluation. Indicates the participants in the current round i The model training effect, Indicates the participants' HEMS in the current round. i Submitted model parameter vector, This represents the global model parameters obtained from aggregation in the current round. express and deviation, Let represent the inner product of the two. Then, calculate the training cost for each participant i in the j-th round of evaluation, using the following formula:
[0077]
[0078] in, cost ij Indicates training cost, h Represents the correlation coefficient. This indicates the size of the local dataset. A participant's contribution is related to two metrics: model training performance and training cost, as shown in the following formula:
[0079]
[0080] in, con ij Indicates contribution level. Indicates training effectiveness. cost ij This represents the training cost. To better reflect the magnitude of each participant's contribution, the contribution needs to be normalized by scaling the data to the same range. The calculation formula is as follows:
[0081]
[0082] in, con' ij This represents the normalized contribution. con max This represents the maximum contribution. con min This represents the minimum contribution. Finally, participants are ranked according to their contributions, and those with higher contributions will participate in the reward distribution. Assume the selected proportion of home energy management systems is... α , Then the set of home energy management systems participating in the reward distribution will be obtained. .
[0083] In this embodiment, a master-slave game model is established, and the optimal reward coefficient for maximizing the utility of each participant is determined based on the master-slave game model. This includes: establishing a master-slave game model; in the master-slave game model, the power distribution system operator acts as the reward budget allocator, the load integrator acts as the leader, and the home energy management system acts as the follower; determining the training costs of the home energy management system and the load integrator; the training costs include energy consumption for local training and communication costs for transmitting model parameters; setting an evaluation function based on the deviation between local model parameters and global model parameters; determining the utility functions of the home energy management system and the load integrator based on the evaluation function; formulating game strategies for the home energy management system and the load integrator based on the master-slave game model, and maximizing the utility functions of the home energy management system and the load integrator; setting an initial value for the reward coefficient, and adjusting and updating the reward coefficient based on the training cost and the evaluation function until the training cost and the evaluation function meet a preset termination condition, and taking the current reward coefficient as the optimal reward coefficient.
[0084] Specifically, a Stackelberg game model is established, with the power distribution system operator as the allocator of the reward budget, the load aggregator as the leader, and the home energy management system as the follower. Then, the HEMS (Heat, Energy, and Management System) of each home energy management system participant is calculated. i Training costs This includes energy consumption for local training. and communication costs for transmitting model parameters The specific calculation formula is as follows:
[0085]
[0086]
[0087]
[0088] in, Indicates participants HEMS i Training costs, Indicates energy consumption. Indicates communication cost, k These are hardware-related coefficients. This indicates the number of rounds the home energy management system undergoes local training. This represents the number of CPU rotations required to complete one iteration. Indicates participants i CPU frequency during local training Indicates the number of parameters submitted. This indicates the transmission rate when the home energy management system submits parameters to the load integrator. For transmission power. Then, calculate the leader LA. l Training costs This includes energy consumption for local computing. and energy consumption for transmitting model parameters The calculation formula is as follows:
[0089]
[0090]
[0091]
[0092] in, The leader LA l Training costs, This indicates the energy consumption used for local calculations. This represents the energy consumption used to transmit model parameters. These are hardware-related coefficients. This indicates the number of rounds in which the load aggregator performs global aggregation calculations. This represents the number of CPU rotations required to complete one global aggregation. This indicates the CPU frequency used by the load integrator during local training. This indicates the amount of parameters issued by the power distribution system operator. This indicates the amount of parameters from the home energy management system aggregated by the load integrator. This indicates the parameter transmission rate between the load integrator and the power distribution system operator. For transmission power. Then, define the estimation function. This represents the economic reward that participants can obtain. This represents the deviation between the local model parameters and the global model parameters. This evaluation function has a linearly increasing relationship with the model training effect provided by the participants, and is expressed as:
[0093]
[0094] in, It is a coefficient greater than 0. Then, based on the valuation function, the Home Energy Management System (HEMS) participants are defined. i The utility function is expressed as:
[0095]
[0096] The first item is the participants. i The second item is the participant's estimated reward. i Energy consumption and coefficients used for local training and uploading model parameters For the same order of magnitude of the preceding and following two items. Then, define the leader LA. l The utility function is expressed as:
[0097]
[0098] The first item is the reward that the load integrator receives from the distribution system operator; the second item is the sum of the estimated rewards paid to the home energy management system; and the third item is the total energy consumption used for calculation and communication, with a coefficient. Using the order of magnitude of the same terms. Then, based on a master-slave game model, a game strategy is formulated between the home energy management system and the load integrator to maximize their utility functions. The game strategy is expressed as follows:
[0099]
[0100]
[0101] in, This represents the incentive budget allocated by the power distribution system operator to each load aggregator. R Indicates the reward budget, W l Indicates the first l The reward received by the load integrator. Then, the distribution system operator will allocate the reward budget. R The reward is distributed equally among all load aggregators, meaning each load aggregator receives an equal reward. Leader LA l A reward coefficient is set randomly at the beginning. , In response, the participant HEMS i To maximize one's utility function by expending corresponding computing power Participants l Evaluate these responses and update the reward coefficient values to increase their utility function. And then broadcast the updated coefficients. Finally, the participants HEMS i Adjust the strategy based on the new reward coefficient to increase individual utility. Then repeat the leader LA calculation. l The training cost is calculated and an evaluation function is set until a preset termination condition is reached. After iteration, the optimal reward coefficient is obtained. .
[0102] In this embodiment, the reward allocation for each participant in the participant set is performed by combining the optimal reward coefficient, including: determining the reward allocated to the home energy management system in the participant set based on the total reward provided by the power distribution system operator and the sum of the participants' contributions; and determining the reward allocated to the corresponding load integrator based on the reward allocated to the home energy management system.
[0103] Specifically, assuming the total reward provided by the Federated Learning Task Publisher (DSO) is... All participants in the reward distribution (i.e., the set) The sum of client contributions is C. HEMS calculates and distributes rewards using the following formula:
[0104]
[0105]
[0106] in, This indicates the rewards received by the home energy management system. This indicates the total number of HEMS selected to participate in the reward distribution. This represents the total number of LAs to which these HEMS belong, expressed in terms of... This represents the set of these LAs. The LA (Lower Income) is used to calculate and allocate rewards, and the calculation formula is as follows:
[0107]
[0108] in, r l This represents the reward received by the load integrator. It is a coefficient between 0 and 1.
[0109] Furthermore, the rewards allocated to the home energy management system and load integrator satisfy a pre-defined reward mechanism. For example, the final rewards must satisfy the budget balancing inequality of the reward mechanism:
[0110]
[0111] in, R This indicates the total amount of the reward.
[0112] The present invention also provides a hierarchical federated learning device for electricity data. The hierarchical federated learning device for electricity data provided by the present invention is described below. The hierarchical federated learning device for electricity data described below can be referred to in correspondence with the hierarchical federated learning method for electricity data described above. Figure 3 This is a structural block diagram of the electricity data hierarchical federated learning device provided by the present invention, as shown below. Figure 3 As shown, the device includes:
[0113] Training module 301 is used to provide participants with initial model parameters and to begin training based on these parameters; participants include home energy management systems and load integrators.
[0114] The data acquisition module 302 is used to provide real-time electricity consumption data to the home energy management system, perform local training based on the real-time electricity consumption data, update the local model parameters of the home energy management system, and submit the local model parameters to the load integrator in the corresponding region.
[0115] The local aggregation module 303 is used to perform asynchronous local aggregation based on local model parameters and current global model parameters to obtain local aggregation parameters, which are then sent to the corresponding regional home energy management system and uploaded to the blockchain.
[0116] The global aggregation module 304 is used to perform global aggregation based on local aggregation parameters, obtain global aggregation parameters, and distribute rewards to participants based on the current global aggregation parameters;
[0117] Update module 305 is used to update the parameters of the load integrator based on the current global aggregation parameters.
[0118] First, the federated learning task publisher distributes initial model parameters to each participant. Participants begin training based on the initial model parameters, i.e. , .in, This represents the local model parameters of the home energy management system. This represents the local aggregation parameters for the load aggregator. (Home energy management system) Continuously collect real-time electricity consumption data from users, construct a local dataset based on this data, and use this local dataset to train a Long Short-Term Memory (LSTM) network locally, continuously updating the local model parameters. The calculation formula is as follows:
[0119]
[0120] in, Indicates local model parameters, Indicates the learning rate. This represents the gradient of the local model parameters. Then, the home energy management system... Regularly update local model parameters Submitted to the load aggregator in the corresponding region Each load aggregator asynchronously aggregates local parameters based on its local model parameters and the current global model parameters to obtain locally aggregated parameters. These locally aggregated parameters are then distributed to the corresponding regional home energy management systems and uploaded to the blockchain for consensus by the blockchain committee. The distribution system operator (DSO) periodically retrieves parameter updates from the blockchain and performs global aggregation to obtain globally aggregated parameters. The global aggregation parameters are then distributed and broadcast across the blockchain. Furthermore, the power distribution system operator distributes rewards to participants based on the current global aggregation parameters. Finally, the load aggregator updates the parameters according to the current global aggregation parameters. It is worth noting that the above process only demonstrates the training process of federated learning once. In practical applications, the above process can be repeated for iterative training, and the number of training iterations can be set according to actual needs.
[0121] When in use, this device utilizes a blockchain-based hierarchical framework to achieve asynchronous aggregation between load integrators, reducing the time overhead required for training. Furthermore, rewards are distributed to each participant, reducing the number of lazy clients and improving the overall efficiency of federated learning. This addresses the issue of poor participant motivation in existing related technologies and achieves efficient training results for electricity consumption data models.
[0122] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 401, a communication interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other via the communication bus 404. The processor 401 can call logical instructions in the memory 403 to execute a hierarchical federated learning method for power consumption data, which includes:
[0123] Participants acquire initial model parameters and begin training based on these parameters; participants include home energy management systems and load integrators.
[0124] The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates the local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding region.
[0125] The load aggregator performs asynchronous local aggregation based on local model parameters and current global model parameters to obtain local aggregated parameters, which are then distributed to the corresponding regional home energy management system and uploaded to the blockchain.
[0126] The power distribution system operator performs global aggregation based on local aggregation parameters to obtain global aggregation parameters, and then distributes rewards to participants based on the current global aggregation parameters;
[0127] The load aggregator updates parameters based on the current global aggregation parameters.
[0128] Furthermore, the logical instructions in the aforementioned memory 403 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0129] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the power consumption data hierarchical federated learning method provided by the above methods, the method including:
[0130] Participants acquire initial model parameters and begin training based on these parameters; participants include home energy management systems and load integrators.
[0131] The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates the local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding region.
[0132] The load aggregator performs asynchronous local aggregation based on local model parameters and current global model parameters to obtain local aggregated parameters, which are then distributed to the corresponding regional home energy management system and uploaded to the blockchain.
[0133] The power distribution system operator performs global aggregation based on local aggregation parameters to obtain global aggregation parameters, and then distributes rewards to participants based on the current global aggregation parameters;
[0134] The load aggregator updates parameters based on the current global aggregation parameters.
[0135] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the hierarchical federated learning method for electricity consumption data provided by the methods described above, the method comprising:
[0136] Participants acquire initial model parameters and begin training based on these parameters; participants include home energy management systems and load integrators.
[0137] The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates the local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding region.
[0138] The load aggregator performs asynchronous local aggregation based on local model parameters and current global model parameters to obtain local aggregated parameters, which are then distributed to the corresponding regional home energy management system and uploaded to the blockchain.
[0139] The power distribution system operator performs global aggregation based on local aggregation parameters to obtain global aggregation parameters, and then distributes rewards to participants based on the current global aggregation parameters;
[0140] The load aggregator updates parameters based on the current global aggregation parameters.
[0141] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; 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; and these 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. A hierarchical federated learning method for electricity consumption data, characterized in that, include: Participants obtain initial model parameters and begin training based on those parameters; The participants include home energy management systems and load integrators; The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates the local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding region. The load aggregator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, and then sends the local aggregation parameters to the corresponding regional home energy management system and uploads them to the blockchain. The power distribution system operator performs global aggregation based on the local aggregation parameters to obtain global aggregation parameters, and distributes rewards to the participants based on the current global aggregation parameters; The load aggregator updates the parameters based on the current global aggregation parameters; Based on the current global aggregation parameters, rewards are distributed to the participants, including: Based on the current global aggregation parameters and the training effect and training cost of the participants, the contribution of the participants is evaluated, and the set of participants to participate in the reward distribution is determined according to the evaluation results. Establish a master-slave game model, and determine the optimal reward coefficient for maximizing the utility of each participant based on the master-slave game model; Based on the optimal reward coefficient, a reward is allocated to each participant in the participant set; Establish a master-slave game model, and determine the optimal reward coefficient for maximizing the utility of each participant based on the master-slave game model, including: A master-slave game model is established; in the master-slave game model, the power distribution system operator is the reward budget allocator, the load integrator is the leader, and the home energy management system is the follower. Determine the training costs of the home energy management system and the load integrator; the training costs include energy consumption for local training and communication costs for model parameter transmission; An evaluation function is set based on the deviation between the local model parameters and the global model parameters; The utility functions of the home energy management system and the load integrator are determined based on the valuation function. Based on the master-slave game model, a game strategy is formulated between the home energy management system and the load integrator, and the utility functions of the home energy management system and the load integrator are maximized. An initial value for the reward coefficient is set, and the reward coefficient is adjusted and updated based on the training cost and the evaluation function until the training cost and the evaluation function meet a preset termination condition. The current reward coefficient is then taken as the optimal reward coefficient.
2. The hierarchical federated learning method for electricity consumption data according to claim 1, characterized in that, The load aggregator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, including: Determine the local model parameter weights and the global model parameter weights; the sum of the local model parameter weights and the global model parameter weights is 1; Based on the proportion of the current home energy management system to all participating home energy management systems, local aggregation parameters are determined.
3. The hierarchical federated learning method for electricity consumption data according to claim 1, characterized in that, Based on the current global aggregation parameters and the training performance and cost of the participants, the contribution of the participants is evaluated, and the set of participants participating in the reward allocation is determined according to the evaluation results, including: The training performance of each participant is evaluated based on the current global model parameters; The training cost of the participant is determined based on the size of the dataset of the local data used for training. The contribution of each participant is determined by combining the training effectiveness and training cost. The contributions of the participants are normalized, and the participants are ranked based on the normalized contributions to determine the participant set.
4. The hierarchical federated learning method for electricity consumption data according to claim 1, characterized in that, Based on the optimal reward coefficient, a reward is allocated to each participant in the participant set, including: The reward allocated to the home energy management system in the participant set is determined based on the total amount of rewards provided by the power distribution system operator and the sum of the participants' contributions. The corresponding reward allocated to the load integrator is determined based on the reward allocated to the home energy management system.
5. The hierarchical federated learning method for electricity consumption data according to claim 4, characterized in that, The rewards allocated to the home energy management system and the load integrator meet the pre-set reward mechanism.
6. A hierarchical federated learning device for electricity data, characterized in that, include: The training module is used to provide participants with initial model parameters and to begin training based on those initial model parameters; The participants include home energy management systems and load integrators; The data acquisition module is used to provide real-time electricity consumption data to the home energy management system, perform local training based on the real-time electricity consumption data, update the local model parameters of the home energy management system, and submit the local model parameters to the load integrator in the corresponding region. The local aggregation module is used to asynchronously aggregate local parameters based on the local model parameters and the current global model parameters to obtain local aggregation parameters, and then distribute the local aggregation parameters to the home energy management system of the corresponding region and upload them to the blockchain. The global aggregation module is used to perform global aggregation based on the local aggregation parameters to obtain global aggregation parameters, and to distribute rewards to the participants based on the current global aggregation parameters; The update module is used to update the parameters of the load integrator based on the current global aggregation parameters; Based on the current global aggregation parameters, rewards are distributed to the participants, including: Based on the current global aggregation parameters and the training effect and training cost of the participants, the contribution of the participants is evaluated, and the set of participants to participate in the reward distribution is determined according to the evaluation results. Establish a master-slave game model, and determine the optimal reward coefficient for maximizing the utility of each participant based on the master-slave game model; Based on the optimal reward coefficient, a reward is allocated to each participant in the participant set; Establish a master-slave game model, and determine the optimal reward coefficient for maximizing the utility of each participant based on the master-slave game model, including: A master-slave game model is established; in the master-slave game model, the power distribution system operator is the reward budget allocator, the load integrator is the leader, and the home energy management system is the follower. Determine the training costs of the home energy management system and the load integrator; the training costs include energy consumption for local training and communication costs for model parameter transmission; An evaluation function is set based on the deviation between the local model parameters and the global model parameters; The utility functions of the home energy management system and the load integrator are determined based on the valuation function. Based on the master-slave game model, a game strategy is formulated between the home energy management system and the load integrator, and the utility functions of the home energy management system and the load integrator are maximized. An initial value for the reward coefficient is set, and the reward coefficient is adjusted and updated based on the training cost and the evaluation function until the training cost and the evaluation function meet a preset termination condition. The current reward coefficient is then taken as the optimal reward coefficient.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the hierarchical federated learning method for electricity consumption data as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the hierarchical federated learning method for electricity consumption data as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Federal learning framework for electric power metering system
CN117669702A
Social behavior for autonomous vehicles
US20210146964A1