Electricity consumption personalized electricity load prediction method based on ensemble function

By combining iterative updates of global and local models on edge nodes and using multi-head attention mechanisms and feed-forward neural networks, the problem of inability to achieve personalized power consumption prediction in the existing technology is solved, and accurate power consumption for users in different areas is achieved. Electrical load forecasting and efficient forecasting of irregularly sampled power time series.

CN118798320AActive Publication Date: 2024-10-18ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD

Patent Information

Application Number
CN202410778077.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-18
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

Existing technology is difficult to achieve personalized prediction of the power consumption patterns of users in different regions, and cannot effectively comprehensively analyze the comprehensive power load of a single station area or user, resulting in low prediction accuracy and low service quality.

Method used

A personalized electricity load prediction method based on aggregation functions is used to obtain regional electricity load data through edge nodes, and iterative updates are performed by combining the global model and the local personalized model, and a multi-head attention mechanism and a feed-forward neural network are used to capture various Regularly sample the timing dependence of power time series to establish a personalized power load prediction model.

Benefits of technology

It achieves accurate power load forecasting for users in different regions, improves forecast accuracy and service quality, is suitable for irregular sampling power time series scenarios, and enhances the scalability and personalized forecasting effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798320A_ABST
    Figure CN118798320A_ABST
Patent Text Reader

Abstract

The invention provides a power consumption personalized power consumption load prediction method based on a set function. The method comprises the steps that an edge node obtains power consumption load original data of each metering point in a region to which the edge node belongs; respectively inputting the original data of the electrical load into the global model and the local personalized model to obtain a global model predicted value and a local personalized model predicted value; wherein the edge node iteratively updates the model parameters of the global model and the local personalized model by using the original data of the electrical load, updates the local personalized model based on the updated model parameters, and sends the update quantity of the model parameters of the global model to the cloud; and the cloud updates the global model according to the model parameter update quantity sent by each edge node. Aiming at the problem of power consumption mode distribution difference of users in different areas, the invention proposes to establish a personalized model for each area based on a personalized federated learning framework so as to adapt to differentiated power consumption modes in different areas and realize accurate power consumption load prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electricity load forecasting, and in particular relates to a method for forecasting personalized electricity load based on a set function. Background Art

[0002] With the increasing popularity of smart grids and the establishment of advanced measurement systems, a huge amount of electricity consumption data has been generated in smart grids. These data can effectively help power companies to effectively predict the load in the power grid. Accurate and safe load forecasting is crucial for power production, transmission and maintenance. Establishing a deep learning model is currently a popular prediction method. Power load data is essentially a time series. Existing methods can well model the temporal dependency in power load data through models such as recurrent neural networks and Transformer, thereby effectively mining the potential power consumption patterns of various power-consuming devices and achieving accurate power load forecasting. In order to save data transmission costs and protect user privacy, a federated learning strategy based on cloud-edge-end architecture has emerged, covering many aspects of power data collection, processing and intelligent analysis. Usually, several edge nodes (edges) are set between the central cloud platform (cloud) and the user terminal (end) to receive the user-end data of each responsible area, and a federated learning strategy is used between the edge nodes to realize the distributed training of the global model, that is, each edge node uses its own local data to adjust the global model and sends the update amount of the model weight to the central cloud server. The central server will calculate the average of the weight update amount sent by all edge nodes to update the global model. As a new type of distributed machine learning technology, federated learning only sends model parameters and does not share original data, ensuring the efficiency and security of model training.

[0003] In general, existing methods use deep learning models to model the timing dependencies in power time series data, and use cloud-edge collaboration solutions and federated learning strategies to solve the efficiency and security problems that arise during model training in actual application scenarios.

[0004] However, when predicting user power load, the existing methods mainly target a single user or a single device of a single user, and only emphasize mining the power consumption pattern of a certain user or a certain device under it, and cannot effectively and comprehensively analyze the comprehensive power load prediction of a single area or a single user, which is not conducive to collective area or user behavior pattern analysis, group classification, and behavior data mining, and it is difficult to achieve personalized prediction. Due to the differences in geography and population types between different areas, and the differences in power consumption habits of different users, realizing collective personalized prediction can further improve prediction accuracy, improve service quality, and improve user experience. Summary of the invention

[0005] In view of this, the present invention aims to provide a personalized electricity load forecasting method and related devices based on set functions, which are used to address the problem of differences in the distribution of electricity consumption patterns of users in different regions. It proposes to establish a personalized model for each region based on a personalized federated learning framework to adapt to the differentiated electricity consumption patterns in different regions and achieve accurate electricity load forecasting.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a method for predicting personalized electricity load based on a set function, comprising the following steps:

[0008] The edge node obtains the original data of power load at each metering point in the area to which it belongs;

[0009] Inputting the original data of power load into the global model and the local personalized model respectively, obtaining the global model prediction value and the local personalized model prediction value;

