A method, device, computer equipment and storage medium for predicting power consumption

Through hierarchical federated learning method, clustering grouping and iterative aggregation of model parameters, the problems of low power consumption prediction accuracy and poor information security are solved, and efficient and accurate power consumption prediction is achieved.

CN113642809BActive Publication Date: 2024-10-22SHENZHEN POWER SUPPLY BUREAU +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202111021694.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-01
Publication Date
2024-10-22
Estimated Expiration
2041-09-01

AI Technical Summary

Technical Problem

In the process of distributed storage and prediction of electricity consumption data, the existing technology results in low accuracy of electricity consumption prediction, large data transmission volume, and poor information security.

Method used

The hierarchical federated learning method is used to train the target prediction model for electricity consumption prediction through clustering grouping and iterative aggregation of intra-group and global model parameters, reducing data transmission and improving prediction accuracy and information security.

Benefits of technology

It improves the accuracy of electricity consumption prediction, reduces data transmission steps, enhances information security, and improves model training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113642809B_ABST
    Figure CN113642809B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for predicting power consumption. The method includes: clustering and grouping the local model parameters corresponding to each participant obtained, and dividing each participant into a corresponding group cluster; determining an intra-group aggregator from multiple participants included in the corresponding group cluster, triggering the intra-group aggregator to perform intra-group aggregation based on the local model parameters of the remaining participants in the group to obtain a target group model parameter; determining a global aggregator from multiple intra-group aggregators, and triggering the global aggregator to perform global aggregation on the target group model parameters of each group cluster to obtain a global model parameter; triggering each participant to update the locally maintained initial prediction model based on the obtained global model parameters, and continuing the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence condition, and outputs the target prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electric power dispatching, and in particular to a method, device, computer equipment and storage medium for predicting electric power consumption. Background Art

[0002] When multiple departments within the power organization jointly model and collaborate on cross-institutional data, the internal electricity consumption data is usually collected by the collection points of each subsidiary and stored in the metering center under the subsidiary. Among them, the collected data itself has a high mining value, can effectively realize electricity consumption prediction, and provide good data support for subsequent power dispatch. However, since the electricity consumption data is distributed and stored in the local servers of each subsidiary, when calling these electricity consumption data, it is necessary to access the data of the local servers of each subsidiary separately.

[0003] In order to solve the above problems, the existing technology collects power consumption data from each subsidiary through a unified data center, and stores the collected power consumption data locally in the data center; then, the data center predicts power consumption in the future preset period based on the collected power consumption data. Although this method can realize the prediction of power consumption in the future preset period, it will affect the accuracy of power consumption prediction due to its own internal and external problems. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for predicting electricity consumption that can improve the prediction accuracy of electricity consumption in response to the above technical problems.

[0005] A method for predicting power consumption comprises the following steps:

[0006] Based on the local model parameters corresponding to each participant obtained, the participants are clustered and grouped to divide multiple matching participants that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant;

[0007] For each grouping cluster, determine an intra-group aggregator from a plurality of matching participants included in the corresponding grouping cluster, and trigger the intra-group aggregator to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding grouping cluster, so as to obtain the target group model parameters;

[0008] Determine a global aggregator from the multiple intra-group aggregators, and trigger the global aggregator to perform global aggregation on the target group model parameters corresponding to each grouping cluster, so as to obtain global model parameters;

[0009] Trigger each of the participants to update the locally maintained initial prediction model based on the acquired global model parameters, and continue the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption.

[0010] A power consumption prediction device, comprising:

[0011] A grouping module, for clustering and grouping the participants based on the local model parameters corresponding to the participants, so as to classify multiple matching participants that meet similar conditions into corresponding grouping clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant;

[0012] A screening module, for determining, for each grouping cluster, from a plurality of matching participants included in the corresponding grouping cluster, an intra-group aggregation party;

[0013] A trigger module, used to trigger the intra-group aggregator to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the target group model parameters;

[0014] The screening module is further used to determine a global aggregator from the multiple in-group aggregators;

[0015] The trigger module is also used to trigger the global aggregator to globally aggregate the target group model parameters corresponding to each grouping cluster to obtain the global model parameters; trigger each of the participating parties to update the locally maintained initial prediction model based on the acquired global model parameters, and continue the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption.

[0016] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0017] Based on the local model parameters corresponding to each participant obtained, the participants are clustered and grouped to divide multiple matching participants that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant;

[0018] For each grouping cluster, determine an intra-group aggregator from a plurality of matching participants included in the corresponding grouping cluster, and trigger the intra-group aggregator to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding grouping cluster, so as to obtain the target group model parameters;

[0019] Determine a global aggregator from the multiple intra-group aggregators, and trigger the global aggregator to perform global aggregation on the target group model parameters corresponding to each grouping cluster, so as to obtain global model parameters;

[0020] Trigger each of the participants to update the locally maintained initial prediction model based on the acquired global model parameters, and continue the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption.

[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0022] Based on the local model parameters corresponding to each participant obtained, the participants are clustered and grouped to divide multiple matching participants that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant;

[0023] For each grouping cluster, determine an intra-group aggregator from a plurality of matching participants included in the corresponding grouping cluster, and trigger the intra-group aggregator to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding grouping cluster, so as to obtain the target group model parameters;

[0024] Determine a global aggregator from the multiple intra-group aggregators, and trigger the global aggregator to perform global aggregation on the target group model parameters corresponding to each grouping cluster, so as to obtain global model parameters;

[0025] Trigger each of the participants to update the locally maintained initial prediction model based on the acquired global model parameters, and continue the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption.

