Electricity consumption prediction method, system, equipment and medium

By constructing a time series graph of electricity consumption on the client side and embedding environmental information, extracting features using a graph neural network, and performing loss-weighted aggregation on the server, the accuracy and privacy issues of electricity consumption prediction in a multi-client environment are solved, and efficient electricity consumption prediction is achieved.

CN121303399APending Publication Date: 2026-01-09HAINAN POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511114629.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-11
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

In a multi-client distributed environment, how can we effectively integrate the temporal correlation, numerical similarity, and environmental information of electricity consumption while ensuring data privacy, and optimize and aggregate model parameters based on differences in client prediction performance, thereby improving the accuracy of electricity consumption prediction?

Method used

A time series graph of electricity consumption is built on the client side, environmental information is embedded, features are extracted using a graph neural network, and loss-weighted model parameters are aggregated on the server side to generate a global prediction model.

Benefits of technology

It significantly improves the model's ability to perceive complex time-series patterns and nonlinear fluctuations, enhances the accuracy and generalization ability of electricity consumption forecasting, and reduces performance degradation caused by data heterogeneity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121303399A_ABST
    Figure CN121303399A_ABST
Patent Text Reader

Abstract

The invention discloses an electricity consumption prediction method, system and device and a medium, and belongs to the technical field of electricity consumption prediction, and the method comprises the steps: respectively obtaining the electricity consumption data of an area where a client is located and the environment information related to the electricity consumption data; constructing an electricity consumption time sequence diagram as graph structure data based on the electricity consumption data; based on the graph structure data, utilizing a graph neural network to carry out feature extraction on the node features, and training to obtain a local prediction model and model parameters; and predicting the power consumption. According to an aggregation mechanism of a global model, a model aggregation method based on loss weighting is provided, so that electricity consumption prediction models suitable for different regions are constructed, and electricity consumption prediction is carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electricity consumption forecasting technology, and specifically to a method, system, device, and medium for electricity consumption forecasting. Background Technology

[0002] Electricity consumption forecasting is a key task in smart grids. However, due to significant differences in industrial structure, population density, and economic level among users in different regions, electricity consumption varies. Providing stable, high-quality power supply to various regions is one of the core tasks of a smart grid system, and accurate forecasting of electricity demand in different regions can greatly improve power supply efficiency and save costs. Furthermore, electricity consumption data may contain sensitive information, often used to infer the economic situation and power supply company status of different regions. Therefore, accurately forecasting electricity consumption in different regions while ensuring data privacy is crucial. Accurate electricity consumption forecasting requires robust prediction models, but electricity consumption data from a single region may be insufficient for effective model training. Federated learning (FL) has become a key method to address this problem. Federated learning (FL) is a machine learning paradigm that leverages distributed data to facilitate collaborative model training across multiple clients. Compared to traditional centralized methods, this approach offers key advantages, particularly reducing privacy risks and efficiently handling large-scale machine learning tasks without aggregating large amounts of data on a central server. FL has already achieved successful applications in real-world sectors such as healthcare, finance, and recommender systems. The basic FedAvg algorithm achieves privacy-preserving model training by learning from multiple local clients, where the model or gradients are shared with a central server to aggregate and generate a global model. Despite these advantages, challenges arise due to the heterogeneity of data among clients. In some regions where electricity consumption is primarily industrial, changes in electricity consumption data are closely related to industrial production, and different scales of industrial production lead to different fluctuations in electricity consumption.

[0003] To address this challenge, this invention improves and optimizes the algorithms on both the client and server sides. On the client side, to better fit the changing patterns of electricity consumption data, this invention constructs an electricity consumption change graph using daily electricity consumption as the time node. Each node in the graph represents the electricity consumption for the corresponding date, and the edges in the graph represent the numerical correlation between the electricity consumption corresponding to different nodes. The closer the electricity consumption values ​​are, the stronger the correlation, indicating a greater influence of the corresponding node in the prediction process. Then, this invention encodes and embeds additional factors such as daily holiday information and weather information into the nodes of the graph as node features. Based on this graph structure, this invention designs a hierarchical multi-scale graph attention neural network on the client side to extract the changing features of electricity consumption data for prediction. On the server side, to effectively integrate the various models, this invention designs a loss-weighted global aggregation method. This allows for the construction of electricity consumption prediction models applicable to different regions.