[0010] Among them, the edge node generates a local personalized model based on the global model initialization obtained from the cloud, and uses the original power load data to iteratively update the model parameters of the global model and the local personalized model, updates the local personalized model based on the updated model parameters, and sends the model parameter update amount of the global model to the cloud, so that the cloud can update the global model according to the model parameter update amount sent by each edge node. Both the global model and the local personalized model are power load prediction models.

[0011] Furthermore, the updating of the global model and the local personalized model at the edge node includes the following steps:

[0012] The edge node inputs the data of the local historical window into the global model, and obtains updated global model parameters based on the difference between the data output by the global model and the data of the prediction window. The data of the local historical window and the data of the prediction window are obtained by dividing the original data of the power load in chronological order through a sliding window.

[0013] Inputting data of the local history window into the local personalized model, and obtaining updated local personalized model parameters based on the difference between the data output by the local personalized model and the data of the prediction window;

[0014] Obtaining an update amount of the global model parameter based on the updated global model parameter, and sending the update amount to the cloud, so that the cloud updates the global model according to the update amount sent by each edge node;

[0015] The local personalized model is updated based on the updated local personalized model parameters.

[0016] Furthermore, the power load forecasting model is a power load forecasting model based on a set function, and the input of the power load forecasting model based on a set function is a triplet of s j =(t j ,z j ,m j ), where s j is the jth power load sampling point, t j is the sampling time of the jth power load sampling point, z j is the power load value of the jth power load sampling point, m j is the terminal type of the source of the jth power load sampling point. The power load forecasting model based on the aggregate function adapts the original power load data of the irregularly sampled power time series through the input data in the form of triples.

[0017] Furthermore, the training steps of the power load forecasting model based on the aggregate function include:

[0018] Extracting sample data for model training from the original power load data;

[0019] Preprocess the sample data in triple form;

[0020] The preprocessed sample data is input into the power load forecasting model based on the feedforward neural network to obtain the power load forecast value;

[0021] According to the difference between the power load prediction value and the power load actual value, the model parameters of the power load prediction model based on the feedforward neural network are updated, and an updated power load prediction model is obtained;

[0022] Among them, the multi-head attention mechanism method is used in the power load forecasting model based on the feedforward neural network to capture the potential timing dependencies in the irregularly sampled power time series corresponding to the sample data, and to mine the user's power consumption characteristics.

[0023] Furthermore, before preprocessing the sample data in triple form, the following steps are also included:

[0024] According to the set historical window length and the window length to be predicted, pairs of historical window data and prediction window data are extracted from the sample data;

[0025] The historical window data is used as input data of the power load forecasting model based on the feedforward neural network to obtain the power load forecast value; the forecast window data is used as the actual power load value to update the power load forecasting model based on the feedforward neural network.

[0026] Furthermore, the sample data in triple form is preprocessed, including:

[0027] The sampling time t of each sampling point triplet j The continuous sine-cosine time coding method is used to encode into a τ-dimensional vector, and the result is:

[0028]

[0029] In the formula, e t is the sampling time t j The corresponding τ-dimensional vector, x 2k (t j ) and x 2k+1 (t j ) represent the even and odd bits of the τ-dimensional vector, k∈{0,...,τ / 2}, represents a vector of dimension τ;

[0030] For each sampling point triplet, the terminal type m j The pre-trained language model BERT is used to encode the text semantic representation vector, and then the feed-forward neural network FFN is used to map the text semantic representation vector into a τ-dimensional vector to obtain:

[0031]

[0032] In the formula, e m For terminal type m j The corresponding τ-dimensional vector, U m , W m , b m is the parameter matrix of the feedforward neural network, and tanh is the hyperbolic tangent activation function.

[0033] For each sampling point triplet, the power load value z j Use feedforward neural network FFN to map it into a τ-dimensional vector and get:

[0034]

[0035] In the formula, e z is the power load value z j The corresponding τ-dimensional vector, U z , W z , b z is the parameter matrix of the feedforward neural network.

[0036] Furthermore, a multi-head attention mechanism is used to capture the potential temporal dependencies in the irregularly sampled power time series corresponding to the sample data, including:

[0037] Using dot product attention with h attention heads, for the i-th head, we learn the matrix and key matrix Any observation point s in the historical window datax The encoding vector h(s x ) is mapped to d-dimensional Query vector and Key vector, that is:

[0038]

[0039] In the formula, and Represent the Query vector and Key vector respectively, represents a vector of dimension τ×d, represents a vector of dimension d;

[0040] Then calculate any two observation points s x and y The attention score between the i-th head

[0041]

[0042] Where exp() represents the exponential operation with natural logarithm e as the base. Any observation point s can be obtained by weighted summing all other M observation points through attention scores. x The output vector of the i-th head

[0043]

[0044] In the formula, is the observation point s x and j The attention score between the i-th head.

