Multi-user power consumption characteristic prediction method based on trend seasonal decomposition and second-order controllable gate unit
By adopting the combined method of trend season decomposition and second-order controllable gate units in the time series prediction model, the problem of insufficient prediction accuracy of existing models when dealing with complex time dependencies is solved, and higher modeling capabilities and prediction accuracy are achieved.
Patent Information
- Application Number
- CN202411691440.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-14
AI Technical Summary
When existing time series prediction models deal with complex time dependencies, it is difficult to effectively capture the global and local timing characteristics of long time series, resulting in low prediction accuracy.
Using a pre-processing method based on trend seasonal decomposition, trends and seasonal features are extracted through a one-dimensional average pooling layer and input them into a second-order controllable gate unit for further encoding and prediction.
Effectively capture the global and local timing characteristics of long time series, improving the model's modeling ability and prediction accuracy of complex time dependencies.
Smart Images

Figure CN119623723A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of time series prediction, and in particular to a method for predicting multi-user power consumption characteristics based on trend seasonal decomposition and second-order controllable gate units, which realizes modeling and prediction of multi-user power consumption data with a long time span through block sequences, trend seasonal decomposition and second-order controllable gate units. Background Art
[0002] Climate feature prediction is crucial in optimizing resource allocation, reducing operating costs, and supporting policy making. The existing first-order controllable gate unit method makes insufficient use of hidden states and is difficult to effectively capture local time series characteristics. The second-order controllable gate unit enhances the modeling ability of the model for local time series characteristics by introducing the hidden state of the previous moment. In addition, mainstream time series models usually do not take processing measures in time series preprocessing, which reduces the model's ability to extract the characteristics of the time series itself. Therefore, an improved method based on trend seasonal decomposition and second-order controllable gate units is proposed to enhance the model's modeling ability for time series and improve prediction accuracy. Summary of the invention
[0003] 1. A method for predicting multi-user power consumption characteristics based on trend seasonal decomposition and second-order controllable gate units, characterized by comprising the following steps:
[0004] Step 1: Suppose there are M users’ electricity consumption time series, where each time step represents the electricity consumption of these users in one hour. The time step of the lookback window is L. Each time the GPU processes B batches of sequence data, so this electricity consumption time series is represented as a B×L×M matrix
[0005] Step 2: Input the sequence data x in the review window of the power consumption sequence into the seasonal trend decomposition layer. The input sequence x passes through a one-dimensional average pooling layer with a kernel size of 25, a step of 1, and a fill of 0 to obtain the trend feature And subtract the input x to get the trend feature x T , and get the seasonal characteristics x S =xx T , the specific calculation process is as follows:
[0006] x T =AvgPool1D(x)
[0007] x S =xx T
[0008] in,
[0009] Step 3: Separately analyze the trend features x T With seasonal characteristics x S Regularization is performed by T With x S Subtract the last data in the review window and Get the trend characteristics after regularization With seasonal characteristics The specific calculation process is as follows:
[0010]
[0011] Step 4: Separately analyze the trend features x TI and seasonal characteristics x SI Split it and look back at each variable in the window length Divide into blocks of length P and transform them to obtain the block trend sequence With block season sequence in is the number of generated blocks;
[0012] Step 5: Separately divide the block trend sequence x TP With the block seasonal series x SP Input to two embedding layers W with the same structure E The embedding layer consists of a linear layer It is composed of a RELU layer. The specific calculation process is as follows:
[0013] x TE =x TP W TEL +b TEL
[0014] x SE =x SP W SEL +b SEL
[0015] in, and They correspond to two embedding layers W with the same structure. E , and They are the encoded trend series and seasonal series respectively;
[0016] Step 6: Place x TE With x SE The N channels are input into two second-order controllable gate units SndGRU with the same structure for further encoding, and the N channels are calculated in sequence to obtain the trend hidden state of the Nth time step. and seasonal hidden states And the trend hidden state at the N-1th time step and seasonal hidden states The specific calculation process is as follows:
[0017]
[0018]
[0019] in,
[0020] and It is the learnable weight in the second-order controllable gate unit SndGRU, and is the input on the i-th channel, and is the hidden state of the trend feature at the i-th step and the i-1-th step, and The hidden state of seasonal characteristics at the i-th step and the i-1-th step, the above calculation process can be summarized as:
[0021]
[0022] Step 7: Randomly generate trend and seasonal position codes in R is the prediction step length;
[0023] Step 8: Encode the trend and seasonal position PE T PE S , the trend hidden state and seasonal hidden state at the Nth time step And the trend hidden state and seasonal hidden state at the N-1th time step Input it into the corresponding second-order controllable gate unit SndGRU in step 6 to obtain the predicted trend hidden state and the predicted seasonal hidden state The specific calculation steps are as follows:
[0024]
[0025] Step 9: Set the predicted trend hidden state h Ty and the predicted seasonal hidden state h Sy Input to the trend prediction layer With seasonal prediction layer The trend prediction value T is obtained y =h Ty W TP +b TP and seasonal forecast value S y =hSy W SP +b SP , and the trend forecast value Seasonal forecast Transform
[0026] Step 10: Normalize the trend forecast value and the seasonal forecast value, and add back each terminal variable value subtracted in step 3. The specific calculation process is as follows:
[0027]
[0028] Step 11: Output trend forecast to T y and seasonal forecast output S y Add together to generate the prediction results for the next R time steps
[0029] Step 12: Use the mean square error (MSE) loss function to calculate the loss of each channel using the following formula:
[0030]
[0031] in, represents the predicted value of the i-th time series, Represents the true value of the i-th time series, M represents the number of users in the power consumption time series, and the losses between the predicted values and the true values of the M users are summarized. The summarized losses are averaged to obtain the overall target loss, and the prediction results are evaluated.
[0032] The beneficial effects of the technical solution provided by the present invention are: using a preprocessing method based on trend seasonal decomposition to effectively capture the global characteristics of long time series, and using second-order controllable gate units to enhance the modeling ability of the model for local time series characteristics, thereby performing better in processing complex time dependencies and improving prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the 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 work.
[0034] Figure 1 A flow chart of a method for predicting multi-user power consumption characteristics based on trend seasonal decomposition and second-order controllable gate units provided in an embodiment of the present invention;
[0035] Figure 2Internal flow chart for the trend season decomposition module;
[0036] Figure 3 The structural diagram of the second-order controllable gate unit is compared with the original controllable gate unit;
[0037] Figure 4 The results of the comparison between this patent and the mainstream time series prediction model on the characteristics of multi-user power consumption; DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings;
[0039] like Figure 1 As shown, the embodiment of the present invention provides a method for predicting multi-user power consumption characteristics based on trend seasonal decomposition and second-order controllable gate units, including:
[0040] 1. A method for predicting multi-user power consumption characteristics based on trend seasonal decomposition and second-order controllable gate units, characterized by comprising the following steps:
[0041] Step 1: Suppose there are 321 users’ electricity consumption time series, where each time step represents the electricity consumption of these users in one hour. The time step of the lookback window is 96. Each time the GPU processes 32 batches of sequence data, so this electricity consumption time series is represented as a 32×96×321 matrix
[0042] Step 2: Input the sequence data x in the review window of the power consumption sequence into the seasonal trend decomposition layer. The input sequence x passes through a one-dimensional average pooling layer with a kernel size of 25, a step of 1, and a fill of 0 to obtain the trend feature And subtract the input x to get the trend feature x T , and get the seasonal characteristics x S =xx T , the specific calculation process is as follows:
[0043] x T =AvgPool1D(x)
[0044] x S =xx T
[0045] in, The internal flow chart of the trend season decomposition layer is as follows: Figure 2 As shown;
[0046] Step 3: Separately analyze the trend features x T With seasonal characteristics x S Regularization is performed byT With x S Subtract the last data in the review window and Get the trend characteristics after regularization With seasonal characteristics The specific calculation process is as follows:
[0047]
[0048] Step 4: Separately analyze the trend features x TI and seasonal characteristics x SI Transform and split, and look back at each variable in the window length Divide into blocks of length 48 and transform to obtain the block trend sequence With block season sequence in is the number of generated blocks;
[0049] Step 5: Separately divide the block trend sequence x TP With the block seasonal series x SP Input to two embedding layers W with the same structure E The embedding layer consists of a linear layer It is composed of a RELU layer. The specific calculation process is as follows:
[0050] x TE =x TP W TEL +b TEL
[0051] x SE =x SP W SEL +b SEL
[0052] in, and They correspond to two embedding layers W with the same structure. E , and They are the encoded trend series and seasonal series respectively;
[0053] Step 6: Place x TE With x SE They are respectively input into two second-order controllable gate units SndGRU with the same structure for further encoding. The internal structure of the second-order controllable gate unit is as follows: Figure 3 As shown, the two channels are calculated in sequence to obtain the trend hidden state of the second time step and seasonal hidden states And the trend hidden state at the first time step and seasonal hidden states The specific calculation process is as follows:
[0054]
[0055] in,
[0056]
[0057]
[0058] and It is the learnable weight in the second-order controllable gate unit SndGRU, and is the input on the i-th channel, and is the hidden state of the trend feature at the i-th step and the i-1-th step, and is the hidden state of the seasonal characteristics at the i-th step and the i-1-th step. The above calculation process can be summarized as:
[0059]
[0060] Step 7: Randomly generate trend and seasonal position codes in 96 is the prediction step length;
[0061] Step 8: Encode the trend and seasonal position PE T PE S , the trend hidden state and seasonal hidden state of the second time step And the trend hidden state and seasonal hidden state of the first time step Input it into the corresponding second-order controllable gate unit SndGRU in step 6 to obtain the predicted trend hidden state and the predicted seasonal hidden state The specific calculation steps are as follows:
[0062]
[0063] Step 9: Set the predicted trend hidden state h Ty and the predicted seasonal hidden state h Sy Input to the trend prediction layer With seasonal prediction layer The trend prediction value T is obtained y =h Ty W TP +b TPand seasonal forecast value S y =h Sy W SP +b SP , and the trend forecast value Seasonal forecast Transform
[0064] Step 10: Normalize the trend forecast value and the seasonal forecast value, and add back each terminal variable value subtracted in step 3. The specific calculation process is as follows:
[0065]
[0066] Step 11: Output trend forecast to T y and seasonal forecast output S y Add together to generate the prediction results for the next R time steps
[0067] Step 12: Use the mean square error (MSE) loss function to calculate the loss of each channel using the following formula:
[0068]
[0069] in, represents the predicted value of the i-th time series, represents the true value of the i-th time series, 321 represents the number of time series, the loss of each channel of the 321 time series is summarized, the summarized loss is averaged over the 321 time series to obtain the overall target loss, and the prediction results are evaluated. Figure 4 By comparing the results of the method proposed in this patent with other mainstream time series prediction models in multi-user electricity consumption prediction, it can be seen that the MSE (mean square error) value and MAE (mean absolute error) value calculated by the power consumption prediction value and the actual power consumption value of the method proposed in this patent are the smallest compared with other mainstream time series prediction models. This fully demonstrates that the method proposed in this patent can accurately predict the power consumption within a long time step, can help enterprises and managers understand the changing pattern of power demand, optimize energy management, avoid over-investment in power generation facilities, thereby reducing operating costs, and can also provide support for policy making, investment decisions and market strategies, and help achieve sustainable development goals.
Claims
1. A method for predicting multi-user power consumption characteristics based on trend seasonal decomposition and second-order controllable gate units, characterized in that The following steps are involved: Step 1: Suppose there are M users’ electricity consumption time series, where each time step represents the electricity consumption of these users in one hour. The time step of the lookback window is L. Each time the GPU processes B batches of sequence data, so this electricity consumption time series is represented as a B×L×M matrix Step 2: Input the sequence data x in the review window of the power consumption sequence into the seasonal trend decomposition layer. The input sequence x passes through a one-dimensional average pooling layer with a kernel size of 25, a step of 1, and a fill of 0 to obtain the trend feature And subtract the input x to get the trend feature x T , and get the seasonal characteristics x S =xx T , the specific calculation process is as follows: x T =AvgPool1D(x) x S =x-x T in, Step 3: Separately analyze the trend features x T With seasonal characteristics x S Regularization is performed by T With x S Subtract the last data in the review window and Get the trend characteristics after regularization With seasonal characteristics The specific calculation process is as follows: Step 4: Separately analyze the trend features x TI and seasonal characteristics x SI Split it and look back at each variable in the window length Divide into blocks of length P and transform them to obtain the block trend sequence With block season sequence in is the number of generated blocks; Step 5: Separately divide the block trend sequence x TP With the block seasonal series x SP Input to two embedding layers W with the same structure E The embedding layer consists of a linear layer It is composed of a RELU layer. The specific calculation process is as follows: x TE =x TP W TEL +b TEL x SE =x SP W SEL +b SEL in, and They correspond to two embedding layers W with the same structure. E , and They are the encoded trend series and seasonal series respectively; Step 6: Place x TE With x SE The N channels are input into two second-order controllable gate units SndGRU with the same structure for further encoding, and the N channels are calculated in sequence to obtain the trend hidden state of the Nth time step. and seasonal hidden states And the trend hidden state at the N-1th time step and seasonal hidden states The specific calculation process is as follows: in, and It is the learnable weight in the second-order controllable gate unit SndGRU, and is the input on the i-th channel, and is the hidden state of the trend feature at the i-th step and the i-1-th step, and The hidden state of seasonal characteristics at the i-th step and the i-1-th step, the above calculation process can be summarized as: Step 7: Randomly generate trend and seasonal position codes in R is the prediction step length; Step 8: Encode the trend and seasonal position PE T PE S , the trend hidden state and seasonal hidden state at the Nth time step And the trend hidden state and seasonal hidden state at the N-1th time step Input it into the corresponding second-order controllable gate unit SndGRU in step 6 to obtain the predicted trend hidden state and the predicted seasonal hidden state The specific calculation steps are as follows: Step 9: Set the predicted trend hidden state h Ty and the predicted seasonal hidden state h Sy Input to the trend prediction layer With seasonal prediction layer The trend prediction value T is obtained y =h Ty W TP +b TP and seasonal forecast value S y =h Sy W SP +b SP , and the trend forecast value Seasonal forecast Transform Step 10: Normalize the trend forecast value and the seasonal forecast value, and add back each terminal variable value subtracted in step 3. The specific calculation process is as follows: Step 11: Output trend forecast to T y and seasonal forecast output S y Add together to generate the prediction results for the next R time steps Step 12: Use the mean square error (MSE) loss function to calculate the loss of each channel using the following formula: in, represents the predicted value of the i-th time series, Represents the true value of the i-th time series, M represents the number of users in the power consumption time series, and the losses between the predicted values and the true values of the M users are summarized. The summarized losses are averaged to obtain the overall target loss, and the prediction results are evaluated.