A method and system for predicting power consumption

By building a cloud-edge-end collaborative distributed power consumption prediction system in the power system, using the Internet of Things and 5G edge computing technology, combined with artificial intelligence deep learning, the poor real-time and high energy consumption of traditional power consumption prediction methods are solved. The problem of this has realized the accurate energy consumption prediction and distribution scheduling of the power system, and promoted the digital transformation of the power grid.

CN118095354BActive Publication Date: 2024-12-20STATE GRID JIANGSU ELECTRIC POWER CO LTD NANJING POWER SUPPLY COMPANY
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410136233.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-30
Publication Date
2024-12-20
Estimated Expiration
2044-01-30

AI Technical Summary

Technical Problem

Traditional power energy consumption prediction methods have problems such as poor real-time performance, high energy consumption and cumbersome data monitoring in complex and huge power systems, making it difficult to achieve accurate power energy distribution and scheduling.

Method used

Using IoT technology, 5G edge computing and artificial intelligence deep learning, a cloud-edge-end three-body collaborative distributed power consumption prediction system is built, and historical energy consumption data is collected by power acquisition terminals, and edge servers perform feature fusion encoding and decoding. , combining time and variable dimension information, predict future energy consumption data, and reduce transmission delay and bandwidth pressure.

Benefits of technology

It improves the accuracy of power energy consumption data, reduces resource consumption, realizes real-time and accurate energy consumption prediction and allocation scheduling of the power system, and promotes the digital transformation and intelligent upgrading of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118095354B_ABST
    Figure CN118095354B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for predicting power consumption. The method is applied to a power consumption prediction system. The system includes a power consumption collection terminal and an edge server. The method collects historical energy consumption data of a target power consumption area in a preset historical time period through the power consumption collection terminal; inputs historical variable data into a feature fusion encoder of a power consumption prediction model through the edge server to obtain a fusion coding matrix, which is an information matrix that integrates time dimension features and variable dimension features; inputs the fusion coding matrix into a decoder of the power consumption prediction model through the edge server to obtain target energy consumption data of the target power consumption area in a future time period, and the power consumption prediction model is trained by a cloud server and sent to the edge server. The method improves the accuracy of target energy consumption data, reduces local transmission delay and bandwidth pressure, and saves resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart grid technology, and in particular to a method and system for predicting power consumption. Background Art

[0002] The allocation and dispatch of electric energy is an important part of the power system. Accurate and effective prediction of electric energy consumption is an important basis for the allocation and dispatch of electric energy, and is also an important guarantee for the safe and stable operation of the power system. Therefore, determining the electric energy consumption in the future time range is an urgent problem to be solved at this stage.

[0003] Traditional electricity energy consumption prediction methods are mainly deployed in the cloud for calculation. However, facing the current complex and huge power system, such methods have problems such as poor real-time performance and high energy consumption costs, making the monitoring of electricity data more cumbersome. Summary of the invention

[0004] The present invention provides a method and system for predicting power consumption, so as to reduce transmission delay and bandwidth pressure and save resource consumption.

[0005] According to one aspect of the present invention, a method for predicting power consumption is provided, which is applied to a power consumption prediction system, wherein the system includes a power collection terminal and an edge server, and the method includes:

[0006] Collecting historical energy consumption data of a target power consumption area in a preset historical time period through the power consumption collection terminal, and sending the historical energy consumption data to the edge server;

[0007] Inputting the historical variable data into the feature fusion encoder of the power energy consumption prediction model through the edge server to obtain a fusion encoding matrix, wherein the fusion encoding matrix is ​​an information matrix that integrates time dimension features and variable dimension features, and the historical variable data includes the historical energy consumption data;

[0008] The fused coding matrix is ​​input into the decoder of the power consumption prediction model through the edge server to obtain the target energy consumption data of the target power consumption area in the future time period. The power consumption prediction model is trained by the cloud server and sent to the edge server.

[0009] According to another aspect of the present invention, a power consumption prediction system is provided, the system comprising a power collection terminal and an edge server.

[0010] The power consumption collection terminal is used to collect historical energy consumption data of the target power consumption area in a preset historical time period, and send the historical energy consumption data to the edge server;

[0011] The edge server is used to input the historical variable data into the feature fusion encoder of the power energy consumption prediction model to obtain a fusion encoding matrix, where the fusion encoding matrix is ​​an information matrix that integrates time dimension features and variable dimension features, and the historical variable data includes the historical energy consumption data;

[0012] The edge server is used to input the fused coding matrix into the decoder of the power consumption prediction model to obtain the target energy consumption data of the target power consumption area in the future time period. The power consumption prediction model is trained by the cloud server and sent to the edge server.

[0013] The embodiment of the present invention provides a method and system for predicting power consumption, which is applied to a power consumption prediction system, wherein the system includes a power consumption collection terminal and an edge server, wherein the method includes: collecting historical energy consumption data of a target power consumption area in a preset historical time period through the power consumption collection terminal, and sending the historical energy consumption data to the edge server; inputting the historical variable data into a feature fusion encoder of a power consumption prediction model through the edge server to obtain a fusion encoding matrix, wherein the fusion encoding matrix is ​​an information matrix that integrates time dimension features and variable dimension features, and the historical variable data includes the historical energy consumption data; inputting the fusion encoding matrix into a decoder of a power consumption prediction model through the edge server to obtain target energy consumption data of the target power consumption area in a future time period, wherein the power consumption prediction model is trained by a cloud server and sent to the edge server. By using the above technical solution, the information of time and variable dimensions can be integrated to improve the accuracy of the target energy consumption data, and at the same time, the power consumption prediction model is trained by a cloud server and sent to an edge server to determine the target energy consumption data, thereby reducing transmission delay and bandwidth pressure and saving resource consumption.

[0014] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments 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 creative work.

[0016] Figure 1 is a flow chart of a method for predicting power consumption provided according to Embodiment 1 of the present invention;

[0017] Figure 2 is a flow chart of a method for predicting power consumption provided according to Embodiment 2 of the present invention;