[0045] Furthermore, the triple s j The encoding vector h(s j ) is as follows:

[0046]

[0047] Furthermore, based on the output vectors obtained by the h attention heads, the expression of the user's electricity consumption characteristics is obtained through the feedforward neural network FFN as follows:

[0048] u i =FFN(o i )

[0049]

[0050] Where, the superscript i is the number of the h attention heads, the subscript i is the user number, and u i is the feature representation of the i-th user, o i is the output vector of the ith attention head, o iis the output vector aggregation matrix of the i-th user, and |H| represents the number of observation points in the historical window.

[0051] Furthermore, the expression of the power load forecast value is as follows:

[0052]

[0053] In the formula, represents user i’s m pred Equipment in t pred The power load forecast value at the moment, || represents the concatenation of vectors.

[0054] In a second aspect, the present invention also provides a personalized electricity load forecasting system based on a set function, comprising: an intelligent metering device, an edge node and a central cloud server;

[0055] The edge node is used to obtain the original data of power load at each metering point in the area through the smart metering device;

[0056] The edge node inputs the original data of power load into the global model and the local personalized model respectively to obtain the global model prediction value and the local personalized model prediction value;

[0057] Among them, the edge node generates a local personalized model based on the global model initialization obtained from the central cloud server, and uses the original power load data to iteratively update the model parameters of the global model and the local personalized model, updates the local personalized model based on the updated model parameters, and sends the model parameter update amount of the global model to the central cloud server, so that the central cloud server can update the global model according to the model parameter update amount sent by each edge node. Both the global model and the local personalized model are power load prediction models.

[0058] Accordingly, the present invention also provides a computer device, the device comprising a processor and a memory:

[0059] The memory is used to store the computer program and send the instructions of the computer program to the processor;

[0060] The processor executes a method for predicting personalized electricity load based on a set function as described in the first aspect according to instructions of the computer program.

[0061] Correspondingly, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a personalized electricity load forecasting method based on a set function as in the first aspect is implemented.

[0062] In summary, the present invention provides a method for predicting electricity load based on a set function, including obtaining the original electricity load data of each metering point in the area to which the edge node belongs; inputting the original electricity load data into the global model and the local personalized model respectively to obtain the global model prediction value and the local personalized model prediction value; wherein, the edge node generates a local personalized model based on the global model initialization obtained from the cloud, and iteratively updates the model parameters of the global model and the local personalized model using the original electricity load data, updates the local personalized model based on the updated model parameters, and sends the model parameter update amount of the global model to the cloud, so that the cloud updates the global model according to the model parameter update amount sent by each edge node, and the global model and the local personalized model are both electricity load prediction models. In view of the problem of differences in the distribution of electricity consumption patterns of users in different regions, the present invention proposes to establish personalized models for each region based on a personalized federated learning framework to adapt to the differentiated electricity consumption patterns in different regions and achieve accurate electricity load prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0064] Figure 1 An overall framework diagram of a method for predicting personalized electricity load based on a set function provided by an embodiment of the present invention;

[0065] Figure 2 A structural diagram of a user power load prediction model based on a set function provided in an embodiment of the present invention;

[0066] Figure 3 A structural diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0067] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0068] This embodiment provides a method for predicting personalized power load based on a set function, comprising the following steps:

[0069] S1: The edge node obtains the original data of power load at each metering point in the area to which it belongs;

[0070] S2: Inputting the original data of power load into the global model and the local personalized model respectively to obtain the global model prediction value and the local personalized model prediction value;

[0071] Among them, the edge node generates a local personalized model based on the global model initialization obtained from the cloud, and uses the original power load data to iteratively update the model parameters of the global model and the local personalized model, updates the local personalized model based on the updated model parameters, and sends the model parameter update amount of the global model to the cloud, so that the cloud can update the global model according to the model parameter update amount sent by each edge node. Both the global model and the local personalized model are power load prediction models.

[0072] It should be noted that in the cloud-edge-device collaboration solution, the edge device can be a single user's home electricity metering device, such as a new meter with edge computing capabilities, or a terminal with edge computing capabilities in the user's substation. The data of different users or different substations will present different data distributions. The existing federated learning strategy is too coarse-grained by simply weighted averaging the parameter updates generated by the global model using data from different regions. The final integrated global model cannot effectively express the fine-grained features of power time series data, that is, it cannot accurately capture the personalized electricity consumption patterns unique to different users or different substations. This will cause the prediction values ​​given by the model to have no regional characteristics and poor prediction performance.

[0073] In this embodiment, a local personalized model is deployed at the edge node, and this local personalized model is generated by the edge node based on the global model provided by the cloud. The edge node uses the original data of the power load in the area to which it belongs as the data basis, and continuously updates the model parameters of the local personalized model, so as to obtain a power load prediction model that meets the power consumption characteristics of users in the area. The prediction using this local personalized model can accurately capture the personalized power consumption patterns unique to different users or different substations, and give a prediction value with regional characteristics, so as to achieve a better personalized prediction effect.

