Power consumption data hierarchical federation learning method and device, equipment and storage medium
By adopting the blockchain hierarchical framework and the power consumption data hierarchical federated learning method of the master-slave game model in the power consumption data analysis scenario, the problem of poor enthusiasm of participants is solved and efficient power consumption data model training is achieved.
Patent Information
- Application Number
- CN202411427613.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In the prior art, the problem of poor motivation among participants, especially in the analysis scenario of electricity consumption data, is inefficient in federated learning due to the lack of mutual trust and unsuitable reward mechanisms.
Using the federated learning method of power consumption data, asynchronous aggregation is achieved through the hierarchical framework design of blockchain, reducing training time overhead, and issuing rewards to each participant, determining the best reward coefficient through the master-slave game model, and improving participation the enthusiasm of the person.
It improves the overall efficiency of federated learning, reduces the number of lazy clients, solves the problem of poor motivation among participants, and achieves efficient power consumption data model training effect.
Smart Images

Figure CN119443307A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of federated learning technology, and in particular to a method, device, equipment and storage medium for hierarchical federated learning of electricity consumption data. Background Art
[0002] With the acceleration of the construction of smart grids, electricity consumption information collection systems represented by smart meters collect and generate a large amount of user electricity consumption data every day. These data can be used for machine learning model training to meet the application needs of smart grid intelligent analysis, help the power grid formulate power generation plans, implement precise scheduling, and ensure the smooth operation of the power system.
[0003] However, electricity consumption data contains user privacy or corporate confidential information. Under the constraints of privacy protection, the direct use of user data is strictly restricted. In addition, since electricity consumption information collection terminals are scattered in different locations and the data they collect belong to different organizations, the mining and analysis of user data still faces the problem of data silos. Federated learning technology can achieve model training without leaving the local device, solving the privacy protection and data silos problems faced by user data analysis. However, in the electricity consumption data analysis scenario, the participating entities usually belong to different operators and lack mutual trust between each other. Some studies have proposed using blockchain to solve the trust problem in federated learning, but there are still the following shortcomings: 1. The existing blockchain-based federated learning framework adopts a synchronous aggregation method. Due to the different computing capabilities and communication conditions between the participants in the electricity data analysis scenario, the local model training time is different, and the synchronous aggregation time overhead is large; 2. The existing reward mechanism for federated learning usually uses a single factor to evaluate node performance, and the evaluation indicators are not comprehensive. The reward strategy is not specific, and only the reward distribution strategy for federated learning participants is given, without considering the strategy and benefits of the task publisher (reward distributor). The reward form is not suitable for electricity data analysis scenarios.
[0004] There is currently no effective solution to the problem of poor participant enthusiasm in existing related technologies. Summary of the invention
[0005] The present invention provides a method, device, equipment and storage medium for hierarchical federated learning of electricity consumption data, so as to solve the defect of poor enthusiasm of participants in the prior art.
[0006] In a first aspect, the present invention provides a hierarchical federated learning method for electricity consumption data, comprising: The participants obtain initial model parameters and start training based on the initial model parameters; the participants include a home energy management system and a load integrator; The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding area; The load integrator 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 home energy management system of the corresponding area, and uploads them to the blockchain; The distribution system operator performs global aggregation based on the local aggregation parameter to obtain a global aggregation parameter, and issues rewards to the participant based on the current global aggregation parameter; The load integrator updates parameters based on the current global aggregation parameters.
[0007] According to a hierarchical federated learning method for power consumption data provided by the present invention, the load integrator 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 weight and the global model parameter weight; the sum of the local model parameter weight and the global model parameter weight is 1; Based on the proportion of the current home energy management system to all home energy management systems participating in the training, a local aggregation parameter is determined.
[0008] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, based on the current global aggregation parameter, rewards are issued 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 participating in the reward distribution is determined according to the evaluation results; Establishing a master-slave game model, and determining the optimal reward coefficient when each participant has the maximum utility based on the master-slave game model; In combination with the optimal reward coefficient, a reward is allocated to each of the participants in the participant set.
[0009] 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 the reward distribution is determined according to the evaluation results, including: Evaluating the training effect of each participant based on the current global model parameters; Determining a training cost for the participant based on a data set size of local data used for training the participant; Determine the contribution of the participant based on the training effect and training cost of the participant; The contributions of the participants are normalized, and the participants are sorted based on the normalized contributions to determine the participant set.
[0010] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, a master-slave game model is established, and based on the master-slave game model, an optimal reward coefficient when each participant has the maximum utility is determined, including: A master-slave game model is established; in the master-slave game model, the distribution system operator serves as a reward budget allocator, the load integrator serves as a leader, and the home energy management system serves as a follower; Determining the training cost of the home energy management system and the load integrator; the training cost includes energy consumption for local training and communication cost for model parameter transmission; Setting an estimation function based on a deviation between the local model parameters and the global model parameters; Determining utility functions of the home energy management system and the load integrator based on the valuation function; Based on the master-slave game model, formulate the game strategy of the home energy management system and the load integrator, and maximize the utility function of the home energy management system and the load integrator; An initial value of the reward coefficient is set, and the reward coefficient is adjusted and updated based on the training cost and the valuation function until the training cost and the valuation function meet a preset termination condition, and the current reward coefficient is used as the optimal reward coefficient.
[0011] According to a hierarchical federated learning method for electricity consumption data provided by the present invention, in combination with the optimal reward coefficient, a reward is distributed to each of the participants in the participant set, including: Determining rewards allocated to the home energy management systems in the set of participants based on the sum of the total rewards provided by the distribution system operator and the contribution of the participants; The reward allocated by the corresponding load integrator is determined based on the reward allocated to the home energy management system.
[0012] According to a 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 a pre-set reward mechanism.
[0013] In a second aspect, the present invention further provides a hierarchical federated learning device for electricity consumption data, comprising: A training module, used to provide initial model parameters to participants and start training based on the initial model parameters; the participants include a home energy management system and a load integrator; A collection module, used to provide real-time electricity consumption data to the home energy management system, and 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 area; A local aggregation module, used to perform asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, send the local aggregation parameters to the home energy management system of the corresponding area, and upload them to the blockchain; A global aggregation module, used for performing global aggregation based on the local aggregation parameters to obtain global aggregation parameters, and issuing rewards to the participants based on the current global aggregation parameters; An updating module is used to update the parameters of the load integrator based on the current global aggregation parameters.
[0014] In a third aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the hierarchical federated learning method for electricity consumption data as described in the first aspect above is implemented.
[0015] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the hierarchical federated learning method for electricity consumption data as described in the first aspect above.
[0016] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the hierarchical federated learning method for electricity consumption data as described in the first aspect above.
[0017] Compared with the prior art, the present invention has the following beneficial effects: The hierarchical federated learning method for electricity consumption data provided by the present invention realizes asynchronous aggregation among load integrators through a hierarchical framework design based on blockchain, reduces the time overhead required for training, and issues rewards to each participant, thereby reducing the number of lazy clients and improving the overall efficiency of federated learning. It solves the problem of poor participant enthusiasm in existing related technologies and achieves efficient electricity consumption data model training effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 is a flow chart of the hierarchical federated learning method for electricity consumption data provided by the present invention; Figure 2 It is a schematic diagram of a hierarchical federated learning framework based on blockchain in the present invention; Figure 3 It is a structural block diagram of the hierarchical federated learning device for electricity consumption data provided by the present invention; Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The present invention provides a hierarchical federated learning method for electricity consumption data. Figure 1 is a flow chart of the hierarchical federated learning method for electricity consumption data provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: Step S101, participants obtain initial model parameters and start training based on the initial model parameters; the participants include a home energy management system and a load integrator; 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 local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding area; Step S103: The load integrator 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 home energy management system of the corresponding area, and uploads them to the blockchain; Step S104, the distribution system operator performs global aggregation based on the local aggregation parameters to obtain a global aggregation parameter, and issues rewards to the participants based on the current global aggregation parameter; Step S105: The load integrator updates parameters based on the current global aggregation parameters.
[0022] For example, Figure 2 This is a schematic diagram of the hierarchical federated learning framework based on blockchain in the present invention. Figure 2 As shown, the set of load integrators (LA) is , Load Integrator l The collection of home energy management systems (HEMS) under the jurisdiction is First, the publisher of the federated learning task sends the initial model parameters to each participant. , participants started training based on the initial model parameters, i.e. , .in, represents the local model parameters of the home energy management system, Represents the local aggregation parameter of the load aggregator. Home Energy Management System Continuously collect users' real-time electricity consumption data, build a local data set based on the real-time electricity consumption data, use the local data set to perform local training based on the Long Short-Term Memory (LSTM) network, and continuously update the local model parameters. The calculation formula is as follows:
[0023] in, represents the local model parameters, represents the learning rate, represents the gradient of the local model parameters. Then, the home energy management system Regularly update local model parameters Submit to the load integrator in the corresponding area Each load integrator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain the local aggregation parameters, and sends the local aggregation parameters to the home energy management system in the corresponding area, and uploads them to the blockchain to execute the blockchain committee consensus. The distribution system operator (DSO) regularly retrieves the parameter updates in the blockchain and performs global aggregation to obtain the global aggregation parameters. , and issue the global aggregation parameters and broadcast them in the blockchain. Moreover, the distribution system operator also issues rewards to participants based on the current global aggregation parameters. Finally, the load integrator updates the parameters based on the current global aggregation parameters, i.e. It is worth noting that the above process only shows the training process of federated learning once. In actual application, the above process can be repeated for iterative training, and the number of training times can be set according to actual needs.
[0024] In this method, the hierarchical framework design based on blockchain realizes asynchronous aggregation among load integrators, reduces the time required for training, and issues rewards to each participant, reducing the number of lazy clients and improving the overall efficiency of federated learning. It solves the problem of poor participant enthusiasm in existing related technologies and achieves efficient electricity consumption data model training.
[0025] In some of the embodiments, in step S103, the load integrator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, including: determining local model parameter weights and global model parameter weights; the sum of the local model parameter weights and the global model parameter weights is 1; 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.
[0026] Exemplarily, the calculation formula of the local aggregation parameter is as follows:
[0027] in, represents the local aggregation parameter, Home Energy Management System The proportion of home energy management systems that participated in the training, is the local model parameter weight, is the global model parameter weight and satisfies , M represents the total number of home energy management systems, i Indicates the serial number of the home energy management system.
[0028] Based on this embodiment, the calculation formula of the global aggregation parameter is as follows:
[0029] in, Represents global aggregation parameters, Indicates load integrator The proportion of all load integrators participating in the training, represents the local aggregation parameter, N represents the total number of load integrators, l Indicates the serial number of the load integrator.
[0030] In some of the embodiments, step S104, based on the current global aggregation parameters, rewards are issued to 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 participating in the reward distribution is determined based on the evaluation results; a master-slave game model is established, and based on the master-slave game model, the optimal reward coefficient when each participant's utility is maximized is determined; and based on the optimal reward coefficient, rewards are distributed to each participant in the participant set.
[0031] For example, first, the distribution system operator implements the reward mechanism after each round of global aggregation is completed, and fairly evaluates the contribution of participants based on the global model parameters and the model training effect and training cost uploaded by the participants, and normalizes the evaluation results, and selects the set of home energy management systems participating in the reward distribution based on the contribution ranking. Then, the distribution system operator is regarded as the reward budget allocator, the load integrator is regarded as the leader, and the home energy management system is regarded as the follower. A master-slave game model is established to obtain the optimal reward coefficient by maximizing the utility function of the load integrator and the home energy management system. Finally, the home energy management system is integrated The home energy management system in the , and calculate and distribute rewards to the load integrators of these home energy management systems .
[0032] In this embodiment, based on the current global aggregation parameters and the training effects and training costs of the participants, the contributions of the participants are evaluated, and the set of participants participating in the reward distribution is determined based on the evaluation results, including: evaluating the training effect of each participant based on the current global model parameters; determining the training cost of the participant based on the data set size of the local data used for the participant training; determining the contribution of the participant based on the training effect and training cost of the participant; normalizing the contribution of the participant, and sorting the participants based on the normalized contribution to determine the set of participants.
[0033] Specifically, each load integrator performs a load-sharing operation on each participant based on the global model parameters issued by the distribution system operator. i The model training effect is evaluated, and the calculation formula is as follows:
[0034] in, j represents the contribution evaluation round, Indicates the participants in the current round i The model training effect, Indicates the HEMS of participants in the current roundi The submitted model parameter vector, Represents the global model parameters obtained by aggregation in the current round, express and The deviation Then, the training cost of each participant i in the jth round of evaluation is calculated as follows:
[0035] in, cost ij represents the training cost, h represents the correlation coefficient, Indicates the size of the local data set. The contribution of the participant is related to two indicators: model training effect and training cost. The specific formula is as follows:
[0036] in, con ij Indicates contribution, Indicates the training effect. cost ij In order to better reflect the contribution of each participant, the contribution needs to be normalized and the data scaled to the same range. The calculation formula is as follows:
[0037] in, con' ij represents the normalized contribution, con max represents the maximum contribution, con min represents the minimum contribution. Finally, participants are ranked according to their contribution, and participants with high contribution will participate in the reward distribution. Assume that the proportion of home energy management systems selected is α , , then we get the set of home energy management systems participating in the reward distribution .
[0038] In this embodiment, a master-slave game model is established, and the optimal reward coefficient when the utility of each participant is maximized is determined based on the master-slave game model, including: establishing a master-slave game model; in the master-slave game model, the distribution system operator serves as a reward budget allocator, the load integrator serves as a leader, and the home energy management system serves as a follower; determining the training cost of the home energy management system and the load integrator; the training cost includes the energy consumption for local training and the communication cost for model parameter transmission; based on the deviation between the local model parameters and the global model parameters, setting a valuation function; determining the utility function of the home energy management system and the load integrator based on the valuation function; based on the master-slave game model, formulating the game strategy of the home energy management system and the load integrator, and maximizing the utility function of the home energy management system and the load integrator; setting an initial value of the reward coefficient, and adjusting and updating the reward coefficient based on the training cost and the valuation function until the training cost and the valuation function meet the preset termination conditions, and taking the current reward coefficient as the optimal reward coefficient.
[0039] Specifically, the distribution system operator is used as the reward budget allocator, the load integrator is used as the leader, and the home energy management system is used as the follower to establish a master-slave game (Stackelberg) model. Then, the cost of each home energy management system participant HEMS is calculated. i The training cost , including the energy consumption for local training and the communication cost for model parameter transmission , the specific calculation formula is as follows:
[0040]
[0041]
[0042] in, Indicates participants HEMS i The training cost, Indicates energy consumption, represents the communication cost, k is a hardware-related coefficient, represents the number of rounds of local training for the home energy management system, Indicates the number of CPU revolutions required to complete one iteration. Indicates participants i CPU frequency when doing local training, Indicates the number of parameters submitted. It represents the transmission rate when the home energy management system submits parameters to the load integrator. is the transmission power. Then, the leader LA is calculated l The training cost , including the energy consumption for local computation and the energy consumption for transmitting model parameters , the calculation formula is as follows:
[0043]
[0044]
[0045] in, Indicates the leader LA l The training cost, represents the energy consumption for local computation, represents the energy consumption for transmitting model parameters, is a hardware-related coefficient, represents the number of rounds of global aggregation calculation performed by the load integrator, Indicates the number of CPU revolutions required to complete a global aggregation. Indicates the CPU frequency when the load integrator performs local training. Indicates the parameter quantity issued by the distribution system operator. represents the parameter quantity from the home energy management system aggregated by the load integrator, represents the parameter transfer rate between the load integrator and the distribution system operator, is the transmission power. Then, set the estimation function To represent the economic returns that participants can obtain, Represents the deviation between the local model parameters and the global model parameters. This valuation function is linearly increasing with the model training effect provided by the participants, and is expressed as:
[0046] in, is a coefficient greater than 0. Then, based on the valuation function, the home energy management system participants HEMS are defined i The utility function is expressed as:
[0047] The first item is the participants i The reward valuation obtained, the second item is the participant i Energy consumption for local training and uploading model parameters, coefficient Used for the same order of magnitude of the two preceding and following terms. Then, define the leader LA l The utility function is expressed as:
[0048] The first item is the reward received by the load integrator 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 for computing and communication. The order of magnitude of each item is used. Based on the master-slave game model, the game strategy of the home energy management system and the load integrator is formulated to maximize the utility function of both. The game strategy is expressed as follows:
[0049]
[0050] in, represents the incentive budget allocated by the distribution system operator to each load integrator, R represents the reward budget, W l Indicates l The distribution system operator will then award the budget R Evenly distributed to each load integrator, each load integrator receives equal rewards, that is, . Leader LA l A random reward coefficient is set at the beginning , In response, participants in HEMS i Pay the corresponding computing power to maximize your utility function . Participants l Evaluate these responses and update the value of the reward coefficient to increase its own utility function , and broadcast the updated coefficients. Finally, the participant HEMS i Adjust the strategy according to the new reward coefficient to increase individual utility. Then repeat the calculation of the leader LA l The training cost and valuation function are set until the preset termination condition is reached. After the iteration is completed, the optimal reward coefficient is obtained. .
[0051] In this embodiment, rewards are allocated to each participant in the participant set in combination with 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 distribution system operator and the sum of the participants' contributions; and determining the reward allocated by the corresponding load integrator based on the reward allocated to the home energy management system.
[0052] Specifically, assume that the total amount of rewards provided by the federated learning task publisher DSO is , all participants in the reward distribution (i.e., the set The sum of the client contributions in is C. The HEMS in the calculation and distribution of rewards is as follows:
[0053]
[0054] in, Represents the rewards received by the home energy management system, Indicates the total number of HEMS selected to participate in the reward distribution, Indicates the total number of LAs to which these HEMS belong, using represents the set of these LAs. The LA in the calculation and distribution of rewards is as follows:
[0055] in, r l Indicates the reward received by the load integrator, is a coefficient between 0 and 1.
[0056] Furthermore, the rewards allocated to the home energy management system and the load integrator satisfy the pre-set reward mechanism. For example, the final reward needs to satisfy the budget balance characteristic inequality of the reward mechanism:
[0057] in, R Indicates the total amount of rewards.
[0058] The present invention also provides a hierarchical federated learning device for electricity consumption data. The hierarchical federated learning device for electricity consumption data provided by the present invention is described below. The hierarchical federated learning device for electricity consumption data described below and the hierarchical federated learning method for electricity consumption data described above can be referenced to each other. Figure 3 is a structural block diagram of the hierarchical federated learning device for electricity consumption data provided by the present invention, such as Figure 3 As shown, the device comprises: The training module 301 is used to provide initial model parameters to participants and start training based on the initial model parameters; the participants include a home energy management system and a load integrator; The collection module 302 is used to provide real-time electricity consumption data to the home energy management system, and 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 of the corresponding area; The local aggregation module 303 is used to perform asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, send the local aggregation parameters to the home energy management system of the corresponding area, and upload them to the blockchain; A global aggregation module 304 is used to perform global aggregation based on the local aggregation parameters to obtain the global aggregation parameters, and to issue rewards to the participants based on the current global aggregation parameters; The updating module 305 is used to update the parameters of the load integrator based on the current global aggregation parameters.
[0059] First, the publisher of the federated learning task sends the initial model parameters to each participant. , participants started training based on the initial model parameters, i.e. , .in, represents the local model parameters of the home energy management system, Represents the local aggregation parameter of the load aggregator. Home Energy Management System Continuously collect users' real-time electricity consumption data, build a local data set based on the real-time electricity consumption data, use the local data set to perform local training based on the Long Short-Term Memory (LSTM) network, and continuously update the local model parameters. The calculation formula is as follows:
[0060] in, represents the local model parameters, represents the learning rate, represents the gradient of the local model parameters. Then, the home energy management system Regularly update local model parameters Submit to the load integrator in the corresponding area Each load integrator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain the local aggregation parameters, and sends the local aggregation parameters to the home energy management system in the corresponding area, and uploads them to the blockchain to execute the blockchain committee consensus. The distribution system operator (DSO) regularly retrieves the parameter updates in the blockchain and performs global aggregation to obtain the global aggregation parameters. , and issue the global aggregation parameters and broadcast them in the blockchain. Moreover, the distribution system operator also issues rewards to participants based on the current global aggregation parameters. Finally, the load integrator updates the parameters based on the current global aggregation parameters, i.e. It is worth noting that the above process only shows the training process of federated learning once. In actual application, the above process can be repeated for iterative training, and the number of training times can be set according to actual needs.
[0061] When this device is in use, the hierarchical framework design based on blockchain realizes asynchronous aggregation among load integrators, reduces the time overhead required for training, and issues rewards to each participant, reducing the number of lazy clients and improving the overall efficiency of federated learning. It solves the problem of poor participant enthusiasm in existing related technologies and achieves efficient electricity consumption data model training effects.
[0062] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. 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 through the communication bus 404. The processor 401 may call the logic instructions in the memory 403 to execute the hierarchical federated learning method of power consumption data, and the method includes: Participants obtain initial model parameters and start training based on the initial model parameters; 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 area; The load integrator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain the local aggregation parameters, sends the local aggregation parameters to the home energy management system in the corresponding area, and uploads them to the blockchain; The distribution system operator performs global aggregation based on the local aggregation parameters to obtain the global aggregation parameters, and issues rewards to the participants based on the current global aggregation parameters; The load integrator performs parameter updates based on the current global aggregate parameters.
[0063] In addition, the logic instructions in the above-mentioned memory 403 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0064] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the hierarchical federated learning method for electricity consumption data provided by the above methods, the method includes: Participants obtain initial model parameters and start training based on the initial model parameters; 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 area; The load integrator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain the local aggregation parameters, sends the local aggregation parameters to the home energy management system in the corresponding area, and uploads them to the blockchain; The distribution system operator performs global aggregation based on the local aggregation parameters to obtain the global aggregation parameters, and issues rewards to the participants based on the current global aggregation parameters; The load integrator performs parameter updates based on the current global aggregate parameters.
[0065] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the hierarchical federated learning method for electricity consumption data provided by the above methods, the method comprising: Participants obtain initial model parameters and start training based on the initial model parameters; 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 area; The load integrator performs asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain the local aggregation parameters, sends the local aggregation parameters to the home energy management system in the corresponding area, and uploads them to the blockchain; The distribution system operator performs global aggregation based on the local aggregation parameters to obtain the global aggregation parameters, and issues rewards to the participants based on the current global aggregation parameters; The load integrator performs parameter updates based on the current global aggregate parameters.
[0066] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0067] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions 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: The participant obtains initial model parameters and starts training based on the initial model parameters; Said participants include home energy management systems and load aggregators; The home energy management system collects real-time electricity consumption data, performs local training based on the real-time electricity consumption data, updates local model parameters of the home energy management system, and submits the local model parameters to the load integrator in the corresponding area; The load integrator 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 home energy management system of the corresponding area, and uploads them to the blockchain; The distribution system operator performs global aggregation based on the local aggregation parameter to obtain a global aggregation parameter, and issues rewards to the participant based on the current global aggregation parameter; The load integrator updates parameters based on the current global aggregation parameters.
2. The hierarchical federated learning method for electricity consumption data according to claim 1, characterized in that: The load integrator 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 weight and the global model parameter weight; the sum of the local model parameter weight and the global model parameter weight is 1; Based on the proportion of the current home energy management system to all home energy management systems participating in the training, a local aggregation parameter is 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, rewards are issued 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 participating in the reward distribution is determined according to the evaluation results; Establishing a master-slave game model, and determining the optimal reward coefficient when each participant has the maximum utility based on the master-slave game model; In combination with the optimal reward coefficient, a reward is allocated to each of the participants in the participant set.
4. The hierarchical federated learning method for electricity consumption data according to claim 3 is characterized in that: 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 the reward distribution is determined according to the evaluation results, including: Evaluating the training effect of each participant based on the current global model parameters; Determining a training cost for the participant based on a data set size of local data used for training the participant; Determine the contribution of the participant based on the training effect and training cost of the participant; The contributions of the participants are normalized, and the participants are sorted based on the normalized contributions to determine the participant set.
5. The hierarchical federated learning method for electricity consumption data according to claim 3, characterized in that: Establishing a master-slave game model, and determining the optimal reward coefficient when each participant has the maximum utility based on the master-slave game model, including: A master-slave game model is established; in the master-slave game model, the distribution system operator serves as a reward budget allocator, the load integrator serves as a leader, and the home energy management system serves as a follower; Determining the training cost of the home energy management system and the load integrator; the training cost includes energy consumption for local training and communication cost for model parameter transmission; Setting an estimation function based on a deviation between the local model parameters and the global model parameters; Determining utility functions of the home energy management system and the load integrator based on the valuation function; Based on the master-slave game model, formulate the game strategy of the home energy management system and the load integrator, and maximize the utility function of the home energy management system and the load integrator; An initial value of the reward coefficient is set, and the reward coefficient is adjusted and updated based on the training cost and the valuation function until the training cost and the valuation function meet a preset termination condition, and the current reward coefficient is used as the optimal reward coefficient.
6. The hierarchical federated learning method for electricity consumption data according to claim 3, characterized in that: In combination with the optimal reward coefficient, a reward is distributed to each of the participants in the participant set, including: Determining rewards allocated to the home energy management systems in the set of participants based on the total amount of rewards provided by the distribution system operator and the sum of the contributions of the participants; The reward allocated by the corresponding load integrator is determined based on the reward allocated to the home energy management system.
7. The hierarchical federated learning method for electricity consumption data according to claim 6, characterized in that: The rewards allocated to the home energy management system and the load integrator meet the pre-set reward mechanism.
8. A hierarchical federated learning device for electricity consumption data, characterized in that: include: A training module, used to provide initial model parameters to the participants and start training based on the initial model parameters; Said participants include home energy management systems and load aggregators; A collection module, used to provide real-time electricity consumption data to the home energy management system, and 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 area; A local aggregation module, used to perform asynchronous local aggregation based on the local model parameters and the current global model parameters to obtain local aggregation parameters, send the local aggregation parameters to the home energy management system of the corresponding area, and upload them to the blockchain; A global aggregation module, used for performing global aggregation based on the local aggregation parameters to obtain global aggregation parameters, and issuing rewards to the participants based on the current global aggregation parameters; An updating module is used to update the parameters of the load integrator based on the current global aggregation parameters.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the hierarchical federated learning method for electricity consumption data as described in any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the hierarchical federated learning method for electricity consumption data as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Federal learning framework for electric power metering system
CN117669702A
Non-intrusive electrical load detection method and system based on hierarchical federal learning
CN118607666A
Social behavior for autonomous vehicles
US20210146964A1
Cited By
Power consumption data hierarchical federation learning method and device and electronic equipment
CN120611770A