[0004] In the operation and management of smart grids, accurate electricity demand forecasting has core strategic value. Influenced by regional development characteristics, significant heterogeneity exists across regions in terms of industrial layout (e.g., manufacturing clusters versus commercial centers), population density (e.g., metropolitan areas versus remote regions), and economic development stage (e.g., emerging development zones versus traditional industrial zones). This directly leads to differentiated electricity consumption patterns in different geographical units. To ensure the stable operation and power supply quality of the power grid system, while simultaneously achieving optimal resource allocation and operational cost control, constructing a regionally customized electricity demand forecasting system is crucial. It is worth noting that electricity consumption data contains information on regional economic trends (e.g., industry activity index) and critical infrastructure information (e.g., production cycles of key enterprises). A significant contradiction exists between the privacy protection requirements of this sensitive information and the value of data sharing. Traditional centralized modeling methods are limited by the finite number of data samples in a single region and the requirements for data isolation, making it difficult to construct forecasting models with strong generalization capabilities. Summary of the Invention

[0005] In view of the above-mentioned problems, the present invention is proposed.

[0006] Therefore, the technical problem solved by this invention is: how to effectively integrate the temporal correlation, numerical similarity and environmental information of electricity consumption in a multi-client distributed environment while ensuring data privacy, and to optimize and aggregate model parameters based on the differences in client prediction performance, thereby improving the accuracy of electricity consumption prediction.