[0074] In addition, the edge nodes also use the original data of power load to train the global model to obtain the model parameters of the global model taking into account the power consumption pattern of users in the area. During the iterative training of the global model by all edge nodes, the updated model parameter update amount after each update is sent to the cloud. The cloud can then update the global model based on the model update amount information provided by all edge nodes.

[0075] It can be seen that compared with the federated learning strategy in the prior art, the local personalized model trained in this embodiment is suitable for personalized prediction of user electricity consumption in the area to which it belongs, while the trained global model can take into account the electricity consumption patterns of users in all areas. After the deployment of the personalized power load prediction model, it can accurately predict the power load of users in different areas. The predicted value after the deployment of the global model can provide a reference for global power allocation, thereby solving the problem that there are differences in the distribution of user electricity consumption patterns in different regions and accurate prediction cannot be achieved.

[0076] This embodiment provides a personalized electricity load forecasting method based on a set function, which establishes a model for a sequence of sampling points of electricity load metering points of all smart devices for a single user or a single substation, realizes personalized electricity consumption pattern mining and power load forecasting, which is conducive to improving the accuracy of prediction, realizing efficient allocation of resources, and thus improving service quality. In view of the differentiated electricity consumption models of users in different regions, this patent adds a personalized federated learning strategy on the basis of the cloud-edge federated learning structure, customizes a personalized power load model for each region, and further increases the accuracy of the prediction.

[0077] In a preferred embodiment of the present invention, the updating of the global model and the local personalized model at the edge node includes the following steps:

[0078] S21: The edge node inputs the data of the local historical window into the global model, and obtains updated global model parameters based on the difference between the data output by the global model and the data of the prediction window. The data of the local historical window and the data of the prediction window are obtained by dividing the original data of the power load in chronological order through a sliding window.

[0079] S22: inputting the data of the local history window into the local personalized model, and obtaining updated local personalized model parameters based on the difference between the data output by the local personalized model and the data of the prediction window;

[0080] S23: obtaining an update amount of the global model parameter based on the updated global model parameter, and sending the update amount to the cloud, so that the cloud updates the global model according to the update amount sent by each edge node;

[0081] S24: Update the local personalized model based on the updated local personalized model parameters.

[0082] It should be noted that the edge nodes can iteratively update the global model parameters and the local personalized model parameters through the back gradient propagation algorithm.

[0083] Please refer to the figure Figure 1In a specific implementation of this embodiment, the overall process of implementing the personalized power load forecasting method based on the aggregate function based on the updating method of the global model and the local personalized model at the edge node is as follows: Figure 1 The following combination Figure 1 The overall process of this method is introduced, which includes the following steps:

[0084] Step S31: Each smart metering device regularly reports the original data of the power load of the metering point (including user ID, power consumption address, metering point ID, user category), and transmits the data to the nearest edge node (electricity meter or terminal).

[0085] Step S32: The cloud center server randomly initializes a global power load forecasting model based on a set function (the detailed design of the model will be described later), and transmits its parameter w to each edge node.

[0086] Step S33: Each edge device uses the model parameter w received from the cloud center server to initialize the local personalized model to adapt to the differentiated power consumption patterns in different regions and achieve accurate power load prediction. For the kth edge node, the initialization parameter of its personalized model is v k , where 1≤k≤K, K is the total number of edge nodes, and the original user data in the local area in step S1 is divided into a historical window and a prediction window in chronological order by means of a sliding window.

[0087] Step S34: Each edge device inputs the data of the local historical window into the latest global model w received from the cloud center server to obtain the predicted output, and then calculates the mean square error between the predicted output and the actual sampling value of the prediction window as the global model optimization objective function, and iteratively updates the global model parameters through the reverse gradient propagation algorithm:

[0088]

[0089] In the above formula, w k represents the updated parameters of the global model trained at the kth edge node region, η g is a pre-set learning rate, Represents the objective function F k For the model parameter w k The obtained gradient, the model iteratively updates r rounds, initially, w k =w.

[0090] Step S35: Each edge device inputs the data of the historical window into the local personalized model of its own area to obtain the predicted output, and then calculates the mean square error between the predicted output and the actual sampling value of the prediction window as the local model optimization objective function, and updates the local personalized model parameters through the reverse gradient propagation algorithm:

[0091]

[0092] In the above formula, v k represents the personalized model parameter of the kth edge node, η1 represents the pre-set learning rate, represents the gradient of the objective function to the local personalized model parameters, and w is the parameter of the global model before iterative update in step S4. is a regularization term, and λ is a pre-set hyperparameter that adjusts the ratio of the global and local personalized models to each other. In particular, when λ→+∞, can be regarded as 0, then only v k When λ→0, the local model is trained independently using local data. In practical applications, the setting of λ is flexible and can be set according to the degree of differentiation of electricity consumption in each region to achieve a balance between personalization and globalization.