[0018] Figure 3 is a schematic diagram of a distance adaptive attention mechanism provided according to Embodiment 2 of the present invention;

[0019] Figure 4 is a schematic diagram of a power consumption prediction model provided according to Embodiment 2 of the present invention;

[0020] Figure 5 is a structural schematic diagram of a power energy consumption prediction system provided according to Embodiment 3 of the present invention;

[0021] Figure 6 is a schematic diagram of the structure of another power consumption prediction system provided according to Embodiment 3 of the present invention;

[0022] Figure 7 It is a schematic diagram of the hierarchical structure of an Internet of Things provided according to Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 described embodiments 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 should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] Embodiment 1

[0026] Figure 1It is a flowchart of an electric power consumption prediction method provided according to the first embodiment of the present invention. This embodiment can be applied to the situation where the energy consumption data of the power system in the future time period is determined. The method can be executed by the electric power consumption prediction system, which includes a power collection terminal and an edge server.

[0027] With the advancement of the times and technology, all walks of life have put forward higher and higher requirements on the power system in their development. In order to promote the digital transformation of the power grid, integrating new technologies with the power system and building a new type of smart grid has become an inevitable trend in the development of the power industry.

[0028] The allocation and dispatch of electric energy is an important part of the power system. Accurate and effective prediction of electric energy consumption is an important basis for the allocation and dispatch of electric energy, and is also an important guarantee for the safe and stable operation of the power system. It can help relevant departments to scientifically formulate power generation and distribution plans, and ensure the normal operation of all walks of life and the normal life of residents. Therefore, the prediction of electric energy consumption is very important.

[0029] The Internet of Things technology is an extension and expansion of the Internet. It connects any device to the Internet for data transmission and communication to achieve intelligent monitoring and management of the equipment. The development of the Internet of Things has promoted a series of intelligent applications, such as smart medical care, smart traffic management, etc. Its application in the power system, namely the power Internet of Things, refers to the interconnection and data interaction of various equipment and links in the power system, with the characteristics of comprehensive status perception, efficient information processing, flexible and convenient application, etc.

[0030] The Internet of Everything means massive data transmission and processing. Although the currently commonly used centralized cloud computing technology can meet the computing needs of most IoT applications, it still has problems such as high data transmission latency, heavy network transmission load, and heavy storage pressure. Therefore, mobile edge computing has gradually become a technology that assists and optimizes cloud computing. Edge computing is a computing model that emphasizes decentralization and performs data processing and computing close to the data source to reduce latency, reduce data transmission volume, and provide faster real-time response, which can reduce cloud transmission and computing pressure and save computing resources. However, due to the limitation of communication capabilities, the scale and application of edge computing were relatively limited. The development of 5G communication technology has made edge computing more powerful and feasible. The communication capabilities of 5G have enhanced the real-time and efficiency of edge computing, and the introduction of edge computing has also enabled 5G networks to better support real-time applications. The two have jointly promoted innovation and development in many fields.

[0031] Artificial intelligence deep learning technology is a powerful tool for data processing and data analysis in the era of big data. When the amount of data is large and complex, traditional data analysis methods may not be able to effectively solve it. Deep learning models can automatically learn its complex rules and associations from massive raw data and extract valuable features by designing deep neural networks, so as to complete various types of tasks such as classification, regression and prediction. However, most of the current data analysis models based on deep learning are often large in scale due to the pursuit of higher accuracy, and the computing resources of edge servers are very limited. Their equipment is usually not enough to run large-scale deep learning models, so they are generally deployed in the cloud, and the data is uploaded to the cloud before data analysis. This application method cannot give full play to the advantages of edge computing, so it is necessary to design a deep learning model that meets certain accuracy requirements and is lightweight enough to enable it to be migrated from the cloud to the edge.

[0032] In order to promote the construction of new smart grids and realize the digital and intelligent upgrade of power systems, the future power consumption forecast must not only be highly accurate, but also more intelligent and convenient, liberate labor, and at the same time, energy consumption issues in power consumption forecasting must be considered, such as computing resource consumption, communication resource consumption, resource waste, etc. However, the traditional energy consumption forecasting process and methods have many problems in the face of the current complex and huge power system, such as inconvenient data monitoring, poor real-time performance, inaccurate prediction, high energy consumption and high cost.

[0033] Based on this, an embodiment of the present invention provides a method for predicting power consumption, which specifically combines Internet of Things technology, 5G edge computing technology, artificial intelligence and deep learning technology to construct a cloud-edge-end three-body coordinated distributed power consumption prediction system architecture to meet the actual business needs of large-scale distributed power data collection and upload and data processing and analysis. At the same time, the key power consumption prediction model part within the system is designed in detail to enable it to accurately and effectively predict future power consumption; in addition, it can be reduced in size to facilitate deployment on the edge side, in line with system architecture requirements. Figure 1 As shown, the method includes:

[0034] S110. Collect historical energy consumption data of a target power consumption area in a preset historical time period through the power consumption collection terminal, and send the historical energy consumption data to the edge server.

[0035] The target power consumption area may refer to the power consumption area for which power consumption forecasting is required, and the historical energy consumption data may refer to the energy consumption data of the target power consumption area in a preset historical time period. The preset historical time period may be set in advance by relevant personnel, such as within the historical 24 hours or within the historical week.

[0036] In this embodiment, the historical energy consumption data of the target power consumption area in a preset historical time period can be collected by the power consumption collection terminal, and the collected historical energy consumption data can be sent to the edge server for subsequent prediction.

[0037] S120. Input the historical variable data into the feature fusion encoder of the power consumption prediction model through the edge server to obtain a fusion encoding matrix. The fusion encoding matrix is ​​an information matrix that integrates time dimension features and variable dimension features. The historical variable data includes the historical energy consumption data.

[0038] The historical variable data may include the historical energy consumption data collected in the above steps, and may also include other parameter data in addition to the historical energy consumption data, such as relevant data of parameters that affect future energy consumption data, etc. The power consumption prediction model may refer to a model trained by a cloud server and sent to an edge server for predicting energy consumption data. The specific means of training the power consumption prediction model will not be described in detail here.

