Power load prediction method based on DPT-LSTM feature selection
Based on DPT-LSTM-based feature selection methods, combined with multi-scale feature extraction and channel attention module, the problem of insufficient power load prediction accuracy in the existing technology, and achieved effective consideration and feature screening of various variable factors. Improve the accuracy of the prediction results.
Patent Information
- Application Number
- CN202411239021.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-01-28
AI Technical Summary
The prior art is difficult to accurately consider the impact of multiple variable factors on power load data, and it is impossible to effectively screen out features that have positive or negative impacts on the prediction results, resulting in insufficient accuracy of power load prediction.
Adopt the feature selection method based on DPT-LSTM, select and process through vertical data, conduct related analysis and multi-scale feature extraction, combine channel attention modules and two-way long-term memory sub-network, screen and integrate main characteristics and auxiliary features. Perform electricity load prediction.
It improves the accuracy of electricity load prediction, can effectively consider the impact of multiple variable factors, and screen out the characteristics of positive impact on the prediction results, reduce negative effects, and improve the accuracy of the prediction results.
Smart Images

Figure CN119382068A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of photovoltaic power generation prediction, and in particular to a method for predicting power load based on DPT-LSTM feature selection. Background Art
[0002] Electricity is a key resource supporting modern society and industrial progress. Accurately predicting its demand is extremely important to ensure sustained and stable economic growth. The stability of the power system depends on the balance between supply and consumption. Accurate power load forecasting can help grid operators allocate resources reasonably and reduce the risk of insufficient or excessive power supply, thereby improving the stability and reliability of the power grid. Accurate load forecasting helps the power grid respond quickly to extreme weather events, large-scale social activities or other emergencies to ensure stable power supply. In addition, there are many factors that affect power load data, including time factors, climate and weather conditions, economic activities, social and demographic factors, etc. This makes traditional models not only unable to take into account multivariate factors, but also unable to simulate the nonlinear characteristics of load data. Summary of the invention
[0003] The technical problem of the present invention is to consider the influence of multiple variable factors on power load data, and screen the features that have positive and negative influences on the prediction results, so as to improve the accuracy of power load prediction.
[0004] The purpose of the present invention is to solve the above problems and provide a DPT-LSTM Feature selection method for power load forecasting.
[0005] The technical solution of the present invention comprises the following steps: S1. Use longitudinal data selection to collect factors that affect power load data, obtain a multivariate time series data set D1, and preprocess the data set D1 to obtain a data set D2; S2. Perform coherence analysis on the data set D2, divide the variable features of the data set D2 into main features and secondary features, decompose the main features according to a fixed ratio, and perform convolution to extract multi-scale features respectively. Use splicing to fuse the multi-scale features, input them into the channel attention module for weighted summation, and obtain the fused main feature map; S3. Construct a DPT-LSTM neural network, input the fused main feature map into the bidirectional long short-term memory sub-network, and input the auxiliary features into the long short-term memory sub-network; S4. Combine the power load forecasting results of the bidirectional long short-term memory subnetwork and the long short-term memory subnetwork in step S3 to obtain the final power load forecasting result.
[0006] Preferably, in step S1, factors affecting power load data are collected, including power load historical factors, power load meteorological factors and social factors. The power load historical factors are historical values of power load, the meteorological factors are temperature, humidity and rainfall in the forecast area, and the social factors are holidays and special social events.
[0007] Preferably, in step S1, the longitudinal data selection is filtering, slicing and selecting according to the time date of the time series data.
[0008] Furthermore, in step S1, the data set D1 is preprocessed, including data cleaning, outlier monitoring, outlier processing and data selection; data cleaning is to remove null values and duplicate values, and use interpolation or forward filling to fill missing values; after the outliers are detected by the standard deviation method, the outliers are smoothed using a sliding window or a smoothing method based on historical data; the calculation formula of the standard deviation method is: Z = (X-μ) / σ In the formula, X is the data point, μ is the data mean, and σ is the standard deviation of the data.
[0009] Preferably, in the coherence analysis in step S2, principal component analysis and Geringer causal analysis are used for multivariate power load data, and statistical indicators are used to measure the linear or nonlinear relationship between the characteristics and the target variable.
[0010] Preferably, in step S2, the multi-scale feature is to perform convolution operations of different sizes on each main feature.
[0011] Further, in step S3, DPT-LSTM The network includes: bidirectional long short-term memory sub-network, long short-term memory sub-network, spatial attention module STAB , time series feature processing module LSTM and output fusion module; (1) The bidirectional long short-term memory subnetwork includes multiple convolutional layers, and the calculation formula is: W_main = Conv1×1(S1)+Conv3×1(S2)+Conv5×1(S3)+Conv7×1(S4); In the formula, W_main represents the output of the main feature extraction of the bidirectional long short-term memory sub-network, Conv1x1, Conv3x1, Conv5x1 and Conv7x1 Respectively represent convolution operations of different sizes; S1, S2, S3 and S4 Represents the input of the same main feature in different convolution operations; (2) Long short-term memory sub-network, the calculation formula is: W_aux = LSTM(Saux_inputS); Where W_aux represents the output of the auxiliary features extracted by the long short-term memory sub-network, Saux_inputS For input LSTM Auxiliary features of the network, LSTM represents the long short-term memory network; (3) Spatial Attention Module STAB , enhance the main feature data, and the calculation formula is: W_attention = STAB(W_main + W_aux); In the formula, W_attention represents the features after spatial attention processing, STAB Represents the spatial attention mechanism module; (4) Time series feature data processing module LSTM , the calculation formula is: W_lstm = LSTM(W_attention); In the formula, W_lstm express LSTM Processed features; (5) Output fusion module, the calculation formula is: S_output = Fusion(W_lstm); In the formula, Fusion Represents a multi-output fusion module; (6) Weight normalization, the calculation formula is: ; In the formula, represents the normalized weight, W represents the original weight, represents the minimum value in the weight set, Represents the maximum value in the weight set; (7) Relu function processing, the calculation formula is: Wrelu = ReLU( ); In the formula, Wrelu Indicates passing ReLU The output after activation function processing, represents the normalized features, ReLU is the rectified linear unit activation function.
[0012] Furthermore, the spatial attention module STAB , including the following sub-steps: (1) Perform local cross-channel interaction between the channel features and the channel features of its neighbors. The calculation formula is:
[0013] In the formula Representativet nearest odd number; c Represents the total number of channels; and b are fixed values, 2 and 1 respectively; (2) Perform weighted summation on all channels, and the calculation formula is: ; Where: represents the i-th channel, Representatives and A set of k adjacent channels; For The adjacent j-th channel output; represents the weight parameter shared by all channels, is the sigmoid function.
[0014] Compared with the prior art, the beneficial effects of the present invention include: 1) The present invention takes into account the impact of multiple variable factors on power load data, and divides the collected data set into main feature data and auxiliary feature data, so that the input variable features have a positive impact on the power load forecast results, and screens out data that have a negative impact on the power load forecast results.
[0015] 2) Multi-scale feature extraction module and efficient channel attention mechanism module, which extract features of different time scales of the main features of the dataset and enhance their features.
[0016] 3) The main features and auxiliary features are predicted separately on the two branches of the bidirectional long short-term memory network and the unidirectional long short-term memory network, and the prediction results of the auxiliary features are screened and combined with the prediction results of the main features to obtain accurate power load prediction results. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0018] Figure 1 The flowchart framework of the prediction method of the present method embodiment; Figure 2 The spatial attention module of this method embodiment STAB Module structure diagram; Figure 3 This is a structural diagram of the DPT-LSTM model of an embodiment of the method; Figure 4 A curve comparison diagram of the actual value and the predicted value of the power load in the embodiment of the method; Figure 5 This is a diagram showing the error comparison between the actual value and the predicted value of the predicted power load in the embodiment of the method; Figure 6This is a comparison chart of the results of the DPT-LSTM and SVR models of the embodiment of the method and the actual values; DETAILED DESCRIPTION
[0019] like Figure 1 As shown, based on DPT-LSTM The power load forecasting method based on feature selection includes the following steps: S1. Use longitudinal data selection to collect factors that affect power load data, obtain a multivariate time series data set D1, and preprocess the data set D1 to obtain a data set D2; S2. Perform coherence analysis on the data set D2, divide the variable features of the data set D2 into main features and secondary features, decompose the main features according to a fixed ratio, and perform convolution to extract multi-scale feature data respectively, fuse the multi-scale features by splicing, input them into the channel attention module for weighted summation, and obtain the fused main feature map; S3. Build DPT-LSTM Neural network, inputs the fused main feature map into the bidirectional long short-term memory sub-network, and inputs the auxiliary features into the long short-term memory sub-network; S4. Combine the power load forecasting results of the bidirectional long short-term memory subnetwork and the long short-term memory subnetwork in step S3 to obtain the final power load forecasting result.
[0020] Preferably, in step S1, factors affecting power load data are collected, including power load historical factors, power load meteorological factors and social factors. The power load historical factors are historical values of power load, the meteorological factors are temperature, humidity and rainfall in the forecast area, and the social factors are holidays and special social events.
[0021] Preferably, in step S1, the longitudinal data selection is filtering, slicing and selecting according to the time date of the time series data.
[0022] Furthermore, in step S1, the data set D1 is preprocessed, including data cleaning, outlier monitoring, outlier processing and data selection; data cleaning is to remove null values and duplicate values, and use interpolation or forward filling to fill missing values; after the outliers are detected by the standard deviation method, the outliers are smoothed using a sliding window or a smoothing method based on historical data; the calculation formula of the standard deviation method is: Z = (X-μ) / σ Where X is the data point, μ is the mean of the data, and σ is the standard deviation of the data.
[0023] Preferably, in step S2, the coherence analysis uses Pearson correlation coefficient and Granger causality analysis on multivariate power load data, and uses statistical indicators to measure the linear or nonlinear relationship between the feature and the target variable.
[0024] Preferably, in step S2, the multi-scale feature is to perform convolution operations of different sizes on each main feature.
[0025] Furthermore, in step S3, the DPT-LSTM network includes: a bidirectional long short-term memory subnetwork, a long short-term memory subnetwork, and a spatial attention module. STAB , time series feature data processing module LSTM and output fusion module; (1) The bidirectional long short-term memory subnetwork includes multiple convolutional layers, and the calculation formula is: W_main = Conv1×1(S1)+Conv3×1(S2)+Conv5×1(S3)+Conv7×1(S4); Where W_main represents the output of the main feature extraction of the bidirectional long short-term memory sub-network, Conv1x1, Conv3x1, Conv5x1 and Conv7x1 Respectively represent convolution operations of different sizes; S1, S2, S3 and S4 Represents the input of the same main feature in different convolution operations; (2) Long short-term memory sub-network, the calculation formula is: W_aux = LSTM(Saux_inputS); In the formula, W_aux represents the output of the auxiliary features extracted by the long short-term memory sub-network, Saux_inputS For input LSTM Auxiliary features of the network, LSTM represents the long short-term memory network; (3) Spatial Attention Module STAB , enhance the main features, and the calculation formula is: W_attention = STAB(W_main + W_aux); In the formula, W_attention represents the features after spatial attention processing, STAB Represents the spatial attention mechanism module; (4) Sequence feature processing module LSTM , the calculation formula is: W_lstm = LSTM(W_attention); In the formula, W_lstm express LSTM Processed features; (5) Output fusion module, the calculation formula is: S_output = Fusion(W_lstm); In the formula, Fusion Represents a multi-output fusion module; (6) Weight normalization, the calculation formula is: ; In the formula, represents the normalized weight, W represents the original weight, represents the minimum value in the weight set, Represents the maximum value in the weight set; (7) Relu function processing, the calculation formula is: Wrelu = ReLU( ) ; In the formula, Wrelu Indicates passing ReLU The output after activation function processing, represents the normalized features, ReLU is the rectified linear unit activation function.
[0026] Furthermore, the spatial attention module STAB , including the following sub-steps: (1) Perform local cross-channel interaction between the channel features and the channel features of its neighbors. The calculation formula is:
[0027] In the formula represents the odd number closest to t; c represents the total number of channels; and b are fixed values, 2 and 1 respectively; (2) Perform weighted summation on all channels, and the calculation formula is: ; Where: represents the i-th channel, Representatives and A set of k adjacent channels; For The adjacent j Channel output; represents the weight parameter shared by all channels, is the sigmoid function.
[0028] Furthermore, the power load forecasting results of the bidirectional long short-term memory subnetwork and the long short-term memory subnetwork are merged by weighted averaging to obtain the final power load forecasting result.
[0029] Algorithm analysis: Figure 4 As shown in the figure, the power load forecasting result obtained by the power load forecasting method based on DPT-LSTM feature selection is basically consistent with the actual power load trend, and the power load value corresponding to the specific moment is also basically consistent; Figure 5As shown in FIG. 1 , the difference between the predicted power load and the actual power load at the same time, when the power load is huge, the error between the predicted power load and the actual power load will not exceed 60 kwh; Figure 6 As shown, the advantages of this method over traditional machine learning models in predicting power load results are verified. This method surpasses traditional machine learning methods not only in prediction accuracy, but also in the accuracy of predicting power load size. In summary, the method proposed in this patent achieves better prediction results when facing huge power loads.
Claims
1. The power load forecasting method based on DPT-LSTM feature selection is characterized by: Multi-scale channel attention is used to extract characteristic information of power load data at different time scales; Construct a dual-branch network to process the main characteristic data and auxiliary characteristic data of power load respectively and fuse them; The following steps are involved: S1. Use longitudinal data selection to collect factors that affect power load data, obtain a multivariate time series data set D1, and preprocess the data set D1 to obtain a data set D2; S2. Perform coherence analysis on the data set D2, divide the variable features of the data set D2 into main feature data and secondary feature data, decompose the main features according to a fixed ratio, and then perform convolution to extract multi-scale feature data, fuse the multi-scale feature data by splicing, and input them into the channel attention module for weighted summation to obtain a fused main feature data graph; S3. Construct a DPT-LSTM neural network, input the fused main feature map into the bidirectional long short-term memory sub-network, and input the auxiliary features into the long short-term memory sub-network; S4. Combine the power load forecasting results of the bidirectional long short-term memory subnetwork and the long short-term memory subnetwork in step S3 to obtain the final power load forecasting result.
2. The power load forecasting method based on DPT-LSTM feature selection according to claim 1 is characterized in that: In step S1, the factors affecting the power load data are collected, including power load historical factors, power load meteorological factors and social factors. The power load historical factors are the historical values of the power load, the meteorological factors are the temperature, humidity and rainfall in the forecast area, and the social factors are holidays and special social events.
3. The power load forecasting method based on DPT-LSTM feature selection according to claim 2 is characterized in that: In step S1, the longitudinal data selection is filtering, slicing and selecting according to the time date of the time series data.
4. The power load forecasting method based on DPT-LSTM feature selection according to claim 3 is characterized in that: In step S1, the data set D1 is preprocessed, including data cleaning, outlier monitoring, outlier processing and data selection; data cleaning is to remove null values, duplicate values and fill missing values with interpolation or forward filling; after outliers are detected by the standard deviation method, the outliers are smoothed using a sliding window or a smoothing method based on historical data; the calculation formula of the standard deviation method is: Z = (X - μ) / σ; Where X is the data point, μ is the mean of the data, and σ is the standard deviation of the data.
5. The power load forecasting based on effective feature selection of DPT-LSTM neural network model according to claim 4 is characterized in that: In step S2, the coherence analysis is to use statistical indicators to measure the linear or nonlinear relationship between the characteristics and the target variable of the multivariate power load data.
6. The power load forecasting method based on DPT-LSTM feature selection according to claim 5 is characterized in that: In step S2, the multi-scale feature is to perform convolution operations of different sizes on each main feature data.
7. The power load forecasting method based on DPT-LSTM feature selection according to claim 6 is characterized in that: In step S3, the DPT-LSTM network includes: a bidirectional long short-term memory subnetwork, a long short-term memory subnetwork, and a spatial attention module. STAB , time series feature data processing module LSTM and output fusion module; (1) The bidirectional long short-term memory subnetwork includes multiple convolutional layers, and the calculation formula is: W_main=Conv1×1(S1)+Conv3×1(S2)+Conv5×1(S3)+Conv7×1(S4); In the formula, W_main represents the output of the main feature extraction of the bidirectional long short-term memory sub-network, Conv1x1, Conv3x1, Conv5x1 and Conv7x1 Respectively represent convolution operations of different sizes; S1, S2, S3 and S4 Represents the input of the same main feature in different convolution operations; (2) Long short-term memory sub-network, the calculation formula is: W_aux = LSTM(Saux_inputS); Where W_aux represents the output of the auxiliary features extracted by the long short-term memory sub-network, Saux_inputS is the auxiliary feature input to the LSTM network, LSTM represents the long short-term memory network; (3) Spatial Attention Module STAB , enhance the main feature data, and the calculation formula is: W_attention = STAB(W_main + W_aux); In the formula, W_attention represents the features after spatial attention processing, STAB Represents the spatial attention mechanism module; (4) Time series feature data processing module LSTM , the calculation formula is: W_lstm = LSTM(W_attention); In the formula, W_lstm express LSTM Processed features; (5) Output fusion module, the calculation formula is: S_output = Fusion(W_lstm); In the formula, Fusion Represents a multi-output fusion module; (6) Weight normalization, the calculation formula is: ; In the formula, represents the normalized weight, W represents the original weight, represents the minimum value in the weight set, Represents the maximum value in the weight set; (7) Relu function processing, the calculation formula is: Wrelu=ReLU( ); In the formula, Wrelu Indicates passing ReLU The output after activation function processing, represents the normalized features, ReLU is the rectified linear unit activation function.
8. The power load forecasting method based on DPT-LSTM feature selection according to claim 7 is characterized in that: The spatial attention module STAB , including the following sub-steps: (1) Perform local cross-channel interaction between the channel features and the channel features of its neighbors. The calculation formula is:
9. In the formula represents the odd number closest to t; c represents the total number of channels; and b are fixed values, 2 and 1 respectively; (2) Perform weighted summation on all channels, and the calculation formula is: ; Where: Indicates i channels, Representatives and Adjacent k A collection of channels; For The adjacent j Channel output; represents the weight parameter shared by all channels, for sigmoid function.