[0093] Step S36: Each edge node calculates its own update amount for the global model parameters:

[0094] Δ k =w k -w

[0095] And send this update volume to the cloud center server.

[0096] Step S37: The cloud center server aggregates the global model parameter update amounts sent by each edge node to update the global model parameters:

[0097]

[0098] Step S38: The cloud center server sends the updated parameter weight w back to each edge node.

[0099] Step S39: Repeat steps S34-S38 until the maximum number of iterations T is reached, and finally obtain the personalized power load prediction model of each regional edge node (the corresponding parameter set is {v k} k∈[K] ) and a global model of a cloud center (the corresponding parameter is w). After the deployment of the personalized power load forecasting model, the power load of users in different regions can be accurately predicted. The predicted value after the deployment of the global model can provide a reference for global power allocation.

[0100] In addition, if the power load of each power-consuming device that can be load-monitored is regarded as a variable, the sampling sequence of all devices owned by a user constitutes a multivariate time series; if the power load of users under each substation is regarded as a variable, the sampling sequence of all users under a substation constitutes a multivariate time series. The existing technology for analyzing multivariate power time series usually requires the number of sampling devices to be determined in advance, and at the same time meets the requirements of uniform sampling intervals of devices and alignment of sampling times between different devices. However, in actual power load scenarios, there are many types of sampling devices associated with the user side, such as private charging piles, air conditioners, lighting, etc., and the types of power-consuming devices will increase. This will cause the number of devices to change within a certain period of time, and the sampling number is difficult to determine in advance. If the design of the model is coupled with the number of sampling devices, it will make the model difficult to expand. There are certain differences in the sampling load intervals of each device, and the sampling intervals may also be uneven due to communication failures, equipment failures, etc. In addition, the clock synchronization problem between devices will affect the alignment of sampling times. These practical problems result in the fact that the power load data time series actually obtained for a single user or a single substation presents irregular sampling characteristics (uneven sampling intervals and non-uniform sampling times), and most power time series prediction technologies cannot be directly applied to scenarios with irregular power time series.

[0101] Aiming at the problem that the user's power load data has the characteristics of irregular sampling and the existing power time series analysis model cannot be directly applied to this scenario, a user power load prediction model based on aggregate function is proposed. The structure of the model is as follows Figure 2 As shown, the following combination Figure 2 The user power load forecasting model based on aggregate function is introduced.

[0102] In a preferred embodiment of the present invention, the input of the model is a triplet of s j =(t j ,z j ,m j ), where s j is the jth power load sampling point, t j is the sampling time of the jth power load sampling point, z j is the power load value of the jth power load sampling point, m j is the terminal type of the source of the jth power load sampling point. The power load forecasting model based on the aggregate function adapts the original power load data of the irregularly sampled power time series through the input data in the form of triples.

[0103] Specifically, the cloud master station establishes the topological relationship of all smart devices under each user or users under each substation, including user ID, electricity usage address, user type, metering point ID field or substation ID, user ID, electricity usage address, user type, and obtains the sampling sequence of all devices under each user (such as different types of users such as private charging piles, shops, or identified electricity devices such as air conditioners and lighting under a certain user near the address) or users under each substation.

[0104] The time series of the irregularly sampled power load of the user can be expressed as a set of observation points, using S i ={s1,s2,…,s M} represents the set of all power load sampling points of all smart terminals under the i-th user, with a size of M, where any sampling point s j It can be expressed as a triple, namely s j =(t j ,z j ,m j ), where t j represents the sampling time of the observation point, z j Represents the collected power load value, m j Is a string representing the terminal type from which the sampling point comes. For example, if a user's charging pile samples a power load value of 7kw at 1:00 on April 1, 2024, then the sampling point is represented as (20240401010000,7,"charging pile"). This triple representation method can represent the sampling point of any device at any time without satisfying the constraints of uniform sampling intervals for the same device and consistent sampling rates for different devices.

[0105] In a preferred embodiment of the present invention, a training method for a power load forecasting model based on a set function is proposed, comprising the following steps:

[0106] S41: extracting sample data for model training from the original power load data;

[0107] S42: preprocessing the sample data in triple form;

[0108] S43: inputting the preprocessed sample data into a power load prediction model based on a feedforward neural network to obtain a power load prediction value;

[0109] S44: updating the model parameters of the power load prediction model based on the feedforward neural network according to the difference between the power load prediction value and the power load actual value, and obtaining an updated power load prediction model;

[0110] Among them, the multi-head attention mechanism method is used in the power load forecasting model based on the feedforward neural network to capture the potential timing dependencies in the irregularly sampled power time series corresponding to the sample data, and to mine the user's power consumption characteristics.

