Energy consumption prediction method and application based on multi-resolution TCN network of time series decomposition

Through the TCN network of time series decomposition and multi-resolution analysis, the problem of mixed trend relationship and periodic relationship in energy consumption forecasting is solved, and the forecast accuracy is improved, especially in long-term forecasting.

CN115481807BActive Publication Date: 2025-09-19HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211164893.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-23
Publication Date
2025-09-19
Estimated Expiration
2042-09-23

AI Technical Summary

Technical Problem

Existing energy consumption prediction models have difficulty in effectively separating trend relationships and cyclical relationships, and are unable to extract feature information at different resolutions, resulting in insufficient prediction accuracy.

Method used

A multi-resolution TCN network with time series decomposition is adopted. The energy consumption data is decomposed into trend terms, seasonal terms and residual terms through sliding window partitioning, time series decomposition algorithm STL and multi-resolution analysis method. The improved TCN network is used to extract local features and combined with AR algorithm for fusion prediction.

Benefits of technology

The accuracy of energy consumption forecasting has been significantly improved, especially in long-term forecasting, and the model's ability to extract temporal features and analyze features at different resolutions has been enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115481807B_ABST
    Figure CN115481807B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and application for energy consumption prediction based on a multi-resolution TCN network based on time series decomposition. The method comprises: 1. using a sliding window to partition and normalize acquired energy consumption data; 2. decomposing the energy consumption data sequence to obtain a trend term, a seasonal term, and a residual term of the energy consumption data; 3. inputting the decomposed trend term, seasonal term, and residual term into an improved TCN network to extract and merge the local features of the three sequences at different time scales, thereby obtaining global features of the three sequences and fusing them into a multi-resolution feature; 4. training a traditional autoregressive AR module in parallel; 5. fusing the output of the multi-resolution module with the output of the AR module to obtain a final prediction result. The present invention can first separate different partial relationships and then use multi-resolution modeling and analysis technology to obtain a more robust model, thereby significantly improving the accuracy of energy consumption prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an attention network, a traditional time series decomposition algorithm STL decomposition, and a multi-resolution module, and belongs to the field of natural language processing (NLP). Specifically, it is an energy consumption prediction method and application of a multi-resolution TCN network based on time series decomposition. Background Art

[0002] Energy consumption forecasting has been a hot research topic in recent years. Accurate energy consumption forecasting can help relevant departments formulate reasonable energy use plans, conserve energy consumption, and actively respond to the current social principles of energy conservation, emission reduction, and sustainable development. While energy consumption forecasting based on long-sequence modeling and extracting channel features from energy consumption data has achieved good results, actual energy consumption data has complex relationships and contains different characteristic information at different resolutions. Therefore, it is necessary to first decompose the complex relationships in energy consumption data, separating the different partial relationships, and then use multi-resolution modeling and analysis to obtain a better model.

[0003] Energy consumption forecasting research at home and abroad is generally divided into four steps:

[0004] (1) Prepare energy consumption datasets. There are three main types of datasets. The first is a single-feature dataset that only contains energy consumption data. Since this type of dataset only has one feature, it is not suitable for complex network models and traditional methods are often used. The second type includes features of external influencing factors. Based on the external features, the energy consumption of a single collection device is predicted. It contains multiple features, but the prediction result has only a single output. The third type includes energy consumption data collected from multiple devices. It has many features, and the prediction results correspond one-to-one with the number of features.

[0005] (2) Abnormal data processing. There are some abnormal data in energy consumption data collection. If these abnormal data are not processed, it will affect the training of the entire model and make the prediction results worse. Generally, there are three types of methods for abnormal data processing: traditional statistical methods, machine learning methods, and deep learning methods.

[0006] (3) Model building. Based on the different principles of the methods, the current energy consumption prediction algorithms are mainly divided into three categories: prediction methods based on statistical learning, prediction methods based on machine learning, and prediction methods based on deep learning.

[0007] (4) Output results: In order to verify the effectiveness of the model, a variety of experiments are conducted.