[0039] In this embodiment, the power energy consumption prediction model may include a feature fusion encoder and a decoder. The feature fusion encoder can be used to fuse the time dimension features and variable dimension features of historical variable data to obtain a fusion coding matrix; the decoder can be used to decode to obtain the target energy consumption data of the target power consumption area in the future time period.

[0040] In the specific process of obtaining the target energy consumption data, the historical variable data can be first input into the feature fusion encoder of the power energy consumption prediction model to obtain the corresponding fusion coding matrix. This embodiment does not limit the specific fusion process, such as it can be determined by the specific composition architecture of the feature fusion encoder, and different composition architectures can correspond to different specific processes.

[0041] S130. Input the fused coding matrix into the decoder of the power consumption prediction model through the edge server to obtain the target energy consumption data of the target power consumption area in the future time period. The power consumption prediction model is trained by the cloud server and sent to the edge server.

[0042] The target energy consumption data can be understood as the energy consumption data of the target electricity consumption area in the future time period.

[0043] In this step, the obtained fusion coding matrix can be input into the decoder in the power energy consumption prediction model, and through a series of calculations, the target energy consumption data of the target power consumption area in the future time period can be obtained.

[0044] A method for predicting power consumption provided by a first embodiment of the present invention is applied to a power consumption prediction system, the system comprising a power consumption collection terminal and an edge server, the method comprising: collecting historical energy consumption data of a target power consumption area in a preset historical time period through the power consumption collection terminal, and sending the historical energy consumption data to the edge server; inputting the historical variable data into a feature fusion encoder of a power consumption prediction model through the edge server to obtain a fusion encoding matrix, the fusion encoding matrix is ​​an information matrix that integrates time dimension features and variable dimension features, and the historical variable data includes the historical energy consumption data; inputting the fusion encoding matrix into a decoder of a power consumption prediction model through the edge server to obtain target energy consumption data of the target power consumption area in a future time period, and the power consumption prediction model is trained by a cloud server and sent to the edge server. By using this method, the information of time and variable dimensions can be integrated to improve the accuracy of the target energy consumption data, and at the same time, the power consumption prediction model is trained by a cloud server and sent to the edge server to determine the target energy consumption data, thereby reducing transmission delay and bandwidth pressure and saving resource consumption.

[0045] In one embodiment, the system further includes a cloud server, and the method further includes:

[0046] The cloud server performs model training based on the original training data to obtain the power consumption prediction model corresponding to the power consumption prediction system.

[0047] The original training data may refer to the original data required for model training, such as the original training data may be various data that have occurred. In addition, the source of the original training data is not limited, and may be differentiated according to the type of the original training data.

[0048] In one embodiment, the original training data includes a first sequence data and at least one second sequence data, the first sequence data is energy consumption data of a preset power consumption area in a historical time range, and the second sequence data is meteorological data corresponding to the preset power consumption area in a historical time range, and the cloud server performs model training based on the original training data to obtain the power energy consumption prediction model corresponding to the power energy consumption prediction system, including:

[0049] Preprocessing each sequence data by the cloud server to obtain preprocessed sequence data;

[0050] The cloud server performs model training based on all preprocessed sequence data to obtain an electric power consumption prediction model corresponding to the electric power consumption prediction system.

[0051] The original training data may include a first sequence of data and at least one second sequence of data. The first sequence of data may refer to energy consumption data of a preset power consumption area within a historical time range, which may be collected by a power consumption collection terminal; the second sequence of data may be meteorological data corresponding to the preset power consumption area within a historical time range. The preset power consumption area may be any power consumption area, or may be a specified one or several power consumption areas.

[0052] Specifically, the training model needs to collect some time series data within the historical time range, and use it to construct the time-variable two-dimensional tensor X={X1, X2, …, X N}, X i ∈R D , where N is the time step and D is the number of variables. Weather is a key factor affecting electricity consumption. Meteorological factors such as temperature, wind speed, humidity, and precipitation can be selected as variables affecting electricity consumption. At the same time, according to the target prediction range and demand, the time step can be in hours, days, weeks, or months (that is, the original training data includes a first sequence of data and at least one second sequence of data, the first sequence of data is the energy consumption data of the preset electricity consumption area in the historical time range, and the second sequence of data is the meteorological data corresponding to the preset electricity consumption area in the historical time range).

[0053] In addition, for the time series of each dimensional variable, due to equipment failures on certain days in history, the collected historical data may be missing, or an emergency may occur, causing the variable to rise sharply, resulting in its value far away from the normal range. If it is directly sent to the prediction model, it will cause serious interference to the training. In general, it is hoped that the trained model will be universal. Therefore, it is necessary to preprocess the input data, and then conduct the next step of model training based on the preprocessed original training data to improve the accuracy of the power consumption prediction model. For example, for each sequence data in the original training data, the sequence data can be preprocessed to obtain preprocessed sequence data; then, based on all the obtained preprocessed sequence data, the model is trained to obtain the power consumption prediction model corresponding to the power consumption prediction system. The specific preprocessing means can adopt the following steps:

[0054] In one embodiment, preprocessing the sequence data by the cloud server for each sequence data to obtain preprocessed sequence data includes:

[0055] identifying, by the cloud server, outliers in the sequence data;

[0056] The cloud server corrects the abnormal value based on the data value at a preset position in the sequence data to obtain preprocessed sequence data.

[0057] The preset position may be pre-configured by relevant personnel. For example, the preset position may be a fixed position or may be determined by the position of the abnormal value.

[0058] In one embodiment, the 3σ theory can be used to identify abnormal points in the data of a certain day, and then the abnormal value points are assigned corrections based on the data of the two moments before and after the same day and the data of the same moment two days before and after. For example, the mean and variance of the sequence data can be calculated first, that is, Among them, x n,i It can be the value of the i-th moment on the n-th day, where N is the judgment day interval, usually 7 or 14 days. σ i 2 They can be x n,i The mean and variance of the value at the moment in the judgment day interval; if the data x at a certain moment on a certain day n,i Satisfy the inequality Then the value can be judged as an abnormal value, where ξ is the scale threshold, which can usually be 0.9 to 1.6.