[0111] The multi-head attention mechanism is an attention mechanism based on neural networks. By introducing multiple attention heads, it can focus on multiple different feature subspaces at the same time, thereby more comprehensively capturing the associations and regularities in multivariate time series data. The multi-head attention mechanism plays an important role in time series analysis. It can help us better understand the interactions between different variables, thereby improving the representation and generalization capabilities of the model.

[0112] In this embodiment, the multi-head attention mechanism can capture the potential timing dependency in the irregularly sampled power time series. At the same time, this embodiment uses a feedforward neural network to build a power load prediction model.

[0113] In a preferred embodiment of the present invention, before step S42, it also includes: extracting pairs of historical window data and prediction window data from the sample data according to the set historical window length and the window length to be predicted; the historical window data is used as input data of the power load prediction model based on the feedforward neural network to obtain the power load prediction value; the prediction window data is used as the actual value of the power load to update the power load prediction model based on the feedforward neural network.

[0114] Specifically, the historical window length and the predicted window length are selected according to actual needs, and paired historical windows H are extracted from the original sampling point set by sliding window method in chronological order. i and prediction window P i , where 1≤i≤N, (N is the number of windows), constitutes the historical window set and the prediction window set. The historical window set will be used as the input of the model, and the prediction window set will be the actual result of the corresponding input, which is the target to be predicted by the model output.

[0115] In a preferred embodiment of the present invention, preprocessing the sample data in triplet form includes encoding each sampling point triplet, as follows:

[0116] 1) Encode the sampling time part of each sampling point triplet. j =(t j ,z j ,m j ), we transform the observation time t into j Encoded into a τ-dimensional vector, the odd and even bits of the vector are:

[0117]

[0118] Where k∈{0,...,τ / 2}, any sampling moment on the continuous time axis can be encoded, so that any sampling moment in the historical window set corresponds to a τ-dimensional encoding vector, that is,

[0119] 2) Encode the source device type of each sampling point. In actual power scenarios, the types of sampling devices may increase or decrease, and the encoding form of One-Hot vectors requires the number of types to be determined in advance, which is not conducive to expansion in actual scenarios. In the present invention, for the sampling point triplet s j =(t j ,z j ,m j ), we encode the sampled device type string m through the pre-trained language model BERT j , and obtain its text semantic representation vector (768 dimensions), and then use the feedforward neural network to map the vector into a τ-dimensional vector, that is: Among them U m , W m , b m is the parameter matrix of the network, and tanh is the hyperbolic tangent activation function. Due to the flexibility of the pre-language model, this encoding method can encode any word without determining the type of sampling device to be analyzed in advance, which greatly improves the scalability of the model.

[0120] 3) Encode the sampling point tuple. In the present invention, for the sampling point s j =(t j ,z j ,m j ), we use a feedforward neural network to map the sampled value scalar into a τ-dimensional vector, namely:

[0121] Thus, the τ-dimensional vector encodings of the sampling time, sampling device type, and sampling value in each tuple are obtained respectively.

[0122] In a preferred embodiment of the present invention, the encoding results of the three parts of each observation tuple are added together to obtain the encoding vector of the entire observation tuple:

[0123]

[0124] The encoding vector based on the entire observation tuple is further processed using a multi-head attention mechanism.

[0125] In a preferred embodiment of the present invention, a multi-head attention mechanism is used to capture the potential temporal dependencies in the user's historical window observation set and mine the user's power consumption pattern. In the present invention, we consider a dot product attention with h attention heads. For the i-th head, we respectively Matrix and The matrix transforms any observation triple s x The encoding vector h(s x ) is mapped to d-dimensional Query vector and Key vector, that is:

[0126]

[0127] Then calculate any two observation points s x and y The attention score between the i-th head

[0128]

[0129] In the above formula, exp() represents the exponential operation with natural logarithm e as the base. Any observation point s can be obtained by weighted summing all other M observation points through attention scores. x The output vector of the i-th head is:

[0130]

[0131] In a further embodiment of the present invention, the output vectors of all observation points in the historical window are aggregated using mean aggregation, namely:

[0132]

[0133] Where |H| represents the number of observation points in the history window. By performing steps S2.6-S2.7 for each of the h attention heads, we can get the output matrix This matrix is ​​finally passed through a feedforward neural network (FFN) to obtain the user-level feature representation. For the i-th user, its feature representation is u i =FFN(o i ).

[0134] In this embodiment, in view of the irregular sampling characteristics of each power load time series data in actual scenarios, this embodiment designs a power load prediction model based on a set function, encodes any time through continuous time coding processing, encodes the sampling device type through a pre-trained language model, and extracts the time series correlation within the user's power consumption sequence through a self-attention mechanism. It is suitable for the situation where the types of smart devices are increasing, the sampling intervals of the same device are uneven, and the sampling points of multiple devices are not aligned, and has good scalability.