[0008] While deep learning models have achieved some success, they still have certain drawbacks. First, energy consumption data exhibits a mix of trend and cyclical relationships. Second, TACN can only extract channel features, not temporal features. Finally, actual energy consumption data contains complex correlations and contains different feature information at different resolutions. Previous models failed to account for this discrepancy in energy consumption data at different resolutions. Summary of the Invention

[0009] The invention aims to address the shortcomings of the above-mentioned existing technologies and proposes an energy consumption prediction method and application of a multi-resolution TCN network based on time series decomposition, in order to separate different partial relationships and then use multi-resolution modeling and analysis methods to obtain a more robust model, thereby significantly improving the accuracy of energy consumption prediction.

[0010] In order to achieve the above-mentioned object, the present invention adopts the following technical solutions:

[0011] The energy consumption prediction method of the multi-resolution TCN network based on time series decomposition of the present invention is characterized in that it includes the following steps:

[0012] Step 1: Use a sliding window to divide the acquired energy consumption data, and then normalize the divided energy consumption data to obtain the normalized energy consumption data sequence X = {X v |v=1,2,…,N};where X v represents the vth normalized energy consumption data, and N represents the number of energy consumption data;

[0013] Step 2: Use the time series decomposition algorithm to decompose the normalized energy consumption data sequence X to obtain the trend item Trend of the energy consumption data. X 、Seasonal X and the residual term Resid X ;

[0014] Step 3: Use the multi-resolution analysis method to analyze the trend items X 、Seasonal X and the residual term Resid X Decompose into trend term sequence, seasonal term sequence, and residual term sequence of different time scales, and then input them into the improved TCN network to extract the local features of the three sequences at different time scales. Then, the local features of the time scales of the three sequences are merged to obtain the global features of the three sequences and fuse them into the multi-resolution feature y NL ;

[0015] Step 4: Use the AR algorithm to perform linear processing on the normalized energy consumption data sequence X to obtain the linear feature y of the energy consumption data sequence X. L ;

[0016] Step 5: Multi-resolution feature y NL With the linear feature y L After fusion, the predicted results of energy consumption are obtained .

[0017] The energy consumption prediction method of the present invention is also characterized in that the improved TCN network in step 3 is to perform the following process on the trend item Trend X Processing:

[0018] Step 3.1: Use binary tree to identify trend items X Perform N decompositions to obtain trend item sequences of different time scales {T n |n=1,2,…,2 N -1}, where T n Indicates the nth node where the trend item after decomposition is located, 2 N -1 represents the number of nodes of the trend item in the binary tree;

[0019] Step 3.2, the nth node T of the binary tree n Perform dilated convolution operation to obtain the nth node T n Eigenvalues ​​on C channels represents the eigenvalue of the cth channel of the nth node, C represents the number of channels, let H n Denotes the eigenvalue U n The length of the sequence;

[0020] Step 3.3: Use formula (3.1) to convert the eigenvalue of the cth channel of the nth node into Perform channel compression operation to obtain the global information value of the cth channel of the nth node Thus, the global information value of the compressed channel eigenvalue is obtained

[0021]

[0022] In formula (3.1), F sq Indicates compression operation, represents the i-th sequence of the c-th channel of the n-th node;

[0023] Step 3.4: Use formula (3.2) to convert the global information value of the cth channel of the nth node into After two fully connected layers and one Sigmoid activation function, the weight of the cth channel of the nth node is obtained. Thus, the weight of the cth channel of the nth node is obtained

[0024]

[0025] In formula (3.2), F ex Represents the excitation operation, W represents the weights of two fully connected layers, W1 represents the weight of one of the fully connected layers, and W2 represents the weight of the other fully connected layer; ReLU represents the nonlinear activation function; δ represents the Sigmoid activation function;

[0026] Step 3.5: Use formula (3.3) to convert the eigenvalue of the cth channel of the nth node into Recalibrate and get the cth calibrated eigenvalue of the nth node Thus, the recalibrated eigenvalues ​​are obtained

[0027]

[0028] In formula (3.3), F scale Indicates recalibration operation;

