A method and system for predicting electricity consumption based on optimal scale convolution and graph memory enhancement
By employing optimal scale convolution and graph memory enhancement methods, the problem of neglecting local spatial information and nonlinear features in existing electricity consumption forecasting is addressed. A BC-sLSTM network is constructed to capture the long-term and short-term temporal correlations of electricity data, thereby improving the accuracy and applicability of electricity consumption forecasting.
Patent Information
- Application Number
- CN202511188578.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Existing electricity consumption forecasting methods neglect local spatial and nonlinear information when dealing with geographically or community-specific demand changes, resulting in poor forecasting performance. Furthermore, LSTM models have limitations in handling large datasets and long-term forecasts, making it difficult to ensure accuracy.
We employ a method based on optimal scale convolution and graph memory enhancement. We extract nonlinear features from power data through adaptive gated quadratic deformation convolution and feature fusion processing. We combine block channel network and self-attention mechanism to capture long-term and short-term temporal correlations and construct BC-sLSTM network to enhance the model's memory capacity.
By effectively integrating local and global spatial dependencies and nonlinear characteristics, the accuracy and applicability of electricity consumption forecasting are improved. It can reflect real-time electricity consumption trends and identify long-term electricity consumption patterns, thus enhancing the model's applicability in complex environments.
Smart Images