[0059] Then, the correction for outliers can be Among them, x n,i ′ is the corrected value at time i on day n, x n+1,i and x n-1,i are the values ​​of the i-th moment of the two days before and after, respectively, n,i-1 and x n,i+1 They are the values ​​at two moments before and after the nth day respectively.

[0060] In one embodiment, preprocessing the sequence data by the cloud server for each sequence data to obtain preprocessed sequence data includes:

[0061] The cloud server fills the missing values ​​in the sequence data based on the target data mean to obtain preprocessed sequence data, and the target data mean is the mean of each data value in the sequence data.

[0062] In one embodiment, each missing value can be replaced by the mean of all non-missing parts of the interpolated data set (i.e., sequence data). That is, if the value at time i on day n is missing, it can be filled with the mean of the i-th time on other days within the day interval, i.e. Among them, x n,i It can be the value at the i-th moment on the n-th day.

[0063] In one embodiment, preprocessing the sequence data by the cloud server for each sequence data to obtain preprocessed sequence data includes:

[0064] Each data value in the sequence data is normalized by the cloud server to obtain preprocessed sequence data.

[0065] In one embodiment, in order to eliminate the influence of the dimensions between the variables, each variable may be normalized, that is, Among them, taking electricity consumption as an example, X t Can be the original power consumption value, min(X t ) can be the minimum value of power consumption, max(X t ) can be the maximum value of power consumption, X t ′ can be a normalized value.

[0066] Embodiment 2

[0067] Figure 2 It is a flow chart of a method for predicting power consumption provided according to Embodiment 2 of the present invention, and Embodiment 2 is optimized on the basis of the above embodiments. In this embodiment, the feature fusion encoder includes a feature fusion module, and the historical variable data is input into the feature fusion encoder through the edge server to obtain a fusion coding matrix, which is further concretized as follows: the historical variable data is subjected to a first encoding process by the edge server to obtain a first feature coding matrix, and the first feature coding matrix is ​​an information matrix of the historical variable data in the time dimension; the historical variable data is subjected to a second encoding process by the edge server to obtain a second feature coding matrix, and the second feature coding matrix is ​​an information matrix of the historical variable data in the variable dimension; the first feature coding matrix and the second feature coding matrix are input into the feature fusion module of the feature fusion encoder through the edge server to obtain a fusion coding information matrix.

[0068] For details not yet provided in this embodiment, please refer to Embodiment 1.

[0069] like Figure 2 As shown, the method includes:

[0070] S210. Collect historical energy consumption data of a target power consumption area in a preset historical time period through the power consumption collection terminal, and send the historical energy consumption data to the edge server.

[0071] S220. Perform a first encoding process on the historical variable data through the edge server to obtain a first feature encoding matrix, where the first feature encoding matrix is ​​an information matrix of the historical variable data in a time dimension.

[0072] S230. Perform a second encoding process on the historical variable data through the edge server to obtain a second feature encoding matrix, where the second feature encoding matrix is ​​an information matrix of the historical variable data in a variable dimension.

[0073] S240. Input the first feature coding matrix and the second feature coding matrix into a feature fusion module of a feature fusion encoder through the edge server to obtain a fusion coding information matrix.

[0074] In a specific implementation, information matrices representing time dimension features and variable dimension features can be obtained respectively, and then the two matrices are fused to obtain a fused coding matrix. For example, the first feature coding matrix can be an information matrix of historical variable data in the time dimension, and the second feature coding matrix can be an information matrix of historical variable data in the variable dimension. The specific means of the first coding process and the second coding process are not limited, wherein the attention mechanism of the first coding process and the decoder adopts a distance adaptive attention mechanism, and the attention mechanism of the second coding process adopts a global attention mechanism, and each time step in the distance adaptive attention mechanism is only calculated with the preset time step corresponding to the time step, and the preset time step is a time step with a fixed interval from the time step.

[0075] Figure 3 is a schematic diagram of a distance adaptive attention mechanism provided according to the second embodiment of the present invention, such as Figure 3 As shown, the dark color represents the current time step, and the light color represents the time step that participates in the attention calculation with the current time step. For example, each time step in the distance adaptive attention mechanism is only calculated with the time steps on both sides of the time step.

[0076] S250: Input the fused coding matrix into a decoder through the edge server to obtain target energy consumption data of the target power consumption area in a future time period.

[0077] Figure 4 is a schematic diagram of a power consumption prediction model provided according to the second embodiment of the present invention, such as Figure 4As shown, assuming that the target value of the future M time steps is predicted based on the historical N time steps, and the variable dimension is set to D, the model input data format can be N×D, where N is the time dimension and D is the variable dimension. The feature fusion encoder is different from the original Transfomer in that the input data is divided into two branches. The first branch can directly input the data, after embedding and position encoding, and then calculate the attention in the time dimension, and change the original multi-head self-attention mechanism to the DA attention mechanism of the present invention, and then a series of residual connections, feedforward layers and normalization layers can be used to obtain the feature encoding information matrix of the time dimension (that is, the edge server performs a first encoding process on the historical variable data to obtain a first feature encoding matrix). The second branch can be to transpose the input data, from the time-variable two-dimensional tensor N×D to the variable-time two-dimensional tensor D×N. Each variable dimension and its value have a clear meaning. Therefore, the data is transposed and then input. After embedding and position encoding, the attention is calculated on the variable dimension to obtain the correlation information between variables. Each variable has a strong correlation, and each dimension variable has a potential impact on the target value. Therefore, the attention mechanism of the variable dimension still uses the original global attention mechanism, and then a series of residual links, feedforward layers and normalization layers can be used to obtain the feature encoding information matrix of the variable dimension (that is, the edge server performs a second encoding process on the historical variable data to obtain the second feature encoding matrix). The feature encoding information matrix obtained by the two branches through the Transfomer encoder encoding is completely consistent with the input matrix dimension, that is, the feature encoding matrix obtained by calculating the attention of the input data on the time dimension is still N×D, and the feature encoding matrix obtained by calculating the attention on the variable dimension is still D×N.