[0029] Step 3.6 After the weight normalization layer, ReLU activation function and Dropout layer, the eigenvalue F is obtained. n ; The characteristic value F n After inputting the first residual block, the eigenvalue F is converted into n After performing residual connection with the energy consumption data sequence X, the residual connection eigenvalue is obtained The output of the previous residual block is used as the input of the next residual block, and after processing by M residual blocks, the eigenvalue of the Mth residual block is obtained using formula (3.5)

[0030]

[0031]

[0032] In formula (3.4)-formula (3.5), F represents the weight normalization layer, ReLU activation function and Dropout layer, represents the eigenvalues ​​of the m-1 residual blocks of the nth node, and SE represents the fusion operation of compression operation, excitation operation and recalibration operation;

[0033] Step 3.7, the eigenvalue F nAfter the Sigmoid function is processed, the mapping value between (0, 1) is obtained and used as the weight of the time dimension of the energy consumption data; then, the weight is combined with Multiply to get the local features of the nth node

[0034]

[0035] Step 3.8, 2 N -1 The local features of the nodes are merged and then mapped through a fully connected layer to obtain the trend item Trend X Global characteristic Trend y .

[0036] The present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a program that supports the processor to execute the energy consumption prediction method, and the processor is configured to execute the program stored in the memory.

[0037] The present invention provides a computer-readable storage medium having a computer program stored thereon. The computer-readable storage medium is characterized in that when the computer program is executed by a processor, the steps of the energy consumption prediction method are executed. Compared with the prior art, the present invention has the following advantages:

[0038] 1. The present invention combines the advantages of traditional time series decomposition algorithms, the characteristics of attention mechanisms, and the effectiveness of multi-resolution analysis for sequence modeling, and proposes a temporal decomposition multi-resolution TCN (Temporal Decomposition Multi-Resolution TCN, TDMRTCN) network model. First, in response to the problem that energy consumption data contains a mixture of trend relationships and periodic relationships, it is proposed to use the traditional time series decomposition algorithm STL, which can separate trend relationships and periodic relationships, for energy consumption data processing. Then, in response to the problem that TACN can only extract channel features but not time features, it is proposed to integrate attention in the time dimension into TACN. Finally, considering the problem that energy consumption data contains different feature information at different resolutions, the idea of ​​multi-resolution analysis is applied to the field of energy consumption prediction, thereby significantly improving the accuracy of energy consumption prediction.

[0039] 2. The present invention integrates the advantages of traditional time series decomposition algorithms, and addresses the problem of mixed trend relationships and periodic relationships in energy consumption data. It proposes to use the traditional time series decomposition algorithm STL, which can separate trend relationships and periodic relationships, for energy consumption data processing, thereby solving the problem of mixed trend relationships and periodic relationships in energy consumption data.

[0040] 3. This paper utilizes the attention mechanism to construct an attention module within the TCN convolutional layer for weight distribution in the temporal dimension. Combined with SENet, this module forms a dual-stage attention DATCN. The attention mechanism obtains the input variables for the next layer by taking a weighted average of the hidden states of all time steps in the encoder. To address the problem that TACN can only extract channel features but not temporal features, this paper proposes to integrate attention in the temporal dimension into TACN, increasing the ability to find effective information from the spatiotemporal attention network model.

[0041] 4. The present invention uses multi-resolution analysis, also known as multi-scale analysis, to decompose the original data step by step. Taking into account the problem that energy consumption data contains different characteristic information at different resolutions, the multi-resolution analysis concept is applied to the field of energy consumption forecasting, effectively improving the interaction ability between time series.

[0042] 5. The present invention utilizes multi-resolution analysis to effectively model sequences, decomposing the original data step by step. In image processing, a low-pass filter is used to smooth the image and downsample it, resulting in a series of reduced-size images. Its analysis of objects progresses from coarse to fine. In the time domain, the scale changes from large to small, and in the frequency domain, the scale changes from small to large. Multi-resolution analysis decomposes the original sequence into sequences of different frequencies, and then processes each decomposed sequence in turn. This increases the network's receptive field, effectively allowing the network model to focus on regions with high time-frequency weights and reducing the interference of invalid information. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is an overview of the time-series decomposition multi-resolution TCN of the present invention;

[0044] Figure 2 This is the structure diagram of the dual-stage attention temporal convolutional network of the present invention;