[0026] The above-mentioned power consumption prediction method, device, computer equipment and storage medium perform clustering and grouping based on the local model parameters corresponding to each participant, so as to divide each participant into the corresponding group cluster. Moreover, based on the grouping situation, each group cluster is first aggregated within the group, and then global aggregation is performed based on the target group model parameters obtained by the intra-group aggregation. At this time, the corresponding global model parameters will be obtained. After that, each participant is triggered to update the locally maintained prediction model based on the obtained global model parameters, and when it is determined that the updated prediction model does not meet the preset convergence conditions, the steps of intra-group aggregation and global aggregation are continued. After multiple rounds of iterative training, a trained target prediction model will be obtained, and this model will be used to predict power consumption. At present, the hierarchical federated learning method can make full use of the local power consumption data of each participant, so that the prediction result of power consumption is more accurate, avoids the participants directly transmitting their own power consumption data, reduces a large number of data transmission steps, improves the efficiency of model training, and improves the information security in the cooperation process between different participants. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 is an application environment diagram of a power consumption prediction method in an embodiment;

[0028] Figure 2 A schematic diagram of a flow chart of a method for predicting power consumption in an embodiment;

[0029] Figure 3 A framework diagram of hierarchical federated learning in one embodiment;

[0030] Figure 4 It is a flowchart of the step of clustering and grouping participants in one embodiment;

[0031] Figure 5 This is a structural diagram of an electricity consumption prediction model based on LSTM in an embodiment;

[0032] Figure 6 is a schematic flow chart of an intra-group aggregation step in one embodiment;

[0033] Figure 7 is a system structure diagram of a power consumption prediction device in one embodiment;

[0034] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0036] The power consumption prediction method provided in this application can be applied to Figure 1 In the application environment shown in the figure, Figure 1 The illustrated application environment includes a group server 102 and a plurality of service servers 104 as participants connected to the group server 102 via a network.

[0037] Specifically, when performing power consumption prediction, the method includes: the grouping server 102 clusters and groups the participants 104 based on the local model parameters corresponding to the participants 104, so as to classify multiple matching participants 104 that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participants 104 based on the power consumption data obtained by themselves; for each group cluster, the grouping server 102 determines the aggregate party in the group from the multiple matching participants included in the corresponding group cluster, and triggers the aggregate party in the group to cluster the participants based on the matching parameters in the corresponding group cluster and the remaining matching parameters. The local model parameters corresponding to the parties are aggregated within the group to obtain the target group model parameters; the group server 102 determines the global aggregation party from multiple intra-group aggregation parties, and triggers the global aggregation party to globally aggregate the target group model parameters corresponding to each group cluster to obtain the global model parameters; each participating party 104 updates the locally maintained initial prediction model based on the acquired global model parameters, and continues the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining the trained target prediction model; the target prediction model is used to predict electricity consumption.

[0038] In one embodiment, the group server 102 and the service server 104 may be implemented using independent servers or a server cluster consisting of multiple servers, which is not limited in this embodiment of the present application.

[0039] In one embodiment, Figure 2 As shown, a method for predicting power consumption is provided. Figure 1 The group server in the example is used to illustrate, including the following steps:

[0040] Step S202, based on the local model parameters corresponding to each participant obtained, cluster the participants to divide multiple matching participants that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant.

[0041] Specifically, when the grouping server determines that it has successfully connected to each participant, it requests each participant to obtain local model parameters and receives the parameter data fed back by each participant. After that, based on the local model parameters corresponding to each participant, the grouping server uses a preset clustering method to cluster and group each participant, so as to divide multiple matching participants with similar local model parameters into corresponding group clusters.

[0042] Clustering refers to a process of classifying and organizing data members that are similar in some aspects. In one embodiment, the grouping server uses a clustering algorithm to cluster and group each participant. It should be noted that the clustering algorithm used in the embodiment of the present application is such as K-means clustering, an algorithm based on hierarchical clustering, or an algorithm based on density clustering, etc., which is not limited in the embodiment of the present application.

[0043] In one embodiment, the grouping server may use the K-means clustering algorithm for clustering. During the clustering process, the grouping server divides multiple matching participants whose similarities meet preset similarity conditions into corresponding grouping clusters based on the similarity between the local model parameters of each participant. It should be noted that the K-means clustering algorithm repeatedly divides data into k clusters based on a certain distance function. For specific grouping conditions, please refer to Figure 3 To understand.

[0044] In one of the embodiments, based on the private IPFS (InterPlanetary File System, distributed file system) network jointly formed by each participant, each participant trains the locally stored electricity consumption data according to the initial prediction model maintained locally; then, based on the training results, the local model parameters are extracted (it can be understood that the local model parameters include but are not limited to the gradient parameters and weight parameters of the model). After that, each participant uploads the extracted local model parameters to the above-mentioned IPFS network, and receives the file hash value corresponding to the feedback of the IPFS network. In one embodiment, the participant packages the received file hash value and uploads the corresponding packaged file to the blockchain to complete the chain.

[0045] Step S204, for each grouping cluster, determine the intra-group aggregator from the multiple matching participants included in the corresponding grouping cluster, and trigger the intra-group aggregator to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding grouping cluster to obtain the target group model parameters.

[0046] Specifically, for each grouping cluster, the grouping server will determine the in-group aggregator from the multiple matching participants included in the corresponding grouping cluster based on the pre-set in-group selection order. Afterwards, the grouping server will trigger the in-group aggregator to obtain the local model parameters of the remaining matching participants in the group, and obtain the corresponding target group model parameters after in-group aggregation. In one embodiment, the in-group aggregator records the target group model parameters obtained by in-group aggregation into the corresponding in-group parameter file, and sends the in-group parameter file to the remaining matching participants in the group, and the remaining matching participants in the group update the local model parameters based on the obtained in-group parameter file.