[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for predicting electricity consumption, comprising: acquiring electricity consumption data and environmental information related to the electricity consumption data for the region where the client is located in multiple clients;

[0008] In each client, a time series graph of electricity consumption is constructed based on electricity consumption data as graph structure data. The graph structure data represents time correlation and numerical similarity, and the encoded environmental information is embedded into the node features of the graph structure data.

[0009] In each client, based on graph structure data, a graph neural network is used to extract features from node features and train a local prediction model and model parameters.

[0010] Send the model parameters and the prediction loss corresponding to the local prediction model to the server;

[0011] In the server, the aggregation weights are determined based on the prediction loss of each client, and the model parameters are weighted and aggregated to obtain the global prediction model.

[0012] Electricity consumption is predicted using a global prediction model.

[0013] As a preferred embodiment of the electricity consumption prediction method of the present invention, the step of constructing an electricity consumption time series graph as graph structure data based on electricity consumption data includes mapping electricity consumption data with time series attributes into nodes of graph structure data in chronological order.

[0014] For any two nodes, the temporal correlation is calculated based on the ratio of the interval length between the two nodes in the time series to the total length of the current series, and the numerical similarity is calculated based on the cosine similarity of the electricity consumption vectors corresponding to the two nodes.

[0015] The temporal correlation and numerical similarity are multiplied to form the weight of the edge between two nodes, and graph structure data is generated based on the weights of the edges between all node pairs.

[0016] The beneficial effects of this preferred technical solution are as follows: by mapping electricity consumption data with time-series attributes to nodes of graph structure data, calculating the temporal correlation and numerical similarity between nodes respectively, and then using the product of the two as the weight of the edge to generate graph structure data, it can not only comprehensively depict the sequential relationship of electricity consumption data in the time dimension and the degree of similarity in the numerical dimension, but also retain the correlation information of temporal features and numerical features in the same data structure. This provides a more accurate and information-rich input representation for subsequent feature extraction based on graph neural networks, thereby significantly improving the model's ability to perceive complex temporal patterns and nonlinear fluctuations.

[0017] As a preferred embodiment of the electricity consumption prediction method of the present invention, the step of embedding the encoded environmental information into the node features of the graph structure data includes encoding the environmental information, which includes converting the categorical environmental information into vector form and performing numerical normalization on the numerical environmental information.

[0018] The encoded environmental information is vector-concatenated with the electricity consumption data features of the corresponding nodes in the graph structure data to obtain node features containing environmental information.

[0019] As a preferred embodiment of the electricity consumption prediction method of the present invention, the step of using a graph neural network to extract node features includes, in the client, based on graph structure data, using a graph neural network with a multi-head attention mechanism, calculating the attention weight between any node and its neighboring nodes in multiple feature subspaces respectively.

[0020] The features of adjacent nodes are weighted and summed according to the attention weights of each feature subspace to update the node features and generate node feature representations at the corresponding scale.

[0021] The node feature representations at multiple scales are concatenated into vectors to obtain the updated node features.

[0022] As a preferred embodiment of the electricity consumption prediction method described in this invention, the training to obtain the local prediction model and model parameters includes, in the client, inputting the updated node features into the local scale layer, extracting the periodic temporal features based on the graph structure data, and filtering noise through a gating mechanism;

[0023] The updated node features are input into the global scale layer, and temporal pooling is performed to generate monthly granular supernodes. A high-order graph structure is then constructed based on the supernodes, and features are propagated through a graph attention mechanism.

[0024] The features output from the local scale layer and the features output from the global scale layer are weighted and concatenated according to adaptive weight parameters to obtain the final node features used to train the local prediction model.

[0025] As a preferred embodiment of the electricity consumption prediction method of the present invention, the weighted aggregation includes receiving model parameters and their corresponding prediction losses from each client.

[0026] Based on the prediction loss of each client, the initial aggregation weights are calculated using the exponential decay function, and then the initial aggregation weights are normalized.

[0027] Based on the initial aggregation weights after normalization, the model parameters of each client are weighted and summed. The difference between the global model parameters of the previous round and the weighted summation result is constrained based on the momentum factor to obtain the aggregation result to be corrected.

[0028] As a preferred embodiment of the electricity consumption prediction method described in this invention, the weighted aggregation further includes calculating the corresponding Kullback-Leibler divergence based on the prediction distribution of the previous round global prediction model on the local data of each client and the distribution of the local data of each client.

[0029] The normalized initial aggregation weights are corrected based on the Kullback–Leibler divergence, and the corrected aggregation weights are then normalized.

[0030] The model parameters of each client are weighted and summed using modified aggregate weights instead of the initial aggregate weights, and combined with momentum factor constraints, to obtain a global prediction model.

[0031] The beneficial effects of this preferred technical solution are as follows: During the aggregation process of the global prediction model, an initial aggregation weight calculation mechanism based on client prediction loss is introduced, and momentum factor constraints are combined to improve the stability of model updates. Furthermore, in the aggregation weight correction stage, the Kullback-Leibler divergence measure is used to measure the difference between the distribution of each client's data and the global model's prediction distribution, dynamically adjusting the allocation ratio of aggregation weights. This solution can simultaneously consider client model performance and data distribution heterogeneity, making the global model more accurate when fusing multi-source information, reducing the global performance degradation caused by bias in some client data, thereby effectively improving the overall accuracy and generalization ability of electricity consumption prediction results.

[0032] This invention provides a system for predicting electricity consumption.

[0033] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a power consumption prediction system, comprising: multiple clients, used to acquire power consumption data of the area where the client is located and environmental information related to the power consumption data;

[0034] This is used to construct a time-series graph of electricity consumption based on the electricity consumption data as graph structure data, and to embed the encoded environmental information into the node features of the graph structure data;

[0035] Used to extract features from node features using a graph neural network based on the graph structure data, and to train a local prediction model and model parameters;

[0036] Used to send the model parameters and the prediction loss corresponding to the local prediction model to the server;

[0037] The server is used to determine the aggregation weight based on the prediction loss of each client, perform weighted aggregation of the model parameters to obtain a global prediction model, and use the global prediction model to predict electricity consumption.

[0038] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method for predicting electricity consumption.

[0039] The present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method for predicting electricity consumption.

[0040] The beneficial effects of this invention are as follows: On the client side, a graph of electricity consumption changes is constructed using daily electricity consumption as the time node. Each node in the graph represents the electricity consumption for the corresponding date. The edges in the graph represent the numerical correlation between the electricity consumption corresponding to different nodes. The closer the electricity consumption values ​​are, the greater the correlation, indicating a greater influence of the corresponding node during the prediction process. Furthermore, this invention encodes and embeds additional factors such as daily holiday information and weather information into the nodes of the graph as node features.

[0041] On the server, a loss-weighted model aggregation method is proposed for the aggregation mechanism of the global model, thereby constructing an electricity consumption prediction model applicable to different regions. Attached Figure Description

[0042] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart illustrating an overall method for predicting electricity consumption, as provided in one embodiment of the present invention.

[0044] Figure 2 This is an experimental comparative analysis diagram of a method for predicting electricity consumption provided in one embodiment of the present invention. Detailed Implementation

[0045] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0046] Example 1, referring to Figure 1This is one embodiment of the present invention, which provides a method for predicting electricity consumption, including:

[0047] In multiple clients, electricity consumption data and related environmental information for the client's location are obtained respectively;

[0048] In each client, a time series graph of electricity consumption is constructed based on electricity consumption data as graph structure data. The graph structure data represents time correlation and numerical similarity, and the encoded environmental information is embedded into the node features of the graph structure data.

[0049] In each client, based on graph structure data, a graph neural network is used to extract features from node features and train a local prediction model and model parameters.

[0050] Send the model parameters and the prediction loss corresponding to the local prediction model to the server;

[0051] In the server, the aggregation weights are determined based on the prediction loss of each client, and the model parameters are weighted and aggregated to obtain the global prediction model.

[0052] Electricity consumption is predicted using a global prediction model.

[0053] It should be noted that, against the backdrop of the rapid development of smart grids, accurate electricity demand forecasting has become a crucial component of power system operation and management. Currently, various electricity forecasting methods based on time-pattern analysis have been proposed and widely applied. However, modeling the peak variation patterns of electricity demand remains a challenging problem, and practical deployment faces numerous challenges because consumption data is scattered across different entities, including power distribution companies and industrial enterprises. Furthermore, privacy protection is required due to the involvement of sensitive industrial information. This data fragmentation leads to the "island effect," isolating data and hindering integration, resulting in insufficient training data and performance degradation for traditional forecasting models. In this context, federated learning becomes a suitable solution.

[0054] As an emerging distributed machine learning paradigm, federated learning offers a novel approach to addressing the data silo problem. However, current federated learning-based electricity demand forecasting methods still have some under-considered aspects. Traditional federated learning (FL) methods encounter two main challenges in electricity demand forecasting that can significantly impact forecast accuracy. The first challenge is preventing overfitting when dealing with limited client data. In federated learning, each client has a limited dataset, which may not adequately capture the diverse consumption behaviors and peak variations across different regions or time periods. Overfitting occurs when the model overfits to the limited data from a single client, resulting in poor generalization to new, unseen data. This problem is particularly severe when modeling consumption peak variations, as these fluctuations are often extreme and irregular, making them more prone to overfitting. The second challenge arises during the aggregation process in federated learning, where models trained locally on multiple clients are aggregated into a global model. During aggregation, client-specific features, such as unique consumption patterns or regional peak variations, may be lost or diluted, causing the model to fail to accurately capture the diversity in client data. This loss of client-specific information can lead to a phenomenon called oversmoothing, where the predictions provided by the global model are too generalized and fail to reflect the actual needs of certain clients. Furthermore, inconsistencies in local model parameters due to differences in training data or model architecture can exacerbate this problem.

[0055] Furthermore, constructing a time-series graph of electricity consumption based on electricity consumption data as graph structure data includes mapping electricity consumption data with time-series attributes into nodes of graph structure data in chronological order;