[0045] Figure 3 This is a schematic diagram of multi-resolution analysis of the present invention;

[0046] Figure 4 This is a structural diagram of the time series decomposition multi-resolution TCN model of the present invention;

[0047] Figure 5 This is the Electricity fitting curve diagram based on TDMRTCN of the present invention. DETAILED DESCRIPTION

[0048] In this embodiment, a method for predicting energy consumption of a multi-resolution TCN network based on time series decomposition is proposed, and a TDMRTCN model is proposed, such as Figure 1As shown. The energy consumption data is decomposed by the traditional time series decomposition algorithm STL to obtain the trend term, seasonal term and residual term of the energy consumption data; the decomposed data is input into the multi-resolution module to obtain the relationship implied by different resolutions in the energy consumption data. The multi-resolution module is constructed by multiple dual-stage attention TCN (Dual-Stage AttentionTCN, DATCN) in the form of a binary tree; DATCN takes TACN as the basic module, integrates the attention mechanism, and forms a dual-stage attention with SENet to enhance TACN's extraction of spatiotemporal features; in order to enhance the model's extraction of linear relationships in energy consumption data, a traditional AR module is trained in parallel, and the output results of the multi-resolution module are fused with the output results of the AR module to obtain the final prediction results. The present invention first decomposes the complex correlation relationship of the energy consumption data, separates the different partial relationships first, and then uses multi-resolution modeling analysis to obtain a better model, thereby significantly improving the accuracy of energy consumption prediction. Specifically, it includes the following steps:

[0049] Step 1: Use a sliding window to divide the acquired energy consumption data, and then normalize the divided energy consumption data to obtain the normalized energy consumption data sequence X = {X v |v=1,2,…,N};where X v represents the vth normalized energy consumption data, and N represents the number of energy consumption data;

[0050] Step 1.1 uses the form of Min-Max Scaling to map all values ​​to between (0, 1). In all samples, select the maximum and minimum values ​​of each feature and perform Min-Max Scaling on each feature.

[0051] In step 1.2, to further verify the model's predictions on the test set, we need to construct a fitting curve between the predicted values ​​and the true values. However, the model's direct output is normalized data. Therefore, we need to denormalize the output.

[0052] Step 1.3: After the values ​​of the entire data set are normalized to the maximum and minimum values, the data set is divided using a sliding window.

[0053] Step 2: Use the time series decomposition algorithm to decompose the normalized energy consumption data sequence X to obtain the trend item Trend of the energy consumption data. X 、Seasonal X and the residual term Resid XIn order to make the algorithm robust enough, an inner loop and an outer loop are designed. The inner loop mainly performs trend fitting and periodic component calculations; the outer loop is mainly used to adjust the robust weights.

[0054] Step 3: Figure 3 As shown, the multi-resolution analysis method is used to analyze the trend items Trend X 、Seasonal X and the residual term Resid X Decompose into trend term series, seasonal term series, and residual term series of different time scales, and then Figure 2 As shown in the figure, the three sequences are input into the improved TCN network and the local features of the three sequences at different time scales are extracted. Then the local features of the time scales of the three sequences are merged to obtain the global features of the three sequences and fuse them into the multi-resolution feature y NL ;

[0055] Step 3.1: Use binary tree to identify trend items X Perform N decompositions to obtain trend item sequences of different time scales {T n |n=1,2,…,2 N -1}, where T n Indicates the nth node where the trend item after decomposition is located, 2 N -1 represents the number of nodes of the trend item in the binary tree;

[0056] Step 3.2, the nth node T of the binary tree n Perform dilated convolution operation to obtain the nth node T n Eigenvalues ​​on C channels represents the eigenvalue of the cth channel of the nth node, C represents the number of channels, let H n Denotes the eigenvalue U n The length of the sequence;

[0057] Step 3.3: Use formula (3.1) to convert the eigenvalue of the cth channel of the nth node into Perform channel compression operation to obtain the global information value of the cth channel of the nth node Thus, the global information value of the compressed channel eigenvalue is obtained

[0058]