[0047] In one of the embodiments, based on the private IPFS network jointly formed by various participants, when it is determined that the participants package the file Hash value and other related information on the chain, the aggregator in the group will read the file Hash value uploaded by other participants in the group from the blockchain. Afterwards, when it is determined that the file Hash value is read successfully, the aggregator in the group will pull the parameter file of other participants in the group and record the local model parameters through the corresponding IPFS node, and when the parameter file is collected, it will perform group aggregation locally based on the pulled local model parameters to obtain the corresponding target group model parameters. It should be noted that a group cluster corresponds to a target group model parameter, and each matching participant in the group cluster shares the target group model parameter so that the local model parameters of each matching participant in the group remain consistent.

[0048] Based on the above-mentioned embodiment, the in-group aggregator will also record the aggregated target group model parameters into the in-group parameter file, upload the in-group parameter file to the above-mentioned IPFS network, and receive the file Hash value fed back by the IPFS network, and upload the received file Hash value and other related information to the blockchain. In one embodiment, when the blockchain receives the file Hash value uploaded by the in-group aggregator, it will synchronously notify the remaining participants in the group, so that the remaining participants in the group can access the above-mentioned IPFS network according to the file Hash value of the updated parameter, and download the in-group parameter file from the in-group aggregator or other participants in the group who have previously extracted the target group model parameters, and update the local model parameters based on the downloaded in-group parameter file.

[0049] Step S206 , determining a global aggregator from the multiple intra-group aggregators, and triggering the global aggregator to perform global aggregation on the target group model parameters corresponding to each grouping cluster, to obtain global model parameters.

[0050] Specifically, a global aggregator is determined from multiple intra-group aggregators, and the global aggregator is triggered to globally aggregate the target group model parameters corresponding to each grouping cluster to obtain the global model parameters, including: selecting the global aggregator based on the multiple intra-group aggregators selected in the last intra-group aggregation iteration; triggering the global aggregator to obtain the target group model parameters corresponding to each grouping cluster, and aggregating the obtained target group model parameters to obtain the corresponding global model parameters.

[0051] In one embodiment, based on the private IPFS network jointly formed by each participant, the intra-group aggregator selected in the last intra-group aggregation iteration in each group will upload the target group model parameters obtained by intra-group aggregation to the global blockchain. Afterwards, the group server selects the global aggregator based on the multiple intra-group aggregators selected in the last intra-group aggregation iteration in each group, and the selected global aggregator performs global aggregation. In one embodiment, the global aggregator records the global model parameters obtained by aggregation into a global file, and uploads the global file Hash value of the global file to the above-mentioned IPFS network and the global blockchain. Afterwards, each participant can obtain the global file Hash value through the global blockchain and pull the global model parameters through the corresponding IPFS node.

[0052] Step S208 triggers each participant to update the locally maintained initial prediction model based on the acquired global model parameters, and continue the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption.

[0053] Specifically, the global aggregator records the global model parameters obtained by aggregation into a global file, and sends the global file to each participant, so that each participant can update the initial prediction model maintained locally based on the global model parameters recorded in the global file, and after the update is completed, return to the above step S202, and re-perform intra-group aggregation and global aggregation based on the updated prediction model. When a certain number of iterations is reached, when it is determined that the prediction model updated in the current iteration converges, the power consumption is predicted based on the currently trained target prediction model, and the iteration is stopped, and the corresponding prediction result is output.

[0054] In one embodiment, each participant is triggered to update the locally maintained initial prediction model based on the acquired global model parameters, and the steps of intra-group aggregation and global aggregation are continued based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model, including: triggering each participant to update the locally maintained initial prediction model based on the acquired global model parameters; when it is determined that the updated prediction model does not converge, entering the next model iteration optimization process; when it is determined that the next model iteration optimization process is entered, the updated prediction model obtained in the previous iteration is used as the initial prediction model maintained locally by the participant in the current iteration, and returning to the step of clustering and grouping each participant based on the acquired local model parameters corresponding to each participant, until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model.

[0055] In one of the embodiments, each participant updates the locally maintained initial prediction model based on the acquired global model parameters, and when it is determined that the updated prediction model does not converge, the federated learning training and aggregation of intra-group aggregation and global aggregation are re-performed until it is determined that the updated prediction model converges, thereby obtaining a trained target prediction model, and performing electricity consumption prediction based on the target prediction model.

[0056] In the above-mentioned power consumption prediction method, clustering and grouping are performed based on the local model parameters corresponding to each participant, so as to divide each participant into the corresponding group cluster. Moreover, based on the grouping situation, each group cluster is first aggregated within the group, and then global aggregation is performed based on the target group model parameters obtained by the intra-group aggregation. At this time, the corresponding global model parameters will be obtained. After that, each participant is triggered to update the locally maintained prediction model based on the obtained global model parameters, and when it is determined that the updated prediction model does not meet the preset convergence conditions, the steps of intra-group aggregation and global aggregation are continued. After multiple rounds of iterative training, a trained target prediction model will be obtained, and this model will be used to predict power consumption. At present, the hierarchical federated learning method can make full use of the local power consumption data of each participant, making the prediction result of power consumption more accurate, avoiding the participants directly transmitting their own power consumption data, reducing a large number of data transmission steps, improving the efficiency of model training, and improving the information security in the cooperation process between different participants.

[0057] In one embodiment, Figure 4 As shown, based on the local model parameters corresponding to each participant obtained, each participant is clustered and grouped to divide multiple matching participants that meet similar conditions into corresponding group clusters, including:

[0058] Step S402: Obtain local model parameters corresponding to each participant.

[0059] Specifically, in the private IPFS network jointly formed by various participants, the group server is connected to each participant based on the private chain. Before obtaining the local model parameters, the group server will initialize the private chain, and after determining the participants to perform pre-training of global federated learning according to the preset number of training rounds, upload the trained local model parameters to the above-mentioned IPFS network, and read the Hash value of the IPFS file uploaded by each participant from the blockchain, so that the group server can pull the local model parameters through the corresponding IPFS node.