[0056] For any two nodes, the temporal correlation is calculated based on the ratio of the interval length between the two nodes in the time series to the total length of the current series, and the numerical similarity is calculated based on the cosine similarity of the electricity consumption vectors corresponding to the two nodes.

[0057] The temporal correlation and numerical similarity are multiplied to form the weight of the edge between two nodes, and graph structure data is generated based on the weights of the edges between all node pairs.

[0058] Embedding encoded environmental information into the node features of graph structure data includes encoding the environmental information, which includes converting categorical environmental information into vector form and performing numerical normalization on numerical environmental information.

[0059] The encoded environmental information is vector-concatenated with the electricity consumption data features of the corresponding nodes in the graph structure data to obtain node features containing environmental information.

[0060] Feature extraction of node features using graph neural networks includes, in the client, using graph neural networks with multi-head attention mechanism based on graph structure data, calculating the attention weight between any node and its neighboring nodes in multiple feature subspaces respectively;

[0061] The features of adjacent nodes are weighted and summed according to the attention weights of each feature subspace to update the node features and generate node feature representations at the corresponding scale.

[0062] The node feature representations at multiple scales are concatenated into vectors to obtain the updated node features.

[0063] The training yields a local prediction model and model parameters, including, in the client, inputting the updated node features into the local scale layer, extracting periodic temporal features based on graph structure data, and filtering noise through a gating mechanism;

[0064] The updated node features are input into the global scale layer, and temporal pooling is performed to generate monthly granular supernodes. A high-order graph structure is then constructed based on the supernodes, and features are propagated through a graph attention mechanism.

[0065] The features output from the local scale layer and the features output from the global scale layer are weighted and concatenated according to adaptive weight parameters to obtain the final node features used to train the local prediction model.

[0066] Weighted aggregation includes receiving model parameters and their corresponding prediction losses from each client;

[0067] Based on the prediction loss of each client, the initial aggregation weights are calculated using the exponential decay function, and then the initial aggregation weights are normalized.

[0068] Based on the initial aggregation weights after normalization, the model parameters of each client are weighted and summed. The difference between the global model parameters of the previous round and the weighted summation result is constrained based on the momentum factor to obtain the aggregation result to be corrected.

[0069] Based on the prediction distribution of the previous round of global prediction model on the local data of each client and the distribution of the local data of each client, calculate the corresponding Kullback-Leibler divergence.

[0070] The normalized initial aggregation weights are corrected based on the Kullback–Leibler divergence, and the corrected aggregation weights are then normalized.

[0071] The model parameters of each client are weighted and summed using modified aggregate weights instead of the initial aggregate weights, and combined with momentum factor constraints, to obtain a global prediction model.

[0072] Specifically, let K be the total number of customers, and Ci be the i-th customer, where 1 ≤ i ≤ K. Specifically, Ci has a corresponding training set, where M is the number of data points for the i-th client. Combined with... Figure 1 :

[0073] First, the model converts the time-series electricity consumption data into an electricity consumption time-series graph, where edge similarity is used to represent the numerical dependencies of electricity consumption, thus integrating temporal correlation and numerical similarity to transform it into a structured electricity consumption time-series graph. In the electricity consumption time-series graph, nodes represent electricity consumption values, and edges encode two axes of temporal continuity and value-based correlation: temporal adjacency (regularity of event intervals, denoted as temporal sequence) and numerical fluctuation amplitude (denoted as numerical value), as expressed in formula (1).

[0074]

[0075] In this context, edge represents the edge of the constructed graph, temporality(xi,xj) represents the temporal representation between xi and xj, and Numerical(xi,xj) captures the numerical similarity between these nodes. len is the length of the current sequence, and |ij| is the temporal distance between xi and xj, meaning that a longer time interval weakens the influence of the temporal factor. To measure numerical similarity, this invention uses cosine similarity.

