A Multi-Scale Short-Term Load Forecasting Method Based on Dynamic Spatiotemporal Graph Networks and Attention-Driven Approach
By using dynamic spatiotemporal graph networks and attention-driven multi-scale short-term load forecasting methods, the problem of not capturing the dynamic spatial correlation and multi-period patterns among load nodes is solved, achieving higher accuracy and robustness in load forecasting.
Patent Information
- Application Number
- CN202611327869.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-31
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2046-08-31
AI Technical Summary
Existing short-term load forecasting methods ignore the dynamic spatial correlation and multi-period patterns between load nodes, resulting in insufficient forecast accuracy and robustness. Traditional methods cannot adapt to the dynamic changes and regional differences in the contribution of different scales under different scenarios.
We employ a multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven approaches. By constructing a customizable multi-period framework, we dynamically build the spatiotemporal topology, introduce a multi-head spatiotemporal attention mechanism and an adaptive fusion strategy, capture the spatiotemporal coupling characteristics of load, and achieve multi-scale feature extraction and dynamic weight adjustment.
It improves the accuracy and robustness of short-term load forecasting, and can adapt to load changes in different regions and time periods, thereby enhancing the accuracy and generalization ability of forecasting.
Smart Images

Figure CN122839308B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of short-term load forecasting technology for power systems, and in particular to a multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven approaches. Background Technology
[0002] Short-term load forecasting is a crucial component of smart grid operation and dispatch, providing vital decision support for generation planning, reserve capacity allocation, demand-side response, and electricity market transactions. With the large-scale integration of distributed energy resources and the increasing complexity of electricity consumption behavior, the scale of electricity load data is constantly expanding, and the nonlinearity, high volatility, and spatiotemporal coupling characteristics of load fluctuations are becoming increasingly prominent. In this context, the accuracy and robustness of load forecasting are even more critical.
[0003] Existing short-term load forecasting methods typically use all historical data as a unified sequence input, allowing the network to implicitly learn the periodic patterns. This approach, considering only a single node or a single time dimension, ignores the dynamic spatial correlations between load nodes in different regions and the inherent multi-period superposition patterns (daily, weekly, monthly, etc.) in the load data, limiting the improvement of forecast accuracy. The daily, weekly, and monthly periodicities superimposed in power load data have different time spans and variation patterns—the daily cycle reflects intraday steady-state patterns, the weekly cycle reflects the behavioral differences between weekdays and weekends, and the monthly cycle depicts seasonal trends—these patterns have significantly different time scales, making it difficult for a single sequence model to accurately capture them simultaneously. In contrast, forecasting methods based on multi-period spatiotemporal fusion can better address the demand for high-precision load forecasting in complex power systems.
[0004] On the other hand, existing load forecasting methods based on graph neural networks usually rely on predefined static graph structures (such as node connections pre-defined based on geographical distance), but the spatial dependencies between nodes in the actual power grid are dynamic—differences in electricity consumption behavior in different seasons and at different times will cause changes in the strength of the association between nodes, and static graph structures cannot reflect this change.
[0005] Meanwhile, traditional load forecasting methods typically employ fixed weights or simple averaging strategies, which cannot adapt to the dynamic changes in the contribution of each scale under different scenarios. For example, daily cyclical patterns may dominate forecast results during weekdays, while the importance of weekly / monthly cyclical patterns increases significantly during holidays; fixed weights cannot be optimal in both scenarios simultaneously. Furthermore, load characteristics vary significantly across different regions, and fixed weights cannot reflect these regional differences.
[0006] Therefore, it is essential to propose a multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven approaches to improve the accuracy and robustness of short-term load forecasting. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven approaches. This method can simultaneously model multi-period time-series dependencies and dynamic spatial correlations, adaptively capture the spatiotemporal coupling characteristics of loads, and effectively address the problems of low prediction accuracy and poor robustness caused by single-scale modeling, static topology, and insufficient spatiotemporal dependency fusion in traditional models. This improves the accuracy and generalization ability of short-term load forecasting.
[0008] To achieve the above technical objectives, this invention provides the following technical solution: a multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods, comprising the following steps:
[0009] Historical load data is collected, a customizable multi-period framework is constructed, load node features are extracted from historical load data, and recent load sequences and multi-period dependency sequences are constructed, which are then constructed into a multi-scale spatiotemporal feature set. The multi-scale spatiotemporal feature set includes normalized load node features at each scale, including recent dependency scale, daily cycle scale, weekly cycle scale, and monthly cycle scale.
[0010] A dynamic graph learning module is constructed to build a normalized adjacency matrix for load nodes in historical load data;
[0011] Construct a multi-layer spatiotemporal convolutional block; the first spatiotemporal convolutional block takes the normalized load node features at each scale as input features, calculates the temporal attention weight matrix and spatial attention weight matrix, and constructs temporal features by combining them with the normalized adjacency matrix. After residual connection and normalization, it is used as the input features of the next spatiotemporal convolutional block. The temporal features at each scale output by the last spatiotemporal convolutional block are sent to the output projection layer at the corresponding scale to generate load prediction results at each scale.
[0012] An adaptive fusion module is constructed to fuse load forecast results at various scales and output a forecast load sequence.
[0013] The real load sequence corresponding to the predicted load sequence is extracted from historical load data. A loss function is constructed and a customizable multi-period framework, dynamic graph learning module, spatiotemporal convolutional block and adaptive fusion module are jointly trained. The trained customizable multi-period framework, dynamic graph learning module, spatiotemporal convolutional block and adaptive fusion module are used to perform short-term load prediction on the real-time collected load sequence.
[0014] Optionally, the step of extracting load node features from historical load data, constructing recent load sequences and multi-period dependent sequences, and then constructing a multi-scale spatiotemporal feature set includes:
[0015] Construct a forecast window of a preset length, and extract the recent load sequence preceding the forecast window from historical load data, mathematically represented as:
[0016] ;
[0017] in, Represents the recent load sequence; Indicates the first Load node characteristics at any given time; Indicates the length of the recent load sequence. A positive integer multiple of the factor. To predict the length of the window;
[0018] Constructing a multi-period dependent sequence, mathematically represented as:
[0019] ;
[0020] in, Indicates a multi-period dependent sequence; Indicates the first Load node characteristics at any given time; The sampling frequency; For periodic scale parameters, Corresponding to the daily cycle, Corresponding to the weekly cycle, Corresponding monthly cycle; It is a positive integer multiple factor;
[0021] The recent load sequence and the multi-period dependent sequence are normalized and then combined to obtain a multi-scale spatiotemporal feature set, mathematically represented as: ;
[0022] in, , , , These represent the recent load sequence, daily cycle-dependent sequence, weekly cycle-dependent sequence, and monthly cycle-dependent sequence after normalization, respectively.
[0023] Optionally, constructing a normalized adjacency matrix for load nodes in historical load data includes:
[0024] The FastDTW algorithm is used to calculate the temporal similarity of features of each load node in historical load data, generating an initial similarity matrix of load nodes. The initial similarity matrix Its elements Indicates the first load nodes With the The temporal similarity between the features of load nodes corresponding to each load node; the smaller the value, the higher the temporal similarity.
[0025] For the initial similarity matrix Introducing two learnable parameter matrices , With diagonal matrix Construct an adaptive similarity matrix, mathematically represented as:
[0026] ;
[0027] in, Represents the adaptive similarity matrix; Represents the ReLU activation function; This represents the element-wise multiplication operation; Indicates the transpose operation; Indicates that the diagonal element is diagonal matrix, Parameters to enhance node self-connection;
[0028] The initial similarity matrix With adaptive similarity matrix The input is concatenated along the channel dimension to form a dual-channel input, then convolved using a single-output-channel convolution kernel, followed by sigmoid activation to generate a similarity matrix and attention weights. ;
[0029] Attention weights based on similarity matrix For the initial similarity matrix fusion With adaptive similarity matrix The fusion matrix is obtained, and its mathematical representation is:
[0030] ;
[0031] in, Represents the fusion matrix;
[0032] For fusion matrix After performing symmetric normalization, we obtain the normalized adjacency matrix, which is mathematically represented as:
[0033] ;
[0034] in, Represents the normalized adjacency matrix; The degree matrix represents the diagonal elements. , Degree matrix of The power, i.e., the degree matrix Take the reciprocal of the square root of each diagonal element. , These are the row and column element indices in the normalized adjacency matrix, i.e., the load node indices in the historical load data; This represents a small constant that suppresses weak connections, with a range of values. .
[0035] Optionally, the spatiotemporal convolutional block includes a multi-head spatiotemporal attention module and a spectrum-building spatiotemporal convolutional module;
[0036] The multi-head spatiotemporal attention module constructs a temporal attention weight matrix and a spatial attention weight matrix of the input features based on a multi-head temporal attention network and a multi-head spatial attention network, and generates temporal attention weighted features.
[0037] The spectral spatiotemporal convolution module calculates the normalized Laplacian matrix of the normalized adjacency matrix and performs Chebyshev polynomial expansion, and then combines it with the spatial attention weight matrix at each scale to perform linear transformation and dilated temporal convolution on the temporal attention weighted features to generate temporal features at each scale.
[0038] The output projection layer is a fully connected layer structure.
[0039] Optionally, the step of constructing a temporal attention weight matrix and a spatial attention weight matrix of the input features based on a multi-head temporal attention network and a multi-head spatial attention network, and generating temporal attention weighted features, includes:
[0040] For each scale of the multi-scale spatiotemporal feature set, construct parallel multi-head temporal attention networks and multi-head spatial attention networks with the same number of attention heads;
[0041] For each attention head in a multi-head temporal attention network, the temporal attention matrix is calculated independently, and the mathematical representation of the calculation method is as follows:
[0042] ;
[0043] in, This indicates the first multi-head time attention network. The time attention matrix generated by each attention head; This represents the sigmoid activation function; Indicates the first The input features of the spatiotemporal convolutional block, when hour, For the normalized load node features in the multi-scale spatiotemporal feature set, when hour, For the first The temporal features generated by the layer spatiotemporal convolutional blocks are generated by residual connection and normalization to produce features; For multi-head time attention networks The output transformation matrix of each attention head is used to linearly reconstruct the attention score after sigmoid activation; For the first Spatial aggregation weights of individual attention heads are used to compress spatial information of input features; For the first Each attention head has a feature-node mapping matrix used to map the feature channel dimension to the load node space; For multi-head time attention networks Channel compression weights for each attention head are used to fuse multi-channel input features into a scalar; This is the time bias matrix;
[0044] For each attention head in a multi-head spatial attention network, the spatial attention matrix is calculated independently, and the mathematical representation of the calculation method is as follows:
[0045] ;
[0046] in, This indicates the first multi-head spatial attention network. The spatial attention matrix generated by each attention head; For multi-head spatial attention networks The output transformation matrix of each attention head is used to linearly reconstruct the attention score after sigmoid activation; For the first Temporal aggregation weights for each attention head are used to compress the temporal information of the input features; This is the feature-time mapping matrix, used to map the feature channel dimension to the time dimension; For multi-head time attention networks Channel compression weights for each attention head are used to fuse multi-channel input features into a scalar; This is the spatial bias matrix; Indicates the transpose operation;
[0047] The outputs of each attention head in the multi-head temporal attention network and the multi-head spatial attention network are fused using average pooling to obtain the fused temporal attention matrix and the fused spatial attention matrix, which are mathematically represented as follows:
[0048] ;
[0049] ;
[0050] in, , These represent the fusion of the temporal attention matrix and the fusion of the spatial attention matrix, respectively. This refers to the number of attention heads in a multi-head temporal attention network, which is equivalent to the number of attention heads in a multi-head spatial attention network.
[0051] The fused temporal attention matrix and the fused spatial attention matrix are respectively subjected to softmax normalization to obtain the temporal attention weight matrix and the spatial attention weight matrix.
[0052] The input features of the current spatiotemporal convolutional block are weighted using a temporal attention weight matrix to obtain temporal attention weighted features.
[0053] Optionally, the step of calculating the normalized Laplacian matrix of the normalized adjacency matrix and performing a Chebyshev polynomial expansion, and then combining it with the spatial attention weight matrices at each scale, to perform linear transformation and dilated temporal convolution on the temporal attention-weighted features to generate temporal features at each scale includes:
[0054] The process of calculating the Laplacian matrix from the normalized adjacency matrix, and then calculating the normalized Laplacian matrix, can be mathematically represented as follows:
[0055] ;
[0056] ;
[0057] in, , Let represent the Laplace matrix and the normalized Laplace matrix of the normalized adjacency matrix, respectively; Laplace matrix The largest eigenvalue; for An identity matrix of dimension 1; This represents the total number of load nodes in the historical load data.
[0058] Normalized Laplace matrix of normalized adjacency matrix Perform a Chebyshev polynomial expansion to obtain the Chebyshev polynomial terms. ,in The index of the order of the expanded polynomial;
[0059] Adding the Chebyshev polynomial terms to the normalized adjacency matrix, and then multiplying them element-wise by the spatial attention weight matrices at each scale, yields the dynamic modulation polynomial terms for each scale, mathematically represented as:
[0060] ;
[0061] in, Represents the dynamic modulation polynomial term; This represents the element-wise multiplication operation; Represents the spatial attention weight matrix;
[0062] The initial temporal features are obtained by linearly transforming and summing the time-attention weighted features at each scale based on the dynamic modulation polynomial term, followed by ReLU activation. The mathematical representation is as follows:
[0063] ;
[0064] in, Indicates the initial temporal characteristics; Represents the ReLU activation function; This represents the total number of orders of the polynomial being expanded. Indicates the transpose operation; The learnable parameter matrix representing the linear transformation; This represents time-attention-weighted features;
[0065] The initial temporal features are fed as input features into multiple 1D dilated temporal convolutional layers to extract temporal features at various scales, mathematically represented as:
[0066] ;
[0067] in, Indicates the first The output features of the first 1D dilated temporal convolutional layer and the output features of the last 1D dilated temporal convolutional layer are used as the temporal features; Indicates the discard layer; This represents a 1D dilated temporal convolution operation. Indicates used to Mapped to Same dimension Convolution operation; Indicates the first The output features of the 1D dilated temporal convolutional layer, i.e., the first... Input features of a 1D dilated temporal convolutional layer; , They represent the first Learnable weights and biases of a 1D dilated temporal convolutional layer; Indicates the expansion rate. For the first The dilation factor of a 1D dilated temporal convolutional layer; Indicates the fill rate. For the first The padding length of a 1D dilated temporal convolutional layer.
[0068] Optionally, the fusion of load forecast results at various scales to output a predicted load sequence includes:
[0069] An element-wise weighted fusion strategy is adopted, and a learnable fusion weight matrix is introduced to dynamically fuse load forecast results from various scales. Mathematically, this is expressed as:
[0070] ;
[0071] in, Represents the predicted load sequence; , , , These represent the load forecast results at the recent-term dependent scale, the daily cycle scale, the weekly cycle scale, and the monthly cycle scale, respectively. , , , These represent the learnable fusion weight matrices corresponding to the recent dependency scale, daily periodic scale, weekly periodic scale, and monthly periodic scale, respectively. This indicates an element-wise multiplication operation.
[0072] Optionally, the construction of the loss function involves joint training of the customizable multi-period framework, the dynamic graph learning module, the spatiotemporal convolutional block, and the adaptive fusion module, including:
[0073] Mean squared error (MSE) is used as the loss function;
[0074] The customizable multi-cycle framework, dynamic graph learning module, spatiotemporal convolutional block, and adaptive fusion module are updated through backpropagation and Adam optimizer iteration.
[0075] The present invention also provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods.
[0076] The present invention also provides a computer-readable storage medium storing computer instructions for causing a processor to execute the aforementioned multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods.
[0077] By employing the above technical solution, this invention provides a multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven approaches, which has at least the following beneficial effects:
[0078] (1) This invention constructs a customizable multi-period framework and extracts recent dependent daily, weekly and monthly multi-period time series features in parallel, effectively capturing the multi-scale periodicity of load; the constructed multi-scale spatiotemporal feature set includes feature information of load nodes at multiple scales, and then features are extracted and mapped independently for each scale. Each branch has completely independent learnable parameters (including the projection matrix of the attention mechanism, convolution kernel weights, output projection layers, etc.). The feature extractors of different period scales do not interfere with each other. The daily period branch does not have to "accommodate" the learning target of the monthly period branch, accurately matching the physical characteristics of the power load - the actual power load data shows the characteristics of short-term random fluctuations and long-term periodic patterns (daily, weekly and monthly), realizing accurate modeling of features at different scales;
[0079] (2) This invention constructs a dynamic graph learning module to dynamically build a spatiotemporal topology based on fastDTW similarity and learnable parameters. It does not rely on static priors such as geographical distance. Instead, it uses the FastDTW algorithm to calculate the temporal similarity between load nodes to construct the initial graph structure. It also introduces a learnable parameter matrix to generate a data-driven adaptive graph structure correction term through low-rank decomposition. Furthermore, it dynamically fuses the prior topology and the data-driven topology by calculating attention weights, so that the graph structure can continuously evolve during training. The low-rank constraints introduced by the learnable parameter matrix can automatically discover the implicit group structure between nodes without the need to predefine group labels or geographical proximity thresholds. This enables the capture of the spatial association between load nodes that changes dynamically over time, breaking through the limitation that static graphs cannot adapt to dynamic spatial associations and solving the problem that static graph structures cannot reflect dynamic spatial dependencies in existing methods.
[0080] (3) This invention constructs several layers of spatiotemporal convolutional blocks and introduces a multi-head spatiotemporal attention mechanism to screen key spatiotemporal features in parallel. The multi-head temporal attention network screens key moments, and the multi-head spatial attention network dynamically adjusts the influence between nodes, avoiding information loss caused by traditional cascaded processing methods. At the same time, it combines the spectral spatiotemporal convolution module to perform differentiated processing of time and space information, thereby achieving synchronous fusion of spatiotemporal features. Thus, different mathematical operations are deeply coordinated in the spectral convolutional layer to accurately capture the spatiotemporal coupling law of time period-determined association and topological constraint propagation in load data, and enhance the model's ability to model the spatiotemporal coupling characteristics of load, solving the problem of insufficient spatiotemporal feature fusion in existing methods and improving prediction accuracy.
[0081] (4) This invention constructs spectral spatiotemporal convolution modules independently for each scale, and combines Chebyshev spectral domain convolution with multi-layer dilated temporal convolution to efficiently integrate spatial correlation and temporal dependence; the method of not sharing the same set of convolutional layers and then processing by scale allows the network depth, receptive field and number of feature channels of each period scale to be set independently according to its corresponding period scale; at the same time, the Chebyshev polynomial terms, normalized adjacency matrix and spatial attention weight matrix are combined with each other. The Chebyshev polynomial terms provide the local filtering basis for spectral domain convolution, and the spatial attention weight matrix introduces the graph structure information updated by the dynamic graph learning module. The spatial attention weight matrix realizes the adaptive adjustment of the influence between nodes. This three-layer progressive spatial modeling method of prior topology, data-driven topology and attention dynamic modulation further enhances the utilization of spatial information, which is something that traditional feature extraction methods using graph convolution or attention mechanisms cannot achieve.
[0082] (5) The present invention designs an adaptive weighted fusion strategy to dynamically fuse multi-scale prediction results. By setting a learnable fusion weight matrix and optimizing it through gradient descent during training, the model can adaptively determine the optimal contribution ratio of each scale according to the data characteristics. At the same time, the weight matrix has the same dimension as the load prediction result, that is, each load node and each time has an independent fusion weight, which can reflect the differences in load change patterns in different regions and time periods, realize true differentiated fusion and node-level and time-level differentiated weighted fusion, adapt to the load fluctuation differences in different regions and time periods, and improve prediction accuracy.
[0083] (6) This invention solves the problems in the prior art where single-scale time series modeling cannot depict multi-period patterns, static graph structures are difficult to adapt to dynamic spatial correlations, and insufficient spatiotemporal feature fusion leads to insufficient prediction accuracy. It improves the accuracy, robustness and generalization ability of short-term load forecasting. It can be applied to both single-node load and regional aggregated load forecasting. It has important practical value and broad application prospects in scenarios such as smart grid dispatch optimization, demand-side management, and power market trading. Attached Figure Description
[0084] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0085] Figure 1 This is a flowchart illustrating the overall process of the multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven approaches of this invention.
[0086] Figure 2 This is an example diagram illustrating the recent dynamics, multi-period dependence, and load prediction of this invention;
[0087] Figure 3 This section compares the performance of the method of this invention with that of a representative baseline model in single load forecasting in three regions: Los Angeles, New York, and Texas.
[0088] Figure 4 This paper compares the performance of the method of this invention with that of a representative baseline model for single load forecasting of 15 households in the New York area.
[0089] Figure 5 This paper compares the performance of the method of this invention with that of a representative baseline model in predicting the load of 15 individual households in the Los Angeles area.
[0090] Figure 6 This study compares the performance of the method of this invention with that of a representative baseline model in predicting individual loads for 15 households in the Texas region.
[0091] Figure 7 This paper compares the performance of the method of the present invention with that of a representative baseline model in aggregate load prediction in three regions: Los Angeles, New York, and Texas.
[0092] Figure 8 The image shows the aggregated load prediction tracking curve of the method of this invention and a representative baseline model over a time segment. Detailed Implementation
[0093] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. This will allow for a full understanding of how the present application uses technical means to solve technical problems and achieve technical effects, and to facilitate its implementation.
[0094] Those skilled in the art will understand that all or part of the steps in the implementation of the methods of the embodiments can be implemented by a program instructing related hardware. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0095] Please refer to Figures 1-8This illustration demonstrates a specific implementation of this embodiment. This embodiment constructs a multi-scale spatiotemporal feature set including recent dependency scale, daily cycle scale, weekly cycle scale, and monthly cycle scale; extracts temporal attention weight matrices and spatial attention weight matrices respectively; performs expansion and fusion of the normalized Laplacian matrix based on Chebyshev polynomials to obtain temporal features; and constructs an adaptive fusion module to generate predicted load sequences. This effectively addresses the problems of low prediction accuracy and poor robustness caused by single-scale modeling, static topology, and insufficient spatiotemporal dependency fusion in traditional models, thereby improving the accuracy and generalization ability of short-term load prediction. The method of this invention is applicable to single-node load prediction and regional aggregated load prediction, with prediction step lengths including 1-hour, 2-hour, and 3-hour short-term load prediction scenarios.
[0096] Please refer to Figure 1 This embodiment proposes a multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods, which includes the following steps:
[0097] S1. Collect historical load data, construct a customizable multi-period framework, extract load node features from historical load data, construct recent load sequences and multi-period dependency sequences, and then construct a multi-scale spatiotemporal feature set; the multi-scale spatiotemporal feature set includes normalized load node features at each scale, including recent dependency scale, daily cycle scale, weekly cycle scale, and monthly cycle scale.
[0098] As a preferred embodiment of step S1, the specific process includes:
[0099] S11, Settings At the current moment, the prediction window length is The sampling frequency is (That is, one sampling point every hour; this can be adjusted according to the data frequency in practical applications). Extracting the recent load sequence before the forecast window from historical load data is mathematically represented as:
[0100] ;
[0101] in, Represents the recent load sequence; Indicates the first Load node characteristics at any given time; Indicates the length of the recent load sequence. A positive integer multiple of the factor. To predict the length of the window; It is the space of real numbers; The total number of load nodes in the historical load data (i.e., the total number of all load nodes in the region participating in the prediction, in this embodiment) ); The number of feature dimensions for a single load node (in this embodiment, we take...) , representing the power value dimension of the load node, therefore Indicates the first (Load node power values at any given time). Recent load sequences focus on short-term transient fluctuations, directly reflecting the immediate trend of load changes.
[0102] In this invention, a "load node" refers to a basic spatial unit in a power system that participates in load forecasting, including but not limited to single-family homes, substations, distribution transformers, industrial parks, or administrative divisions. In the experimental scenario of the OpenEI dataset, each load node corresponds to the hourly load power metering point of a single-family home.
[0103] S12. Construct a multi-period dependent sequence, mathematically represented as:
[0104] ;
[0105] in, Indicates a multi-period dependent sequence; Indicates the first Load node characteristics at any given time; The sampling frequency; For periodic scale parameters, Corresponding to the daily cycle, Corresponding to the weekly cycle, Corresponding monthly cycle; It is a positive integer multiple of the factor. Multi-period dependent sequences accurately depict the periodicity of load by aligning data from the same time period across different periods.
[0106] Figure 2 Examples are given for recent dynamics contained in recent load sequences, multi-period dependencies contained in multi-period dependent sequences (including weekly and daily periodicity), and load forecasts contained in predicted load sequences (unit: kilowatt-hour).
[0107] S13. Normalize the recent load sequence and the multi-period dependent sequence (Z-score normalization is used in this embodiment) to eliminate the influence of dimensions. Then, combine the load node features in the normalized recent load sequence and the multi-period dependent sequence to obtain a multi-scale spatiotemporal feature set, mathematically represented as: ;
[0108] in, , , , These represent the recent load sequence, daily cycle-dependent sequence, weekly cycle-dependent sequence, and monthly cycle-dependent sequence after normalization, respectively, with each branch sequence remaining independent and processed in parallel.
[0109] This invention constructs a customizable multi-period framework to extract recent dependencies and daily, weekly, and monthly multi-period time-series features in parallel, effectively capturing the multi-scale periodicity of load. The constructed multi-scale spatiotemporal feature set includes feature information of load nodes at multiple scales. Subsequently, feature extraction and mapping are performed independently for each scale, and each branch has completely independent learnable parameters (including the projection matrix of the attention mechanism, convolutional kernel weights, output projection layers, etc.). That is, the recent branch, daily periodic branch, weekly periodic branch, and monthly periodic branch are optimized independently. This means that feature extractors of different periodic scales do not interfere with each other, and the daily periodic branch does not have to accommodate the learning target of the monthly periodic branch. It accurately matches the physical characteristics of power load—actual power load data exhibits the characteristics of short-term random fluctuations and long-term periodic patterns (daily, weekly, and monthly), realizing accurate modeling of features at different scales.
[0110] S2. Construct a dynamic graph learning module to build a normalized adjacency matrix for load nodes in historical load data, thereby obtaining a dynamic spatiotemporal topology.
[0111] As a preferred embodiment of step S2, the specific process includes:
[0112] S21. Construct predefined branches, use the FastDTW algorithm to calculate the temporal similarity of the power values of each load node in the historical load data, and generate an initial similarity matrix. Initial similarity matrix Inner element Indicates load node With load nodes The temporal similarity between load node characteristics is denoted by a value; a smaller value indicates a higher temporal similarity.
[0113] S22. Construct adaptive branches for the initial similarity matrix. Introducing two learnable parameter matrices , With diagonal matrix Construct an adaptive similarity matrix, mathematically represented as:
[0114] ;
[0115] in, Represents the adaptive similarity matrix; Represents the ReLU activation function; This represents the element-wise multiplication operation; Indicates the transpose operation; Indicates that the diagonal element is diagonal matrix, Parameters for enhancing node self-connection. Learnable parameter matrix. , Through low-rank decomposition Generate a data-driven adaptive graph structure correction term to capture the initial similarity matrix. The implicit spatial dependencies not included in the data enable the model to adaptively learn dynamically evolving spatial topologies from the data. Node self-connection enhances parameters. For learnable parameters, Each self-connection enhancement parameter is learned independently to enhance the self-connection strength of each load node, ensuring that the basic information of the load node itself is preserved in the graph convolution, and preventing the model from over-relying on problematic connections and ignoring its own features when the similarity between load nodes is low or there is noise.
[0116] S23. The initial similarity matrix... With adaptive similarity matrix The input is concatenated along the channel dimension to form a dual-channel input, then convolved using a 1×1 convolution kernel with a single output channel, and finally activated by sigmoid to generate attention weights. merging the initial similarity matrix With adaptive similarity matrix This yields the fusion matrix, achieving a dynamic balance between prior topology and data-driven topology. This process can be mathematically represented as:
[0117] ;
[0118] in, This represents the fusion matrix.
[0119] S24, regarding the fusion matrix After performing symmetric normalization, we obtain the normalized adjacency matrix, which is mathematically represented as:
[0120] ;
[0121] in, Represents the normalized adjacency matrix; The degree matrix represents the diagonal elements. , Degree matrix of The power, i.e., the degree matrix Take the reciprocal of the square root of each diagonal element. ,when Time regulations Used for fusion matrix Symmetric normalization is performed to mitigate the impact of node degree differences and improve training stability; This represents a small constant that suppresses weak connections, with a range of values. In this embodiment, we take "Weak connection" refers to the fusion matrix. Medium weight value is lower than The node, through The connection weights below the threshold are reset to zero to achieve sparsity of the adjacency matrix and avoid excessive propagation of node features between irrelevant nodes.
[0122] This invention constructs a dynamic graph learning module that dynamically builds spatiotemporal topology based on FastDTW similarity and learnable parameters. It does not rely on static priors such as geographical distance, but instead uses the FastDTW algorithm to calculate the temporal similarity between load nodes to construct the initial graph structure. Furthermore, it introduces a learnable parameter matrix through low-rank decomposition. A data-driven adaptive graph structure correction term is generated. Furthermore, prior topology and data-driven topology are dynamically fused by calculating attention weights, so that the graph structure continues to evolve during training. The low-rank constraint introduced by the learnable parameter matrix can automatically discover the implicit group structure between nodes (such as node groups with similar electricity consumption patterns) without the need to predefine group labels or geographical proximity thresholds. This enables the capture of the spatial correlation between load nodes that changes dynamically over time, breaking through the limitation that static graphs cannot adapt to dynamic spatial correlations and solving the problem that static graph structures cannot reflect dynamic spatial dependencies in existing methods.
[0123] S3, Construction The spatiotemporal convolutional block includes a multi-head spatiotemporal attention module and a spectrum-building spatiotemporal convolutional module.
[0124] The first spatiotemporal convolutional block uses normalized load node features at various scales as input features, calculates the temporal attention weight matrix and spatial attention weight matrix, and constructs temporal features by combining them with the normalized adjacency matrix. After residual connection and normalization, these features are used as input features for the next spatiotemporal convolutional block. The last layer (the...) The temporal features of each scale output by the spatiotemporal convolutional block are fed into the corresponding scale output projection layer to generate load prediction results at each scale.
[0125] As a preferred embodiment of step S3, the specific process includes:
[0126] S31. Construct a multi-head spatiotemporal attention module. Based on the multi-head temporal attention network and the multi-head spatial attention network, construct the temporal attention weight matrix and the spatial attention weight matrix of the input features and generate temporal attention weighted features. Select key spatiotemporal features and suppress redundant information to enhance feature expression capabilities.
[0127] As a preferred embodiment of step S31, the specific process includes:
[0128] S311. For each scale of the multi-scale spatiotemporal feature set, construct parallel multi-head temporal attention networks and multi-head spatial attention networks with the same number of attention heads.
[0129] S312. Calculate the temporal attention matrix independently for each attention head of the multi-head temporal attention network. The mathematical representation of the calculation method is as follows:
[0130] ;
[0131] in, This indicates the first multi-head time attention network. The time attention matrix generated by each attention head; This represents the sigmoid activation function; Indicates the first The input features of the spatiotemporal convolutional block, when hour, For the normalized load node features in the multi-scale spatiotemporal feature set, when hour, For the first The temporal features generated by the layer spatiotemporal convolutional blocks are generated by residual connection and normalization to produce features; For multi-head time attention networks The output transformation matrix of each attention head is used to linearly reorganize the attention score after sigmoid activation, so that each attention head learns a temporal dependency pattern with different emphases. For the first The spatial aggregation weights of each attention head are used to compress the spatial information of the input features, extract the features of key load nodes, and form the attention query side representation. For the first The feature-node mapping matrix of each attention head is used to map the feature channel dimension to the load node space, so that each load node obtains a differentiated query representation; For multi-head time attention networks The channel compression weights of each attention head are used to fuse multi-channel input features into a scalar, forming an attention key-side representation, and... Combined with the calculation of temporal similarity; The time bias matrix provides an inductive bias for attention scores, encoding priors such as short-term inertia and long-distance information decay in adjacent time steps.
[0132] S313. Calculate the spatial attention matrix independently for each attention head of the multi-head spatial attention network. The mathematical representation of the calculation method is as follows:
[0133] ;
[0134] in, This indicates the first multi-head spatial attention network. The spatial attention matrix generated by each attention head has dimensions of . ; For multi-head spatial attention networks The output transformation matrix of each attention head is used to linearly reorganize the attention score after sigmoid activation, so that each attention head learns different spatial dependency patterns. For the first The temporal aggregation weights of individual attention points are used to compress the temporal information of input features, filter key moment features, and form a query-side representation. This is a feature-time mapping matrix used to map the feature channel dimension to the time dimension, enabling each time step to obtain a differentiated spatial query representation; For multi-head time attention networks The channel compression weights of each attention head are used to fuse multi-channel input features into a scalar, forming a key-side representation, and... In conjunction with the calculation of spatial correlation between load nodes; The spatial bias matrix provides an inductive bias for attention scores, encoding spatial proximity or electrical topology priors between nodes; This indicates the transpose operation.
[0135] In this embodiment, the number of attention heads in both the multi-head temporal attention network and the multi-head spatial attention network is set to 4.
[0136] S314. Perform average pooling to fuse the outputs of each attention head of the multi-head temporal attention network and the multi-head spatial attention network to obtain the fused temporal attention matrix and the fused spatial attention matrix, mathematically represented as follows:
[0137] ;
[0138] ;
[0139] in, , These represent the fusion of the temporal attention matrix and the fusion of the spatial attention matrix, respectively. This refers to the number of attention heads in a multi-head temporal attention network, which is equivalent to the number of attention heads in a multi-head spatial attention network.
[0140] S315. Perform softmax normalization on the fused temporal attention matrix and the fused spatial attention matrix respectively to obtain the temporal attention weight matrix. Spatial attention weight matrix .
[0141] S316. Use the time attention weight matrix to weight the features to obtain time attention weighted features.
[0142] This invention introduces a multi-head spatiotemporal attention mechanism to screen key spatiotemporal features in parallel rather than through cascaded processing (cascaded structures cause the first processed dimension to filter out the key information needed by subsequent dimensions). The multi-head temporal attention network screens key moments, while the multi-head spatial attention network dynamically adjusts the influence between nodes, avoiding the information loss caused by traditional cascaded processing methods. Subsequently, a spectral spatiotemporal convolution module is combined to perform differentiated processing on temporal and spatial information, thereby achieving synchronous fusion of spatiotemporal features. This allows for deep collaboration of different mathematical operations in the spectral convolutional layer, accurately capturing the spatiotemporal coupling laws of time-dependent correlations and topological constraint propagation in load data, and enhancing the model's ability to model the spatiotemporal coupling characteristics of load. This solves the problem of insufficient spatiotemporal feature fusion in existing methods and improves prediction accuracy.
[0143] S32. Construct a spectral spatiotemporal convolution module, calculate the normalized Laplacian matrix of the normalized adjacency matrix and perform Chebyshev polynomial expansion, and then combine it with the spatial attention weight matrix of each scale to perform linear transformation and dilated temporal convolution on the temporal attention weighted features to generate temporal features at each scale.
[0144] As a preferred embodiment of step S32, the specific process includes:
[0145] S321. For the normalized adjacency matrix Calculate the Laplace matrix Then, the normalized Laplace matrix is calculated, which is mathematically represented as:
[0146] ;
[0147] in, , Let represent the Laplace matrix and the normalized Laplace matrix of the normalized adjacency matrix, respectively; Laplace matrix The largest eigenvalue; for An identity matrix of dimension 1.
[0148] S322, Normalized Laplace matrix of the normalized adjacency matrix Perform a Chebyshev polynomial expansion to determine the total number of polynomial orders. We obtain the Chebyshev polynomial terms. The recursive formula is: ;
[0149] in For the order index of the expanded polynomial, It is an identity matrix.
[0150] S323, Transform the Chebyshev polynomial terms With normalized adjacency matrix The terms are added together and then multiplied element-wise by the spatial attention weight matrices at each scale to obtain the dynamic modulation polynomial terms at each scale, thus achieving the dynamic fusion of spatial topology and attention weights. Mathematically, this is expressed as:
[0151] ;
[0152] in, Represents the dynamic modulation polynomial term; This represents the element-wise multiplication operation; This represents the spatial attention weight matrix. The physical meaning of the addition operation in the above equation lies in the Chebyshev polynomial terms... Based on this, a normalized adjacency matrix is superimposed. This allows the dynamically modulated polynomial terms to retain the original graph topological information while incorporating graph structure information updated by the dynamic graph learning module, and to utilize the spatial attention weight matrix. This enables dynamic modulation of the influence between load nodes.
[0153] S324. Based on the dynamic modulation polynomial term, the time attention weighted features at each scale are linearly transformed and summed, and then activated by ReLU to obtain the initial time series features, mathematically represented as:
[0154] ;
[0155] in, Indicates the initial temporal characteristics; Represents the ReLU activation function; This represents the total number of orders of the polynomial being expanded. Indicates the transpose operation; The learnable parameter matrix representing the linear transformation; This represents the time-attention-weighted feature.
[0156] S325. The initial temporal features are processed using multi-layer 1D dilated temporal convolutions, combined with residual connections and dropout layers, to extract temporal features at various scales. Mathematically, this is expressed as:
[0157] ;
[0158] in, Indicates the first The output features of the first 1D dilated temporal convolutional layer and the output features of the last 1D dilated temporal convolutional layer are used as the temporal features. This indicates the discard layer; in this embodiment, the discard rate is set to 0.2. This represents a 1D dilated temporal convolution operation with a kernel size of [size missing]. , Indicates used to Mapped to Same dimension Convolution operation; Indicates the first The output features of the 1D dilated temporal convolutional layer, i.e., the first... Input features of a 1D dilated temporal convolutional layer; , They represent the first Learnable weights and biases of a 1D dilated temporal convolutional layer; Indicates the expansion rate. For the first The dilation factor of the 1D dilated temporal convolutional layer is set to ; Indicates the fill rate. For the first The padding length of the 1D dilated temporal convolutional layer is set to... .
[0159] The temporal features output from the last 1D dilated temporal convolutional layer corresponding to each scale are fed into independent output projection layers to obtain the load prediction results for each scale. The output projection layer of this invention adopts a fully connected layer structure.
[0160] This invention efficiently integrates spatial correlation and temporal dependency by independently constructing spectral spatiotemporal convolution modules for each scale, combining Chebyshev spectral domain convolution with multi-layer dilated temporal convolution. The method of not sharing the same set of convolutional layers before scale-based processing allows the network depth, receptive field, and number of feature channels at each periodic scale to be independently set according to its corresponding periodic scale. Simultaneously, the Chebyshev polynomial term, normalized adjacency matrix, and spatial attention weight matrix work together. The Chebyshev polynomial term provides the local filtering basis for spectral domain convolution, while the spatial attention weight matrix incorporates graph structure information updated by the dynamic graph learning module to adaptively adjust the influence between nodes. This three-layer progressive spatial modeling approach—prior topology, data-driven topology, and dynamic attention modulation—further enhances the utilization of spatial information, which is impossible to achieve with traditional feature extraction methods using graph convolution or attention mechanisms.
[0161] S4. Construct an adaptive fusion module to fuse the load forecast results at various scales and output the predicted load sequence.
[0162] As a preferred embodiment of step S4, the specific process includes:
[0163] An element-wise weighted fusion strategy is adopted, and a learnable fusion weight matrix is introduced to dynamically fuse load forecast results from various scales. Mathematically, this is expressed as:
[0164] ;
[0165] Among them, among them, Represents the predicted load sequence; , , , These represent the load forecast results at the recent-term dependent scale, the daily cycle scale, the weekly cycle scale, and the monthly cycle scale, respectively. , , , These represent the learnable fusion weight matrices corresponding to the recent dependency scale, daily periodic scale, weekly periodic scale, and monthly periodic scale, respectively. This indicates an element-wise multiplication operation. The output predicted load sequence has a dimension of... That is, the future of all nodes Load forecast values for each step (1, 2, or 3 hours).
[0166] This invention designs an adaptive weighted fusion strategy to dynamically fuse multi-scale prediction results. By setting a learnable fusion weight matrix and optimizing it through gradient descent during training, the model can adaptively determine the optimal contribution ratio for each scale based on data characteristics. Furthermore, unlike traditional multi-branch fusion strategies where each branch typically learns a global scalar weight, this invention sets a weight matrix with the same dimension as the load prediction result. This means each load node and each time point has an independent fusion weight, reflecting the differences in load variation patterns across different regions and time periods, achieving truly differentiated fusion: different fusion strategies are configured for different regions—nodes with large load fluctuations can be assigned higher weights to recently dependent branches to quickly respond to instantaneous changes, while nodes with strong regularity can be assigned higher weights to periodic branches to fully utilize periodic patterns. This achieves node-level and time-level differentiated weighted fusion, adapting to load fluctuation differences across different regions and time periods, and enabling accurate short-term load prediction. In addition, the learnable weights converge to the optimal fusion scheme during training. Even if the data distribution changes over time, the model can update the weights through retraining or fine-tuning, exhibiting good scenario adaptability.
[0167] S5. Extract the real load sequence corresponding to the predicted load sequence from the historical load data, construct a loss function, and jointly train the customizable multi-period framework, dynamic graph learning module, spatiotemporal convolutional block and adaptive fusion module. Use the trained customizable multi-period framework, dynamic graph learning module, spatiotemporal convolutional block and adaptive fusion module to perform short-term load prediction on the real-time collected load sequence.
[0168] As a preferred embodiment of step S5, the specific process includes:
[0169] Mean squared error (MSE) is used as the loss function.
[0170] The customizable multi-period framework, dynamic graph learning module, multi-head spatiotemporal attention module, spectral spatiotemporal convolution module, and adaptive fusion module are updated through backpropagation and Adam optimizer iteration.
[0171] During training, historical load data is sampled in batches, and feature alignment, graph learning, spatiotemporal attention calculation, spectral spatiotemporal convolution and feature fusion are performed sequentially until the model converges.
[0172] Next, experiments will be conducted to verify the effectiveness of the present invention.
[0173] This embodiment is based on experiments using a real OpenEI dataset. This dataset, released by the National Renewable Energy Laboratory (NREL), contains load data for major residential and commercial buildings across all climate zones in the United States, with a 1-hour resolution and 8760 data points per building. In the experiment, 15 adjacent buildings were randomly selected from each of the three regions of Los Angeles (LA), New York (NY), and Texas (TX) for single-point load forecasting and aggregated load forecasting (i.e., the hourly total power of all buildings in the same region). Data preprocessing employed standard normalization and divided the data into training, validation, and test sets at a ratio of 60%, 20%, and 20%, respectively.
[0174] In this embodiment, the mean absolute error Mean absolute percentage error (%) and root mean square error The selected evaluation metric, used for performance comparison based on the test set, is defined as follows:
[0175] ;
[0176] ;
[0177] ;
[0178] in, The first of the predicted load sequences generated by this method One predicted charge value, For the corresponding number The true value of each charge. This represents the total number of charge nodes in the generated predicted load sequence, i.e., the total number of test set samples. Calculation of the modulus length.
[0179] To verify the effectiveness of the proposed method (AMDSGN), five representative baseline models were selected for comparative experiments: Support Vector Regression (SVR), Feedforward Neural Network (FNN), Long Short-Term Memory Network (LSTM), Gated Recurrent Unit (GRU), and Spatiotemporal Attention Graph Convolutional Network (ASTGCN). All models were implemented using the PyTorch framework, and the total number of Chebyshev polynomial orders was [not specified]. After optimization, the value was determined to be 3.
[0180] Figure 3 The performance comparison of individual load forecasts in three regions—Los Angeles (LA), New York (NY), and Texas (TX)—is presented, showing the average MAE, average MAPE, and average RMSE of individual load forecasts from left to right. Figure 3 As can be seen, the AMDSGN proposed in this invention outperforms all baseline models in short-term load forecasting performance across all three regions.
[0181] Figure 4 , Figure 5 , Figure 6 The performance comparison of the method of this invention and the representative baseline model in predicting individual loads of 15 households in New York, Los Angeles and Texas is shown respectively. The figures from top to bottom are MAE, MAPE and RMSE of individual loads, and the horizontal axis House number represents the household number.
[0182] Figure 7 This shows a performance comparison of aggregate load forecasting in the three regions, from left to right: average MAE of aggregate load forecasting, average MAPE of aggregate load forecasting, and average RMSE of aggregate load forecasting. Figure 7 As can be seen, the AMDSGN of this invention also achieves the best results in aggregate load prediction.
[0183] Figure 8 The aggregated load prediction tracking curves of the method of this invention and the representative baseline model are displayed intuitively over time segments (the horizontal axis represents time, in hours). Figure 8 The upper side shows the aggregate load prediction tracking curve over a time span of 0-120 hours. Figure 8 The bottom section shows the aggregate load forecast tracking curve for the 55th-75th hour time span. From Figure 8It can be seen that the AMDSGN of the present invention exhibits the best tracking ability of the actual value for the load (unit: kW / h) predicted on both the rising and falling edges.
[0184] To verify the effectiveness of each module of the present invention, this embodiment further conducted ablation experiments. Three simplified models were designed:
[0185] STGN1: Removes the customizable multi-period framework and uses only a single period for forecasting;
[0186] STGN2: Removes the dynamic graph learning module and directly uses the initial similarity matrix calculated by fastDTW for static graph prediction;
[0187] STGN3: Removed multi-head spatiotemporal attention mechanism.
[0188] Table 1 below presents a performance comparison of the next hour's single load and aggregate load forecasts for five households in three regions: Los Angeles (LA), New York (NY), and Texas (TX).
[0189] Table 1. Performance comparison of single and aggregated load forecasts for five households in Los Angeles, New York, and Texas for the next hour.
[0190]
[0191] The ablation experiments described above show that: compared to single-cycle (STGN1), the complete multi-cycle framework of this invention reduces the MAE of a single load by 7.6% and the average MAE of aggregated loads by 13.6% in the New York area; the dynamic graph learning module of this invention (compared to STGN2) reduces the average RMSE of aggregated loads in the Los Angeles area from 2.7209 to 2.4241; the multi-head spatiotemporal attention mechanism of this invention (compared to STGN3) has the most significant impact, increasing the average MAE of aggregated loads in Los Angeles by 24.2% and the average RMSE of aggregated loads in New York by 40.6%. This demonstrates that each module of this invention significantly contributes to the predictive performance of loads.
[0192] This application also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods.
[0193] This application also provides a computer-readable storage medium storing computer instructions that enable a processor to execute the aforementioned multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods.
[0194] This invention solves the problems in existing technologies, such as the inability of single-scale temporal modeling to depict multi-period patterns, the difficulty of adapting static graph structures to dynamic spatial correlations, and insufficient prediction accuracy due to inadequate spatiotemporal feature fusion. Five modules (customizable multi-period framework, dynamic graph learning module, multi-head spatiotemporal attention module, spectral spatiotemporal convolution module, and adaptive fusion module) form a complete prediction process of decomposition → modeling → fusion. The customizable multi-period framework is responsible for data decomposition, the dynamic graph learning module, multi-head spatiotemporal attention module, and spectral spatiotemporal convolution module are responsible for feature modeling, and the adaptive fusion module is responsible for result integration. There is a clear logical progression relationship between the modules, and they work together to form a mutually synergistic organic whole.
[0195] This invention improves the accuracy, robustness, and generalization ability of short-term load forecasting. It can be applied to both single-node load and regional aggregated load forecasting, and has significant practical value and broad application prospects in scenarios such as smart grid dispatch optimization, demand-side management, and electricity market trading.
[0196] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.
[0197] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0198] The above embodiments provide a detailed description of the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven approaches, characterized in that, include: Historical load data is collected, a customizable multi-period framework is constructed, load node features are extracted from historical load data, recent load sequences and multi-period dependent sequences are constructed, and then a multi-scale spatiotemporal feature set is constructed. The multi-scale spatiotemporal feature set includes normalized load node features at each scale, including recent dependency scale, daily cycle scale, weekly cycle scale, and monthly cycle scale. A dynamic graph learning module is constructed to build a normalized adjacency matrix for load nodes in historical load data; Construct a multi-layer spatiotemporal convolutional block; the first spatiotemporal convolutional block takes the normalized load node features at each scale as input features, calculates the temporal attention weight matrix and spatial attention weight matrix, and constructs temporal features by combining them with the normalized adjacency matrix. After residual connection and normalization, it is used as the input features of the next spatiotemporal convolutional block. The temporal features at each scale output by the last spatiotemporal convolutional block are sent to the output projection layer at the corresponding scale to generate load prediction results at each scale. An adaptive fusion module is constructed to fuse load forecast results at various scales and output a forecast load sequence. The real load sequence corresponding to the predicted load sequence is extracted from historical load data. A loss function is constructed and a customizable multi-period framework, dynamic graph learning module, spatiotemporal convolutional block and adaptive fusion module are jointly trained. The trained customizable multi-period framework, dynamic graph learning module, spatiotemporal convolutional block and adaptive fusion module are used to perform short-term load prediction on the real-time collected load sequence.
2. The multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods according to claim 1, characterized in that: The process of extracting load node features from historical load data, constructing recent load sequences and multi-period dependent sequences, and then constructing a multi-scale spatiotemporal feature set includes: Construct a forecast window of a preset length, and extract the recent load sequence preceding the forecast window from historical load data, mathematically represented as: ; in, Represents the recent load sequence; Indicates the first Load node characteristics at any given time; Indicates the length of the recent load sequence. A positive integer multiple of the factor. To predict the length of the window; Constructing a multi-period dependent sequence, mathematically represented as: ; in, Indicates a multi-period dependent sequence; Indicates the first Load node characteristics at any given time; The sampling frequency; For periodic scale parameters, Corresponding to the daily cycle, Corresponding to the weekly cycle, Corresponding monthly cycle; It is a positive integer multiple factor; The recent load sequence and the multi-period dependent sequence are normalized and then combined to obtain a multi-scale spatiotemporal feature set, mathematically represented as: ,in, , , , These represent the recent load sequence, daily cycle-dependent sequence, weekly cycle-dependent sequence, and monthly cycle-dependent sequence after normalization, respectively.
3. The multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods according to claim 1, characterized in that: The construction of a normalized adjacency matrix for load nodes in historical load data includes: The FastDTW algorithm is used to calculate the temporal similarity of features of each load node in historical load data, generating an initial similarity matrix of load nodes. The initial similarity matrix Its elements Indicates the first load nodes With the The temporal similarity between the features of load nodes corresponding to each load node is such that the smaller the value, the higher the temporal similarity. For the initial similarity matrix Introducing two learnable parameter matrices , With diagonal matrix Construct an adaptive similarity matrix, mathematically represented as: ; in, Represents the adaptive similarity matrix; Represents the ReLU activation function; This represents the element-wise multiplication operation; Indicates the transpose operation; Indicates that the diagonal element is diagonal matrix, Parameters to enhance node self-connection; The initial similarity matrix With adaptive similarity matrix The input is concatenated along the channel dimension to form a dual-channel input, then convolved using a single-output-channel convolution kernel, followed by sigmoid activation to generate a similarity matrix and attention weights. ; Attention weights based on similarity matrix For the initial similarity matrix fusion With adaptive similarity matrix The fusion matrix is obtained, and its mathematical representation is: ; in, Represents the fusion matrix; For fusion matrix After performing symmetric normalization, we obtain the normalized adjacency matrix, which is mathematically represented as: ; in, Represents the normalized adjacency matrix; The degree matrix represents the diagonal elements. , Degree matrix of The power, i.e., the degree matrix Take the reciprocal of the square root of each diagonal element. , These are the row and column element indices in the normalized adjacency matrix, i.e., the load node indices in the historical load data; This represents a small constant that suppresses weak connections, with a range of values. .
4. The multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods according to claim 3, characterized in that: The spatiotemporal convolutional block includes a multi-head spatiotemporal attention module and a spectrum-building spatiotemporal convolutional module; The multi-head spatiotemporal attention module constructs a temporal attention weight matrix and a spatial attention weight matrix of the input features based on a multi-head temporal attention network and a multi-head spatial attention network, and generates temporal attention weighted features. The spectral spatiotemporal convolution module calculates the normalized Laplacian matrix of the normalized adjacency matrix and performs Chebyshev polynomial expansion, and then combines it with the spatial attention weight matrix at each scale to perform linear transformation and dilated temporal convolution on the temporal attention weighted features to generate temporal features at each scale. The output projection layer is a fully connected layer structure.
5. The multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods according to claim 4, characterized in that: The process of constructing temporal attention weight matrices and spatial attention weight matrices for input features based on multi-head temporal attention networks and multi-head spatial attention networks, and generating temporal attention weighted features, includes: For each scale of the multi-scale spatiotemporal feature set, construct parallel multi-head temporal attention networks and multi-head spatial attention networks with the same number of attention heads; For each attention head in a multi-head temporal attention network, the temporal attention matrix is calculated independently, and the mathematical representation of the calculation method is as follows: ; in, This indicates the first multi-head time attention network. The time attention matrix generated by each attention head; This represents the sigmoid activation function; Indicates the first The input features of the spatiotemporal convolutional block, when hour, For the normalized load node features in the multi-scale spatiotemporal feature set, when hour, For the first The temporal features generated by the layer spatiotemporal convolutional blocks are generated by residual connection and normalization to produce features; For multi-head time attention networks The output transformation matrix of each attention head is used to linearly reconstruct the attention score after sigmoid activation; For the first Spatial aggregation weights of individual attention heads are used to compress spatial information of input features; For the first Each attention head has a feature-node mapping matrix used to map the feature channel dimension to the load node space; For multi-head time attention networks Channel compression weights for each attention head are used to fuse multi-channel input features into a scalar; This is the time bias matrix; For each attention head in a multi-head spatial attention network, the spatial attention matrix is calculated independently, and the mathematical representation of the calculation method is as follows: ; in, This indicates the first multi-head spatial attention network. The spatial attention matrix generated by each attention head; For multi-head spatial attention networks The output transformation matrix of each attention head is used to linearly reconstruct the attention score after sigmoid activation; For the first Temporal aggregation weights for each attention head are used to compress the temporal information of the input features; This is the feature-time mapping matrix, used to map the feature channel dimension to the time dimension; For multi-head time attention networks Channel compression weights for each attention head are used to fuse multi-channel input features into a scalar; This is the spatial bias matrix; Indicates the transpose operation; The outputs of each attention head in the multi-head temporal attention network and the multi-head spatial attention network are fused using average pooling to obtain the fused temporal attention matrix and the fused spatial attention matrix, which are mathematically represented as follows: ; ; in, , These represent the fusion of the temporal attention matrix and the fusion of the spatial attention matrix, respectively. This refers to the number of attention heads in a multi-head temporal attention network, which is equivalent to the number of attention heads in a multi-head spatial attention network. The fused temporal attention matrix and the fused spatial attention matrix are respectively subjected to softmax normalization to obtain the temporal attention weight matrix and the spatial attention weight matrix. The input features of the current spatiotemporal convolutional block are weighted using a temporal attention weight matrix to obtain temporal attention weighted features.
6. The multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods according to claim 4, characterized in that: The process involves calculating the normalized Laplacian matrix of the normalized adjacency matrix and performing a Chebyshev multinomial expansion, then combining it with the spatial attention weight matrices at each scale. This is followed by linear transformation and dilated temporal convolution of the temporal attention-weighted features to generate temporal features at each scale, including: The process of calculating the Laplacian matrix from the normalized adjacency matrix, and then calculating the normalized Laplacian matrix, can be mathematically represented as follows: ; ; in, , Let represent the Laplace matrix and the normalized Laplace matrix of the normalized adjacency matrix, respectively; Laplace matrix The largest eigenvalue; for An identity matrix of dimension 1; This represents the total number of load nodes in the historical load data. Normalized Laplace matrix of normalized adjacency matrix Perform a Chebyshev polynomial expansion to obtain the Chebyshev polynomial terms. ,in The index of the order of the expanded polynomial; Adding the Chebyshev polynomial terms to the normalized adjacency matrix, and then multiplying them element-wise by the spatial attention weight matrices at each scale, yields the dynamic modulation polynomial terms for each scale, mathematically represented as: ; in, Represents the dynamic modulation polynomial term; This represents the element-wise multiplication operation; Represents the spatial attention weight matrix; The initial temporal features are obtained by linearly transforming and summing the time-attention weighted features at each scale based on the dynamic modulation polynomial term, followed by ReLU activation. The mathematical representation is as follows: ; in, Indicates the initial temporal characteristics; Represents the ReLU activation function; This represents the total number of orders of the polynomial being expanded. Indicates the transpose operation; The learnable parameter matrix representing the linear transformation; This represents time-attention-weighted features; The initial temporal features are fed as input features into multiple 1D dilated temporal convolutional layers to extract temporal features at various scales, mathematically represented as: ; in, Indicates the first The output features of the first 1D dilated temporal convolutional layer and the output features of the last 1D dilated temporal convolutional layer are used as the temporal features; Indicates the discard layer; This represents a 1D dilated temporal convolution operation. Indicates used to Mapped to Same dimension Convolution operation; Indicates the first The output features of the 1D dilated temporal convolutional layer, i.e., the first... Input features of a 1D dilated temporal convolutional layer; , They represent the first Learnable weights and biases of a 1D dilated temporal convolutional layer; Indicates the expansion rate. For the first The dilation factor of a 1D dilated temporal convolutional layer; Indicates the fill rate. For the first The padding length of a 1D dilated temporal convolutional layer.
7. The multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods according to claim 1, characterized in that: The process of fusing load forecast results at various scales to output a predicted load sequence includes: An element-wise weighted fusion strategy is adopted, and a learnable fusion weight matrix is introduced to dynamically fuse load forecast results from various scales. Mathematically, this is expressed as: ; in, Represents the predicted load sequence; , , , These represent the load forecast results at the recent-term dependent scale, the daily cycle scale, the weekly cycle scale, and the monthly cycle scale, respectively. , , , These represent the learnable fusion weight matrices corresponding to the recent dependency scale, daily periodic scale, weekly periodic scale, and monthly periodic scale, respectively. This indicates an element-wise multiplication operation.
8. The multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods according to claim 1, characterized in that: The loss function is constructed by jointly training the customizable multi-period framework, dynamic graph learning module, spatiotemporal convolutional block, and adaptive fusion module, including: Mean squared error (MSE) is used as the loss function; The customizable multi-cycle framework, dynamic graph learning module, spatiotemporal convolutional block, and adaptive fusion module are updated through backpropagation and Adam optimizer iteration.
9. An electronic device, characterized in that, The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the multi-scale short-term load forecasting method based on dynamic spatiotemporal graph networks and attention-driven methods as described in any one of claims 1-8.
Citation Information
Patent Citations
Road traffic safety prediction method based on dynamic graph attention space-time network
CN117746628A
Deep neural network-based IES multi-element load short-term joint prediction method
CN117878916A