[0060] In one embodiment, the packet server performs model training based on the LSTM (Long Short-Term Memory) network. For the model structure diagram of the LSTM network, please refer to Figure 5 .based on Figure 5 It can be seen that the LSTM network used in this embodiment includes an input layer, an LSTM network layer and a fully connected layer; wherein the feature vector at each moment in the input layer corresponds to an LSTM network layer structure; and the LSTM hyperparameter network layer number and the number of LSTM cells will determine the stacking structure and total number of LSTM cells contained in an LSTM network; for a training with a time window of w, the output of w LSTM networks will be given as input X to the fully connected layer to map the LSTM to the output feature space.

[0061] In one embodiment, during the actual training of the model, for the LSTM network model containing multiple hidden layers, the dropout-overfitting technology will be adopted to avoid the model from being overly dependent on a small number of local neurons, solve the problem of overfitting of the model in the later stage of training, and further improve the robustness and training efficiency of the model. It should be noted that the dropout technology will randomly discard the output of some hidden layers while retaining the output gate weights. At the same time, during the network training process, when it is observed that the loss function decreases slowly in the later stage and oscillates, in order to improve the overall learning effect and learning efficiency, a learning rate decay strategy with a fixed step size decay can also be introduced to ensure the learning efficiency of the model in the early stage while improving the learning precision of the model in the later stage.

[0062] Step S404, taking the local model parameters corresponding to each participant as a sample and the set formed by each participant as a sample space, in the initial stage of cluster analysis, a preset number of cluster centers are selected in the sample space; each cluster center represents a grouping cluster.

[0063] Step S406, calculating the distance between each sample and each cluster center, and grouping the samples to the cluster center with the closest distance to form corresponding grouping clusters.

[0064] Step S408, calculate the mean of each grouping cluster, take the mean as the new cluster center, and continue to execute the step of returning to calculate the distance between each sample and each cluster center based on the new cluster center to perform iterative processing until the cluster center no longer changes or reaches a preset number of iterations, thereby obtaining multiple grouping clusters.

[0065] Specifically, the grouping server divides the data into K groups and randomly selects K objects as the initial cluster centers. After that, the distance between each object and each seed cluster center is calculated, and each object is assigned to the cluster center closest to it. Among them, the cluster centers and the objects assigned to them represent a cluster (i.e., a grouping cluster). And, when the grouping server assigns a sample each time, the cluster center of the cluster will be recalculated based on the existing objects in the cluster to obtain a new cluster center. The above process will be repeated until the preset termination condition is met, and the corresponding grouping cluster is output.

[0066] In one embodiment, the termination condition may be that no (or a minimum number) of objects are reallocated to different clusters, no (or a minimum number) of cluster centers change again, the sum of squared errors is locally minimized, etc., which is not limited in this embodiment of the present application.

[0067] In this embodiment, the participants are clustered and grouped using the k-means clustering algorithm. Since the k-means clustering algorithm is simple in principle, easy to operate, and highly efficient, it can effectively reduce the complexity of grouping and improve the efficiency of grouping execution.

[0068] In one embodiment, Figure 6 As shown, the triggering group aggregation party performs group aggregation based on the local model parameters corresponding to the other matching participants in the corresponding group cluster to obtain the target group model parameters, including:

[0069] Step S602, when performing the first intra-group aggregation iteration, the triggering intra-group aggregation party aggregates the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain initial group model parameters.

[0070] Step S604, triggering each participant to update the local model parameters based on the initial group model parameters to determine the corresponding updated model parameters.

[0071] Specifically, when the first intra-group aggregation is performed in each group cluster, the group server will trigger the intra-group aggregation party, aggregate based on the local model parameters of the remaining matching participants in the group, and obtain the corresponding initial group model parameters. In one embodiment, the group server records the obtained initial group model parameters in the corresponding intra-group parameter file, and sends the file to each participant, and each participant updates the local model parameters based on the obtained intra-group parameter file.

[0072] Step S606: reselect the in-group aggregate party from the remaining matching participants in the corresponding group cluster according to the in-group selection order to determine the in-group aggregate party corresponding to the next in-group training.

[0073] Specifically, the group server determines a specific group selection order for each participant in the group in advance within the corresponding group range, and sends the determined group selection order to each participant in the group, so that each participant in the group can predetermine the round in which to participate in the scheduling work, that is, in which round of iteration, it will act as the aggregator in the group. In one embodiment, the above-mentioned group selection order can be set based on the ID (Identity document) of the participant, or based on the priority level of the participant, etc., and this embodiment of the application does not limit this.

[0074] Step S608, when entering the next intra-group aggregation iteration, the updated model parameters are used as the local model parameters in the next intra-group aggregation iteration, and the triggering intra-group aggregation party is returned to aggregate the local model parameters corresponding to the remaining matching participants in the corresponding grouping cluster, and the step of obtaining the initial group model parameters continues until the preset iteration end condition is met, and the initial group model parameters calculated in the last intra-group aggregation iteration are used as the target group model parameters.

[0075] Specifically, when entering the next intra-group aggregation iteration, the intra-group aggregator will again obtain the updated local model parameters of the remaining participants in the group, and aggregate based on the updated local model parameters to obtain an intra-group parameter file that records the group model parameters. At this time, the intra-group aggregator will send the intra-group parameter file obtained in the current iteration to the remaining intra-group participants, and the remaining intra-group participants will update the local model parameters again based on the obtained intra-group parameter file. This will be repeated for multiple iterations until the preset iteration end condition is met, and the group model parameters calculated in the last intra-group aggregation iteration will be used as the target group model parameters.

[0076] In one embodiment, the preset iteration end condition may be that a preset number of iterations is reached, the group model parameters obtained by aggregation remain unchanged during multiple consecutive iterations, and all participants in the group have become aggregators in the group, etc. This embodiment of the application does not limit this.