[0076] By embedding environmental information into the electricity consumption time series graph, it is found that regional electricity consumption patterns are closely related to regional environmental factors such as weather conditions and holidays. Changes in environmental factors are a significant driver of fluctuations in regional electricity consumption. Commonly used environmental factors include temperature, weather, humidity, holidays, and the comparison between weekends and weekdays. These variables are interrelated and collectively affect fluctuations in electricity consumption. To model these factors, this invention uses a bag-of-words model to represent holidays, weekends, weather, and weekdays as one-hot encoded vectors, and combines normalized temperature and humidity into a unified environmental information vector. The encoded environmental information is then embedded into the electricity consumption time series graph.

[0077] The client constructs a multi-scale graph attention neural network with a node feature fusion layer. Let the node feature matrix be H∈RN×d, where N is the number of time nodes and d is the feature dimension. The daily electricity consumption ei, holiday codes hi, and weather codes wi are linearly transformed and concatenated to generate the initial node features.

[0078] hi(0)=σ(Weei⊕Whhi⊕Wwwi) (2)

[0079] Where We,Wh,Ww are trainable parameter matrices, ⊕ represents vector concatenation, and σ is the activation function.

[0080] Multi-scale attention extraction layer

[0081] A multi-head attention mechanism is employed to compute dynamic weights between nodes at different scales:

[0082] Attention coefficients of the k-th attention head for nodes i and j:

[0083]

[0084] Where W(k)∈Rdk×d is the projection matrix and a is the attention parameter vector.

[0085] Each head outputs features:

[0086]

[0087] Multi-scale feature fusion:

[0088]

[0089] Where K is the number of attention heads, and ∥ represents vector concatenation.

[0090] Hierarchical aggregation layers construct a two-layer pyramid structure:

[0091] Local scale layer: Extracts periodic temporal features from the original time map structure and filters noise through a gating mechanism.

[0092] Hlocal = GRU(H′)

[0093] Global scale layer: After temporal pooling of nodes, monthly granularity supernodes are generated, and a higher-order graph is constructed for feature propagation.

[0094] Hglobal=GAT(MaxPooling(H′))

[0095] Finally, the predicted features are output through residual connections:

[0096] Y^=MLP(Hlocal+βHglobal)

[0097] Here, β is an adaptive weight parameter. This network achieves the coordinated capture of short-term fluctuations and long-term trends through multi-head decomposition of the feature space and pyramid aggregation of the temporal dimension.

[0098] Server model construction, based on a loss-weighted model aggregation method, assumes the server receives local model parameter sets {θk}k=1K from K regional clients, and each client corresponds to a training loss Lk. Global aggregation is achieved through the following steps:

[0099] Loss normalization weight calculation uses an exponential decay function to map the loss to contribution weights:

[0100]

[0101] Here, λ>0 is a temperature coefficient that controls the steepness of the weight distribution. Clients with lower Lk values ​​(better model performance) receive higher weights.

[0102] Parameter space weighted aggregation, the global model parameters θG are updated by the following formula:

[0103]

[0104] Where η is the momentum factor, and the second term constrains the stability of the polymerization process by the difference in historical parameters.

[0105] Regional adaptability enhancement: A weight adjustment term is designed to address the heterogeneity of regional data.

[0106]

[0107] Where KL(pG∥pk) is the KL divergence between the global model prediction distribution pG and the local data distribution pk in region k, dynamically balancing the matching degree between model performance and regional characteristics.

[0108] Example 2, refer to Figure 2 This is one embodiment of the present invention, which provides a method for predicting electricity consumption. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.

[0109] The electricity consumption dataset comes from Tetouan, Morocco (Data_kaggle). This dataset contains 52,416 energy consumption observations within 10-minute time windows, each described by 9 feature columns. Specifically, these include: date and time (each 10-minute time window), temperature (weather temperature), humidity (weather humidity), wind speed (wind speed), general diffusion flow (“diffusion flow” is a general term referring to low-temperature (<0.2°C to approximately 100°C) fluids slowly released through sulfide piles, broken lava flows, bacterial mats, and large animal populations), diffusion flow, electricity consumption in region 1, electricity consumption in region 2, and electricity consumption in region 3. Environmental information includes temperature, humidity, wind speed, and diffusion flow. Holiday information was not included in this dataset; we use this information as an additional attribute in the vector f. The results are shown in Table 1.

