CN-122000860-A - Federal power load prediction method based on dynamic clustering and layering personalized aggregation
Abstract
The invention relates to the technical field of power load prediction, and discloses a federal power load prediction method based on dynamic clustering and layering personalized aggregation, which comprises the following steps of constructing a transverse federal learning frame; the method comprises the steps of carrying out independent training on local load data by each client and uploading updated model parameters to a server, calculating the similarity by the server by utilizing cosine similarity to dynamically adjust the structure of clusters, setting an active period according to training rounds, deleting inactive clusters by judging whether the clusters are active or not to adjust the number of the clusters, respectively carrying out hierarchical federation aggregation on each cluster model by the server based on the current clustering result, respectively transmitting the aggregated cluster models to each client of a corresponding cluster by the server to carry out the next training round, and realizing continuous dynamic optimization. The method has obvious advantages in key indexes such as prediction precision and convergence rate, and improves load prediction performance under the federal frame.
Inventors
- CHEN ZHENPING
- FENG JING
- ZHOU YIHONG
- LU YOU
- WANG XIAOLIANG
Assignees
- 苏州科技大学
Dates
- Publication Date
- 20260508
- Application Date
- 20251203
Claims (10)
- 1. The federal power load prediction method based on dynamic clustering and layering personalized aggregation is characterized by comprising the following steps of: S1, constructing a transverse federal learning framework, wherein the framework comprises N resident clients and 1 central server, each resident client stores a private power load data set, and the private power load data set comprises power load data, humidity data, temperature data and dew point temperature data; S2, local training and model uploading, wherein after each resident client receives the model parameters issued by the central server, independent local training is performed on the basis of a local private power load data set to obtain updated model parameters, and the updated model parameters are uploaded to the central server; S3, dynamically clustering, namely, a central server receives updated model parameters uploaded by each resident client, calculates similarity between clients by using cosine similarity, completes division of initial clusters based on the similarity, calculates similarity between the clients and each cluster based on the cosine similarity in a subsequent federal training process to dynamically adjust the structure of the clusters, and meanwhile, sets active periods of the clusters according to training rounds, and deletes inactive clusters to dynamically adjust the number of the clusters by judging whether each cluster meets active conditions or not; S4, model layering aggregation, wherein the central server respectively executes layering federation aggregation on the models of all clusters based on the current clustering result obtained in the S3, so as to realize global knowledge sharing by performing inter-cluster global aggregation on shared layer parameters of all clusters; s5, model issuing and iterative updating, wherein the central server issues each cluster model aggregated in the S4 to each resident client of the corresponding cluster respectively, and returns to the S2 to be repeatedly executed until training reaches a preset stopping condition, so that a final federal power load prediction model is obtained; S6, inputting 48 multi-characteristic data points at intervals of 30min on the previous day by utilizing the final federal power load prediction model, and outputting 48 power load predicted values at intervals of 30min on the next day.
- 2. The federal power load prediction method based on dynamic clustering and hierarchical personalized aggregation according to claim 1, wherein the model in S2 is a TCN-BiLSTM hybrid network model, and the structure of the TCN-BiLSTM hybrid network model includes a TCN layer, a BiLSTM layer and a full connection layer, wherein the TCN layer is used for extracting time sequence characteristics of power load data, the BiLSTM layer is used for capturing global context time information of the power load data, and the full connection layer is used for mapping the characteristics to a target output dimension.
- 3. The federal power load prediction method based on dynamic clustering and hierarchical personalized aggregation according to claim 2, wherein the sharing layer is a TCN layer, the personalized layer is a combination of BiLSTM layers and a full connection layer, the TCN layer of the sharing layer is used for extracting common time sequence characteristics common to all clusters, and the BiLSTM-FC layer of the personalized layer is used for adapting unique data distribution characteristics of all clusters.
- 4. The federal power load prediction method based on dynamic clustering and hierarchical personalized aggregation according to claim 1, wherein the cosine similarity in S3 is calculated by: , Wherein: And Respectively represent clients And a client Model parameter vector of;' "Means the vector dot product operation, The closer the cosine similarity value is to 1, the more similar the data distribution of two resident clients is indicated.
- 5. The federal power load prediction method according to claim 3, wherein the specific step of S3 comprises: initial Cluster Structure construction, in the first training round, the central server updates the model parameters based on all resident clients Construction of similarity matrix from cosine similarity According to the matrix by hierarchical clustering method Dividing all clients to obtain an initial cluster structure Initial model parameters for each cluster ; And in the subsequent cluster structure updating, in the non-first training round, the central server randomly selects part of resident clients to participate in training, calculates cosine similarity between the local updating parameters of each selected resident client and the current cluster model parameters, distributes the resident clients to the cluster with the highest similarity, and completes the dynamic updating of the cluster structure.
- 6. The federal power load prediction method based on dynamic clustering and hierarchical personalized aggregation according to claim 5, wherein step S3 further comprises introducing an inactive cluster deletion mechanism in a subsequent cluster structure update phase, periodically checking Whether all the clusters in the database are active or not, and deleting if the clusters are inactive; Recording the active state determination period as If there is a cluster In a continuous manner No client is added after the round of training, namely the state is satisfied , The cluster is considered to be inactive, at which point, the first All clusters satisfying the condition form an inactive cluster index set The server then deletes the corresponding cluster from the current cluster structure according to the index set, and the deletion process can be expressed as: And at the same time, updating the total number of clusters to be 。
- 7. The federal power load prediction method based on dynamic clustering and hierarchical personalized aggregation according to claim 1, wherein the intra-cluster aggregation comprises the specific steps of: the server clusters each cluster to maintain cluster model parameters for the clusters All clients of (3) The intra-cluster polymerization process is as follows: , , Wherein: To at the first In-wheel cluster Is used for the model parameters of the model (a), Is a cluster Middle client Is used for the weight of the (c), To at the first Rear cluster for wheel training Middle client The server marks the cluster model parameters as model parameters of (a) Wherein And Respectively the first Rear cluster for wheel training Model parameters of the shared layer and the personalized layer.
- 8. The federal power load prediction method based on dynamic clustering and hierarchical personalized aggregation according to claim 1, wherein the inter-cluster global aggregation specifically comprises the following steps: The server uses the clusters as units to carry out global aggregation on the shared layer parameters of all the clusters for updating the global shared layer, and the method is specifically expressed as follows: , Wherein, the Representing the updated global model parameters of the shared layer, Is the first In-wheel cluster The parameters of the layer are shared and, Global aggregation-time cluster Is used for the weight parameters of the (c), Represent the first Number of clusters in the wheel.
- 9. The federal power load prediction method based on dynamic clustering and hierarchical personalized aggregation according to claim 1, further comprising a data preprocessing step before independent local training based on a local private power load dataset: Correcting the missing humidity data, temperature data and dew point temperature data in the private power load data set by adopting a linear interpolation method; and carrying out normalization processing on the corrected meteorological data and the power load data by adopting a maximum-minimum value normalization method.
- 10. Federal power load prediction system based on dynamic clustering and hierarchical personalized aggregation for implementing the federal power load prediction method according to any one of claims 1-9, characterized in that the system comprises a central server and N residential clients; the central server includes: The clustering module is used for executing dynamic clustering operation, and specifically comprises the steps of calculating cosine similarity of model parameters between clients, constructing a similarity matrix, dynamically adjusting a cluster structure, setting an active period and deleting an inactive cluster; the aggregation module is used for executing hierarchical federation aggregation operation and specifically comprises the steps of carrying out global aggregation among clusters on shared layer parameters of all clusters and carrying out intra-cluster aggregation on personalized layer parameters in each cluster; The model management module is used for storing initial model parameters and cluster model parameters trained in each round, issuing model parameters to resident clients and receiving updated model parameters uploaded by the resident clients; The resident client includes: The data preprocessing module is used for executing data preprocessing operation, including linear interpolation correction of missing meteorological data and maximum-minimum value normalization processing data; The local training module is used for carrying out independent local training by utilizing the model parameters issued by the central server based on the preprocessed local private power load data set to obtain updated model parameters; And the parameter uploading module is used for uploading the updated model parameters to the model management module of the central server.
Description
Federal power load prediction method based on dynamic clustering and layering personalized aggregation Technical Field The invention relates to the technical field of power load prediction, in particular to a federal power load prediction method based on dynamic clustering and layering personalized aggregation. Background Short-term power load prediction (STLF) is of great importance in the efficient operation of smart grids, especially as intermittent and difficult-to-predict renewable energy supplies increase, the role of accurate Short-term power load prediction in smart grid construction and stable scheduling is becoming more critical. The domestic electricity is used as a key ring in the intelligent power grid, and has important influence on reasonable scheduling planning and stable operation of the power grid. The federal learning (FEDERATEDLEARNING, FL) is used as a distributed machine learning method, the core idea is to allow a plurality of devices to store own data locally, and to perform joint training only by uploading local model parameters or gradients, so as to obtain a global model suitable for all devices on the premise of not directly exchanging original data, and the mechanism not only avoids the risk of original data leakage, protects privacy, but also has higher expandability than centralized learning, and has been applied to the field of power load prediction. In order to cope with the ubiquitous Non-independent co-distribution (Non-IID) characteristic of resident load data, the prior proposal introduces a clustering mechanism in federal learning, and clusters the clients with similar data distribution into clusters for training, including a one-time clustering method of fixed cluster division before training and a dynamic clustering method of dynamically updating cluster identity in training. However, the existing dynamic clustering methods still have two key limitations that 1) the methods are all independent in each cluster for federal learning training, the clusters are completely independent and mutually noninterfere, and an information exchange mechanism between the clusters is lacked. 2) The number of clusters needs to be manually pre-specified, and excessive number of clusters may result in waste of computing resources, while too little clusters cannot fully capture the diversity of data distribution, and the prior knowledge dependence is often difficult to meet in practical application. Disclosure of Invention In order to solve the technical problems, the invention provides the federal power load prediction method based on dynamic clustering and layering personalized aggregation, which has obvious advantages on key indexes such as prediction precision, convergence rate and the like, effectively relieves the influence of Non-IID load data on federal learning, and improves the load prediction performance under a federal frame. In order to achieve the above purpose, the technical scheme of the invention is as follows: the federal power load prediction method based on dynamic clustering and layering personalized aggregation comprises the following steps: S1, constructing a transverse federal learning framework, wherein the framework comprises N resident clients and 1 central server, each resident client stores a private power load data set, and the private power load data set comprises power load data, humidity data, temperature data and dew point temperature data; S2, local training and model uploading, wherein after each resident client receives the model parameters issued by the central server, independent local training is performed on the basis of a local private power load data set to obtain updated model parameters, and the updated model parameters are uploaded to the central server; S3, dynamically clustering, namely, a central server receives updated model parameters uploaded by each resident client, calculates similarity between clients by using cosine similarity, completes division of initial clusters based on the similarity, calculates similarity between the clients and each cluster based on the cosine similarity in a subsequent federal training process to dynamically adjust the structure of the clusters, and meanwhile, sets active periods of the clusters according to training rounds, and deletes inactive clusters to dynamically adjust the number of the clusters by judging whether each cluster meets active conditions or not; S4, model layering aggregation, wherein the central server respectively executes layering federation aggregation on the models of all clusters based on the current clustering result obtained in the S3, so as to realize global knowledge sharing by performing inter-cluster global aggregation on shared layer parameters of all clusters; s5, model issuing and iterative updating, wherein the central server issues each cluster model aggregated in the S4 to each resident client of the corresponding cluster respectively, and returns to the S2 to be repeated