[0059] In formula (3.1), F sq Indicates compression operation, represents the i-th sequence of the c-th channel of the n-th node,

[0060] Step 3.4: Use formula (3.2) to convert the global information value of the cth channel of the nth node into After two fully connected layers and one Sigmoid activation function, the weight of the cth channel of the nth node is obtained. Thus, the weight of the cth channel of the nth node is obtained

[0061]

[0062] In formula (3.2), F ex Represents the excitation operation, W represents the weights of two fully connected layers, W1 represents the weight of one of the fully connected layers, and W2 represents the weight of the other fully connected layer; ReLU represents the nonlinear activation function; δ represents the Sigmoid activation function;

[0063] Step 3.5: Use formula (3.3) to convert the eigenvalue of the cth channel of the nth node into Recalibrate and get the cth calibrated eigenvalue of the nth node Thus, the recalibrated eigenvalues ​​are obtained

[0064]

[0065] In formula (3.3), F scale Indicates recalibration operation;

[0066] Step 3.6 After the weight normalization layer, ReLU activation function and Dropout layer, the eigenvalue F is obtained. n ; Eigenvalue F n After inputting the first residual block, use formula (3.4) to convert the eigenvalue F n After performing residual connection with the energy consumption data sequence X, the residual connection eigenvalue is obtained The output of the previous residual block is used as the input of the next residual block, and after processing by M residual blocks, the eigenvalue of the Mth residual block is obtained using formula (3.5)

[0067]

[0068]

[0069] In formula (3.4)-formula (3.5), F represents the weight normalization layer, ReLU activation function and Dropout layer, represents the eigenvalues ​​of the m-1 residual blocks of the nth node, and SE represents the compression operation, the excitation operation, and the recalibration operation.

[0070] Step 3.7, eigenvalue F n After the Sigmoid function is processed, the mapping value between (0, 1) is obtained and used as the weight of the time dimension of the energy consumption data; then, the weight is combined with Multiply to get the local features of the nth node

[0071]

[0072] Step 3.8, 2 N -1 The local features of the nodes are merged and then mapped through a fully connected layer to obtain the trend item Trend X Global characteristic Trend y .

[0073] Step 4: Use the AR algorithm to perform linear processing on the normalized energy consumption data sequence X to obtain the linear feature y of the energy consumption data sequence X. L ;

[0074] y L =WX+b (4.1)

[0075] In formula (4.1), X is the energy consumption data, W is the weight matrix, b is the bias, and y L is the linear output of the AR module;

[0076] Step 5: Figure 4 As shown, the multi-resolution feature yNL is combined with the linear feature y L After fusion, the predicted results of energy consumption are obtained .

[0077] To verify the effectiveness of TDMRTCN, we conducted experiments on the public Electricity dataset and plotted a fitting curve for the test set to examine the degree of fit between the predicted and true values. Due to the large number of features and samples in the test set, we selected some samples of some features for fitting tests.

[0078] like Figure 5 As shown in the figure, it represents the fitting curve with a time step of 3. Experiments show that as the time step increases, the fitting effect of the model gradually becomes worse, which means that the long-term prediction accuracy of energy consumption is lower than the short-term prediction accuracy.

[0079] In this embodiment, an electronic device includes a memory and a processor. The memory is used to store a program that supports the processor to execute the energy consumption prediction method. The processor is configured to execute the program stored in the memory.

[0080] In this embodiment, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the energy consumption prediction method are executed.

[0081] In summary, in energy consumption prediction, this method can combine the advantages of traditional time series decomposition algorithms, the characteristics of attention mechanisms, and the effectiveness of multi-resolution analysis for sequence modeling. It can address the problem that the temporal attention network model TACN can only extract channel features but not time features. It proposes to integrate attention in the time dimension into TACN. Considering the problem that energy consumption data contains different feature information at different resolutions, the idea of ​​multi-resolution analysis is applied to the field of energy consumption prediction.

Claims