[0135] In a further embodiment of the present invention, the power load forecasting model based on the feedforward neural network calculates the forecast result of the point to be forecasted. Specifically, the m pred Equipment in t pred The power load forecast value at the moment It can be calculated by the following formula:

[0136]

[0137] Among them, || represents the concatenation of vectors.

[0138] The personalized electricity load forecasting method based on the set function proposed in the above embodiment has the following advantages and effects compared with the prior art:

[0139] 1. The present invention models the electricity usage sequence at the user level, focusing on the accurate mining of personalized electricity usage patterns on the user side, while the prior art mainly focuses on the electricity usage status on the device side, and does not accurately distinguish between specific users.

[0140] 2. The present invention designs a prediction model based on set functions for irregularly sampled power series prediction scenarios. It processes the sampling points at any time through continuous time coding technology, and uses a pre-trained model to distinguish different types of sampling devices. Compared with existing power prediction models, it has stronger scalability, no special requirements for the sampling frequency of the sampling device, and can also be well applied when the sampling rates of different sampling devices are different and the sampling points are irregular. It has strong practicality in the context of the increasing number of smart device terminals.

[0141] 3. The present invention deploys a distributed electricity consumption forecasting model based on the cloud-edge federated learning strategy, introduces a personalized federated learning regularization term, and trains the personalized power load forecasting model and the global forecasting model for each region at the same time. Compared with the existing federated learning scheme, it achieves a more accurate regional forecasting accuracy and can provide a macro-effective reference for global power allocation.

[0142] Based on the same inventive concept, the embodiment of the present application also provides a set function-based personalized electricity load forecasting system for implementing the above-mentioned set function-based personalized electricity load forecasting method. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiment of the set function-based personalized electricity load forecasting system provided below can be referred to the limitations of the set function-based personalized electricity load forecasting method above, and will not be repeated here.

[0143] This embodiment provides a personalized electricity load forecasting system based on a set function, including: a smart metering device, an edge node and a central cloud server;

[0144] The edge node is used to obtain the original data of power load at each metering point in the area through the smart metering device;

[0145] The edge node inputs the original data of power load into the global model and the local personalized model respectively to obtain the global model prediction value and the local personalized model prediction value;

[0146] Among them, the edge node generates a local personalized model based on the global model initialization obtained from the central cloud server, and uses the original power load data to iteratively update the model parameters of the global model and the local personalized model, updates the local personalized model based on the updated model parameters, and sends the model parameter update amount of the global model to the central cloud server, so that the central cloud server can update the global model according to the model parameter update amount sent by each edge node. Both the global model and the local personalized model are power load prediction models.

[0147] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0148] Reference Figure 3 The embodiment of the present invention further provides a computer device 3, comprising: a memory 302 and a processor 301 and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, the personalized electricity load forecasting method based on the set function as described in any one of the above methods is implemented.

[0149] The computer device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.

[0150] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0151] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 3. Further, the memory 302 may also include both an internal storage unit of the computer device 3 and an external storage device. The memory 302 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 302 may also be used to temporarily store data that has been output or is to be output.

[0152] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for predicting personalized electricity load based on a set function as described in any one of the above methods is implemented.

[0153] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0154] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0155] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0156] In the embodiments disclosed in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0157] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting personalized electricity load based on aggregate functions, characterized in that: The steps include: The edge node obtains the original data of power load at each metering point in the area to which it belongs; Inputting the power load raw data into the global model and the local personalized model respectively to obtain the global model prediction value and the local personalized model prediction value; Among them, the edge node generates the local personalized model according to the global model initialization obtained from the cloud, and uses the power load original data to iteratively update the model parameters of the global model and the local personalized model, updates the local personalized model based on the updated model parameters, and sends the model parameter update amount of the global model to the cloud, so that the cloud updates the global model according to the model parameter update amount sent by each edge node. The global model and the local personalized model are both power load prediction models.

2. The method for predicting personalized electricity load based on aggregate function according to claim 1 is characterized in that: The updating of the global model and the local personalized model at the edge node comprises the following steps: The edge node inputs the data of the local history window into the global model, and obtains updated global model parameters based on the difference between the data output by the global model and the data of the prediction window, wherein the data of the local history window and the data of the prediction window are obtained by dividing the original data of the power load in chronological order by means of a sliding window; Inputting data of a local history window into the local personalized model, and obtaining updated local personalized model parameters based on the difference between the data output by the local personalized model and the data of the prediction window; Obtaining an update amount of the global model parameter based on the updated global model parameter, and sending the update amount to the cloud, so that the cloud updates the global model according to the update amount sent by each edge node; The local personalized model is updated based on the updated local personalized model parameters.

3. The method for predicting personalized electricity load based on aggregate function according to claim 1 is characterized in that: The power load forecasting model is a power load forecasting model based on a set function, and the input of the power load forecasting model based on a set function is a triplet form of s j =(t j ,z j ,m j ), where s j is the jth power load sampling point, t j is the sampling time of the jth power load sampling point, z j is the power load value of the jth power load sampling point, m j is the terminal type of the jth power load sampling point source, and the power load prediction model based on the aggregate function adapts to the original power load data of the irregularly sampled power time series through the input data in the form of triples.

