TCN-Informer-based electricity consumption prediction method and system
By combining the TCN and Informer models, the problems of low accuracy and low efficiency in power load forecasting are solved, enabling efficient extraction of short-term and long-term features of power data and improving the forecasting accuracy and stability of the power system.
Patent Information
- Application Number
- CN202510738632.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-10-31
AI Technical Summary
Existing technologies struggle to effectively capture the multidimensional and long-sequence information of power data, resulting in low accuracy and efficiency in power load forecasting. Traditional models are computationally inefficient or unable to accurately capture nonlinear features when processing long sequences.
By combining the short-term feature extraction capability of TCN with the long-term dependency capability of Informer, the raw time-series data is preprocessed by TCN to extract short-term dynamic features, and its output is used as the input of Informer to capture long-term dependencies. The encoding and decoding are performed using the ProbSparse self-attention mechanism and cross-attention module.
It enables efficient extraction of key features from power load data, accurately captures short-term fluctuations and long-term trends, significantly improves prediction accuracy, and enhances the stability and management efficiency of the power system.
Smart Images

Figure CN120879524A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system load forecasting technology, specifically to a power consumption forecasting method and system based on TCN-Informer. Background Technology
[0002] With global population growth and industrial expansion, electricity demand is constantly rising, prompting the continuous expansion of power system infrastructure. However, this makes the management and maintenance of power systems increasingly complex, highlighting the growing importance of electricity data time series forecasting and consumption anomaly detection. Electricity data time series data suffers from long-term dependencies, nonlinear characteristics, and noise interference. Traditional single deep learning models struggle to capture multidimensional and long-sequence information and cannot effectively extract global and local features. Existing technologies, such as the ARIMA model, RNNs and their variants, TCNs (temporal convolutional networks), and Transformers (self-attention mechanisms), all have limitations and cannot meet the high-precision requirements of long-sequence time series forecasting tasks. For example, the ARIMA model is a linear model and cannot accurately capture time series data with nonlinear characteristics; RNN variants such as GRU and LSTM are computationally inefficient when processing long-sequence data due to their serial computation characteristics and are prone to gradient vanishing or exploding problems; while TCN performs well in extracting short-term time features, its ability to handle long-term dependencies and fluctuations in long-term series is limited; and Transformers are not sensitive enough to short-term dynamic changes and local features. Summary of the Invention
[0003] In view of the above-mentioned problems, the present invention is proposed.
[0004] Therefore, this invention aims to address the problems of low accuracy, low efficiency, and inability to fully adapt to the characteristics of power load forecasting in existing technologies. It combines the short-term feature extraction capabilities of TCN with the advantages of Informer (a novel Transformer for long-term time series forecasting) in capturing long-term dependencies, creating a complementary advantage and processing power load data more efficiently.
[0005] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a power consumption prediction method based on TCN-Informer, which includes the following steps,
[0006] Electricity consumption time-series data is extracted from the power grid database based on meter numbers, and the collected data is preprocessed. The power data is divided according to a set window length to construct a training dataset. A combined TCN-Informer model is constructed for power load prediction. The TCN is used to preprocess the original time-series data to extract short-term dynamic features and generate feature-enhanced sequences. The output of the TCN is used as the input of the Informer, which encodes and decodes long sequences to capture long-period dependencies.
[0007] As a preferred embodiment of the TCN-Informer-based power consumption prediction method described in this invention, the power consumption time series data includes daily power consumption data of users within a specified area.
[0008] As a preferred embodiment of the TCN-Informer-based power consumption prediction method of the present invention, the preprocessing includes a first processing and a second processing.
[0009] The first process involves filling in missing values in the data using linear interpolation;
[0010] The second process involves normalizing the data using a minimax method.
[0011] As a preferred embodiment of the TCN-Informer-based electricity consumption prediction method of the present invention, the construction of the dataset for training includes dividing the input univariate time series into non-overlapping subsequences through a sliding window.
[0012] Set the window length, slide the window starting from the beginning of the time series, and extract the data within the window as subsequence data samples;
[0013] In the subsequence data samples, the corresponding time encoding information is fused and input into the training along with the subsequence data. The processed data is then divided into training set, validation set and test set.
[0014] As a preferred embodiment of the TCN-Informer-based power consumption forecasting method described in this invention, the preprocessing of the original time-series data using TCN includes: constructing a combined model based on TCN-Informer and inputting data, and processing the original power load time-series data through TCN.
[0015] TCN consists of dilated causal convolution and dilated convolution, and introduces residual connections to directly pass the input to the output layer, thus optimizing the training of deep networks.
[0016] Dilated causal convolution fills the input sequence on one side, while expanded convolution inserts gaps between kernel elements.
[0017] As a preferred embodiment of the TCN-Informer-based power consumption prediction method of the present invention, the method of capturing long-period dependencies includes using the TCN output as the input of the Informer encoder.
[0018] The Informer encoder consists of two or more stacked coding layers. Each coding layer contains ProbSparse self-attention and a feedforward neural network for encoding. The decoder masks the ProbSparse self-attention operation.
[0019] The similarity score between the query vector and the key vector is calculated and transformed into a probability distribution. The ProbSparse self-attention mechanism calculates the attention entropy and selects the key vector with the largest entropy value to calculate and output the encoded features.
[0020] As a preferred embodiment of the TCN-Informer-based power consumption prediction method described in this invention, the method of capturing long-term dependencies further includes a decoder consisting of two or more stacked decoding layers, each decoding layer containing a cross-attention module, a ProbSparse self-attention mechanism, and a feedforward neural network.
[0021] During the decoding process, the cross-attention module captures the relationship between the encoder output and the encoder's predicted output;
[0022] The output of the cross-attention module is passed through the ProbSparse self-attention mechanism and the feedforward neural network to output the final predicted time series value.
[0023] Meanwhile, the Informer encoder introduces a distillation mechanism, which improves model efficiency by introducing an auxiliary loss function into the encoder.
[0024] Another objective of this invention is to provide a power consumption prediction system based on TCN-Informer.
[0025] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a power consumption forecasting system based on TCN-Informer, comprising: a data acquisition and processing module, a training module, and a load forecasting module;
[0026] The data acquisition and processing module extracts electricity consumption time-series data from the power grid database according to the meter number, and preprocesses the acquired data.
[0027] The training module divides the power data according to a set window length to construct a dataset for training.
[0028] The load forecasting module includes a TCN processing module and an Informer module. It constructs a combined TCN-Informer model for power load forecasting. The TCN processing module preprocesses the original time-series data, extracts short-term dynamic features, and generates feature-enhanced sequences. The output of the TCN processing module is used as the input of the Informer module. The Informer encodes and decodes long sequences to capture long-period dependencies.
[0029] The Informer module consists of a decoding layer and an encoding layer. The encoding layer includes a ProbSparse self-attention module and a feedforward neural network module, while the decoding layer includes a cross-attention module, a ProbSparse self-attention module, and a feedforward neural network module.
[0030] The present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the TCN-Informer-based power consumption prediction method.
[0031] The present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the TCN-Informer-based power consumption prediction method.
[0032] The beneficial effects of this invention are as follows: The TCN-Informer model of this invention successfully integrates the powerful short-term feature extraction capability of TCN and the excellent long-term dependency capture capability of Informer, enabling efficient extraction of key features from power load data and accurate capture of short-term fluctuations and long-term trends. Through comparative experiments, this model demonstrates significant advantages over benchmark models such as ARIMA, GRU, Informer, and TCN-Transformer in key performance indicators such as mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE), resulting in a substantial improvement in prediction accuracy. This provides high-precision load forecasting results for power system management and maintenance, effectively enhancing power system stability. Attached Figure Description
[0033] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1The following is a flowchart of an overall power consumption prediction method based on TCN-Informer, provided as an embodiment of the present invention.
[0035] Figure 2 The graph shows the training and validation loss value variation curves of a TCN-Informer model for an electricity consumption prediction method based on TCN-Informer, provided as an embodiment of the present invention.
[0036] Figure 3 This is a comparison chart of the prediction results of the TCN-Informer model and other models in a power consumption prediction method based on TCN-Informer provided in one embodiment of the present invention. Detailed Implementation
[0037] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0038] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a power consumption prediction method based on TCN-Informer, including:
[0039] S1. Extract electricity consumption time series data from the power grid database according to the meter number, and preprocess the collected data.
[0040] Specifically, electricity consumption time-series data is extracted from the power grid database based on the meter serial numbers. This data comes from the Southern Power Grid and covers two years of daily electricity consumption records for users' meters in a specific area, providing a rich and comprehensive data foundation for model training.
[0041] S101. Preprocess the collected data, including first processing and second processing.
[0042] S102. The first processing step is to fill in the missing values in the data using linear interpolation.
[0043] Specifically, in an embodiment of the present invention, for an electricity consumption data sequence, if there is a missing value x... i By calculating adjacent data points x i-1 and x i+1 The average value is used to fill in the gaps, which to some extent ensures the continuity and integrity of the data and facilitates subsequent model training. The formula is:
[0044] xi =(x i-1 +x i+1 ) / 2
[0045] In an optional embodiment, missing values in the data can be filled by forward padding, where missing values are replaced with the previous known values. The electricity consumption data sequence is traversed, and if the current value is found to be missing, it is replaced with the non-missing value immediately preceding it.
[0046] In another optional embodiment, filling missing values in the data can also be done by using the average value within a set time window before and after the missing value, setting the time window size N, traversing the electricity consumption data sequence, calculating the average value of N days before and after each missing value, and filling it at the missing position.
[0047] S103. The second processing step is to normalize the data using the minimax method.
[0048] Specifically, in the embodiments of the present invention, the data is normalized using the minimax method to eliminate differences in magnitude and value range between different features, as shown in the formula:
[0049]
[0050] Where x is the original data value, x min and x max x represents the minimum and maximum values of the features in the dataset, respectively. norm These are the normalized data values. After this processing, all data are mapped to the [0,1] interval, effectively improving the stability and convergence speed of model training.
[0051] In an optional embodiment, the normalization process can be Z-score standardization, where for an electricity consumption data sequence, the mean and standard deviation of the original data are calculated, and each data point is standardized by subtracting the mean from the original data value and dividing by the standard deviation.
[0052] In another alternative embodiment, the normalization process can also be a Log transformation. For all electricity consumption data values greater than 0, a Log transformation of the natural logarithm is applied. After the Log transformation, the minimax method is selected to normalize the transformed data.
[0053] S2. Divide the power data according to the set window length and construct a dataset for training.
[0054] S21. In order to better represent the local patterns and long-term trends in time series, and thus to more comprehensively analyze the characteristics of time series data.
[0055] In an embodiment of the present invention, the input univariate time series is divided into a series of non-overlapping subsequences {x1, x2, ..., xn} of length n using a sliding window. n}
[0056] Set the window length to n and the step size to m. Start sliding the window from the beginning of the time series and extract the data in each window as a subsequence sample.
[0057] For a time series [t1, t2, t3, ..., t] T The first window contains data [t1, t2, ..., t]. n The second window contains data [t] m+1 ,t m+2 ,...,t n+m ], until the end of the sequence; where, [t m+1 ,t m+2 ,...,t n+m The [] indicates that the second window contains data starting from the (m+1)th data point in the time series and continuing to the (m+n)th data point, until the end of the series. This division method helps to capture the patterns and changes in the time series within a local time range, while also preserving long-term trend information.
[0058] Where [t1,t2,t3,...,t] T ] represents each data point in the time series, n represents the length of the sliding window, i.e., the number of data points contained in each subsequence; m represents the step size of the sliding window, i.e., the number of data points moved each time the window slides.
[0059] This method of segmentation helps to capture patterns and changes in time series within a local time frame, while also preserving long-term trend information.
[0060] S22, Time Coding and Feature Fusion.
[0061] In each subsequence, the corresponding year, month, and weekday encoding information is introduced. The time encoding information is concatenated with the subsequence data, and the concatenated data is used as input for training, so that the model can better understand the time order and time interval relationship of the data.
[0062] By fusing time encoding with data, the model's ability to perceive time in time series data is enhanced, which helps to discover time patterns and trends at different time scales.
[0063] S23. Divide the processed data into a training set, a validation set, and a test set, with proportions of 70%, 20%, and 10%, respectively. The training set is used to learn the model parameters, the validation set is used to adjust hyperparameters to prevent overfitting, and the test set is used to evaluate the final performance of the model.
[0064] In an alternative embodiment, the dataset used for training can be constructed using a time window method instead of a sliding window method to capture the temporal characteristics of the data.
[0065] According to step S1, data is collected and preprocessed. A fixed window length n is set, which covers a specific time period (e.g., 7 days a week). The raw data is divided into non-overlapping time windows according to the fixed time period. For example, weekly electricity consumption data is extracted as a time window sample, so that each sample represents the electricity consumption trend of that week.
[0066] Within each time window, the average, maximum, and minimum daily electricity consumption are calculated and used as additional features input to the model to enhance the model's understanding of the features within the time window, ensuring consistency with step S23 for the processed data.
[0067] In another optional embodiment, the dataset for training can also be constructed by collecting and preprocessing data according to step S1, maintaining a sliding window according to step S21, setting the window length to n and the step size to m, calculating the statistical features of the data in each sliding window, such as mean, variance, kurtosis and skewness, and adding these features to the model input to enrich the information input of the subsequent model, continuing to integrate time-encoded information into the features, and combining statistical features and time features as the input of the model, and allocating the proportions of training set, validation set and test set according to step S23.
[0068] S3. Construct a combined model based on TCN-Informer for power load forecasting. Use TCN to preprocess the original time series data, extract short-term dynamic features, and generate feature-enhanced sequences.
[0069] The output of TCN is used as the input of Informer, which encodes and decodes long sequences to capture long-term dependencies.
[0070] Specifically, a combined TCN-Informer model is proposed for power load forecasting. This model combines the advantages of TCN and Informer, enabling efficient modeling and analysis of complex time-series data.
[0071] TCN is used to preprocess the original time series data, extract short-term dynamic features, and generate feature-enhanced sequences.
[0072] The output of TCN is used as the input of Informer, which further encodes and decodes long sequences to capture long-term dependencies.
[0073] S301. Input the data into the TCN model to process the original power load time series data. The core of TCN consists of causal convolution and dilated convolution, supplemented by residual connections to optimize deep network training. Through operations such as dilated causal convolution within residual blocks, short-term dynamic features are extracted, effectively reducing data noise, strengthening local dependencies, and generating feature-enhanced sequences.
[0074] Specifically, the core of TCN consists of causal convolution and dilated convolution, supplemented by residual connections to optimize deep network training. These modules work together to enable TCN to adapt to complex time series prediction tasks and perform well in different application scenarios.
[0075] Dilated causal convolution, by padding the input sequence on one side, ensures that the output depends only on historical data, strictly adhering to the causal relationship of the time series and effectively preventing "information leakage." The formula is expressed as:
[0076]
[0077] Among them, y t This represents the convolution output value at time step t, where k is the size of the convolution kernel, and w i The weights of the convolution kernel, x t-i It represents the input values at the current time step and before.
[0078] Expanded convolution, by inserting gaps between kernel elements, enlarges the model's receptive field, enabling it to capture dependencies over longer time spans. The formula for expanded convolution is:
[0079]
[0080] Where, x t-d·i Let represent the input value at time step td·i. The receptive field of the model is expanded by introducing a scaling factor d; d represents the scaling factor, which typically increases exponentially with the number of network layers. This means that deeper networks can utilize expanded convolutions to process sequence data with very long time dependencies without significantly increasing computational overhead.
[0081] As the number of network layers increases, the model may face the problem of vanishing gradients, which in turn affects the training effect of the model.
[0082] To address this challenge, TCN introduces residual connections. Residual connections directly pass the input to the output layer, ensuring gradients propagate smoothly throughout the network and reducing the risk of gradient vanishing. The formula for residual connections is:
[0083] y i =F(x) i )+x i
[0084] Where F(x) i ) represents the output value of the convolutional layer.
[0085] S302, Use the TCN output as the input of the Informer encoder.
[0086] The Informer encoder is equipped with a multi-head ProbSparse self-attention mechanism to extract long encoded sequences and capture long-term dependencies;
[0087] The decoder finely encodes features by masking multi-head ProbSparse self-attention and other operations, and finally outputs the prediction result.
[0088] The Informer model, a variant of the Transformer architecture in time series forecasting, deeply optimizes the traditional Transformer to achieve efficient and accurate modeling of long series. Informer introduces the ProbSparse self-attention mechanism, which is based on the sparse distribution of attention in long series, meaning that for each query vector, only a few key vectors have a significant impact on it.
[0089] To quantify the attention distribution, we first calculate the query vector qi and the key vector k. j Similarity score:
[0090]
[0091] Where, d k Let be the dimension of the key vector; the scores are transformed into a probability distribution using the Softmax function:
[0092]
[0093] Where L is the sequence length; the ProbSparse self-attention mechanism filters the key vectors most important to the current query vector by calculating the attention entropy E. i The calculation formula is:
[0094]
[0095] By selecting the top U key vectors with the largest entropy values for computation, the computational complexity of the self-attention mechanism is reduced from O(L...).2 The computational complexity is reduced to O(LU), which significantly reduces computational and memory usage while effectively preserving the ability to capture long-sequence dependencies.
[0096] Meanwhile, Informer is composed of multiple stacked coding layers, each of which contains a ProbSparse self-attention module and a feedforward neural network (FFN) module.
[0097] Assume the input sequence is Given the set of real numbers, Z1 is obtained after processing by the ProbSparse self-attention module:
[0098] Z1=ProbSparse-Attention(X)+X
[0099] After further processing by the feedforward neural network module, the encoded feature Z2 is output:
[0100] Z2=FFN(Z1)+Z1
[0101] The encoder extracts long-term dependency features from the input long-series time series data step by step through multi-layer stacking.
[0102] The decoder also consists of multiple stacked decoding layers, each of which contains a cross-attention module, a ProbSparse self-attention module, and a feedforward neural network module.
[0103] During decoding, the cross-attention module is responsible for capturing the relationship between the encoder output and the previously predicted output. Let the encoder output be B, the previously predicted output be D, and the cross-attention module produce C:
[0104] C = Cross-Attention(D,E) + D
[0105] After passing through the ProbSparse self-attention module and the feedforward neural network module, the final prediction output is obtained; the decoder generates future time series values step by step based on the encoder output and the previous prediction results.
[0106] To enable the model to learn more compact and efficient feature representations, Informer introduces a distillation mechanism. This is achieved by adding an auxiliary loss function L to the encoder. aux To optimize model performance and efficiency.
[0107] Assume the intermediate output of the encoder is H i The reference feature is represented as T. i The auxiliary loss function can be expressed as:
[0108]
[0109] Where N is the number of encoder layers, and MSE is the mean squared error function. Using this loss function, the model can extract more representative features, improving overall performance.
[0110] Example 2, refer to Figure 2 and Figure 3 This is the second embodiment of the present invention, which provides a power consumption prediction method based on TCN-Informer. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.
[0111] Based on the electricity consumption prediction steps, a trained model is used to predict electricity consumption, and the performance of the TCN-Informer model is verified through comparative experiments.
[0112] The experimental environment was built using Python and the PyTorch deep learning framework, and training was accelerated using an NVIDIA 4060 GPU.
[0113] The Adam optimizer was used with a learning rate of 0.001 for 50 training cycles. The input sample length was 90 days of daily electricity consumption data, and the output was 10 days of predicted electricity consumption data.
[0114] Figure 2 The curves showing the changes in training and validation loss values for the TCN-Informer model demonstrate that the model gradually converges during training, while the validation loss remains stable, indicating good generalization ability and stability.
[0115] Comparative experiments were conducted to test the model's performance. The experimental results show that the TCN-Informer model has significant advantages over benchmark models such as ARIMA, GRU, Informer, and TCN-Transformer in key performance indicators such as mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error (MAPE).
[0116] Figure 2 The results show a comparison between the prediction results of the TCN-Informer model and other models. The predicted values of the TCN-Informer model are highly consistent with the actual values in terms of trend, especially during the peak and trough of the load, where the fitting effect is more significant.
[0117] Table 1 lists the performance evaluation metrics of different models. The TCN-Informer model has the lowest MAE, RMSE and MAPE, which proves its superior performance in the electricity consumption prediction task.
[0118] Table 1. Predictive performance evaluation of different models
[0119]
[0120]
[0121] Example 3 is the third embodiment of the present invention, which differs from the previous two embodiments in that:
[0122] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0123] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0124] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0125] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0126] Example 4 is the fourth embodiment of the present invention. This embodiment provides a power consumption forecasting system based on TCN-Informer, including: a data acquisition and processing module, a training module, and a load forecasting module;
[0127] The data acquisition and processing module extracts electricity consumption time-series data from the power grid database according to the meter number, and preprocesses the acquired data, including filling missing values in the data through linear interpolation and normalizing the data through the minimax method.
[0128] The training module divides the input univariate time series into non-overlapping subsequences using a sliding window; it sets the window length, slides the window starting from the beginning of the time series, and extracts the data within the window as subsequence data samples; it integrates the corresponding time encoding information into the subsequence data samples and inputs them into the training along with the subsequence data, and divides the processed data into training set, validation set, and test set.
[0129] The load forecasting module includes a TCN processing module and an Informer module. It constructs a combined TCN-Informer model for power load forecasting. The TCN processing module preprocesses the original time-series data, extracts short-term dynamic features, and generates feature-enhanced sequences. The output of the TCN processing module is used as the input of the Informer module. The Informer encodes and decodes long sequences to capture long-period dependencies.
[0130] The Informer module consists of a decoding layer and an encoding layer. The encoding layer includes a ProbSparse self-attention module and a feedforward neural network module, while the decoding layer includes a cross-attention module, a ProbSparse self-attention module, and a feedforward neural network module.
[0131] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A power consumption prediction method based on TCN-Informer, characterized in that: include, Electricity consumption time-series data is extracted from the power grid database based on the meter number, and the collected data is preprocessed. Divide the power data into segments according to a set window length and construct a training dataset. A combined TCN-Informer model is constructed for power load forecasting. The TCN is used to preprocess the raw time series data, extract short-term dynamic features, and generate feature-enhanced sequences. The output of TCN is used as the input of Informer, which encodes and decodes long sequences to capture long-term dependencies.
2. The electricity consumption prediction method based on TCN-Informer as described in claim 1, characterized in that: The electricity consumption time-series data includes daily electricity consumption data of users within a specified area.
3. The electricity consumption prediction method based on TCN-Informer as described in claim 2, characterized in that: The preprocessing includes a first process and a second process; The first process involves filling in missing values in the data using linear interpolation; The second process involves normalizing the data using a minimax method.
4. The electricity consumption prediction method based on TCN-Informer as described in claim 3, characterized in that: The construction of the training dataset includes dividing the input univariate time series into non-overlapping subsequences using a sliding window; Set the window length, slide the window starting from the beginning of the time series, and extract the data within the window as subsequence data samples; In the subsequence data samples, the corresponding time encoding information is fused and input into the training along with the subsequence data. The processed data is then divided into training set, validation set and test set.
5. The electricity consumption prediction method based on TCN-Informer as described in claim 4, characterized in that: The preprocessing of raw time-series data using TCN includes constructing a combined model based on TCN-Informer and inputting data, and processing the raw power load time-series data through TCN. TCN consists of dilated causal convolution and dilated convolution, and introduces residual connections to directly pass the input to the output layer, thus optimizing the training of deep networks. Dilated causal convolution fills the input sequence on one side, while expanded convolution inserts gaps between kernel elements.
6. The electricity consumption prediction method based on TCN-Informer as described in claim 5, characterized in that: The capture of long-period dependencies includes using the TCN output as the input to the Informer encoder; The Informer encoder consists of two or more stacked coding layers. Each coding layer contains ProbSparse self-attention and a feedforward neural network for encoding. The decoder masks the ProbSparse self-attention operation. The similarity score between the query vector and the key vector is calculated and transformed into a probability distribution. The ProbSparse self-attention mechanism calculates the attention entropy and selects the key vector with the largest entropy value to calculate and output the encoded features.
7. The electricity consumption prediction method based on TCN-Informer as described in claim 6, characterized in that: The capture of long-term dependencies also includes that the decoder is also composed of two or more stacked decoding layers, each of which contains a cross-attention module, a ProbSparse self-attention mechanism and a feedforward neural network. During the decoding process, the cross-attention module captures the relationship between the encoder output and the encoder's predicted output; The output of the cross-attention module is passed through the ProbSparse self-attention mechanism and the feedforward neural network to output the final predicted time series value. Meanwhile, the Informer encoder introduces a distillation mechanism, which improves model efficiency by introducing an auxiliary loss function into the encoder.
8. A power consumption forecasting system based on TCN-Informer, employing the power consumption forecasting method based on TCN-Informer as described in any one of claims 1 to 7, characterized in that, include: Data acquisition and processing module, training module, and load forecasting module; The data acquisition and processing module extracts electricity consumption time-series data from the power grid database according to the meter number, and preprocesses the acquired data. The training module divides the power data according to a set window length to construct a dataset for training. The load forecasting module includes a TCN processing module and an Informer module. It constructs a combined TCN-Informer model for power load forecasting. The TCN processing module preprocesses the original time-series data, extracts short-term dynamic features, and generates feature-enhanced sequences. The output of the TCN processing module is used as the input of the Informer module. The Informer encodes and decodes long sequences to capture long-period dependencies. The Informer module consists of a decoding layer and an encoding layer. The encoding layer includes a ProbSparse self-attention module and a feedforward neural network module, while the decoding layer includes a cross-attention module, a ProbSparse self-attention module, and a feedforward neural network module.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the power consumption prediction method based on TCN-Informer as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the power consumption prediction method based on TCN-Informer as described in any one of claims 1 to 7.