[0110] Table 1 Comparison of Experimental Results

[0111]

[0112] The comparison methods include: the first group combines common electricity consumption prediction methods with typical federated learning frameworks such as AvgFL and FedCor, forming models such as AvgFL-SVR, AvgFL-BiLSTM, AvgFL-Multi-Scale Attention Model (AvgFL-MSattention), FedCor-SVR, FedCor-BiLSTM, and FedCor-Multi-Scale Attention Model (FedCor-MSattention). Here, SVR refers to Support Vector Regression, BiLSTM refers to Bidirectional LSTM, and Multi-Scale Attention Model refers to Multi-Scale Attention Model.

[0113] CNN-LSTMFED is a predictive model based on augmented intelligent datasets. In this study, generative adversarial networks (GANs) are used to generate electricity consumption data, mitigating the overfitting problem of client-side data through data augmentation.

[0114] Adaptive Stacked LSTM, an energy consumption prediction framework, leverages the concepts of adaptive learning, federated learning, and edge computing.

[0115] SparseMoE: The expert network in the MoE (Expert Hybrid) architecture is implemented through a transformer-based deep learning model, Meta-former. It utilizes exponentially weighted moving average (EMA) operations and pooling operations for prediction.

[0116] Example 3 is an embodiment of the present invention. This embodiment provides a system for predicting electricity consumption, including: multiple clients, used to acquire electricity consumption data of the area where the client is located and environmental information related to the electricity consumption data;

[0117] This is used to construct a time-series graph of electricity consumption based on the electricity consumption data as graph structure data, and to embed the encoded environmental information into the node features of the graph structure data;

[0118] Used to extract features from node features using a graph neural network based on the graph structure data, and to train a local prediction model and model parameters;

[0119] Used to send the model parameters and the prediction loss corresponding to the local prediction model to the server;

[0120] The server is used to determine the aggregation weight based on the prediction loss of each client, perform weighted aggregation of the model parameters to obtain a global prediction model, and use the global prediction model to predict electricity consumption.

[0121] It should be noted that, on the client side, in order to fit the changing patterns of electricity consumption data as closely as possible, this invention constructs an electricity consumption change graph on the client side, using daily electricity consumption as the time node. Each node in this graph represents the electricity consumption for the corresponding date, and the edges in the graph represent the numerical correlation between the electricity consumption corresponding to different nodes. The closer the electricity consumption values ​​are, the stronger the correlation, indicating a greater influence of the corresponding node during the prediction process. Then, this invention encodes additional factors such as daily holiday information and weather information and embeds them into the nodes of the graph as node features. Based on this graph structure, this invention designs a hierarchical multi-scale graph attention neural network on the client side to extract the changing features of electricity consumption data and then perform predictions. On the server side, in order to effectively integrate the various models, this invention designs a loss-weighted global aggregation method. This allows for the construction of electricity consumption prediction models applicable to different regions.

[0122] This embodiment also provides an electronic device applicable to a power consumption prediction method, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement a power consumption prediction method as proposed in the above embodiment.

[0123] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements a power consumption prediction method as described in the above embodiments.

[0124] The storage medium proposed in this embodiment belongs to the same inventive concept as the method for predicting electricity consumption proposed in the above embodiments. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0125] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0126] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for predicting electricity consumption, characterized in that: include, In multiple clients, electricity consumption data and related environmental information for the client's location are obtained respectively; In each client, a time series graph of electricity consumption is constructed based on electricity consumption data as graph structure data. The graph structure data represents time correlation and numerical similarity, and the encoded environmental information is embedded into the node features of the graph structure data. In each client, based on graph structure data, a graph neural network is used to extract features from node features and train a local prediction model and model parameters. Send the model parameters and the prediction loss corresponding to the local prediction model to the server; In the server, the aggregation weights are determined based on the prediction loss of each client, and the model parameters are weighted and aggregated to obtain the global prediction model. Electricity consumption is predicted using a global prediction model.