1. A method for predicting energy consumption based on a multi-resolution TCN network with time series decomposition, characterized in that: The steps include: Step 1: Use a sliding window to divide the acquired energy consumption data, and then normalize the divided energy consumption data to obtain a normalized energy consumption data sequence. ;in, represents the vth normalized energy consumption data, and N represents the number of energy consumption data; Step 2: Use the time series decomposition algorithm to normalize the energy consumption data series Decompose and get the trend items of energy consumption data , Seasonal items and the residual ; Step 3: Use the multi-resolution analysis method to analyze the trend items , Seasonal items and the residual Decompose into trend term sequence, seasonal term sequence, and residual term sequence of different time scales, and then input them into the improved TCN network to extract the local features of the three sequences at different time scales. Then merge the local features of the time scales of the three sequences respectively to obtain the global features of the three sequences and fuse them into multi-resolution features. The improved TCN network is constructed by multiple dual-stage attention TCNs in the form of a binary tree. The dual-stage attention TCN uses TACN as the basic module, integrates the attention mechanism, and inserts SENet between the hollow convolution layer and the weight normalization layer to form a dual-stage attention. Step 4: Use AR algorithm to normalize the energy consumption data series Perform linear processing to obtain energy consumption data series Linear characteristics ; Step 5: Multi-resolution features With the linear characteristics After fusion, the predicted results of energy consumption are obtained .

2. The energy consumption prediction method according to claim 1, wherein: The improved TCN network in step 3 is to perform the following process on the trend item Processing: Step 3.1: Use binary tree to identify trend items Perform N decompositions to obtain trend item sequences of different time scales ,in, Indicates the nth node where the decomposed trend item is located, The number of nodes representing the trend item in the binary tree; Step 3.2, the nth node of the binary tree Perform dilated convolution operation to obtain the nth node exist The eigenvalues ​​on the channels = , represents the eigenvalue of the cth channel of the nth node, represents the number of channels, let Represents eigenvalues The length of the sequence; Step 3.3: Use formula (3.1) to convert the eigenvalue of the cth channel of the nth node into Perform channel compression operation to obtain the global information value of the cth channel of the nth node , thereby obtaining the global information value of the compressed channel eigenvalue ; (3.1) In formula (3.1), Indicates compression operation, represents the i-th sequence of the c-th channel of the n-th node; Step 3.4: Use formula (3.2) to convert the global information value of the cth channel of the nth node into After two fully connected layers and one Sigmoid activation function, the weight of the cth channel of the nth node is obtained. , thus obtaining the weight of the cth channel of the nth node ; (3.2) In formula (3.2), represents the incentive operation, represents the weights of the two fully connected layers, represents the weight of one of the fully connected layers, represents the weight of another fully connected layer; represents a nonlinear activation function; Represents the Sigmoid activation function; Step 3.5: Use formula (3.3) to convert the eigenvalue of the cth channel of the nth node into Recalibrate and get the cth calibrated eigenvalue of the nth node , thus obtaining the recalibrated eigenvalues ; (3.3) In formula (3.3), Indicates recalibration operation; Step 3.6 After the weight normalization layer, ReLU activation function and Dropout layer in sequence, the eigenvalue is obtained ; The characteristic value After inputting the first residual block, the eigenvalues ​​are converted into Energy consumption data series After performing the residual connection, the residual connection eigenvalue is obtained ; The output of the previous residual block is used as the input of the next residual block, and After processing the residual blocks, the eigenvalue of the Mth residual block is obtained using formula (3.5) : (3.4) (3.5) In formula (3.4)-formula (3.5), represents the weight normalization layer, ReLU activation function and Dropout layer, represents the eigenvalues ​​of the m-1 residual blocks of the nth node, represents the fusion operation of compression operation, excitation operation and rescaling operation; Step 3.7, the characteristic value After processing by the Sigmoid function, we get The mapping value between them is used as the weight of the time dimension of energy consumption data; then, the weight is combined with Multiply to get the local features of the nth node : (3.6) Step 3.8, The local features of each node are merged and then mapped through a fully connected layer to obtain the trend item Global characteristics of .

3. An electronic device comprising a memory and a processor, characterized in that: The memory is used to store a program that supports the processor to execute the energy consumption prediction method according to claim 1 or 2, and the processor is configured to execute the program stored in the memory.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the energy consumption prediction method according to claim 1 or 2 are executed.