[0078] Then a feature fusion module is needed to fuse the feature coding information matrices of the two dimensions. The specific operation of the feature fusion module can be to transpose the feature coding matrix of the variable dimension again, regress to the same dimension N×D as the feature coding matrix of the time dimension, and then transform it into N×(D+D) through the splicing layer, and then convert the spliced ​​matrix into N×D dimensions through a linear layer. The N×D-dimensional feature coding information matrix obtained in this way is a fused coding information matrix that fuses the time dimension features and the variable dimension features (that is, the first feature coding matrix and the second feature coding matrix are input into the feature fusion module of the feature fusion encoder through the edge server to obtain a fused coding information matrix).

[0079] Finally, the fused coding information matrix can be input into the decoder as the output of the entire encoder. The decoder goes through a series of masked multi-head self-attention mechanisms, multi-head attention mechanisms, residual links and normalization, and finally connects a linear layer to obtain the predicted output target energy consumption data (that is, the fused coding matrix is ​​input into the decoder through the edge server to obtain the target energy consumption data of the target power consumption area in the future time period), wherein the attention mechanism of the decoder can adopt the DA attention mechanism of the present invention (that is, the attention mechanism of the first encoding process and the decoder adopts a distance adaptive attention mechanism, and the attention mechanism of the second encoding process adopts a global attention mechanism, and each time step in the distance adaptive attention mechanism is only calculated with the preset time step corresponding to the time step, and the preset time step is a time step with a fixed interval from the time step).

[0080] A second embodiment of the present invention provides an electric power consumption prediction method, which is applied to an electric power consumption prediction system. The system includes an electric power collection terminal and an edge server. The method includes: collecting historical energy consumption data of a target power consumption area in a preset historical time period through the electric power collection terminal, and sending the historical energy consumption data to the edge server; performing a first encoding process on the historical variable data through the edge server to obtain a first feature encoding matrix, and the first feature encoding matrix is ​​an information matrix of the historical variable data in the time dimension; performing a second encoding process on the historical variable data through the edge server to obtain a second feature encoding matrix, and the second feature encoding matrix is ​​an information matrix of the historical variable data in the variable dimension; inputting the first feature encoding matrix and the second feature encoding matrix into a feature fusion module of the feature fusion encoder through the edge server to obtain a fusion encoding information matrix; inputting the fusion encoding matrix into the decoder through the edge server to obtain the target energy consumption data of the target power consumption area in the future time period. Using this method, by performing the first encoding process and the second encoding process on the historical variable data respectively, the information of the time and variable dimensions is obtained. The edge server inputs the historical variable data into the feature fusion encoder in the power energy consumption prediction model to obtain the target energy consumption data. The information of the time dimension features and the variable dimension features can be integrated to improve the accuracy of the target energy consumption data.

[0081] The following is an exemplary description of a method for predicting power consumption provided by an embodiment of the present invention:

[0082] Step 1: Build a cloud-edge-end three-body coordinated distributed power energy consumption prediction system architecture.

[0083] Specifically, according to actual business needs, such as dividing regions into cities, districts, counties or towns, power supply companies need to predict the power consumption of each region and then complete the allocation and dispatch of power resources. A central server (i.e., cloud server) can be set up in the cloud as the data center and computing center of all regions to uniformly manage the power consumption of each region; edge computing nodes (i.e., edge servers) can be set up near each divided area as data transfer stations for the cloud and terminals and undertake the power consumption prediction and calculation tasks of their respective regions; power consumption collection terminals can be set up in each area for power consumption perception and power data collection, and then transmit data to upstream edge nodes and the cloud. Data transmission between cloud-edge-end can all use 5G communication technology and equipment.

[0084] Step 2: Design a power consumption prediction model.

[0085] The essence of the power consumption prediction problem can be time series prediction. Generally, time series prediction can be divided into univariate time series prediction and multivariate time series prediction. Univariate time series prediction uses only a single variable (generally the target value itself) and its time changes to predict the future target value, while multivariate time series prediction involves multiple input features, including multiple factors that may affect the target value in addition to the target value, to jointly predict the future target value. Univariate time series prediction only predicts based on one feature, does not make full use of other potential information related to the prediction target, and has great limitations in prediction performance. Therefore, the embodiment of the present invention considers a multivariate time series prediction model.

[0086] Multivariate time series forecasting can be a given historical two-dimensional time series X = {X1, X2, ..., X N}, X i ∈R D , where N is the time step and D is the number of variables, to predict the target value Y={x N+1 , x N+2 , ..., x N+M}, x i∈R. The Transformer model can capture the long-term dependency of time series and performs well in multivariate time series prediction. The multivariate time series prediction model of the present invention adopts a codec structure based on Transformer, but the existing work based on Transformer to solve the multivariate time series problem mostly embeds the multivariate variables of each time step into a vector, and then calculates attention between each time step. This operation mode only considers the correlation in the time dimension, which can well capture the time dependency, but cannot capture the dependency in the variable dimension, thereby limiting the model prediction ability. The complexity of multivariate time series lies in that its characteristics may exist in the interaction between variables. For example, in theory, the change of one variable will cause the target variable to change, but due to the reverse change of several other variables, it may eventually cause the target variable to remain unchanged. This cross-variable dimension dependency cannot be obtained by calculating attention only in the time dimension. Therefore, the embodiment of the present invention can target the multivariate time series prediction problem and design a new encoder structure based on the Transformer model—feature fusion encoder, so that the feature encoding information output by the encoder contains not only the correlation information in the time dimension, but also the correlation information in the variable dimension.