[0077] In this embodiment, by grouping the participants and performing federated learning training and aggregation within the group (i.e., intra-group aggregation), the local electricity consumption data of each participant can be fully utilized, making the electricity consumption prediction results more accurate, and avoiding a series of problems caused by central server failures in traditional centralized federated learning, thereby improving the accuracy of electricity consumption prediction.

[0078] In one embodiment, the method further includes: determining a screening range according to a plurality of matching participants included in the corresponding grouping cluster; and determining within the screening range, an intra-group selection order in which each matching participant is sequentially selected as an intra-group aggregator in the corresponding intra-group aggregation iteration.

[0079] Specifically, the group server sets multiple matching participants belonging to the same group cluster within a screening range. Within the screening range, the selection order within the group of each matching participant can be set based on the participant ID (Identity document), priority level, etc., which is not limited in the embodiments of the present application. It should be noted that each participant uses its own collected local electricity consumption data to train the model, and takes the role of the aggregator within the group in rotation. In group-wide federated learning, the local model parameters of the remaining participants in the group obtained through local training are collected by the aggregator within the group, and intra-group aggregation and global aggregation are performed based on the collected local model parameters. In the current embodiment, the electricity consumption data of each participant is fully utilized to make the prediction results of electricity consumption more accurate. At the same time, the hierarchical structure can also reduce the global communication cost.

[0080] It should be understood that although Figure 2 , Figure 4 and Figure 6 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , Figure 4 and Figure 6 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0081] In one embodiment, please refer to Figure 7 , a power consumption prediction device 700 is provided, the device 700 includes a grouping module 701, a screening module 702 and a triggering module 703, wherein:

[0082] The grouping module 701 is used to cluster and group the participants based on the local model parameters corresponding to each participant, so as to divide multiple matching participants that meet similar conditions into corresponding grouping clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant.

[0083] The screening module 702 is used to determine, for each grouping cluster, the in-group aggregated party from the multiple matching participants included in the corresponding grouping cluster.

[0084] The trigger module 703 is used to trigger the intra-group aggregation party to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the target group model parameters.

[0085] The screening module 702 is further used to determine a global aggregator from multiple in-group aggregators.

[0086] The trigger module 703 is also used to trigger the global aggregator to globally aggregate the target group model parameters corresponding to each grouping cluster to obtain the global model parameters; trigger each participating party to update the locally maintained initial prediction model based on the acquired global model parameters, and continue the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption.

[0087] In one embodiment, the screening module 702 is also used to obtain local model parameters corresponding to each participant; take the local model parameters corresponding to each participant as a sample, and take the set formed by each participant as a sample space, and in the initial stage of cluster analysis, select a preset number of cluster centers in the sample space; each cluster center represents a grouping cluster; calculate the distance between each sample and each cluster center, and divide the samples into the cluster centers closest to each other to form corresponding grouping clusters; calculate the mean of each grouping cluster, take the mean as the new cluster center, and return to the step of calculating the distance between each sample and each cluster center based on the new cluster center, and continue to execute iterative processing until the cluster center no longer changes or stops when the preset number of iterations is reached, and multiple grouping clusters are obtained.

[0088] In one embodiment, the trigger module 703 is also used to trigger the aggregator within the group to aggregate based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster during the first intra-group aggregation iteration to obtain initial group model parameters; trigger each participant to update the local model parameters based on the initial group model parameters to determine the corresponding updated model parameters; reselect the aggregator within the group from the remaining matching participants in the corresponding group cluster according to the intra-group selection order to determine the aggregator within the group corresponding to the next intra-group training; when entering the next intra-group aggregation iteration, use the updated model parameters as the local model parameters in the next intra-group aggregation iteration, and return to the step of aggregating the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the initial group model parameters by triggering the aggregator within the group to continue executing until the preset iteration end condition is met, and the initial group model parameters calculated in the last intra-group aggregation iteration are used as the target group model parameters.

[0089] In one of the embodiments, the screening module 702 is further used to determine a screening range based on multiple matching participants included in the corresponding grouping cluster; within the screening range, determine the intra-group selection order in which each matching participant is selected in turn as an intra-group aggregation party in the corresponding intra-group aggregation iteration.

[0090] In one of the embodiments, the trigger module 703 is also used to select a global aggregator based on multiple intra-group aggregators selected in the last intra-group aggregation iteration; trigger the global aggregator to obtain the target group model parameters corresponding to each grouping cluster, and aggregate the obtained target group model parameters to obtain the corresponding global model parameters.

[0091] In one of the embodiments, the trigger module 703 is also used to trigger each participant to update the locally maintained initial prediction model based on the acquired global model parameters; when it is determined that the updated prediction model does not converge, it will enter the next model iteration optimization process; when it is determined to enter the next model iteration optimization process, the updated prediction model obtained in the previous iteration is used as the initial prediction model maintained locally by the participant in the current iteration, and returns to the clustering and grouping step for each participant based on the acquired local model parameters corresponding to each participant, and continues to execute until the updated prediction model meets the preset convergence conditions to obtain a trained target prediction model.

[0092] The above-mentioned power consumption prediction device performs clustering and grouping based on the local model parameters corresponding to each participant, so as to divide each participant into the corresponding group cluster. Moreover, based on the grouping situation, each group cluster is first aggregated within the group, and then global aggregation is performed based on the target group model parameters obtained by the intra-group aggregation. At this time, the corresponding global model parameters will be obtained. After that, each participant is triggered to update the locally maintained prediction model based on the obtained global model parameters, and when it is determined that the updated prediction model does not meet the preset convergence conditions, the steps of intra-group aggregation and global aggregation are continued. After multiple rounds of iterative training, a trained target prediction model will be obtained, and this model will be used to predict power consumption. At present, the hierarchical federated learning method can make full use of the local power consumption data of each participant, so that the prediction result of power consumption is more accurate, avoids the participants directly transmitting their own power consumption data, reduces a large number of data transmission steps, improves the model training efficiency, and improves the information security in the cooperation process between different participants.