4. The method for predicting personalized electricity load based on aggregate function according to claim 3 is characterized in that: The training step of the power load forecasting model based on the aggregate function includes: Extracting sample data for model training from the raw data of power load; Preprocessing the sample data in triple form; Inputting the preprocessed sample data into a power load prediction model based on a feedforward neural network to obtain a power load prediction value; According to the difference between the power load prediction value and the power load actual value, the model parameters of the power load prediction model based on the feedforward neural network are updated, and the updated power load prediction model is obtained; Among them, the power load forecasting model based on the feedforward neural network adopts a multi-head attention mechanism method to capture the potential timing dependencies in the irregularly sampled power time series corresponding to the sample data, and mine the user's power consumption characteristics.

5. The method for predicting personalized electricity load based on aggregate function according to claim 4 is characterized in that: Before preprocessing the sample data in triple form, the method further includes: According to the set historical window length and the window length to be predicted, extracting pairs of historical window data and predicted window data from the sample data; The historical window data is used as input data of the power load prediction model based on the feedforward neural network to obtain the power load prediction value; the prediction window data is used as the actual power load value to update the power load prediction model based on the feedforward neural network.

6. The method for predicting personalized electricity load based on aggregate function according to claim 5 is characterized in that: The sample data in triple form is preprocessed, including: The sampling time t of each sampling point triplet j The continuous sine-cosine time coding method is used to encode into a τ-dimensional vector, and the result is: In the formula, e t is the sampling time t j The corresponding τ-dimensional vector, x 2k (t j ) and x 2k+1 (t j ) represent the even and odd bits of the τ-dimensional vector, k∈{0,...,τ / 2}, represents a vector of dimension τ; For each sampling point triplet, the terminal type m j The pre-trained language model BERT is used to encode the text semantic representation vector, and then the feed-forward neural network FFN is used to map the text semantic representation vector into a τ-dimensional vector to obtain: In the formula, e m For terminal type m j The corresponding τ-dimensional vector, U m , W m , b m is the parameter matrix of the feedforward neural network, and tanh is the hyperbolic tangent activation function; For each sampling point triplet, the power load value z j The feedforward neural network FFN is used to map into a τ-dimensional vector, and the following is obtained: In the formula, e z is the power load value z j The corresponding τ-dimensional vector, U z , W z , b z is the parameter matrix of the feedforward neural network.

7. The method for predicting personalized electricity load based on aggregate function according to claim 6 is characterized in that: The multi-head attention mechanism is used to capture the potential temporal dependencies in the irregularly sampled power time series corresponding to the sample data, including: Using dot product attention with h attention heads, for the i-th head, we learn the matrix and key matrix Any observation point s in the historical window data x The encoding vector h((s x ) is mapped to d-dimensional Query vector and Key vector, that is: In the formula, and Respectively represent the Query vector and Key vector, represents a vector of dimension τ×d, represents a vector of dimension d; Then calculate any two observation points s x and y The attention score between the i-th head Where exp() represents the exponential operation with natural logarithm e as the base. Any observation point s can be obtained by weighted summing all other M observation points through attention scores. X The output vector of the i-th head In the formula, is the observation point s x and j The attention score between the i-th head.

8. The method for predicting personalized electricity load based on aggregate function according to claim 7 is characterized in that: Triples j The encoding vector h(s j ) is as follows:

9. The method for predicting personalized electricity load based on aggregate function according to claim 7, characterized in that: Based on the output vectors obtained by the h attention heads, the expression of the user's electricity consumption characteristics is obtained through the feedforward neural network FFN as follows: u i =FFN(of i ) Where, the superscript i is the number of the h attention heads, the subscript i is the user number, and u i is the feature representation of the i-th user, o i is the output vector of the ith attention head, o i is the output vector aggregation matrix of the i-th user, and |H| represents the number of observation points in the historical window.

10. The method for predicting personalized electricity load based on aggregate function according to claim 9, characterized in that: The expression of the power load prediction value is as follows: In the formula, represents user i’s m pred Equipment in t pred The power load forecast value at the moment, || represents the concatenation of vectors.

Citation Information

Patent Citations

  • Personalized federal learning method based on multi-head attention mechanism

    CN113378243A

  • Sub-industry power load prediction method and device based on federated learning, and storage medium

    CN115600717A

  • Short-term power load prediction analysis method based on PSO-LSSVM

    CN115907228A

  • Power load prediction method based on federal map neural network

    CN116826743A

  • Personalized federal learning identification method and system based on differential privacy

    CN117196012A

Cited By

  • Multi-edge cooperation load prediction method based on personalized federal deep learning

    CN119865435A