[0087] Exemplarily, the details of the feature fusion encoder may include: the model input may be a time-variable two-dimensional tensor, one dimension is the time dimension, representing the value of a certain variable at each time step, and one dimension is the variable dimension, representing different variables at each time step, and the entire input is a combination of multiple single-variable time series. First, the two-dimensional tensor can be divided into the Transfomer model according to the time dimension, the attention is calculated on the time dimension, the dependency relationship on the time is established, and finally the feature encoding information of the time dimension is output. In addition, because each dimension of the variable dimension of the multivariate time series has a definite meaning, the value has a clear meaning, and there may be an implicit relationship between the values ​​of different variables, in order to obtain the correlation between the variables, the two-dimensional tensor can be divided into the Transfomer model again according to the variable dimension, the attention is calculated on the variable dimension, the dependency relationship on the variable is established, and finally the feature encoding information of the variable dimension is output. Finally, the feature encoding information of the time dimension and the feature encoding information of the variable dimension can be fused to obtain the final feature encoding information, which contains both the correlation of multiple time steps of a single variable and the correlation of multiple variables of a single time step.

[0088] After the time series is input into the feature fusion encoder, the output feature encoding information is more comprehensive than the feature encoding information obtained by calculating the correlation only in the time dimension, and can better reflect the characteristics of the multivariate time series, which is conducive to improving the accuracy of model prediction. In addition, in order to reduce the complexity of model calculation, compress the model scale, and according to the local close correlation and remote sparse correlation characteristics inherent in the time dimension of the time series, the embodiment of the present invention designs a distance adaptation (Distance Adaptation) attention mechanism for the attention calculation of the time dimension, and each time step is only calculated with the time steps with a fixed interval on both sides around it. Specifically, assuming that the current time step is ti, the time steps participating in the attention calculation with ti can be ti-1, ti-2, ti-3, ti+1, ti+2, ti+3, then the time step interval between ti and ti-1, ti+1 is 0, the time interval between ti-1 and ti-2, ti+1 and ti+2 is 1, the time interval between ti-2 and ti-3, ti+2 and ti+3 is 2, and so on. The calculation method of the DA attention mechanism conforms to the correlation characteristics of time series, that is, the correlation in the local range is greater than the correlation in the long-distance range, and the attention of each time step to the entire sequence time step gradually weakens with the distance, which not only reduces the computational complexity but also does not affect the model performance.

[0089] Step 3: Power consumption prediction model training and deployment.

[0090] The cloud can collect a large amount of historical data, build models, complete training on cloud computing servers, and download and deploy the trained models to edge nodes (i.e., the power consumption prediction model is trained by the cloud server and sent to the edge server). The power consumption prediction task is completed at the edge node, and the power supply company formulates power generation and distribution plans based on the prediction results, thereby completing the allocation and scheduling of electric energy. That is, the trained model on the cloud can be downloaded and deployed to edge nodes near each area, meteorological data can be downloaded from the cloud, and after the power consumption data of each area is uploaded to the edge node, the model can be directly inferred on the edge side to complete the energy consumption prediction calculation task.

[0091] It can be found from the above description that the power consumption prediction method provided by the embodiment of the present invention has the following advantages:

[0092] (1) Regarding the problem of power consumption prediction, the present invention combines new technologies such as the Internet of Things, 5G edge computing, artificial intelligence and deep learning, and designs and constructs a cloud-edge-end three-body collaborative distributed power consumption prediction system architecture to meet the actual business needs of large-scale distributed power data collection and upload as well as data processing and analysis. It can help relevant departments to scientifically formulate power generation and distribution plans, carry out power energy allocation and scheduling, and promote the digital transformation and intelligent upgrading of the power grid.

[0093] The system architecture firstly moves the power consumption prediction task originally in the cloud to the edge side. The edge computing nodes in each region are responsible for the energy consumption prediction of their respective regions. The power consumption data of each region does not have to be uploaded to the cloud for processing, thus realizing the distributed and concurrent prediction of power consumption in multiple regions. Secondly, under this system architecture, the cloud does not have to carry all data and calculations. The data of each region only needs to be uploaded to the edge node to complete the calculation. The edge node, as a data transfer station, only needs to upload important data to the cloud for backup. This greatly reduces the transmission delay and bandwidth pressure as well as the storage and computing pressure of the cloud server, saving resource consumption.

[0094] (2) In the power consumption prediction model, most of the existing works based on the Transformer model to solve the multivariate time series prediction problem only consider the correlation of the time series in the time dimension, but do not consider the correlation of the equally critical variable dimension, and the prediction performance is limited. The present invention designs a feature fusion encoder that can capture the dual features of the time series in the time dimension and the variable dimension, which is beneficial to improving the prediction accuracy of the model.

[0095] Secondly, in view of the inherent local close correlation and long-range sparse correlation characteristics of time series in the time dimension, the present invention designs a distance adaptation attention mechanism, which is beneficial to reducing the computational complexity of the model and compressing the model scale.

[0096] Embodiment 3

[0097] Figure 5 is a schematic diagram of the structure of a power consumption prediction system provided according to Embodiment 3 of the present invention. Figure 5 As shown, the system includes a power collection terminal 1 and an edge server 2.

[0098] The power consumption collection terminal 1 is used to collect historical energy consumption data of the target power consumption area in a preset historical time period, and send the historical energy consumption data to the edge server;

[0099] The edge server 2 is used to input the historical variable data into the feature fusion encoder of the power energy consumption prediction model to obtain a fusion encoding matrix, where the fusion encoding matrix is ​​an information matrix that integrates time dimension features and variable dimension features, and the historical variable data includes the historical energy consumption data;

[0100] The edge server 2 is used to input the fusion coding matrix into the decoder of the power consumption prediction model to obtain the target energy consumption data of the target power consumption area in the future time period. The power consumption prediction model is trained by the cloud server and sent to the edge server.

[0101] A power consumption prediction system provided in the third embodiment of the present invention includes a power collection terminal and an edge server, wherein the power collection terminal is used to collect historical energy consumption data of a target power consumption area in a preset historical time period, and send the historical energy consumption data to the edge server; the edge server is used to input the historical variable data into the feature fusion encoder of the power consumption prediction model to obtain a fusion coding matrix, wherein the fusion coding matrix is ​​an information matrix that integrates time dimension features and variable dimension features, and the historical variable data includes the historical energy consumption data; the edge server is used to input the fusion coding matrix into the decoder of the power consumption prediction model to obtain the target energy consumption data of the target power consumption area in the future time period, and the power consumption prediction model is trained by the cloud server and sent to the edge server. By using this system, the information of time and variable dimensions can be integrated to improve the accuracy of the target energy consumption data. At the same time, the power consumption prediction model is trained by the cloud server and sent to the edge server to determine the target energy consumption data, which reduces the transmission delay and bandwidth pressure and saves resource consumption.