[0093] It should be noted that the specific limitations on the power consumption prediction device can be found in the above limitations on the power consumption prediction method, which will not be repeated here.

[0094] In one embodiment, a computer device is provided. It should be noted that the packet server in the above-mentioned method embodiments and the service server as a participant can be implemented by a computer device. The computer device can be a terminal or a server, and its internal structure diagram can be as follows: Figure 8 As shown. The computer device includes a processor, a memory and a communication interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for predicting power consumption is implemented.

[0095] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0096] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: clustering and grouping the participants based on the local model parameters corresponding to the respective participants, so as to divide multiple matching participants that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participants based on the power consumption data obtained by the participants themselves; for each group cluster, determining the aggregate party in the group from the multiple matching participants included in the corresponding group cluster, and triggering the aggregate party in the group to perform a clustering based on the local model parameters; In the corresponding group cluster, the local model parameters corresponding to the remaining matching participants are aggregated within the group to obtain the target group model parameters; from the multiple intra-group aggregators, the global aggregator is determined, and the global aggregator is triggered to globally aggregate the target group model parameters corresponding to each group cluster to obtain the global model parameters; each participant is triggered to update the locally maintained initial prediction model based on the acquired global model parameters, and continue the steps of intra-group aggregation and global aggregation based on the updated prediction model, until the updated prediction model meets the preset convergence conditions, and the trained target prediction model is obtained; the target prediction model is used to predict electricity consumption.

[0097] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining local model parameters corresponding to each participant; taking the local model parameters corresponding to each participant as a sample, and taking the set formed by each participant as a sample space, and in the initial stage of cluster analysis, selecting a preset number of cluster centers in the sample space; each cluster center represents a grouping cluster; calculating the distance between each sample and each cluster center, and dividing the samples into the cluster centers closest to each other to form corresponding grouping clusters; calculating the mean of each grouping cluster, taking the mean as a new cluster center, and returning to the step of calculating the distance between each sample and each cluster center based on the new cluster center, and continuing to execute iterative processing until the cluster center no longer changes or stops when a preset number of iterations is reached, and multiple grouping clusters are obtained.

[0098] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when performing the first intra-group aggregation iteration, the triggering intra-group aggregator aggregates the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain initial group model parameters; triggering each participant to update the local model parameters based on the initial group model parameters to determine the corresponding updated model parameters; reselecting the intra-group aggregator from the remaining matching participants in the corresponding group cluster according to the intra-group selection order to determine the intra-group aggregator corresponding to the next intra-group training; when entering the next intra-group aggregation iteration, the updated model parameters are used as the local model parameters in the next intra-group aggregation iteration, and the step of returning to the triggering intra-group aggregator to aggregate the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the initial group model parameters continues to be executed until the preset iteration end condition is met, and the initial group model parameters calculated in the last intra-group aggregation iteration are used as the target group model parameters.

[0099] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining a screening range based on multiple matching participants included in the corresponding grouping cluster; within the screening range, determining the intra-group selection order in which each matching participant is selected in turn as an intra-group aggregator in the corresponding intra-group aggregation iteration.

[0100] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the multiple intra-group aggregators selected in the last intra-group aggregation iteration, a global aggregator is selected; the global aggregator is triggered to obtain the target group model parameters corresponding to each grouping cluster, and the obtained target group model parameters are aggregated to obtain the corresponding global model parameters.

[0101] In one embodiment, when the processor executes the computer program, the following steps are also implemented: triggering each participant to update the locally maintained initial prediction model based on the acquired global model parameters; when it is determined that the updated prediction model does not converge, entering the next model iteration optimization process; when it is determined to enter the next model iteration optimization process, the updated prediction model obtained in the previous iteration is used as the initial prediction model maintained locally by the participant in the current iteration, and returning to the clustering and grouping step for each participant based on the acquired local model parameters corresponding to each participant, until the updated prediction model meets the preset convergence conditions, and a trained target prediction model is obtained.

[0102] The computer device performs clustering and grouping based on the local model parameters corresponding to each participant, so as to divide each participant into a corresponding group cluster. Moreover, based on the grouping situation, each group cluster is first aggregated within the group, and then global aggregation is performed based on the target group model parameters obtained by the intra-group aggregation. At this time, the corresponding global model parameters will be obtained. After that, each participant is triggered to update the locally maintained prediction model based on the obtained global model parameters, and when it is determined that the updated prediction model does not meet the preset convergence conditions, the steps of intra-group aggregation and global aggregation are continued. After multiple rounds of iterative training, a trained target prediction model will be obtained, and this model will be used to predict the power consumption. At present, the hierarchical federated learning method can make full use of the local power consumption data of each participant, so that the prediction result of power consumption is more accurate, avoids the participants directly transmitting their own power consumption data, reduces a large number of data transmission steps, improves the model training efficiency, and improves the information security in the cooperation process between different participants.

[0103] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: based on the local model parameters corresponding to each participant obtained, the participants are clustered and grouped to divide multiple matching participants that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by the participant pre-training the initial prediction model maintained by itself based on the power consumption data obtained by itself; for each group cluster, from the multiple matching participants included in the corresponding group cluster, an in-group aggregation party is determined, and the in-group aggregation party is triggered based on the corresponding group cluster. Within the cluster, the local model parameters corresponding to the remaining matching participants are aggregated within the group to obtain the target group model parameters; from multiple intra-group aggregators, a global aggregator is determined, and the global aggregator is triggered to globally aggregate the target group model parameters corresponding to each grouping cluster to obtain the global model parameters; each participant is triggered to update the locally maintained initial prediction model based on the obtained global model parameters, and continue to perform the intra-group aggregation and global aggregation steps based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining the trained target prediction model; the target prediction model is used to predict electricity consumption.

