Power consumption prediction method and system based on optimal scale convolution and graph memory enhancement
Through the methods of optimal scale convolution and graph memory enhancement, local and global spatial dependencies are integrated, long-term and short-term temporal correlations are captured, the limitations of existing electricity consumption forecasting methods are solved, and more accurate electricity consumption forecasts are achieved.
Patent Information
- Application Number
- CN202511188578.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Existing electricity consumption forecasting methods ignore local spatial information and nonlinear information when dealing with geographical or community-specific demand changes, and the LSTM model has limitations in processing large data sets and long-term forecasts, resulting in poor forecasting results.
A method based on optimal scale convolution and graph memory enhancement is adopted to extract nonlinear features through adaptive gated quadratic deformation convolution and feature mixing processing. It is combined with block channel network and self-attention mechanism to capture long-term and short-term temporal correlations and integrate local and global spatial dependencies.
It improves the accuracy and applicability of electricity consumption forecasts, can reflect the characteristics of different regions and consumption behaviors, identify long-term electricity consumption patterns, and enhance the recognition ability and time sensitivity of electricity data.
Smart Images

Figure CN120675076A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field 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 Art
[0002] As the scale and complexity of global power systems continue to grow, accurate electricity demand forecasting has become a core component of power system management. Electricity demand forecasting is not only important for optimizing power production and distribution but also plays a vital role in maintaining grid stability and reliability. The accuracy of electricity demand forecasts directly impacts the economic efficiency and operational safety of power systems, especially in grids increasingly populated by renewable energy, where effectively balancing supply and demand presents a challenge. Furthermore, fluctuations in electricity demand are influenced by a variety of factors, such as seasonal variations, weather conditions, economic activity, and consumer behavior, which add to the uncertainty and complexity of forecasting.
[0003] To improve the accuracy of electricity consumption forecasts, several existing methods have been developed. Traditional forecasting methods include statistical methods such as moving averages, exponential smoothing, and seasonal adjustment. With advances in computing technology, machine learning methods such as support vector machines (SVMs), decision trees, and random forests have been introduced to electricity forecasting. These methods can handle nonlinear problems and improve the accuracy of forecasting models. In recent years, deep learning technologies, particularly long short-term memory networks (LSTMs), gated recurrent units (GRUs), and convolutional neural networks (CNNs), have become a hot topic of research. These deep learning models are widely used in analyzing time series data of electricity consumption due to their excellent ability to automatically extract data features and handle complex data relationships.
[0004] While the aforementioned methods have demonstrated some effectiveness in addressing electricity consumption forecasting, they still have some limitations. First, while CNN models excel at extracting global spatial information, they often overlook the importance of local spatial and nonlinear information. This can lead to poor forecasting performance when predicting demand changes that are geographically or community-specific. Second, while the LSTM model has demonstrated some effectiveness in addressing electricity consumption forecasting, it has significant limitations when dealing with large datasets and long-term forecasts. The LSTM's short memory cycle limits its effectiveness in capturing long-term data stability, such as seasonal variations. This also impacts the model's short-term forecasting performance when dealing with large datasets containing subtle and rapidly changing electricity consumption patterns. These limitations reduce the model's applicability and accuracy in practical applications, particularly in environments with highly uneven and rapidly changing demand, where accurate forecasts are difficult to ensure. Summary of the Invention
[0005] In order to solve the deficiencies in the prior art, the present invention provides a power consumption prediction method based on a multi-scale graph convolutional network and feature graph memory enhancement, which can solve the technical problems in the prior art of the power consumption prediction method based on deep learning models with a small scope of application and insufficient accuracy.
[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: Collect historical electricity consumption data of each node in the power network and preprocess the data to obtain preprocessed historical electricity consumption data; Perform spatial feature extraction on the pre-processed historical electricity consumption data to obtain the optimal scale spatial features; The nonlinear features of the pre-processed historical electricity consumption data are adaptively extracted through adaptive gated quadratic deformation convolution and feature mixing processing to obtain nonlinear features; Construct a block channel network to process the optimal scale space features and nonlinear features to obtain hidden states and normalized states; Based on the self-attention mechanism, the long-term correlation between the hidden state and the normalized state is extracted to obtain the global state, and the global state is linearly transformed to obtain the predicted power consumption.
[0008] Preferably, collecting historical electricity consumption data of each node in the power network and preprocessing the data to obtain preprocessed electricity consumption data specifically includes: The historical electricity consumption data of each node in the power network during the T period is collected and preprocessed to obtain the following historical electricity consumption data:
[0009] Where t represents the current time, Indicates the time point after pretreatment The data vector at i∈[t,t ].
[0010] Preferably, the extracting spatial features of the pre-processed historical electricity consumption data to obtain the optimal scale spatial feature representation specifically includes: Construct a convolution kernel to perform one-dimensional convolution expansion processing on the preprocessed historical electricity consumption data to obtain the feature representation of each time point of the historical electricity consumption data; Combining the feature representation of historical electricity consumption data at each time point, different expansion factors are used to obtain the spatial local feature extraction results; Adaptive average pooling and convolution processing are performed on the pre-processed historical electricity consumption data to obtain the spatial global feature extraction results; The spatial local feature extraction results and the spatial global feature extraction results are fused to obtain the optimal scale spatial feature representation.
[0011] Preferably, a convolution kernel is constructed to perform one-dimensional convolution expansion processing on the pre-processed historical electricity consumption data to obtain feature representations of the historical electricity consumption data at each time point, specifically including: Set the convolution kernel length to k , Represents the convolution kernel in The weight of each position, i∈[1,k]; the pre-processed historical electricity consumption data is processed by one-dimensional convolution expansion:
[0012] in, Indicates at a point in time The feature representation at Indicates at a point in time Subtract the expansion factor Multiply by the convolution kernel position index The corresponding input sequence element, Represents the expansion factor.
[0013] Preferably, combining the feature representation of each time point of the historical electricity consumption data and using different expansion factors to obtain the spatial local feature extraction results specifically includes: The calculation formula for the spatial local feature extraction result is as follows:
[0014] in, The time point after pretreatment The data vector at The corresponding spatial local feature extraction results, represents the set of all possible dilation factors, When the expansion factor for Time to time point The data vector at The output result after one-dimensional dilated convolution processing; Represents the linear normalization operation; ReLU() is the activation function, Indicates the time point after pretreatment The data vector at Take the expansion factor probability.
[0015] Preferably,
[0016] Where, is the base of natural logarithms; is the inflation value function; is the total number of possible expansion factors The sum of the exponentials of .
[0017] Preferably, the nonlinear features are adaptively extracted from the pre-processed historical electricity consumption data by adaptive gated quadratic deformation convolution and feature mixing processing to obtain nonlinear features, specifically including: Constructing gating signals through two-dimensional convolution operations and activation functions :
[0018] Among them, Conv2D represents a two-dimensional convolution operation; Sigmoid() is an activation function used to map any real value to the (0,1) interval. is the generated gating signal, Conv2D () is a two-dimensional convolution calculation, which means a two-dimensional convolution operation is performed on the input data. It is a feature map obtained by combining the spatial local feature extraction results and the spatial global feature extraction results along the specified dimension; Use the gate signal Gate to modulate the output of the deformed convolution to obtain nonlinear features :
[0019] in, represents element-wise multiplication, It is the feature map adjusted by the gating mechanism. DefConv () is the deformable convolution operation.
[0020] Preferably, the building of the block channel network processes the optimal scale space features and nonlinear features through a gating mechanism, specifically including: set up The time point after pretreatment The data vector at , calculate the spatial features ,in, and They are the optimal scale space features and nonlinear features respectively; The spatial features and the spatial characteristics The pre-processed historical electricity consumption data corresponding to the historical moment is 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 to store new information in the current input that needs to be included in the long-term memory. The candidate state generation unit is used to be controlled by the gating unit, thereby controlling the flow and update of information. Each unit processes spatial features through weight matrix and cyclic weight matrix The pre-processed historical electricity consumption data at the corresponding historical moment and the hidden state at the previous moment are processed by the activation function to generate three sets of gating signals, including forgetting gate signal, input gate signal and output gate signal; The forget gate signal controls the retention ratio of the historical state, and the input gate signal controls the update strength of the candidate state. The two work together to update the cell state and calculate the normalization factor. The output gate signal selects the cell state and normalization factor by weight, and outputs the hidden state and normalized state at the current moment.
[0021] Preferably, the long-term correlation extraction of the hidden state and the normalized state based on the self-attention mechanism to obtain the global state, and the global state is linearly transformed to obtain the predicted power consumption, specifically including: The global state is obtained by extracting long-term correlation between the hidden state and the normalized state through the self-attention mechanism; The global states corresponding to all historical moments are combined to obtain a global state vector, and the global state vector is linearly transformed to obtain the predicted power consumption.
[0022] The present invention also proposes a power consumption prediction system based on optimal scale convolution and graph memory enhancement, which is used to implement the power 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; The acquisition module is used to collect historical electricity consumption data of each node in 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 the pre-processed historical electricity consumption data to obtain the optimal scale spatial features; The nonlinear feature extraction module performs nonlinear feature adaptive extraction on the pre-processed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature mixing 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 extract the long-term correlation between the hidden state and the normalized state based on the self-attention mechanism to obtain the global state; The prediction module obtains the predicted power consumption through linear transformation based on the global state.
[0023] The present invention also provides a terminal, comprising a processor and a storage medium; The storage medium is used to store instructions; The processor is used 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.
[0024] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the power consumption prediction method based on optimal scale convolution and graph memory enhancement.
[0025] The beneficial effect of the present invention is that, compared with the prior art, the present invention proposes a power consumption prediction method that can effectively integrate local and global spatial dependencies and nonlinear features, and can capture long-term and short-term temporal correlations. It uses an adaptive convolutional network to extract global and local spatial information and nonlinear features from power consumption data. At the same time, the standard sLSTM (Scalar Long Short-Term Memory) network is improved by constructing a BC-sLSTM network to enhance its ability to capture long-term and short-term temporal correlations. The spatial feature extraction module is used to obtain key cross-scale spatial feature information from power data. The complex nonlinear dependencies in power data are captured by the nonlinear feature adaptive extraction module. The short-term temporal correlations in power data are effectively extracted through block processing and channel independence strategies. Finally, the long-term temporal correlations in power data are extracted through the self-attention mechanism. As a result, the prediction model can not only reflect the immediate power consumption trend, but also identify and learn long-term power consumption patterns based on historical data, thereby improving the applicability and accuracy of the prediction method in actual operation. The beneficial effects of the present invention include at least: (1) The present invention adopts 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, and then the nonlinear feature adaptive extraction module is used to capture the complex nonlinear dependencies in the power data. The present invention constructs an expansion factor for adaptive dynamic optimization selection and constructs an expansion value function to adjust the expansion factor so as to apply different expansion factors to adapt to the feature capture requirements at different resolutions. The adaptive gated quadratic deformation 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, effectively handles the spatial complexity and variability of power data, and improves the model's ability to recognize power consumption patterns, so that it can accurately reflect the characteristics of different regions and different consumption behaviors when predicting power consumption.
[0026] (2) The present invention enhances the standard sLSTM network to enhance its ability to capture long-term and short-term temporal correlations in power consumption data. The short-term temporal correlations in power data are effectively extracted 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, the present invention not only enhances the time sensitivity of the model 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Flowchart of a method for predicting power consumption based on optimal scale convolution and graph memory enhancement in an embodiment of the present invention; Figure 2 This is a process framework diagram of a power consumption prediction method based on optimal scale convolution and graph memory enhancement in an embodiment of the present invention; Figure 3 Schematic diagram of a spatial feature extraction module in an embodiment of the present invention; Figure 4 Schematic diagram of characteristic mixing in an embodiment of the present invention; Figure 5 This is a structural diagram of a power consumption prediction system based on optimal scale convolution and graph memory enhancement in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. The embodiments described in this application are only part of the embodiments of the present invention, not all of them. Based on the spirit of the present invention, other embodiments obtained by ordinary technicians in this field without making creative efforts are all within the scope of protection of the present invention.
[0029] like Figure 1 、 2 As shown, the present invention proposes a power consumption prediction method based on optimal scale convolution and graph memory enhancement, which includes the following steps: Step 1: Collect historical electricity consumption data of each node in the power network and preprocess the data to obtain preprocessed historical electricity consumption data.
[0030] Model the power network to be predicted as a graph ,in is a node set, representing the nodes in the power grid, including power stations, substations and power users, and Represents a node set The number of nodes ; is a set of edges, representing the connection relationship between nodes. is the adjacency matrix.
[0031] Since the data generated by the power system is huge and complex, the data often contains missing values and non-numerical information. These characteristics require data preprocessing.
[0032] The first processing step involves converting all non-numeric data to numeric values. For example, character data representing device status or operating conditions is converted using a specified numeric encoding method to ensure that this data can be correctly interpreted by subsequent analysis models. This conversion process applies to all similar character data.
[0033] Secondly, for missing values in the data, this paper adopts a feature mean-based imputation method. Specifically, if a feature is missing in the data, these missing values will be estimated and filled based on the mean of the feature in the training dataset, thereby maintaining the integrity and statistical properties of the data.
[0034] Assume that the current time is t, and the history is obtained through the above processing Electricity consumption data collection for each period },in, is the data recorded at the time i to be normalized, i∈[t, ]; Finally, the present invention has a great impact on the history of collection The electricity consumption data for each period is normalized to adjust the data to a predefined fixed interval, such as [0,1], to facilitate model processing. This normalization step is achieved using the following formula:
[0035] in, represents the normalized processing result of the data at the i-th moment, is the data recorded at the i-th moment to be normalized, and are the mean and variance vectors in the training time series, respectively.
[0036] Step 2: Extract spatial features from the preprocessed historical electricity consumption data to obtain the optimal scale spatial features; The present invention proposes a new feature acquisition method, which 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 the present invention, for the pre-processed historical electricity consumption data, feature extraction operations are performed on the electricity consumption data at different historical moments.
[0037] 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.
[0038] The spatial feature extraction module uses one-dimensional convolution (1D convolution) to adapt to the feature capture requirements at different resolutions by applying different expansion factors. A smaller expansion factor allows the model to perform convolution operations within a smaller receptive field, thereby accurately identifying local patterns and detailed structures, and enhancing the recognition and understanding of complex patterns. Conversely, a larger expansion factor expands the receptive field, enabling the model to identify contextual relationships over a wider range, which helps to understand the global layout of the data. The spatial feature extraction module ensures the positional invariance of the data during processing by aggregating features and pattern information of different resolutions at the same location. In order to further extract global trends and patterns, an adaptive average pooling operation is introduced, which helps to capture the overall trends and patterns in the power load data, thereby enriching the model's understanding of the dynamics of the power system. The operation process is as follows: Figure 2 shown.
[0039] In the data processing pipeline, the spatial feature extraction module first performs multi-resolution convolution operations with different dilation factors to losslessly expand the receptive field of the convolution kernel, thereby learning the local context and patterns of the data while preserving the original resolution. Next, global adaptive average pooling technology is used to effectively integrate the global information of the entire feature map, helping the model fully understand the global structure and patterns of the input sequence. The specific steps are as follows: Step 2-1: Construct a convolution kernel to perform one-dimensional convolution expansion on the preprocessed historical electricity consumption data to obtain feature representations of the historical electricity consumption data at each time point; After preprocessing, we get a length of The input sequence , where each Indicates a time point The data vector observed at , and a convolution kernel of length k , Represents the convolution kernel in The weight of the position.
[0040] The present invention constructs a one-dimensional dilated convolution to perform one-dimensional convolution dilation processing on the pre-processed historical electricity consumption data. The calculation formula of the one-dimensional dilated convolution is as follows:
[0041] in, Indicates at a point in time The feature representation at Indicates at a point in time Subtract the expansion factor Multiply by the convolution kernel position index The corresponding input sequence element, Indicates that the convolution kernel is at position The weight of Represents the dilation factor, which is used to adjust the receptive field size. This calculation method allows the convolution kernel to cover the input data with an expanded step size, integrating the information of local data points through weighted summation to obtain the feature representation of each time point.
[0042] Step 2-2, combining the feature representation of each time point of the historical electricity consumption data, and using different expansion factors to obtain the spatial local feature extraction results; In order to capture local features and pattern information at different resolutions, the present invention applies different expansion factors to the preprocessed data. Perform multi-resolution convolution and combine it with linear normalization and ReLU activation function processing. The calculation formula for spatial local feature extraction is as follows:
[0043] in, The time point after pretreatment The data vector at The corresponding spatial local feature extraction results are obtained by Perform convolution and linear normalization ( )and The result after activation function processing. represents the set of all possible dilation factors, It is the result calculated according to the above convolution formula, that is, when the expansion factor for Time to time point The data vector at The output result after one-dimensional dilated convolution processing; Represents a linear normalization operation, which standardizes the output of a neural network layer; ReLU() is an activation function used to introduce nonlinearity. Represents the original data Take the expansion factor probability.
[0044] Step 2-3: Perform adaptive average pooling and convolution processing on the pre-processed historical electricity consumption data to obtain the spatial global feature extraction result; In order to effectively integrate the global information of the entire feature map, the present invention applies the adaptive average pooling technology to obtain the spatial global feature extraction result:
[0045] in, It is the spatial global feature extraction result obtained after adaptive average pooling. Indicates input Using dilation factors Perform average pooling operation; Here, the convolution operation is applied again to the pooled result. The Upsample operation is to enlarge the convolution result back to the original size for subsequent processing; Strategy Is a function that represents the original data Take the expansion factor probability.
[0046] In order to optimize the strategy of selecting different expansion factors, the present invention constructs the expansion value function , the inflation value function is used to calculate the inflation factor For the original data The value of the The discounted sum of future rewards and the inflated value function is as follows:
[0047] in, Represents the original data Take the expansion factor the value of It is an immediate reward that reflects the value of the current decision; [0,1] is the discount factor, which is used to adjust the importance of future rewards; Indicates subtracting the expansion factor from the current position Multiply by the step size The data of the corresponding time point; represents the expected value of future rewards, is the weight of the convolution kernel, is one of all possible expansion factors.
[0048] Instant Rewards It is determined by the L1 loss between the predicted value and the true value, and its formula is:
[0049] in, Indicates immediate reward; It's time Real data; is the corresponding predicted value; is the time span of the forecast, which means considering multiple time points in the future.
[0050] Select a strategy Defined as using a specific expansion factor The probability of follows the Softmax distribution:
[0051] in, Represents the original data Take the expansion factor probability; is the base of natural logarithms; is the inflation value function; is the total number of possible expansion factors The sum of the exponentials of , ensures the normalization of the probability distribution. The larger the value, the better the original data For example, the expansion factor The greater the possibility of being considered optimal, the higher the probability of being selected. Smaller, it means that for the original data For example, the expansion factor Unlikely to be the best choice, the probability of being selected is low. High probability Means expansion factor At the current data point It shows a higher value or fitness, so it has a greater chance of being selected as the optimal expansion factor. Means expansion factor At the current data point It performs poorly and is unlikely to be the best choice, so it is less likely to be selected.
[0052] Step 2-4: Fuse the spatial local feature extraction results and the spatial global feature extraction results to obtain the optimal scale spatial feature representation; This paper fuses features of the same position but different resolutions to form the final optimal scale space feature representation.
[0053]
[0054] in, is the discount factor, close to 1 More attention is paid to larger expansion factors, close to 0 More consideration is given to smaller expansion factors; Represents all possible expansion factors and the weighted sum of its corresponding probabilities; It represents the result of combining the spatial local feature extraction results and the spatial global feature extraction results. Combining local and global features ensures that the model can understand the overall structure and pattern while retaining details, improving the effectiveness and accuracy of feature extraction. In this way, the present invention can comprehensively and effectively extract features from power load data, providing a solid foundation for subsequent analysis.
[0055] Step 3: Adaptively extract nonlinear features from the pre-processed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature mixing processing to obtain nonlinear features; In processing power load data, addressing its nonlinear and non-uniform distribution characteristics, this paper introduces a nonlinear feature adaptive extraction module based on adaptively 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 variations and complex patterns in power data. This makes it particularly suitable for processing sudden changes and periodic fluctuations in power load data.
[0056] Adaptive gated quadratic deformable convolution uses raw data to determine the offset based on traditional convolution, rather than requiring a learned offset like conventional deformable convolution. 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 transition from fine-grained to coarse-grained information.
[0057] First, define an input feature map , where each element Indicates location The data value at the given location and a set of relative position indexes , the present invention defines the learning offset for:
[0058] Among them, Unif means uniform distribution; It's location The learning offset at is determined by the original data sampling; is the weight matrix used to calculate the offset; Relative to Location The data value on A collection of relative position indexes.
[0059] Next, the present invention defines the deformation convolution DefConv operation as:
[0060] in, Indicates the current processing reference position, Relative to the reference position The relative position index of Indicates the reference position The output feature map value at represents the input feature map, represents the sampling point on the input feature map after applying the offset, represents the weight of the convolution kernel, Is a relative position The learning offset, A collection of relative position indexes.
[0061] In order to further enhance the adaptive ability of the model, this paper proposes a gating mechanism to control the output of the deformable convolution. Specifically, the optimal scale-space local feature representation obtained in the previous step is and optimal scale-space global feature representation Merge into a new feature map along the specified dimension :
[0062] in, Represents an operation to merge multiple tensors along a specified dimension; Then, the present invention generates a gating signal through a two-dimensional convolution operation (Conv2D) and a Sigmoid activation function.
[0063]
[0064] Among them, Conv2D represents a two-dimensional convolution operation; Sigmoid() is an activation function used to map any real value to the (0,1) interval. is the generated gating signal, Conv2D () is a two-dimensional convolution calculation, which means a two-dimensional convolution operation is performed on the input data.
[0065] Next, the present invention uses the gate signal Gate to modulate the output of the deformed convolution to obtain the nonlinear feature representation :
[0066] in, represents element-wise multiplication, It is the feature map adjusted by the gating mechanism. DefConv () is the deformable convolution operation.
[0067] In addition, the present invention also designs a feature mixing layer to integrate low-level and high-level input sequence information through linear transformation, such as Figure 4 As shown in Figure 2, this strategy promotes information exchange and fusion between features of different resolutions. Then, through the use of residual connections, the present invention ensures the effective transmission of key feature information in the deep network structure, effectively preventing information loss during multi-layer processing. The process is described as follows:
[0068]
[0069] Among them, Linear represents the linear transformation operation; is the output of the feature mixing layer, It is a nonlinear feature.
[0070] The present invention compares the characteristic graph Process, get , that is, to obtain the initial nonlinear feature representation, and then By integrating low-level and high-level input sequence information through linear transformation, a nonlinear feature representation that integrates feature information of different resolutions is obtained. , then Use residual connections to avoid feature maps Information is lost during the processing of step 3, and the final nonlinear feature is obtained , realizing the nonlinear spatial correlation in power load data of different dimensions was captured.
[0071] Step 4: Construct a block channel network to process the optimal scale space features and nonlinear features to obtain the hidden state and normalized state; Constructing a block channel network to process optimal scale space features and nonlinear features through a gating mechanism, specifically including: set up The time point after pretreatment The data vector at , calculate the spatial features ,in, and They are the optimal scale space features and nonlinear features respectively; The spatial features and the spatial characteristics The pre-processed historical electricity consumption data corresponding to the historical moment is input into the gate control unit of the block channel network. The gate control unit includes a forget gate, an input gate, and an output gate. The block channel network also includes a candidate state generation unit. Each unit processes spatial features through weight matrix and cyclic weight matrix The pre-processed historical electricity consumption data at the corresponding historical moment and the hidden state at the previous moment are processed by the activation function to generate three sets of gating signals, including forgetting gate signal, input gate signal and output gate signal; The forget gate signal controls the retention ratio of the historical state, and the input gate signal controls the update strength of the candidate state. The two work together to update the cell state and calculate the normalization factor. The output gate signal selects the cell state and normalization factor by weight, and outputs the hidden state and normalized state at the current moment.
[0072] The existing sLSTM (Scalar LSTM) network adds a scalar update mechanism and optimizes the gating mechanism to the traditional LSTM, making it more suitable for processing sequence data with subtle temporal variations. While sLSTM networks can effectively perform geometric traversals, their short memory period limits their effectiveness when processing dense, short-term time series data. This type of data, such as load readings recorded every few minutes in power systems, accumulates to form massive datasets. To overcome this limitation, the present invention constructs a BC-sLSTM network (block-channel network) based on the sLSTM network. By introducing block processing and channel independence strategies, this method effectively enhances the network's memory capacity, making it more suitable for processing large-scale time series data.
[0073] BC-sLSTM first employs a channel independence strategy, dividing multivariate time series data into distinct independent channels specifically designed to process various load data in the power system. By dividing the data into multiple channels, each processing a single variable sequence, this design enables 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. The data from each channel is then split into multiple blocks, which are initially processed through a specially designed linear layer, enhancing responsiveness to short-term fluctuations in power load data.
[0074] To illustrate the design of this linear layer, the present invention further describes its function and operation: Specifically, given a batch The sample sequence , the size is ,in represents the number of time steps, Indicates the number of channels (i.e. the number of variables). Initially the data is converted to , and after channel independence processing, we get The data is then divided into blocks to obtain ,in is the number of blocks, is the block size. Next, each block Projected through the first linear layer, which transforms each block from Dimensions are mapped to an intermediate dimension , to capture short-term fluctuation characteristics. This operation can be expressed as:
[0075] in, is the weight matrix used to transform the input data from Dimensions are mapped to intermediate dimensions is the bias vector used to adjust the result of the linear transformation, is the input data block, which contains the multi-channel time series data after block division. It is the feature representation after projection, which captures the characteristics of short-term fluctuations.
[0076] Feature representation after projection After being processed by the BC-sLSTM module, it passes through another linear layer again, and the intermediate dimension Mapping back to the original time dimension , to ensure that the output format is consistent with the input. This operation can be expressed as:
[0077] Where, Represents the output after the second linear layer, the shape is , and then restore it by splicing all the blocks , to realize the intermediate dimension Mapping back to the original time dimension .
[0078] The weight matrix is used to transform the intermediate dimensions Map back to the original size of each block ; Represents the bias vector, which adjusts the result of the linear transformation.
[0079] The operation of the BC-sLSTM module and its meaning are as follows: Assume It's time The input electricity consumption data will be spatially characterized directly into the gating mechanism, where and They are the optimal scale space features and nonlinear space features respectively.
[0080] The spatial features Inputting the block channel network, the operation process of the BC-sLSTM module can be expressed as:
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087] in, 、 represent the cell states at time t and time t-1 respectively, 、 Represent the output of the forget gate at time t and the original value of the forget gate without activation, 、 Represent the output of the output gate at time t and the original value of the output gate without activation, represents the activation form of the cell state at time t, Represents the normalized state The inverse result of 、 They represent the candidate state after the hyperbolic tangent (tanh) activation function at time t and the linear combination of the candidate states, 、 Represent the input gate output and the original value of the input gate before activation at time t respectively; is the input weight matrix, It's time electricity consumption data, represents the cyclic weight matrix, 、 are the hidden states at time t and time t-1 respectively, and is the bias vector, function is the hyperbolic tangent activation function, for activation function, represents the Hadamard product.
[0088] By building a BC-sLSTM network, we not only improve the ability to capture short-term temporal correlations, but also enhance the model's ability to process large-scale time series data. This approach not only improves the accuracy of short-term forecasts, but also provides support for processing larger datasets.
[0089] Step 5: Based on the self-attention mechanism, the long-term correlation between the hidden state and the normalized state is extracted to obtain the global state, and the predicted power consumption is obtained through linear transformation based on the global state; While BC-sLSTM models excel at processing short-term time series data in power systems, such as intra-hour or intra-day load fluctuations, using block processing and channel independence strategies, these strategies are limited in capturing long-term temporal dependencies. For example, they struggle to adequately predict seasonal variations or the stability of industrial electricity demand over economic cycles. While these strategies can effectively manage and predict rapidly changing instantaneous loads, their ability to predict long-term trends is significantly limited. To overcome this limitation, the present invention enhances the model's ability to capture long-term temporal dependencies in power systems through a self-attention mechanism.
[0090] The present invention first applies the self-attention mechanism to analyze the global time dependency of the current time step in the power data. and normalized state ,The self-attention mechanism can extract global features that are closely related to the current power load forecast.
[0091] Specifically, the query and key in self-attention are respectively normalized by state and hidden state This method can be used to analyze the temporal dynamics of power data in detail.
[0092] Then, the output of the self-attention mechanism is combined with the hidden state and normalized state Combined to form a comprehensive global state representation , which 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:
[0093]
[0094] in, are learnable parameters, Indicates a connection operation. is the query matrix, is the bond matrix, is a value matrix. is the global state representation, Represents the bond matrix dimension.
[0095] In order to more effectively utilize the local and global time series information provided by the BC-sLSTM model, the present invention optimizes the update process of memory units by combining the hidden unit outputs from the BC-sLSTM and the global state obtained by the self-attention mechanism through an information fusion strategy.
[0096] In order to effectively combine the local and global information obtained from BC-sLSTM and self-attention mechanism, the present invention transforms the hidden unit and global state Fusion to obtain memory information.
[0097] Specifically, the updated unit input, input gate, forget gate, and output gate expressions are as follows:
[0098]
[0099]
[0100]
[0101] Finally, the present invention effectively captures the spatiotemporal patterns of historical power data to predict future power demand. This method first converts historical data into high-dimensional features and then directly predicts the power consumption at the next moment through linear transformation.
[0102] Specifically, the power consumption at the next moment is predicted through linear transformation, including: The global state, spatial features, hidden state and normalized state are used as the input of the block channel network at the next moment to calculate the global state, spatial features, hidden state and normalized state at the next moment; The global states of all historical moments are converted into future electricity consumption predictions using linear transformation.
[0103] To optimize prediction accuracy and prevent gradient explosion, the L1 loss function is used to minimize the prediction error.
[0104]
[0105] in, represents all learnable parameters in the network, is the true value, is the time step The predicted values of all nodes at . The entire network is trained end-to-end.
[0106] like Figure 5As shown, the present invention also proposes a power consumption prediction system based on optimal scale convolution and graph memory enhancement, which is used in the above-mentioned power 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; The acquisition module is used to collect historical electricity consumption data of each node in 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 the pre-processed historical electricity consumption data to obtain the optimal scale spatial features; The nonlinear feature extraction module performs nonlinear feature adaptive extraction on the pre-processed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature mixing 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 extract the long-term correlation between the hidden state and the normalized state based on the self-attention mechanism to obtain the global state; The prediction module obtains the predicted power consumption through linear transformation according to the global state.
[0107] The beneficial effect of the present invention is that, compared with the existing technology, the present invention can effectively integrate local and global spatial dependencies and nonlinear characteristics, and can capture long-term and short-term time correlations, thereby achieving accurate power consumption prediction.
[0108] The present disclosure may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0109] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punched card or raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse passing through a fiber optic cable), or an electrical signal transmitted through an electrical wire.
[0110] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.
[0111] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state 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++, and conventional procedural programming languages such as "C" or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of 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, the state information of the computer-readable program instructions is used to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), so that the electronic circuit can execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.
[0112] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection 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: The steps include: Collect historical electricity consumption data of each node in the power network and preprocess the data to obtain preprocessed historical electricity consumption data; Perform spatial feature extraction on the pre-processed historical electricity consumption data to obtain the optimal scale spatial features; The nonlinear features of the pre-processed historical electricity consumption data are adaptively extracted through adaptive gated quadratic deformation convolution and feature mixing processing to obtain nonlinear features; Construct a block channel network to process the optimal scale space features and nonlinear features to obtain hidden states and normalized states; Based on the self-attention mechanism, the long-term correlation between the hidden state and the normalized state is extracted to obtain the global state, and the predicted power consumption is obtained through linear transformation based on the global state.
2. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1 is characterized in that: The collecting of historical power consumption data of each node in the power network and preprocessing the data to obtain preprocessed power consumption data specifically includes: The historical electricity consumption data of each node in the power network during the T period is collected and preprocessed to obtain the following historical electricity consumption data: Where t represents the current time, Indicates the time point after pretreatment The data vector at i∈[t,t ].
3. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1 is characterized in that: The spatial feature extraction of the pre-processed historical electricity consumption data to obtain the optimal scale spatial feature representation specifically includes: Construct a convolution kernel to perform one-dimensional convolution expansion processing on the preprocessed historical electricity consumption data to obtain the feature representation of each time point of the historical electricity consumption data; Combining the feature representation of historical electricity consumption data at each time point, different expansion factors are used to obtain the spatial local feature extraction results; Adaptive average pooling and convolution processing are performed on the pre-processed historical electricity consumption data to obtain spatial global feature extraction results; The spatial local feature extraction results and the spatial global feature extraction results are fused to obtain the optimal scale spatial feature representation.
4. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 3 is characterized in that: Construct a convolution kernel to perform one-dimensional convolution expansion on the preprocessed historical electricity consumption data to obtain the feature representation of each time point of the historical electricity consumption data, including: Set the convolution kernel length to k , Represents the convolution kernel in The weight of each position, i∈[1,k]; the pre-processed historical electricity consumption data is processed by one-dimensional convolution expansion: in, Indicates at a point in time The feature representation at Indicates at a point in time Subtract the expansion factor Multiply by the convolution kernel position index The corresponding input sequence element, Represents the expansion factor.
5. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 4 is characterized in that: The method combines the feature representation of each time point of the historical electricity consumption data and uses different expansion factors to obtain the spatial local feature extraction results, specifically including: The calculation formula for the spatial local feature extraction result is as follows: in, The time point after pretreatment The data vector at The corresponding spatial local feature extraction results, represents the set of all possible dilation factors, When the expansion factor for Time to time point The data vector at The output result after one-dimensional dilated convolution processing; Represents the linear normalization operation; ReLU() is the activation function, Indicates the time point after pretreatment The data vector at Take the expansion factor probability.
6. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 5 is characterized in that: Where, is the base of natural logarithms; is the inflation value function; is the total number of possible expansion factors The sum of the exponentials of .
7. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1 is characterized in that: The nonlinear features are adaptively extracted from the pre-processed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature mixing processing to obtain nonlinear features, specifically including: Constructing gating signals through two-dimensional convolution operations and activation functions : Among them, Conv2D represents a two-dimensional convolution operation; Sigmoid() is an activation function used to map any real value to the (0,1) interval. is the generated gating signal, Conv2D () is a two-dimensional convolution calculation, which means a two-dimensional convolution operation is performed on the input data. It is a feature map obtained by combining the spatial local feature extraction results and the spatial global feature extraction results along the specified dimension; Use the gate signal Gate to modulate the output of the deformed convolution to obtain nonlinear features : in, represents element-wise multiplication, It is the feature map adjusted by the gating mechanism. DefConv () is the deformable convolution operation.
8. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 1 is characterized in that: The block channel network is constructed to process the optimal scale space features and nonlinear features through a gating mechanism, specifically including: set up The time point after pretreatment The data vector at , calculate the spatial features ,in, and They are the optimal scale space features and nonlinear features respectively; The spatial features and the spatial characteristics The pre-processed historical electricity consumption data corresponding to the historical moment is 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 to store new information in the current input that needs to be included in the long-term memory. The candidate state generation unit is used to be controlled by the gating unit, thereby controlling the flow and update of information. Each unit processes spatial features through weight matrix and cyclic weight matrix The pre-processed historical electricity consumption data at the corresponding historical moment and the hidden state at the previous moment are processed by the activation function to generate three sets of gating signals, including forgetting gate signal, input gate signal and output gate signal; The forget gate signal controls the retention ratio of the historical state, and the input gate signal controls the update strength of the candidate state. The two work together to update the cell state and calculate the normalization factor. The output gate signal selects the cell state and normalization factor by weight, and outputs the hidden state and normalized state at the current moment.
9. The power consumption prediction method based on optimal scale convolution and graph memory enhancement according to claim 8 is characterized in that: The self-attention mechanism is used to extract the long-term correlation between the hidden state and the normalized state to obtain the global state, and the global state is linearly transformed to obtain the predicted power consumption, specifically including: The global state is obtained by extracting long-term correlation between the hidden state and the normalized state through the self-attention mechanism; The global states corresponding to all historical moments are combined to obtain a global state vector, and the global state vector is linearly transformed to obtain the predicted power consumption.
10. 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 according to any one of claims 1 to 9, characterized in that: include: Acquisition module, preprocessing module, spatial feature extraction module, nonlinear feature extraction module, correlation extraction module and prediction module; The acquisition module is used to collect historical electricity consumption data of each node in 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 the pre-processed historical electricity consumption data to obtain the optimal scale spatial features; The nonlinear feature extraction module performs nonlinear feature adaptive extraction on the pre-processed historical electricity consumption data through adaptive gated quadratic deformation convolution and feature mixing 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 extract the long-term correlation between the hidden state and the normalized state based on the self-attention mechanism to obtain the global state; The prediction module obtains the predicted power consumption through linear transformation according to the global state.
11. 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 execute the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Hyperspectral image classification method based on multi-scale spatial-spectral feature joint learning
CN114842264A
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