[0102] Optionally, the edge server is specifically used for:

[0103] Performing a first encoding process on the historical variable data to obtain a first feature encoding matrix, where the first feature encoding matrix is ​​an information matrix of the historical variable data in a time dimension;

[0104] Performing a second encoding process on the historical variable data to obtain a second feature encoding matrix, where the second feature encoding matrix is ​​an information matrix of the historical variable data in a variable dimension;

[0105] The first feature coding matrix and the second feature coding matrix are input into a feature fusion module of the feature fusion encoder to obtain a fusion coding information matrix.

[0106] Optionally, the attention mechanism of the first encoding process and the decoder adopts a distance adaptive attention mechanism, and the attention mechanism of the second encoding process adopts a global attention mechanism, and each time step in the distance adaptive attention mechanism is calculated only with a preset time step corresponding to the time step, and the preset time step is a time step with a fixed interval from the time step.

[0107] Optionally, the system further includes a cloud server.

[0108] The cloud server is used to perform model training based on original training data to obtain an electric power consumption prediction model corresponding to the electric power consumption prediction system.

[0109] Optionally, the original training data includes a first sequence of data and at least one second sequence of data, the first sequence of data is energy consumption data of a preset power consumption area in a historical time range, and the cloud server is used to:

[0110] For each sequence data, preprocessing the sequence data to obtain preprocessed sequence data;

[0111] Model training is performed based on all preprocessed sequence data to obtain an electric power consumption prediction model corresponding to the electric power consumption prediction system.

[0112] Optionally, the cloud server is specifically used for:

[0113] identifying, by the cloud server, outliers in the sequence data;

[0114] The cloud server corrects the abnormal value based on the data value at a preset position in the sequence data to obtain preprocessed sequence data.

[0115] Optionally, the cloud server is specifically used for:

[0116] The cloud server fills the missing values ​​in the sequence data based on the target data mean to obtain preprocessed sequence data, and the target data mean is the mean of each data value in the sequence data.

[0117] Optionally, the cloud server is specifically used for:

[0118] Each data value in the sequence data is normalized by the cloud server to obtain preprocessed sequence data.

[0119] Figure 6 FIG. 1 is a schematic diagram of the structure of another power consumption prediction system provided according to Embodiment 3 of the present invention. Figure 6 As shown, it can include power consumption areas, edge servers, cloud servers and power supply companies. Each power consumption area can be configured with a corresponding power consumption collection terminal, that is, the power consumption collection terminal can be used to collect historical energy consumption data of the target power consumption area in a preset historical time period, and send the historical energy consumption data to the edge server; the edge server can be used to input historical variable data into the power consumption prediction model to obtain the target energy consumption data of the target power consumption area in the future time period, so that the power supply company can formulate subsequent power generation and distribution plans based on the obtained target energy consumption data, and scientifically perform power resource allocation and scheduling. Among them, the power consumption prediction model can be trained by the cloud server and sent to the edge server.

[0120] Figure 7 is a schematic diagram of a hierarchical structure of an Internet of Things provided according to Embodiment 3 of the present invention, such as Figure 7As shown, the above-mentioned cloud-edge-end three-body coordinated distributed power energy consumption prediction system architecture can contain the Internet of Things layering, including the perception layer, the transmission layer and the application layer. The perception layer can be used as the bottom layer of the Internet of Things to play the role of power consumption perception and data collection. Specifically, current and voltage sensors, smart meters and other hardware terminal devices can be set up in the power consumption area to collect the energy consumption of the entire area in real time and pass the data to the upper layer. The transmission layer can be used as an intermediate layer, responsible for transmitting the data collected by the perception layer to a higher-level processing and analysis system. The system architecture can embed edge computing into the transmission layer, and the transmission layer is responsible for data transmission from the power collection terminal to the edge node and from the edge node to the cloud. The transmission layer can use 5G communication technology and configure 5G hardware equipment on the data transmission link, including 5G base stations, core networks, bandwidth resources, etc., as well as 5G software technology, which can include 5G communication protocols, network protocol stacks, routing transmission protocols, etc. The cloud can belong to the top layer of the Internet of Things, namely the application layer, which is the data center and computing center of the entire system. It can be equipped with a database, a large computing server, and staff for back-end maintenance to macro-control the energy consumption of each region.

[0121] To summarize, the embodiment of the present invention constructs a cloud-edge-end three-body collaborative distributed power consumption prediction system architecture to meet the actual business needs of large-scale distributed power data collection and upload as well as data processing and analysis. At the same time, the key power consumption prediction model part within the system is designed in detail to enable it to accurately and effectively predict future power consumption, while reducing its scale to facilitate deployment on the edge side, in line with the system architecture requirements.

Claims

1. A method for predicting power consumption, characterized in that: Applied to a power consumption prediction system, the system includes a power collection terminal and an edge server, and the method includes: Collecting historical energy consumption data of a target power consumption area in a preset historical time period through the power consumption collection terminal, and sending the historical energy consumption data to the edge server; The historical variable data is input into the feature fusion encoder of the power energy consumption prediction model through the edge server to obtain a fusion encoding matrix, which is an information matrix that integrates the time dimension features and the variable dimension features. The historical variable data includes the historical energy consumption data and the time-variable two-dimensional tensor. , where N is the time step, D is the number of variables, and the variables include at least one of temperature, wind speed, humidity and precipitation; The fused coding matrix is ​​input into the decoder of the power consumption prediction model through the edge server to obtain the target energy consumption data of the target power consumption area in the future time period, and the power consumption prediction model is trained by the cloud server and sent to the edge server; The feature fusion encoder includes a feature fusion module, and the historical variable data is input into the feature fusion encoder of the power consumption prediction model through the edge server to obtain a fusion coding matrix, including: Performing a first encoding process on the time-variable two-dimensional tensor in the historical variable data by the edge server to obtain a first feature encoding matrix, where the first feature encoding matrix is ​​an information matrix of the historical variable data in the time dimension; The edge server performs a second encoding process on the transposition of the time-variable two-dimensional tensor in the historical variable data to obtain a second feature encoding matrix, where the second feature encoding matrix is ​​an information matrix of the historical variable data in the variable dimension; The first feature coding matrix and the second feature coding matrix are input into the feature fusion module through the edge server to obtain a fusion coding information matrix.