[0104] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining local model parameters corresponding to each participant; taking the local model parameters corresponding to each participant as a sample, and taking the set formed by each participant as a sample space, and in the initial stage of cluster analysis, selecting a preset number of cluster centers in the sample space; each cluster center represents a grouping cluster; calculating the distance between each sample and each cluster center, and dividing the samples into the cluster centers closest to each other to form corresponding grouping clusters; calculating the mean of each grouping cluster, taking the mean as a new cluster center, and returning to the step of calculating the distance between each sample and each cluster center based on the new cluster center, and continuing to execute iterative processing until the cluster center no longer changes or stops when a preset number of iterations is reached, and multiple grouping clusters are obtained.

[0105] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when performing the first intra-group aggregation iteration, the triggering intra-group aggregator aggregates the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain initial group model parameters; triggering each participant to update the local model parameters based on the initial group model parameters to determine the corresponding updated model parameters; reselecting the intra-group aggregator from the remaining matching participants in the corresponding group cluster according to the intra-group selection order to determine the intra-group aggregator corresponding to the next intra-group training; when entering the next intra-group aggregation iteration, using the updated model parameters as the local model parameters in the next intra-group aggregation iteration, and returning to the step of aggregating the local model parameters corresponding to the remaining matching participants in the corresponding group cluster by the triggering intra-group aggregator to obtain the initial group model parameters, and continuing to execute until the preset iteration end condition is met, and the initial group model parameters calculated in the last intra-group aggregation iteration are used as the target group model parameters.

[0106] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining a screening range based on multiple matching participants included in the corresponding grouping cluster; within the screening range, determining the intra-group selection order in which each matching participant is selected in turn as an intra-group aggregator in the corresponding intra-group aggregation iteration.

[0107] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the multiple intra-group aggregators selected in the last intra-group aggregation iteration, a global aggregator is selected; the global aggregator is triggered to obtain the target group model parameters corresponding to each grouping cluster, and the obtained target group model parameters are aggregated to obtain the corresponding global model parameters.

[0108] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: triggering each participant to update the locally maintained initial prediction model based on the acquired global model parameters; when it is determined that the updated prediction model does not converge, entering the next model iteration optimization process; when it is determined to enter the next model iteration optimization process, the updated prediction model obtained in the previous iteration is used as the initial prediction model maintained locally by the participant in the current iteration, and returning to the clustering and grouping step for each participant based on the acquired local model parameters corresponding to each participant, until the updated prediction model meets the preset convergence conditions, and a trained target prediction model is obtained.

[0109] The storage medium is clustered and grouped based on the local model parameters corresponding to each participant, so as to divide each participant into a corresponding group cluster. Moreover, based on the grouping situation, each group cluster is first aggregated within the group, and then global aggregation is performed based on the target group model parameters obtained by the intra-group aggregation. At this time, the corresponding global model parameters will be obtained. After that, each participant is triggered to update the locally maintained prediction model based on the obtained global model parameters, and when it is determined that the updated prediction model does not meet the preset convergence conditions, the steps of intra-group aggregation and global aggregation are continued. After multiple rounds of iterative training, a trained target prediction model will be obtained, and this model will be used to predict the power consumption. At present, the hierarchical federated learning method can make full use of the local power consumption data of each participant, so that the prediction result of power consumption is more accurate, avoids the participants directly transmitting their own power consumption data, reduces a large number of data transmission steps, improves the model training efficiency, and improves the information security in the cooperation process between different participants.

[0110] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0111] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0112] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for predicting power consumption, characterized in that: The following steps are involved: Based on the local model parameters corresponding to each participant obtained, the participants are clustered and grouped to divide multiple matching participants that meet similar conditions into corresponding group clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant, and the local model parameters include the gradient parameters and weight parameters of the model; For each grouping cluster, determine an intra-group aggregator from a plurality of matching participants included in the corresponding grouping cluster, and trigger the intra-group aggregator to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding grouping cluster, so as to obtain the target group model parameters; Based on the multiple intra-group aggregators selected in the last intra-group aggregation iteration, a global aggregator is selected; the global aggregator is triggered to obtain the target group model parameters corresponding to each of the grouping clusters, and the obtained target group model parameters are aggregated to obtain corresponding global model parameters; Triggering each of the participants to update the locally maintained initial prediction model based on the acquired global model parameters, and continue to perform the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence conditions, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption; Among them, the triggering of the in-group aggregator performs in-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the target group model parameters, including: when performing the first in-group aggregation iteration, the triggering in-group aggregator performs aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the initial group model parameters; triggering each participant to update the local model parameters based on the initial group model parameters to determine the corresponding updated model parameters; determining a screening range based on a plurality of matching participants included in the corresponding group cluster; within the screening range, determining that each matching participant is selected in turn as the group in the corresponding in-group aggregation iteration The intra-group selection order of the inner-aggregator; according to the intra-group selection order, reselect the inner-group aggregator from the remaining matching participants in the corresponding group cluster to determine the inner-group aggregator corresponding to the next intra-group training; when entering the next intra-group aggregation iteration, use the updated model parameters as the local model parameters in the next intra-group aggregation iteration, and return to the triggering inner-group aggregator to aggregate the local model parameters corresponding to the remaining matching participants in the corresponding group cluster, and continue to execute the step of obtaining the initial group model parameters until the preset iteration end condition is met, and stop, and use the initial group model parameters calculated in the last intra-group aggregation iteration as the target group model parameters.