2. The method for predicting electricity consumption as described in claim 1, characterized in that: The construction of a time-series graph of electricity consumption based on electricity consumption data as graph structure data includes mapping electricity consumption data with time-series attributes into nodes of graph structure data in chronological order. For any two nodes, the temporal correlation is calculated based on the ratio of the interval length between the two nodes in the time series to the total length of the current series, and the numerical similarity is calculated based on the cosine similarity of the electricity consumption vectors corresponding to the two nodes. The temporal correlation and numerical similarity are multiplied to form the weight of the edge between two nodes, and graph structure data is generated based on the weights of the edges between all node pairs.

3. The method for predicting electricity consumption as described in claim 2, characterized in that: The process of embedding the encoded environmental information into the node features of the graph structure data includes encoding the environmental information, which includes converting categorical environmental information into vector form and performing numerical normalization on numerical environmental information. The encoded environmental information is vector-concatenated with the electricity consumption data features of the corresponding nodes in the graph structure data to obtain node features containing environmental information.

4. The method for predicting electricity consumption as described in claim 3, characterized in that: The feature extraction of node features using graph neural networks includes, in the client, using graph neural networks with multi-head attention mechanism based on graph structure data, calculating the attention weight between any node and its neighboring nodes in multiple feature subspaces respectively. The features of adjacent nodes are weighted and summed according to the attention weights of each feature subspace to update the node features and generate node feature representations at the corresponding scale. The node feature representations at multiple scales are concatenated into vectors to obtain the updated node features.

5. The method for predicting electricity consumption as described in claim 4, characterized in that: The training to obtain the local prediction model and model parameters includes, in the client, inputting the updated node features into the local scale layer, extracting periodic temporal features based on graph structure data, and filtering noise through a gating mechanism; The updated node features are input into the global scale layer, and temporal pooling is performed to generate monthly granular supernodes. A high-order graph structure is then constructed based on the supernodes, and features are propagated through a graph attention mechanism. The features output from the local scale layer and the features output from the global scale layer are weighted and concatenated according to adaptive weight parameters to obtain the final node features used to train the local prediction model.

6. The method for predicting electricity consumption as described in claim 5, characterized in that: The weighted aggregation includes receiving model parameters and their corresponding prediction losses from each client; Based on the prediction loss of each client, the initial aggregation weights are calculated using the exponential decay function, and then the initial aggregation weights are normalized. Based on the initial aggregation weights after normalization, the model parameters of each client are weighted and summed. The difference between the global model parameters of the previous round and the weighted summation result is constrained based on the momentum factor to obtain the aggregation result to be corrected.

7. The method for predicting electricity consumption as described in claim 6, characterized in that: The weighted aggregation also includes calculating the corresponding Kullback-Leibler divergence based on the prediction distribution of the previous round of global prediction model on the local data of each client and the distribution of the local data of each client; The normalized initial aggregation weights are corrected based on the Kullback–Leibler divergence, and the corrected aggregation weights are then normalized. The model parameters of each client are weighted and summed using modified aggregate weights instead of the initial aggregate weights, and combined with momentum factor constraints, to obtain a global prediction model.

8. A system for predicting electricity consumption, employing the method for predicting electricity consumption as described in any one of claims 1 to 7, characterized in that, include: Multiple clients are used to obtain electricity consumption data and related environmental information for the area where the client is located, respectively. This is used to construct a time-series graph of electricity consumption based on the electricity consumption data as graph structure data, and to embed the encoded environmental information into the node features of the graph structure data; Used to extract features from node features using a graph neural network based on the graph structure data, and to train a local prediction model and model parameters; Used to send the model parameters and the prediction loss corresponding to the local prediction model to the server; The server is used to determine the aggregation weight based on the prediction loss of each client, perform weighted aggregation of the model parameters to obtain a global prediction model, and use the global prediction model to predict electricity consumption.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for predicting electricity consumption according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for predicting electricity consumption as described in any one of claims 1 to 7.