2. The method according to claim 1, characterized in that The attention mechanism of the first encoding process and the decoder adopts a distance adaptive attention mechanism, and the attention mechanism of the second encoding process adopts a global attention mechanism. Each time step in the distance adaptive attention mechanism is calculated only with a preset time step corresponding to the time step, and the preset time step is a time step with a fixed interval from the time step.

3. The method according to claim 1, characterized in that The system further includes a cloud server, and the method further includes: The cloud server performs model training based on the original training data to obtain the power consumption prediction model corresponding to the power consumption prediction system.

4. The method according to claim 3, characterized in that The original training data includes a first sequence of data and at least one second sequence of data, the first sequence of data is energy consumption data of a preset power consumption area in a historical time range, and the second sequence of data is meteorological data corresponding to the preset power consumption area in a historical time range, and the cloud server performs model training based on the original training data to obtain an electric power consumption prediction model corresponding to the electric power consumption prediction system, including: Preprocessing each sequence data by the cloud server to obtain preprocessed sequence data; The cloud server performs model training based on all preprocessed sequence data to obtain an electric power consumption prediction model corresponding to the electric power consumption prediction system.

5. The method according to claim 4, characterized in that The step of preprocessing each sequence data by the cloud server to obtain preprocessed sequence data includes: identifying, by the cloud server, outliers in the sequence data; The cloud server corrects the abnormal value based on the data value at a preset position in the sequence data to obtain preprocessed sequence data.

6. The method according to claim 4, characterized in that The step of preprocessing each sequence data by the cloud server to obtain preprocessed sequence data includes: The cloud server fills the missing values ​​in the sequence data based on the target data mean to obtain preprocessed sequence data, and the target data mean is the mean of each data value in the sequence data.

7. The method according to claim 4, characterized in that The step of preprocessing each sequence data by the cloud server to obtain preprocessed sequence data includes: Each data value in the sequence data is normalized by the cloud server to obtain preprocessed sequence data.

8. A power consumption prediction system, characterized in that: The system includes an electricity collection terminal and an edge server. The power consumption collection terminal is used to collect historical energy consumption data of the target power consumption area in a preset historical time period, and send the historical energy consumption data to the edge server; The edge server is used to input the historical variable data into the feature fusion encoder of the power energy consumption prediction model to obtain a fusion encoding matrix, which is an information matrix that integrates the time dimension features and the variable dimension features. The historical variable data includes the historical energy consumption data and the time-variable two-dimensional tensor. , where N is the time step, D is the number of variables, and the variables include at least one of temperature, wind speed, humidity and precipitation; The edge server is used to input the fusion coding matrix into the decoder of the power energy consumption prediction model to obtain the target energy consumption data of the target power consumption area in the future time period. The power energy consumption prediction model is trained by the cloud server and sent to the edge server; Wherein, the feature fusion encoder includes a feature fusion module, and the edge server is specifically used for: Performing a first encoding process on the time-variable two-dimensional tensor in the historical variable data to obtain a first feature encoding matrix, where the first feature encoding matrix is ​​an information matrix of the historical variable data in the time dimension; Performing a second encoding process on the transpose of the time-variable two-dimensional tensor in the historical variable data to obtain a second feature encoding matrix, where the second feature encoding matrix is ​​an information matrix of the historical variable data in the variable dimension; The first feature coding matrix and the second feature coding matrix are input into the feature fusion module to obtain a fusion coding information matrix.

9. The system according to claim 8, characterized in that The attention mechanism of the first encoding process and the decoder adopts a distance adaptive attention mechanism, and the attention mechanism of the second encoding process adopts a global attention mechanism. Each time step in the distance adaptive attention mechanism is calculated only with a preset time step corresponding to the time step, and the preset time step is a time step with a fixed interval from the time step.

10. The system according to claim 8, characterized in that The system also includes a cloud server, The cloud server is used to perform model training based on original training data to obtain an electric power consumption prediction model corresponding to the electric power consumption prediction system.

11. The system according to claim 10, characterized in that The original training data includes a first sequence of data and at least one second sequence of data, wherein the first sequence of data is energy consumption data of a preset power consumption area in a historical time range, and the second sequence of data is meteorological data corresponding to the preset power consumption area in a historical time range, and the cloud server is used to: For each sequence data, preprocessing the sequence data to obtain preprocessed sequence data; Model training is performed based on all preprocessed sequence data to obtain an electric power consumption prediction model corresponding to the electric power consumption prediction system.

12. The system according to claim 11, characterized in that The cloud server is specifically used for: identifying, by the cloud server, outliers in the sequence data; The cloud server corrects the abnormal value based on the data value at a preset position in the sequence data to obtain preprocessed sequence data.

13. The system according to claim 11, characterized in that The cloud server is specifically used for: The cloud server fills the missing values ​​in the sequence data based on the target data mean to obtain preprocessed sequence data, and the target data mean is the mean of each data value in the sequence data.

14. The system according to claim 11, characterized in that The cloud server is specifically used for: Each data value in the sequence data is normalized by the cloud server to obtain preprocessed sequence data.

Citation Information

Patent Citations

  • Multivariable input and multivariable output time series prediction method and system

    CN112561704A

  • Multivariate time series classification method and device based on bidirectional self-attention

    CN115563537A

  • Adaptive Lasso-LSTM-based building group energy consumption short-term prediction method considering user privacy

    CN115965049A

  • Conversation generation method fusing basic knowledge and user information

    CN116010575A

  • Multi-energy load prediction method and system based on improved coding and decoding model

    CN116777668A