2. The method according to claim 1, characterized in that: The clustering and grouping of the participants based on the acquired local model parameters corresponding to the participants, so as to divide a plurality of matching participants satisfying similar conditions into corresponding group clusters, includes: Obtain the local model parameters corresponding to each participant; The local model parameters corresponding to each of the participants are taken as samples, and the set formed by each of the participants is taken as a sample space. In the initial stage of cluster analysis, a preset number of cluster centers are selected in the sample space; each cluster center represents a grouping cluster; Calculate the distance between each sample and each cluster center, and divide the samples into the cluster center with the closest distance to form the corresponding grouping cluster; Calculate the mean of each grouping cluster, use the mean as the new cluster center, return to the step of calculating the distance between each sample and each cluster center based on the new cluster center, and continue to execute iterative processing until the cluster center no longer changes or reaches a preset number of iterations, thereby obtaining multiple grouping clusters.

3. The method according to claim 1, characterized in that The triggering of each of the participants to update the locally maintained initial prediction model based on the acquired global model parameters, and continuing the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence condition, thereby obtaining a trained target prediction model, including: Triggering each of the participants to update the locally maintained initial prediction model based on the acquired global model parameters; When it is determined that the updated prediction model does not converge, the next model iteration optimization process will be entered; When it is determined to enter the next model iteration optimization process, the updated prediction model obtained in the previous iteration is used as the initial prediction model maintained locally by the participants in the current iteration, and the process returns to the local model parameters corresponding to each participant obtained, and the clustering and grouping steps for each participant are continued until the updated prediction model meets the preset convergence conditions to obtain a trained target prediction model.

4. The method according to claim 1, characterized in that: Before clustering and grouping the participants based on the acquired local model parameters corresponding to the participants, the method further includes: When it is determined that each participant is successfully connected, a request is made to each participant to obtain local model parameters, and the corresponding parameter data fed back by each participant is received.

5. A power consumption prediction device, characterized in that: The device comprises: A grouping module, for clustering and grouping the participants based on the local model parameters corresponding to the participants, so as to classify multiple matching participants that meet similar conditions into corresponding grouping clusters; wherein the local model parameters are obtained by pre-training the initial prediction model maintained by the participant based on the power consumption data obtained by the participant, and the local model parameters include the gradient parameters and weight parameters of the model; A screening module, for determining, for each grouping cluster, from a plurality of matching participants included in the corresponding grouping cluster, an intra-group aggregation party; A trigger module, used to trigger the intra-group aggregator to perform intra-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the target group model parameters; The screening module is further used to select a global aggregator based on the multiple intra-group aggregators selected in the last intra-group aggregation iteration; The trigger module is also used to trigger the global aggregation party to obtain the target group model parameters corresponding to each of the grouping clusters, and to aggregate the obtained target group model parameters to obtain the corresponding global model parameters; trigger each of the participating parties to update the locally maintained initial prediction model based on the obtained global model parameters, and continue to perform the steps of intra-group aggregation and global aggregation based on the updated prediction model until the updated prediction model meets the preset convergence condition, thereby obtaining a trained target prediction model; the target prediction model is used to predict electricity consumption; Among them, the triggering of the in-group aggregator performs in-group aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the target group model parameters, including: when performing the first in-group aggregation iteration, the triggering in-group aggregator performs aggregation based on the local model parameters corresponding to the remaining matching participants in the corresponding group cluster to obtain the initial group model parameters; triggering each participant to update the local model parameters based on the initial group model parameters to determine the corresponding updated model parameters; determining a screening range based on a plurality of matching participants included in the corresponding group cluster; within the screening range, determining that each matching participant is selected in turn as the group in the corresponding in-group aggregation iteration The intra-group selection order of the inner-aggregator; according to the intra-group selection order, reselect the inner-group aggregator from the remaining matching participants in the corresponding group cluster to determine the inner-group aggregator corresponding to the next intra-group training; when entering the next intra-group aggregation iteration, use the updated model parameters as the local model parameters in the next intra-group aggregation iteration, and return to the triggering inner-group aggregator to aggregate the local model parameters corresponding to the remaining matching participants in the corresponding group cluster, and continue to execute the step of obtaining the initial group model parameters until the preset iteration end condition is met, and stop, and use the initial group model parameters calculated in the last intra-group aggregation iteration as the target group model parameters.

6. The device according to claim 5, characterized in that The grouping module is also used to obtain local model parameters corresponding to each participant; take the local model parameters corresponding to each participant as a sample, take the set formed by each participant as a sample space, and in the initial stage of cluster analysis, select a preset number of cluster centers in the sample space; each cluster center represents a grouping cluster; calculate the distance between each sample and each cluster center, and divide the samples into the cluster centers closest to each other to form corresponding grouping clusters; calculate the mean of each grouping cluster, take the mean as a new cluster center, and return to the step of calculating the distance between each sample and each cluster center based on the new cluster center to continue to execute for iterative processing until the cluster center no longer changes or stops when a preset number of iterations is reached, and obtain multiple grouping clusters.

7. The device according to claim 6, characterized in that The trigger module is also used to trigger each of the participants to update the locally maintained initial prediction model based on the acquired global model parameters; when it is determined that the updated prediction model does not converge, it will enter the next model iteration optimization process; When it is determined to enter the next model iteration optimization process, the updated prediction model obtained in the previous iteration is used as the initial prediction model maintained locally by the participants in the current iteration, and the process returns to the local model parameters corresponding to each participant obtained, and the clustering and grouping steps for each participant are continued until the updated prediction model meets the preset convergence conditions to obtain a trained target prediction model.

8. The device according to claim 6, characterized in that The grouping module is also used to request each participant to obtain local model parameters when it is determined that the connection to each participant is successful, and receive the parameter data fed back by each participant accordingly.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • User electricity consumption relevant factor identification and electricity consumption quantity prediction method under environment of big data

    CN105512768A

  • Automatic auditing system and method

    CN111652570A

  • User electricity consumption characteristic selection method based on maximum correlation minimum redundancy criterion

    CN111860600A

  • Edge-based federated learning model cleaning and equipment clustering method, system and equipment and readable storage medium

    CN112181971A

  • Model training method and device based on federated learning and storage medium

    CN112712182A