Figure CN120675076B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of power system management and artificial intelligence application technology, and more specifically, to a power consumption prediction method based on optimal scale convolution and graph memory enhancement. Background Technology
[0002] As the scale and complexity of global power systems continue to grow, accurate electricity demand forecasting has become a core part of power system management. Electricity demand forecasting is not only crucial for optimizing electricity production and distribution, but also plays a vital role in maintaining the stability and reliability of the power grid. The accuracy of electricity demand forecasting directly impacts the economic efficiency and operational safety of the power system, especially in the face of increasingly abundant renewable energy, where effectively balancing supply and demand has become a challenge. Furthermore, fluctuations in electricity demand are influenced by various factors, such as seasonal variations, weather conditions, economic activity, and consumer behavior, which increase the uncertainty and complexity of forecasting.
[0003] To improve the accuracy of electricity consumption forecasting, several methods have been developed. Traditional forecasting methods include statistical methods such as moving averages, exponential smoothing, and seasonal adjustments. With advancements in computing technology, machine learning methods such as Support Vector Machines (SVM), decision trees, and random forests have been introduced into electricity forecasting. These methods can handle nonlinear problems and improve the accuracy of forecasting models. In recent years, deep learning techniques, especially Long Short-Term Memory Networks (LSTM), Gated Recurrent Units (GRU), and Convolutional Neural Networks (CNN), have become a research hotspot. These deep learning models are widely used in time-series data analysis of electricity consumption due to their excellent ability to automatically extract data features and handle complex data relationships.
[0004] While the aforementioned methods have shown some effectiveness in addressing electricity consumption forecasting, several limitations remain. First, although CNN models excel at extracting global spatial information, they often neglect the importance of local spatial and nonlinear information. This can lead to poor prediction results when forecasting geographically or community-specific demand changes. Second, while LSTM models have demonstrated some success in electricity consumption forecasting, they have significant limitations in handling large datasets and long-term predictions. The short memory period of LSTMs limits their ability to capture the stability of long-term data, such as seasonal variations. This also affects the model's short-term prediction performance on large datasets containing subtle and rapidly changing electricity consumption patterns. These limitations reduce the models' applicability and accuracy in practical applications, particularly in environments with highly uneven and rapidly changing demand, making it difficult to ensure accurate predictions. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a power consumption prediction method based on multi-scale graph convolutional networks and feature map memory enhancement, which can solve the technical problems of limited applicability and insufficient accuracy of existing power consumption prediction methods based on deep learning models.
[0006] The present invention adopts the following technical solutions.
[0007] A method for predicting electricity consumption based on optimal scale convolution and graph memory enhancement includes the following steps:
[0008] Historical electricity consumption data of each node in the power network is collected and preprocessed to obtain preprocessed historical electricity consumption data.
[0009] Spatial features are extracted from the preprocessed historical electricity consumption data to obtain the optimal scale spatial features;
[0010] Nonlinear features are obtained by adaptively extracting nonlinear features from preprocessed historical electricity consumption data through adaptive gated quadratic deformable convolution and feature fusion processing.
[0011] A block-based channel network is constructed to process the optimal scale space features and nonlinear features, thereby obtaining the hidden state and the normalized state;
[0012] The global state is obtained by extracting long-term correlation between the hidden state and the normalized state based on the self-attention mechanism, and the predicted electricity consumption is obtained by linear transformation of the global state.
[0013] Preferably, the step of collecting historical electricity consumption data from each node of the power network and preprocessing the data to obtain preprocessed electricity consumption data specifically includes:
[0014] Historical electricity consumption data for time period T was collected from each node of the power network, and preprocessed to obtain the following preprocessed historical electricity consumption data:
[0015]
[0016] In the formula, t represents the current time. Indicates the time point after preprocessing. The data vector at position i∈[t,t ].
[0017] Preferably, the step of extracting spatial features from the preprocessed historical electricity consumption data to obtain the optimal scale spatial feature representation specifically includes:
[0018] Convolutional kernels are constructed to perform one-dimensional convolutional dilation on the preprocessed historical electricity consumption data to obtain feature representations of each time point in the historical electricity consumption data;
[0019] By combining the feature representations of historical electricity consumption data at different time points, spatial local feature extraction results are obtained by using different expansion factors;
[0020] Adaptive average pooling and convolution processing are applied to the preprocessed historical electricity consumption data to obtain spatial global feature extraction results.
[0021] The results of local spatial feature extraction and global spatial feature extraction are fused to obtain the optimal scale spatial feature representation.
[0022] Preferably, a convolution kernel is constructed to perform one-dimensional convolution dilation on the preprocessed historical electricity consumption data to obtain feature representations of each time point in the historical electricity consumption data, specifically including:
[0023] Set the convolution kernel to length k. , The convolution kernel is in the th... The weights of each position, i∈[1,k], are applied to the preprocessed historical electricity consumption data using one-dimensional convolution dilation:
[0024]
[0025] in, Indicates a point in time Feature representation at location, Indicates a point in time Subtract the inflation factor Multiply by the kernel position index The corresponding input sequence elements, This represents the expansion factor.
[0026] Preferably, the step of combining the feature representations of historical electricity consumption data at various time points and using different expansion factors to obtain spatial local feature extraction results specifically includes:
[0027] The formula for calculating the spatial local feature extraction result is as follows:
[0028]
[0029] in, The time point after preprocessing Data vector at The corresponding spatial local feature extraction results, Represents the set of all possible expansion factors. When the expansion factor for Time to time point Data vector at The output result after performing one-dimensional dilated convolution; ReLU represents the linear normalization operation; ReLU() is the activation function. Indicates the time point after preprocessing Data vector at Take expansion factor The probability of.
[0030] Preferably,
[0031] In the formula, is the base of the natural logarithm; It is an inflated value function; For all possible inflation factors The sum of exponents.
[0032] Preferably, the nonlinear feature adaptive extraction of the preprocessed historical electricity consumption data through adaptive gated quadratic deformable convolution and feature fusion processing to obtain nonlinear features specifically includes:
[0033] Gating signals are constructed using two-dimensional convolution operations and activation functions. :
[0034]
[0035] Here, Conv2D represents a two-dimensional convolution operation; Sigmoid() is an activation function used to map any real value to the interval (0,1). For the generated gating signal, Conv2D ( ) represents two-dimensional convolution computation, indicating that a two-dimensional convolution operation is performed on the input data. It is a feature map obtained by combining the results of spatial local feature extraction and spatial global feature extraction along a specified dimension;
[0036] The output of the deformable convolution is modulated using a gate signal (Gate) to obtain nonlinear features. :
[0037]
[0038] in, This represents element-wise multiplication. It is a feature map adjusted by the gating mechanism. DefConv () represents the deformable convolution operation.
[0039] Preferably, the construction of the segmented channel network processes optimal scale spatial features and nonlinear features through a gating mechanism, specifically including:
[0040] set up The time point after preprocessing Calculate spatial features from data vectors at locations. ,in, and These are the optimal scale space features and the nonlinear features, respectively.
[0041] spatial features and the spatial features The preprocessed historical electricity consumption data corresponding to the historical moment are jointly input into the gating unit of the block channel network. The gating unit includes a forget gate, an input gate, and an output gate. The block channel network also includes a candidate state generation unit. The candidate state generation unit is used for new information in the current input that needs to be included in long-term memory. The candidate state generation unit is used to be controlled by the gating unit, thereby controlling the flow and updating of information.
[0042] Each unit processes spatial features using a weight matrix and a cyclic weight matrix. The preprocessed historical electricity consumption data corresponding to the historical moment and the hidden state of the previous moment are processed by the activation function to generate three sets of gate signals, including the forget gate signal, the input gate signal and the output gate signal;
[0043] The forget gate signal controls the retention ratio of historical states, and the input gate signal controls the update intensity of candidate states. The two work together to update the cell state and calculate the normalization factor.
[0044] The output gate signal is weighted and selected by the cell state and normalization factor to output the hidden state and normalized state at the current time.
[0045] Preferably, the step of extracting long-term correlation between the hidden state and the normalized state based on the self-attention mechanism to obtain the global state, and then using a linear transformation to obtain the predicted electricity consumption, specifically includes:
[0046] The global state is obtained by extracting the long-term correlation between the hidden state and the normalized state through a self-attention mechanism.
[0047] The global state vector is obtained by combining the global states corresponding to all historical moments, and the predicted electricity consumption is obtained by performing a linear transformation on the global state vector.
[0048] This invention also proposes an electricity consumption prediction system based on optimal scale convolution and graph memory enhancement, used to implement the electricity consumption prediction method based on optimal scale convolution and graph memory enhancement, including: an acquisition module, a preprocessing module, a spatial feature extraction module, a nonlinear feature extraction module, a correlation extraction module, and a prediction module;
[0049] The data acquisition module is used to collect historical electricity consumption data from various nodes of the power network.
[0050] The preprocessing module is used to preprocess the collected data to obtain preprocessed historical electricity consumption data;
[0051] The spatial feature extraction module is used to extract spatial features from preprocessed historical electricity consumption data to obtain optimal scale spatial features;
[0052] The nonlinear feature extraction module performs adaptive nonlinear feature extraction on the preprocessed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature fusion processing to obtain nonlinear features;
[0053] The correlation extraction module is used to construct a block channel network to process the optimal scale space features and nonlinear features to obtain the hidden state and normalized state; and to perform long-term correlation extraction on the hidden state and normalized state based on the self-attention mechanism to obtain the global state.
[0054] The prediction module obtains the predicted electricity consumption based on the global state through a linear transformation.
[0055] The present invention also proposes a terminal, including a processor and a storage medium;
[0056] The storage medium is used to store instructions;
[0057] The processor is configured to operate according to the instructions to execute the steps of the power consumption prediction method based on optimal scale convolution and graph memory enhancement.
[0058] The present invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the power consumption prediction method based on optimal scale convolution and graph memory enhancement.
[0059] The beneficial effects of this invention are as follows: Compared with the prior art, this invention proposes a power consumption prediction method that can effectively integrate local and global spatial dependencies and nonlinear features, and capture long-term and short-term temporal correlations. It employs an adaptive convolutional network to extract global and local spatial information and nonlinear features from power consumption data. Simultaneously, it improves the standard sLSTM (Scalar Long Short-Term Memory) network by constructing a BC-sLSTM network to enhance its ability to capture long-term and short-term temporal correlations. A spatial feature extraction module obtains key cross-scale spatial feature information from power data. A nonlinear feature adaptive extraction module captures complex nonlinear dependencies in power data. Through block processing and channel independence strategies, it effectively extracts short-term temporal correlations from power data. Finally, through a self-attention mechanism, it extracts long-term temporal correlations from power data. This allows the prediction model to not only reflect immediate power consumption trends but also identify and learn long-term power consumption patterns based on historical data, improving the applicability and accuracy of the prediction method in practical operation. The beneficial effects of this invention include at least:
[0060] (1) This invention uses an adaptive convolutional network to extract global and local spatial information and nonlinear features from power consumption data. First, the spatial feature extraction module is used to obtain key cross-scale spatial feature information. Then, the nonlinear feature adaptive extraction module is used to capture the complex nonlinear dependencies in the power data. This invention constructs an adaptively dynamically optimized dilation factor and constructs a dilation value function to adjust the dilation factor, thereby applying different dilation factors to adapt to the feature capture requirements at different resolutions. The adaptive gated quadratic deformable convolution uses the original data sampling to determine the offset on the basis of traditional convolution, which reduces the process of learning the offset required by traditional deformable convolution. It effectively handles the spatial complexity and variability of power data, improves the model's ability to identify power consumption patterns, and enables it to accurately reflect the characteristics of different regions and different consumption behaviors when predicting power consumption.
[0061] (2) This invention enhances the standard sLSTM network to improve its ability to capture short-term and long-term temporal correlations in power consumption data. It effectively extracts short-term temporal correlations in power data through block processing and channel independence strategies, while the self-attention mechanism is used to extract long-term temporal correlations. By combining short-term and long-term dynamic analysis methods, this invention not only enhances the model's time sensitivity when processing power data, but also enables the model to identify and learn long-term patterns of power consumption based on historical data, thereby significantly improving the accuracy of power consumption prediction. Attached Figure Description
[0062] Figure 1This is a flowchart of the electricity consumption prediction method based on optimal scale convolution and graph memory enhancement in an embodiment of the present invention;
[0063] Figure 2 This is a process framework diagram of the electricity consumption prediction method based on optimal scale convolution and graph memory enhancement in an embodiment of the present invention;
[0064] Figure 3 This is a schematic diagram of the spatial feature extraction module in an embodiment of the present invention;
[0065] Figure 4 This is a schematic diagram of feature mixing in an embodiment of the present invention;
[0066] Figure 5 This is a structural diagram of the electricity consumption prediction system based on optimal scale convolution and graph memory enhancement in an embodiment of the present invention. Detailed Implementation
[0067] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, other embodiments obtained by those skilled in the art without creative effort are all within the protection scope of this invention.
[0068] like Figure 1 , 2 As shown, this invention proposes a power consumption prediction method based on optimal scale convolution and graph memory enhancement, which includes the following steps:
[0069] Step 1: Collect historical electricity consumption data from each node of the power network and preprocess the data to obtain preprocessed historical electricity consumption data.
[0070] The power network to be predicted is modeled as a graph. ,in It is a set of nodes, representing the nodes in the power grid, including power plants, substations, and electricity users, and Represents a set of nodes Number of nodes ; It is a set of edges, representing the connections between nodes. It is an adjacency matrix.
[0071] Because the power system generates a large and complex amount of data, which often contains missing values and non-numerical information, these characteristics require data preprocessing.
[0072] First, the processing steps include converting all non-numerical data into numerical data. For example, character data representing device status or operating conditions is converted using a specified numerical encoding method to ensure that this data can be correctly parsed by subsequent analysis models. This conversion process applies to all similar character data.
[0073] Secondly, to address the missing values in the data, this invention employs a feature mean-based imputation method. Specifically, if a feature is missing in the data, these missing values are estimated and imputed based on the mean of that feature in the training dataset, thereby maintaining the integrity and statistical properties of the data.
[0074] Let the current time be t, and the history be obtained through the above processing. Electricity consumption data set for different time periods { },in, The data recorded at time i to be normalized, i∈[t, ];
[0075] Finally, this invention provides historical data collection. The electricity consumption data for each time period was normalized to adjust the data to a predefined fixed interval, such as [0,1], to facilitate model processing. This normalization step was achieved through the following formula:
[0076]
[0077] in, This represents the normalized result obtained from the data at time i. The data recorded at time i to be normalized. and These are the mean and variance vectors in the training time series, respectively.
[0078] Step 2: Extract spatial features from the preprocessed historical electricity consumption data to obtain the optimal scale spatial features;
[0079] This invention proposes a novel feature acquisition method. The module consists of a spatial feature extraction module and a nonlinear feature adaptive extraction module, aiming to comprehensively and effectively extract features from power load data. In the feature extraction process of this invention, for preprocessed historical electricity consumption data, feature extraction operations are performed on the electricity consumption data at each historical time according to different historical time periods.
[0080] The spatial feature extraction module is used to capture the spatial dependency information of local and global patterns in power load data, while the nonlinear feature adaptive extraction module focuses on extracting nonlinear information between different users in the data.
[0081] The spatial feature extraction module employs one-dimensional convolution (1D convolution), adapting to feature capture requirements at different resolutions by applying different dilation factors. A smaller dilation factor allows the model to perform convolution operations within a smaller receptive field, thereby accurately identifying local patterns and detailed structures, enhancing the recognition and understanding of complex patterns. Conversely, a larger dilation factor expands the receptive field, enabling the model to identify contextual relationships over a wider range, contributing to understanding the global layout of the data. The spatial feature extraction module ensures the positional invariance of data during processing by aggregating feature and pattern information at the same location at different resolutions. To further extract global trends and patterns, an adaptive average pooling operation is introduced. This operation helps capture the overall trends and patterns in power load data, enriching the model's understanding of power system dynamics. The operation process is as follows: Figure 2 As shown.
[0082] In the data processing flow, the spatial feature extraction module first expands the receptive field of the convolution kernel without loss through multi-resolution convolution operations with different dilation factors, thereby learning the local context and patterns of the data while preserving the original resolution. Next, global adaptive average pooling effectively integrates the global information of the entire feature map, helping the model to fully understand the global structure and patterns of the input sequence. The specific operation steps are as follows:
[0083] Step 2-1: Construct convolution kernels to perform one-dimensional convolution dilation on the preprocessed historical electricity consumption data to obtain the feature representations of each time point of the historical electricity consumption data;
[0084] After preprocessing, a length of is obtained input sequence Each of them Indicates a point in time The observed data vector, and a convolution kernel of length k. , The convolution kernel is in the th... The weight of each position.
[0085] This invention constructs a one-dimensional dilated convolution to perform one-dimensional convolution dilation processing on preprocessed historical electricity consumption data. The calculation formula for the one-dimensional dilated convolution is as follows:
[0086]
[0087] in, Indicates a point in time Feature representation at location, Indicates a point in time Subtract the inflation factor Multiply by the kernel position index The corresponding input sequence elements, Indicates the position of the convolution kernel The weight of the position, This represents the dilation factor, used to adjust the receptive field size. This calculation method allows the convolutional kernel to cover the input data with a dilation stride, integrating information from local data points through weighted summation to obtain the feature representation at each time point.
[0088] Step 2-2: Combining the feature representations of historical electricity consumption data at each time point, different expansion factors are used to obtain spatial local feature extraction results;
[0089] To capture local features and pattern information at different resolutions, this invention applies different dilation factors to the preprocessed data. Multi-resolution convolution is performed, and combined with linear normalization and ReLU activation function processing, the spatial local feature extraction calculation formula is as follows:
[0090]
[0091] in, The time point after preprocessing Data vector at The corresponding spatial local feature extraction results are obtained by analyzing the original data. Perform convolution and linear normalization ( )and The result after processing by the activation function. Represents the set of all possible expansion factors. This is the result calculated based on the above convolution formula, that is, when the dilation factor... for Time to time point Data vector at The output result after performing one-dimensional dilated convolution; ReLU represents the linear normalization operation, which normalizes the output of a neural network layer; ReLU() is an activation function used to introduce nonlinearity. Indicates the original data Take expansion factor The probability of.
[0092] Steps 2-3 involve adaptive average pooling and convolution processing on the preprocessed historical electricity consumption data to obtain spatial global feature extraction results.
[0093] To effectively integrate the global information of the entire feature map, this invention applies an adaptive average pooling technique to obtain the spatial global feature extraction results:
[0094]
[0095] in, This is the spatial global feature extraction result obtained after adaptive average pooling. Indicates input Use expansion factor Perform average pooling operation; This refers to applying a convolution operation again to the pooled result. The upsample operation, on the other hand, enlarges the convolution result back to its original size for subsequent processing; strategy It is a function that represents the original data. Take expansion factor The probability of.
[0096] To optimize the strategy of selecting different inflation factors, this invention constructs an inflation value function. The inflation value function is used to calculate the inflation value of a specific inflation factor. For the original data The value, which includes instant rewards. The inflationary value function, including discounts on future rewards, is as follows:
[0097]
[0098] in, Indicates the original data Take expansion factor Value; It is an immediate reward that reflects the value of the current decision; [0,1] is a discount factor used to adjust the emphasis on future rewards; This means subtracting the inflation factor from the current position. Multiply by step size Data at the corresponding time point; It represents the expected value of future rewards. These are the weights of the convolution kernel. It is one of all possible expansion factors.
[0099] Instant rewards The L1 loss, determined by the difference between the predicted and actual values, is expressed by the following formula:
[0100]
[0101] in, Indicates an immediate reward; It is a moment Real data; These are the corresponding predicted values; It represents the time span of the forecast, indicating that multiple points in the future are considered.
[0102] Choose strategy Defined as using a specific expansion factor The probability follows a Softmax distribution:
[0103]
[0104] in, Indicates the original data Take expansion factor The probability of; It is the base of the natural logarithm; It is an inflated value function; in the denominator For all possible inflation factors The sum of the exponents ensures the normalization of the probability distribution. When The larger the value, the better for the original data. In terms of expansion factor The greater the likelihood of being considered optimal, the higher the probability of it being selected. Conversely, if... Smaller indicates that for the original data In terms of expansion factor It's unlikely to be the optimal choice; the probability of it being selected is low. High probability. This means the expansion factor At the current data point Those exhibiting higher value or fitness have a greater chance of being selected as the optimal inflation factor. Low probability. This means the expansion factor At the current data point If it performs poorly, it is unlikely to be the optimal choice, and therefore has a low probability of being selected.
[0105] Steps 2-4 involve fusing the results of local spatial feature extraction and global spatial feature extraction to obtain the optimal scale spatial feature representation.
[0106] This invention fuses features at the same location but with different resolutions to form the final optimal scale-space feature representation.
[0107]
[0108] in, It's a discount factor, close to 1. More attention is paid to larger inflation factors, close to 0. A smaller inflation factor is preferred; Represents all possible expansion factors and the weighted sum of their corresponding probabilities; This indicates the result of combining the results of spatial local feature extraction and spatial global feature extraction. By combining local and global features, this invention ensures that the model can understand the overall structure and patterns while preserving details, thus improving the effectiveness and accuracy of feature extraction. In this way, the invention can comprehensively and effectively extract features from power load data, providing a solid foundation for subsequent analysis.
[0109] Step 3: Adaptive nonlinear feature extraction is performed on the preprocessed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature fusion processing to obtain nonlinear features;
[0110] In processing power load data, facing its nonlinear and non-uniform distribution characteristics, this invention introduces an adaptive nonlinear feature extraction module based on adaptive gated quadratic deformation convolution. This module not only dynamically adjusts the shape and position of the convolution kernel through a gating mechanism, but also incorporates the concept of quadratic deformation, enabling the model to more accurately capture nonlinear changes and complex patterns in power data, making it particularly suitable for handling abrupt changes and periodic fluctuations in power load data.
[0111] Adaptive gated quadratic deformable convolution determines the offset using the original data, unlike traditional deformable convolution which requires learning the offset. This reduces reliance on external information, simplifies the model structure, and improves the model's adaptability and robustness. Furthermore, adaptive gated quadratic deformable convolution combines multi-resolution feature maps with global feature maps, enhancing information integration and improving the model's ability to process information at different spatial scales while ensuring a seamless connection between fine-grained and coarse-grained information.
[0112] First, define an input feature map. , where each element Indicates position The data value at that location. For a given location. and a set of relative position indices This invention defines a learning offset. for:
[0113]
[0114] Wherein, Unif represents a uniform distribution; It is a location The learning offset at a given point is determined by the sampling of the original data; It is a weight matrix used to calculate the offset; Relative to Location The data values on It is a set of relative position indices.
[0115] Next, this invention defines the deformable convolution DefConv operation as follows:
[0116]
[0117] in, Indicates the current reference position for processing. Relative to the reference position The relative position index, Indicates the reference position Output feature map value at that location, Indicates the input feature map, This represents the sampling points on the input feature map after the offset has been applied. Indicates the weights of the convolution kernel. It is a relative position The learning offset, It is a set of relative position indices.
[0118] To further enhance the model's adaptability, this invention proposes a gating mechanism to control the output of deformable convolution. Specifically, the optimal scale-space local features obtained in the previous steps are represented... and optimal scale space global feature representation Merge along the specified dimension to form a new feature map :
[0119]
[0120] in, This represents an operation that merges multiple tensors along a specified dimension; This is the combined feature map. Then, this invention generates a gated signal using a two-dimensional convolution operation (Conv2D) and a sigmoid activation function.
[0121]
[0122] Here, Conv2D represents a two-dimensional convolution operation; Sigmoid() is an activation function used to map any real value to the interval (0,1). For the generated gating signal, Conv2D () represents two-dimensional convolution computation, indicating that a two-dimensional convolution operation is performed on the input data.
[0123] Next, this invention uses a gate signal (Gate) to modulate the output of the deformable convolution to obtain a nonlinear feature representation. :
[0124]
[0125] in, This represents element-wise multiplication. It is a feature map adjusted by the gating mechanism. DefConv () represents the deformable convolution operation.
[0126] Furthermore, this invention also designs a feature mixing layer, which integrates low-level and high-level input sequence information through linear transformation, such as... Figure 4 As shown, this strategy facilitates information exchange and fusion between features of different resolutions. Then, through the use of residual connections, this invention ensures the effective transmission of key feature information in deep network structures, effectively preventing information loss during multi-layer processing. The process is described below:
[0127]
[0128]
[0129] Wherein, Linear represents a linear transformation operation; It is the output of the feature mixing layer. It exhibits nonlinear characteristics.
[0130] This invention achieves this by analyzing feature maps. Processing, obtaining That is, to obtain the initial nonlinear characteristic representation, and then to... By integrating low-level and high-level input sequence information through linear transformation, a nonlinear feature representation that fuses feature information at different resolutions is obtained. Then to Use residual connections to avoid feature maps Information is lost during the processing in step 3, resulting in the final nonlinear characteristic. To realize the nonlinear spatial correlation in power load data of different dimensions It was captured.
[0131] Step 4: Construct a block-based channel network to process the optimal scale space features and nonlinear features, and obtain the hidden state and normalized state;
[0132] Constructing a segmented channel network to handle optimal scale-space features and nonlinear features through a gating mechanism, specifically including:
[0133] set up The time point after preprocessing Calculate spatial features from data vectors at locations. ,in, and These are the optimal scale space features and the nonlinear features, respectively.
[0134] spatial features and the spatial features The preprocessed historical electricity consumption data corresponding to the historical moment are jointly input into the gating unit of the block channel network. The gating unit includes a forget gate, an input gate, and an output gate. The block channel network also includes a candidate state generation unit.
[0135] Each unit processes spatial features using a weight matrix and a cyclic weight matrix. The preprocessed historical electricity consumption data corresponding to the historical moment and the hidden state of the previous moment are processed by the activation function to generate three sets of gate signals, including the forget gate signal, the input gate signal and the output gate signal;
[0136] The forget gate signal controls the retention ratio of historical states, and the input gate signal controls the update intensity of candidate states. The two work together to update the cell state and calculate the normalization factor.
[0137] The output gate signal is weighted and selected by the cell state and normalization factor to output the hidden state and normalized state at the current time.
[0138] Existing sLSTM (Scalar LSTM) adds a scalar update mechanism and optimizes the gating mechanism on top of the traditional LSTM, making it more suitable for processing sequence data with subtle time variations. While sLSTM networks can effectively perform geometric traversal, their short memory cycles limit their performance when processing dense, short-term time series data. Such data, such as load readings recorded every few minutes in a power system, accumulate to form massive datasets. To overcome this limitation, this invention constructs a BC-sLSTM network (block-channel network) based on the sLSTM network. This method effectively enhances the network's memory capacity by introducing block processing and channel independence strategies, making it more suitable for processing large-scale time series data.
[0139] BC-sLSTM first employs a channel independence strategy, dividing multivariate time series data into different independent channels specifically for processing various load data in power systems. By dividing the data into multiple channels, each processing a single-variable sequence, this design allows different data channels to share the same backbone network architecture while maintaining the independence of the forward propagation process, effectively improving processing efficiency and reducing the risk of model overfitting. Then, the data in each channel is further divided into multiple blocks, which undergo preliminary processing through a specifically designed linear layer, enhancing the responsiveness to short-term fluctuations in power load data.
[0140] To further illustrate the design of this linear layer, the present invention further describes its function and operation:
[0141] Specifically, given a batch sample sequence Size is ,in Indicates the number of time steps. This represents the number of channels (i.e., the number of variables). The initial data was converted... And after channel independence processing, we obtain These data were then processed through block operations to obtain... ,in It is the number of blocks. That's the size of the block. Next, each block... Projection is performed through the first linear layer, which projects each block from... Dimension mapped to an intermediate dimension This is to capture short-term volatility characteristics. This operation can be represented as:
[0142]
[0143] in, It is a weight matrix, used to weight the input data from... Dimension mapping to intermediate dimension It is a bias vector used to adjust the result of the linear transformation. It is the input data block, containing multi-channel time series data after being divided into blocks. It is a feature representation after projection, which captures the characteristics of short-term fluctuations.
[0144] Feature representation after projection After processing by the BC-sLSTM module, it passes through another linear layer to reduce the intermediate dimension. Mapping back to the original time dimension This is to ensure that the output format is consistent with the input. This operation can be represented as:
[0145]
[0146] In the formula, This represents the output after the second linear layer, with the shape of... Then, by piecing together all the blocks, it can be restored to its original state. To achieve the intermediate dimension Mapping back to the original time dimension .
[0147] Weight matrix, used to weight the intermediate dimensions Map back to the original size of each block ;
[0148] This represents the bias vector, which adjusts the result of the linear transformation.
[0149] The operation and meaning of the BC-sLSTM module are as follows: Assume It is time Input electricity consumption data, spatial characteristics Directly integrated into the gating mechanism, in which and These are the optimal scale spatial features and the nonlinear spatial features, respectively.
[0150] spatial features The operation of the BC-sLSTM module when inputting into a block channel network can be represented as follows:
[0151]
[0152]
[0153]
[0154]
[0155]
[0156]
[0157]
[0158] in, , These represent the cell states at time t and time t-1, respectively. , These represent the output of the forget gate and the unactivated original value of the forget gate at time t, respectively. , These represent the output of the output gate and the unactivated original value of the output gate at time t, respectively. This represents the activation form of the cell state at time t. Represents the normalized state The reverse result, , Let and represent the candidate states and the linear combination of the candidate states after processing with the hyperbolic tangent (tanh) activation function at time t, respectively. , These represent the input gate output and the unactivated original value of the input gate at time t, respectively. It is the input weight matrix. It is time Electricity consumption data Represents the cyclic weight matrix. , Let be the hidden states at time t and time t-1, respectively. and For the bias vector, the function It is the hyperbolic tangent. Activation function for Activation function This represents the Hadamard product.
[0159] By constructing a BC-sLSTM network, we not only improve the ability to capture short-term temporal correlations but also enhance the model's ability to handle large-scale time series data. This approach not only improves the accuracy of short-term predictions but also supports the processing of larger datasets.
[0160] Step 5: Based on the self-attention mechanism, extract the long-term correlation between the hidden state and the normalized state to obtain the global state, and obtain the predicted electricity consumption through linear transformation based on the global state;
[0161] While BC-sLSTM models excel at handling short-term time-series data in power systems, such as hourly or daily load fluctuations, using block processing and channel independence strategies, these strategies have limitations in capturing long-term time dependencies. For example, they struggle to adequately predict industrial power consumption stability during seasonal variations or economic cycles. Although these strategies are effective at managing and predicting rapidly changing instantaneous loads, their ability to predict long-term trends is significantly insufficient. To overcome this limitation, this invention enhances the model's ability to capture long-term time correlations in power systems through a self-attention mechanism.
[0162] This invention first applies a self-attention mechanism to analyze the global temporal dependencies of the current time step in power data. This is achieved by utilizing hidden states. and normalized state The self-attention mechanism can extract global features that are closely related to the current power load forecast.
[0163] Specifically, in self-attention, the query and key are respectively determined by normalized states. and hidden state This method allows for detailed analysis of the temporal dynamics of power data.
[0164] Subsequently, the output and hidden state of the self-attention mechanism and normalized state These are combined to form a comprehensive global state representation. This representation reflects the overall situation of the power system at the current time step. This method not only improves the ability to capture long-term dependencies but also provides more accurate data support for real-time monitoring of the power system and future load forecasting. The expression is as follows:
[0165]
[0166]
[0167] in, These are learnable parameters. Indicates a connection operation. For querying the matrix, The key matrix, It is a value matrix. This represents the global state. Key matrix Dimensions.
[0168] To more effectively utilize the local and global time series information provided by the BC-sLSTM model, this invention optimizes the memory cell update process by combining the hidden unit outputs from the BC-sLSTM and the global state obtained through the self-attention mechanism using an information fusion strategy.
[0169] To effectively combine local and global information obtained from BC-sLSTM and self-attention mechanisms, this invention incorporates hidden units. and global state Fusion to acquire memory information.
[0170] Specifically, the updated expressions for the unit input, input gate, forget gate, and output gate are as follows:
[0171]
[0172]
[0173]
[0174]
[0175] Finally, this invention predicts future electricity demand by effectively capturing the spatiotemporal patterns of historical electricity data. The method first converts historical data into high-dimensional features, and then directly predicts the electricity consumption at the next moment through a linear transformation.
[0176] Specifically, predicting electricity consumption at the next moment through linear transformation includes:
[0177] The global state, spatial features, hidden state, and normalized state are used as inputs to the block channel network at the next time step to calculate the global state, spatial features, hidden state, and normalized state at the next time step.
[0178] A linear transformation is used to convert the global state of all historical moments into predicted future electricity consumption values.
[0179] To optimize prediction accuracy and prevent gradient explosion, the L1 loss function is used to minimize the prediction error.
[0180]
[0181] in, This represents all learnable parameters in the network. It is the actual value. It is a time step The predicted values for all nodes. The entire network is trained end-to-end.
[0182] like Figure 5 As shown, the present invention also proposes an electricity consumption prediction system based on optimal scale convolution and graph memory enhancement, which is used in the above-mentioned electricity consumption prediction method based on optimal scale convolution and graph memory enhancement. The system includes: an acquisition module, a preprocessing module, a spatial feature extraction module, a nonlinear feature extraction module, a correlation extraction module, and a prediction module.
[0183] The data acquisition module is used to collect historical electricity consumption data from various nodes of the power network.
[0184] The preprocessing module is used to preprocess the collected data to obtain preprocessed historical electricity consumption data;
[0185] The spatial feature extraction module is used to extract spatial features from preprocessed historical electricity consumption data to obtain optimal scale spatial features;
[0186] The nonlinear feature extraction module performs adaptive nonlinear feature extraction on the preprocessed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature fusion processing to obtain nonlinear features;
[0187] The correlation extraction module is used to construct a block channel network to process the optimal scale space features and nonlinear features to obtain the hidden state and normalized state; and to perform long-term correlation extraction on the hidden state and normalized state based on the self-attention mechanism to obtain the global state.
[0188] The prediction module obtains the predicted power consumption through a linear transformation based on the global state.
[0189] The beneficial effects of this invention are that, compared with the prior art, this invention can effectively integrate local and global spatial dependencies and nonlinear characteristics, and can capture long-term and short-term temporal correlations, thereby achieving accurate electricity consumption prediction.
[0190] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0191] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0192] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0193] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0194] Finally, 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 the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A method for predicting electricity consumption based on optimal scale convolution and graph memory enhancement, characterized in that, Includes the following steps: Historical electricity consumption data of each node in the power network is collected and preprocessed to obtain preprocessed historical electricity consumption data. Spatial features are extracted from the preprocessed historical electricity consumption data to obtain the optimal scale spatial features; The step of extracting spatial features from the preprocessed historical electricity consumption data to obtain optimal scale spatial features specifically includes: Convolutional kernels are constructed to perform one-dimensional convolutional dilation on the preprocessed historical electricity consumption data to obtain feature representations of each time point in the historical electricity consumption data; By combining the feature representations of historical electricity consumption data at different time points, spatial local feature extraction results are obtained by using different expansion factors; Adaptive average pooling and convolution processing are applied to the preprocessed historical electricity consumption data to obtain spatial global feature extraction results. The results of local spatial feature extraction and global spatial feature extraction are fused to obtain the optimal scale spatial feature representation; Nonlinear features are obtained by adaptively extracting nonlinear features from preprocessed historical electricity consumption data through adaptive gated quadratic deformable convolution and feature fusion processing. A block-based channel network is constructed to process the optimal scale space features and nonlinear features, thereby obtaining the hidden state and the normalized state; The global state is obtained by extracting long-term correlation between the hidden state and the normalized state based on the self-attention mechanism, and the predicted electricity consumption is obtained by linear transformation based on the global state.
2. The electricity consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1, characterized in that, The process of collecting historical electricity consumption data from each node of the power network and preprocessing the data to obtain preprocessed electricity consumption data specifically includes: Historical electricity consumption data for time period T was collected from each node of the power network, and preprocessed to obtain the following preprocessed historical electricity consumption data: In the formula, t represents the current time. Indicates the time point after preprocessing. The data vector at position i∈[t,t ].
3. The electricity consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1, characterized in that, A convolution kernel is constructed to perform one-dimensional convolution dilation on the preprocessed historical electricity consumption data, resulting in feature representations of each time point in the historical electricity consumption data, specifically including: Set the convolution kernel to length k. , The convolution kernel is in the th... The weights of each position, i∈[1,k], are applied to the preprocessed historical electricity consumption data using one-dimensional convolution dilation: in, Indicates a point in time Feature representation at location, Indicates a point in time Subtract the inflation factor Multiply by the kernel position index The corresponding input sequence elements, This represents the expansion factor.
4. The electricity consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 3, characterized in that, The method of combining the feature representations of historical electricity consumption data at various time points and using different expansion factors to obtain spatial local feature extraction results specifically includes: The formula for calculating the spatial local feature extraction result is as follows: in, The time point after preprocessing Data vector at The corresponding spatial local feature extraction results, Represents the set of all possible expansion factors. When the expansion factor for Time to time point Data vector at The output result after performing one-dimensional dilated convolution; ReLU represents the linear normalization operation; ReLU() is the activation function. Indicates the time point after preprocessing Data vector at Take expansion factor The probability of.
5. The electricity consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 4, characterized in that, In the formula, is the base of the natural logarithm; It is an inflated value function; For all possible inflation factors The sum of exponents.
6. The electricity consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1, characterized in that, The process involves adaptively extracting nonlinear features from the preprocessed historical electricity consumption data using adaptive gated quadratic deformable convolution and feature fusion processing. Specifically, this includes: Gating signals are constructed using two-dimensional convolution operations and activation functions. : Here, Conv2D represents a two-dimensional convolution operation; Sigmoid() is an activation function used to map any real value to the interval (0,1). For the generated gating signal, Conv2D ( ) represents two-dimensional convolution computation, indicating that a two-dimensional convolution operation is performed on the input data. It is a feature map obtained by combining the results of spatial local feature extraction and spatial global feature extraction along a specified dimension; The output of the deformable convolution is modulated using a gate signal (Gate) to obtain nonlinear features. : in, This represents element-wise multiplication. It is a feature map adjusted by the gating mechanism. DefConv () represents the deformable convolution operation.
7. The electricity consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1, characterized in that, The constructed block channel network processes optimal scale spatial features and nonlinear features through a gating mechanism, specifically including: set up The time point after preprocessing Calculate spatial features from data vectors at locations. ,in, and These are the optimal scale space features and the nonlinear features, respectively. spatial features and the spatial features The preprocessed historical electricity consumption data corresponding to the historical moment are jointly input into the gating unit of the block channel network. The gating unit includes a forget gate, an input gate, and an output gate. The block channel network also includes a candidate state generation unit. The candidate state generation unit is used for new information in the current input that needs to be included in long-term memory. The candidate state generation unit is used to be controlled by the gating unit, thereby controlling the flow and updating of information. Each unit processes spatial features using a weight matrix and a cyclic weight matrix. The preprocessed historical electricity consumption data corresponding to the historical moment and the hidden state of the previous moment are processed by the activation function to generate three sets of gate signals, including the forget gate signal, the input gate signal and the output gate signal; The forget gate signal controls the retention ratio of historical states, and the input gate signal controls the update intensity of candidate states. The two work together to update the cell state and calculate the normalization factor. The output gate signal is weighted and selected by the cell state and normalization factor to output the hidden state and normalized state at the current time.
8. The electricity consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 7, characterized in that, The process of extracting long-term correlations between the hidden state and the normalized state based on a self-attention mechanism to obtain the global state, and then using a linear transformation of the global state to obtain the predicted electricity consumption, specifically includes: The global state is obtained by extracting the long-term correlation between the hidden state and the normalized state through a self-attention mechanism. The global state vector is obtained by combining the global states corresponding to all historical moments, and the predicted electricity consumption is obtained by performing a linear transformation on the global state vector.
9. A power consumption prediction system based on optimal scale convolution and graph memory enhancement, used to implement the power consumption prediction method based on optimal scale convolution and graph memory enhancement as described in any one of claims 1-8, characterized in that, include: The system includes an acquisition module, a preprocessing module, a spatial feature extraction module, a nonlinear feature extraction module, a correlation extraction module, and a prediction module. The data acquisition module is used to collect historical electricity consumption data from various nodes of the power network. The preprocessing module is used to preprocess the collected data to obtain preprocessed historical electricity consumption data; The spatial feature extraction module is used to extract spatial features from preprocessed historical electricity consumption data to obtain optimal scale spatial features; The nonlinear feature extraction module performs adaptive nonlinear feature extraction on the preprocessed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature fusion processing to obtain nonlinear features; The correlation extraction module is used to construct a block channel network to process the optimal scale space features and nonlinear features to obtain the hidden state and normalized state; and to perform long-term correlation extraction on the hidden state and normalized state based on the self-attention mechanism to obtain the global state. The prediction module obtains the predicted power consumption through a linear transformation based on the global state.
10. A terminal, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1-8.
Citation Information
Patent Citations
Substation load prediction method based on CEEMDAN and improved Kepler algorithm optimization model
CN119891178A
Short-term load prediction system based on coder-decoder architecture and construction method thereof
CN120146292A