Short-term power load prediction method and system based on spatiotemporal graph attention

CN116703000BActive Publication Date: 2026-08-07STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID HUNAN ELECTRIC POWER COMPANY LIMITED
Filing Date
2023-06-26
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

但是,基于机理模型的负荷预测方法,其在使用时具有极大的局限性,在预测前需要了解负荷预测结果与其驱动因素之间的对应关系,并明确对应的模型类型;因此,这类方案在使用时,适用范围较小,而且方案较为复杂

Benefits of technology

[0055]本发明提供的这种基于时空图注意力的短期电力负荷预测方法及系统,基于k近邻网络构建技术,解决了在多变量时序分析中图建模时存在的过平滑或冗余的问题,同时提出时空图神经网络的架构,动态地同时捕捉用户的电力负荷间的耦合关系和各个用户的电力负荷在时间维度上的非线性关系;因此本发明不仅能够进行用户的电力负荷短期预测,而且可靠性高、精确性好且客观科学。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116703000B_ABST
    Figure CN116703000B_ABST
Patent Text Reader

Abstract

The application discloses a kind of short-term power load prediction methods based on space-time graph attention, including obtaining the historical power load data information of target area and processing to obtain power consumption dataset;Short-term power load prediction initial model is constructed and short-term power load prediction model is trained;Based on short-term power load prediction model, short-term power load prediction based on space-time graph attention is completed.The application also discloses a kind of system for implementing the short-term power load prediction method based on space-time graph attention.The application is based on k near neighbor network construction technology, solves the problem of oversmoothing or redundancy when graph modeling in multivariate time series analysis, while proposing the architecture of space-time graph neural network, dynamically capturing the coupling relationship between the power load of user and the nonlinear relationship of each user's power load in time dimension;Therefore, the application not only can carry out the short-term prediction of the power load of user, but also has high reliability, good accuracy and objectivity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electrical automation, and specifically relates to a short-term power load forecasting method and system based on spatiotemporal graph attention. Background Technology

[0002] With economic and technological development and the improvement of people's living standards, electricity has become an indispensable secondary energy source in people's production and daily life, bringing endless convenience. Therefore, ensuring a stable and reliable supply of electricity has become one of the most important tasks of the power system.

[0003] Currently, with the large-scale grid connection of new energy power generation systems, the power system faces unprecedented challenges. For the power system, stable and reliable load forecasting results can effectively help in formulating dispatch and operation plans, thereby ensuring the stable and reliable operation of the power system. Therefore, load forecasting is an important prerequisite for the safe and stable operation of the power system and is of paramount importance.

[0004] Existing power load forecasting generally relies on historical load data and employs classic mechanistic model-based forecasting methods or machine learning-based methods to predict short-term power system load. However, mechanistic model-based load forecasting methods have significant limitations. Before forecasting, it is necessary to understand the correspondence between the load forecast results and their driving factors, and to clearly define the corresponding model type. Therefore, this type of approach has a limited scope of application and is quite complex. Machine learning-based methods, on the other hand, construct a causal feature set for the forecast results through feature engineering, use an appropriate loss function, and train the model to obtain a time-series forecasting model. While this approach achieves static modeling and forecasting, it only considers information at a single time scale and does not explore the dynamic dependencies between multivariate time-series data. Therefore, the reliability and accuracy of this type of approach are relatively poor. Summary of the Invention

[0005] One of the objectives of this invention is to provide a short-term power load forecasting method based on spatiotemporal graph attention that is highly reliable, accurate, and objective.

[0006] A second objective of this invention is to provide a system for implementing the aforementioned short-term power load forecasting method based on spatiotemporal graph attention.

[0007] The short-term power load forecasting method based on spatiotemporal graph attention provided by this invention includes the following steps:

[0008] S1. Obtain historical power load data for the target area;

[0009] S2. Process the data information obtained in step S1 to obtain the electricity consumption dataset;

[0010] S3. Based on the k-nearest neighbor network construction method and spatiotemporal graph attention technique, an initial model for short-term power load forecasting is constructed.

[0011] S4. Using the electricity consumption dataset constructed in step S2, train the initial short-term power load forecasting model constructed in step S3 to obtain the short-term power load forecasting model.

[0012] S5. Based on the short-term power load forecasting model obtained in step S4, complete the short-term power load forecasting based on spatiotemporal graph attention.

[0013] Step S2 involves processing the data obtained in step S1 to obtain an electricity consumption dataset, specifically including the following steps:

[0014] For the historical power load data of the target area obtained in step S1, a sliding window with a set window size and a set step size is used to sum the historical power load data, thereby obtaining the hourly power load of the target area.

[0015] The obtained data is then divided into a training set and a test set. The training set is used to train the model, and the test set is used to test the trained model. Together, the training set and the test set constitute the electricity consumption dataset.

[0016] Step S3, which describes the construction of an initial model for short-term power load forecasting based on the k-nearest neighbor network construction method and spatiotemporal graph attention technique, specifically includes the following steps:

[0017] The constructed initial model for short-term power load forecasting includes a graph structure construction module and a spatiotemporal graph attention module;

[0018] The graph structure building module is used to build a static graph structure for multivariate time series data in a target region based on the k-nearest neighbor network construction method.

[0019] The spatiotemporal graph attention module is used to predict the load of a target region based on spatiotemporal graph attention technology and a constructed static graph.

[0020] The graph structure construction module specifically includes the following:

[0021] The similarity between any two electricity users is calculated using the electricity consumption dataset obtained in step S2, using the following formula:

[0022] S ij =X i ·(X j ) T

[0023] In the formula S ij X represents the similarity value between electricity user i and electricity user j; i X is the electricity consumption data matrix for user i; j Let T be the electricity consumption data matrix for electricity user j; T is the transpose of the matrix.

[0024] The calculated similarity values ​​among all electricity users are normalized to obtain the similarity matrix S.

[0025] Set an initial value for the neighbor number k; and obtain a completely disconnected graph structure A;

[0026] The value of the nearest neighbor k is increased from the initial value to the total number of electricity users according to a set step size. During the increase, the corresponding network average consistency estimate h and average clustering coefficient ACC are calculated using the following formulas for each increase, and finally the curves h(k) and ACC(k) are obtained:

[0027]

[0028]

[0029] In the formula, N is the total number of electricity users; i0 is the initial value of the neighbor number k; k i Let k be the current value of the nearest neighbor k; E(i) be the value of node v in the current graph structure A. i k i The actual number of edges between adjacent nodes; (dis ij ) min For node v i to node v j The minimum distance between them;

[0030] Based on the obtained curve h(k) for h value and curve ACC(k) for ACC value, take the value of the nearest neighbor k corresponding to the intersection point of curve h(k) and curve ACC(k) as the final nearest neighbor value kk.

[0031] Based on the nearest neighbor value k, the graph structure A is constructed using the following formula:

[0032]

[0033] In the formula A(v i ,v j ) represents node v i and node v j Connection status, A(v) i ,v j ) = 1 indicates that node v i and node v j Connected, A(v) i ,vj ) = 0 indicates that node v i and node v j Disconnect; Neigh kk (v i ) represents the distance from node v i The set of the k nearest nodes;

[0034] Finally, for each node, two other nodes that are not connected to the current node are randomly selected and connected with a set probability p to complete the construction of graph structure A.

[0035] The aforementioned spatiotemporal graph attention module specifically includes the following content:

[0036] The spatiotemporal graph attention module includes temporal convolutional layers, spatial convolutional layers, and fully connected layers;

[0037] Temporal convolutional layers consist of a DCCN network, gated linear units, and residual modules;

[0038] The DCCN network employs a CNN network with holes, which can expand the field of view of the convolutional kernels without increasing the network parameters; the process of expanding the convolution is represented as:

[0039]

[0040] In the formula, F(t) represents the result after performing dilation and convolution on the input data x; x is the input time series data; * D To expand the convolution kernel; k is the size of the convolution kernel; f(i) is the kernel weight; x t-dr·i Historical data; dr is the inflation ratio;

[0041] The formula for calculating the temporal convolutional layer is as follows:

[0042] X GDCCN =((X*) D f)* G W G +b G )⊙σ((X* D f)* G V G +c G )

[0043] In the formula X GDCCN X is the output of the temporal convolutional layer; X is the input of the temporal convolutional layer; * D To expand the convolution kernel;* G For gated convolution; W G b is the first parameter to be learned. G The second parameter to be learned; ⊙ is the Hadamard product; σ is the ReLU function; V G c is the third parameter to be learned.G The fourth parameter to be learned;

[0044] The spatial convolutional layer includes a node attention layer and a graph convolutional layer; the calculation formula for the spatial convolutional layer is expressed as follows:

[0045]

[0046] In the formula X GCN This is the output matrix of the spatial convolutional layer; Let U be the eigenvalue matrix corresponding to the Laplace matrix of adjacency matrix A, and U be the eigenvector corresponding to the Laplace matrix of adjacency matrix A; K is the Chebyshev order; W ChebyNet These are the parameters to be learned; For use The Chebyshev polynomials calculated; X NA Let X be the input matrix of the spatial convolutional layer and X NA =Att DC ⊙F ex (x q W SENet )·X GDCCN Att DC Attention guided by degree centrality calculated based on node embeddings and softmax() is the logistic regression function, DC() is the degree centrality calculation function, and ReLU() is the activation function. E1 is the sixth parameter to be learned, and E1 is the first randomly initialized node embedding. Let E2 be the seventh parameter to be learned, and E2 be the node embedding of the first randomly initialized node. DC F is the bias vector. ex () is an intermediate function and F ex (x q W SENet The formula for calculating F is F ex (x q W SENet )=σ(W2 SENet σ(W1 SENet x q )), σ is the ReLU function, W2 SENet W1 is the eighth parameter to be learned. SENet W is the ninth parameter to be learned. SENet It is an intermediate parameter and includes W1. SENet and W2 SENet X GDCCN x is the output of the temporal convolutional layer. q X is the output of the temporal convolutional layer. GDCCN The result obtained after compression excitation module and the calculation formula is: TS represents the time length of the network input data, and x(1,t) represents the data of N nodes at time t;

[0047] The load data is input into the temporal convolutional layer to obtain the output of the temporal convolutional layer; then the constructed graph structure A and the output of the temporal convolutional layer are input into the spatial convolutional layer together, and the potential similarity of the user data is used to couple them to obtain the output of the spatial convolutional layer.

[0048] Repeat the above steps several times, and finally use a fully connected layer to read out the power load data of the user data to obtain the prediction results of the user's electricity consumption data.

[0049] The training described in step S4 specifically includes the following steps:

[0050] The following function is used as the loss function during the training process:

[0051]

[0052] In the formula, n is the total number of training data; Y is the true value; This is a predicted value;

[0053] During training, the Adam optimization algorithm is used to calculate the network error gradient for each parameter in backpropagation, and new network parameters are obtained through the parameter update process. The weights of the network parameters are iteratively calculated until the predetermined minimum loss is reached and the best prediction value is obtained.

[0054] This invention also provides a system for implementing the aforementioned short-term power load forecasting method based on spatiotemporal graph attention, comprising a data acquisition module, a data processing module, a model building module, a model training module, and a load forecasting module; the data acquisition module, data processing module, model building module, model training module, and load forecasting module are connected in series; the data acquisition module is used to acquire historical power load data information of the target area and upload the data to the data processing module; the data processing module is used to process the received data information to obtain a power consumption dataset and upload the data to the model building module; the model building module is used to construct an initial short-term power load forecasting model based on the received data, using the k-nearest neighbor network construction method and spatiotemporal graph attention technology, and upload the data to the model training module; the model training module is used to train the initial short-term power load forecasting model using the received data and the power consumption dataset to obtain a short-term power load forecasting model and upload the data to the load forecasting module; the load forecasting module is used to complete the short-term power load forecasting based on the received data and the obtained short-term power load forecasting model.

[0055] The short-term power load forecasting method and system based on spatiotemporal graph attention provided by this invention solves the problems of oversmoothing or redundancy in graph modeling in multivariate time series analysis by using k-nearest neighbor network construction technology. At the same time, it proposes a spatiotemporal graph neural network architecture to dynamically capture the coupling relationship between users' power loads and the nonlinear relationship of each user's power load in the time dimension. Therefore, this invention can not only perform short-term forecasting of users' power loads, but also has high reliability, good accuracy and objective scientific nature. Attached Figure Description

[0056] Figure 1 This is a schematic diagram of the method flow of the present invention.

[0057] Figure 2 This is a schematic diagram of the functional modules of the system of the present invention. Detailed Implementation

[0058] like Figure 1 The diagram shown is a flowchart of the method of the present invention: The short-term power load forecasting method based on spatiotemporal graph attention provided by the present invention includes the following steps:

[0059] S1. Obtain historical power load data for the target area;

[0060] S2. Process the data information obtained in step S1 to obtain the electricity consumption dataset; specifically, this includes the following steps:

[0061] For the historical power load data of the target area obtained in step S1, a sliding window with a set window size and a set step size is used to sum the historical power load data, thereby obtaining the hourly power load of the target area.

[0062] Then, the obtained data is divided into a training set and a test set. The training set is used to train the model, and the test set is used to test the trained model. Together, the training set and the test set constitute the electricity consumption dataset.

[0063] S3. Based on the k-nearest neighbor network construction method and spatiotemporal graph attention technique, construct an initial model for short-term power load forecasting; specifically, the following steps are included:

[0064] The constructed initial model for short-term power load forecasting includes a graph structure construction module and a spatiotemporal graph attention module;

[0065] The graph structure building module is used to build a static graph structure for multivariate time series data in a target region based on the k-nearest neighbor network construction method.

[0066] The spatiotemporal graph attention module is used to predict the load of a target region based on spatiotemporal graph attention technology and a constructed static graph.

[0067] In practical implementation, the graph structure construction module includes the following:

[0068] The similarity between any two electricity users is calculated using the electricity consumption dataset obtained in step S2, using the following formula:

[0069] S ij =X i ·(X j ) T

[0070] In the formula S ij X represents the similarity value between electricity user i and electricity user j; i X is the electricity consumption data matrix for user i; j Let T be the electricity consumption data matrix for electricity user j; T is the transpose of the matrix.

[0071] The calculated similarity values ​​among all electricity users are normalized to obtain the similarity matrix S.

[0072] Set the initial value of the neighbor number k; obtain a completely disconnected graph structure A, initially the matrix corresponding to graph structure A is a matrix of all zeros;

[0073] The value of the nearest neighbor k is increased from the initial value to the total number of electricity users according to a set step size. During this process, the graph structure gradually becomes denser, so the average clustering coefficient ACC gradually increases, and the average network consistency estimate h gradually decreases. During the increase, the corresponding average network consistency estimate h and average clustering coefficient ACC are calculated using the following formulas for each increase, and finally the curves h(k) and ACC(k) of h value and ACC value are obtained:

[0074]

[0075]

[0076] In the formula, N is the total number of electricity users; i0 is the initial value of the neighbor number k; k i Let k be the current value of the nearest neighbor k; E(i) be the value of node v in the current graph structure A. i k i The actual number of edges between adjacent nodes; (dis ij ) min For node v i to node v j The minimum distance between them; k i (k i -1) / 2 is k i The number of possible edges between adjacent nodes;

[0077] Based on the obtained curve h(k) for h value and curve ACC(k) for ACC value, take the value of the nearest neighbor k corresponding to the intersection point of curve h(k) and curve ACC(k) as the final nearest neighbor value kk.

[0078] Based on the nearest neighbor value k, the graph structure A is constructed using the following formula:

[0079]

[0080] In the formula A(v i ,v j ) represents node v i and node v j Connection status, A(v) i ,v j ) = 1 indicates that node v i and node v j Connected, A(v) i ,v j ) = 0 indicates that node v i and node v j Disconnect; Neigh kk (v i ) represents the distance from node v i The set of the k nearest nodes;

[0081] Finally, for each node, two other nodes that are not connected to the current node are randomly selected and connected with a set probability p to complete the construction of graph structure A;

[0082] The aforementioned spatiotemporal graph attention module specifically includes the following content:

[0083] The spatiotemporal graph attention module includes temporal convolutional layers, spatial convolutional layers, and fully connected layers;

[0084] Temporal convolutional layers consist of a DCCN network, gated linear units, and residual modules;

[0085] The DCCN network employs a CNN network with holes, which can expand the field of view of the convolutional kernels without increasing the network parameters. The core idea of ​​dilated convolution is to expand the parameters of the originally closely connected convolutional kernels according to a set ratio. The process of dilated convolution is represented as follows:

[0086]

[0087] In the formula, F(t) represents the result after performing dilation and convolution on the input data x; x is the input time series data; * D To expand the convolution kernel; k is the size of the convolution kernel; f(i) is the kernel weight; x t-dr·i This is historical data; dr is the inflation ratio.

[0088] The formula for calculating the temporal convolutional layer is as follows:

[0089] X GDCCN =((X*) D f)* G W G +b G )⊙σ((X* D f)* G V G +c G )

[0090] In the formula X GDCCN X is the output of the temporal convolutional layer; X is the input of the temporal convolutional layer; * D To expand the convolution kernel;* G For gated convolution; W G b is the first parameter to be learned. G The second parameter to be learned; ⊙ is the Hadamard product; σ is the ReLU function; V G c is the third parameter to be learned. G The fourth parameter to be learned;

[0091] The spatial convolutional layer includes a node attention layer and a graph convolutional layer; the calculation formula for the spatial convolutional layer is expressed as follows:

[0092]

[0093] In the formula X GCN This is the output matrix of the spatial convolutional layer; Let U be the eigenvalue matrix corresponding to the Laplace matrix of adjacency matrix A, and U be the eigenvector corresponding to the Laplace matrix of adjacency matrix A; K is the Chebyshev order; W ChebyNet These are the parameters to be learned; For use The Chebyshev polynomials calculated; X NA Let X be the input matrix of the spatial convolutional layer and X NA =Att DC ⊙F ex (x q W SENet )·X GDCCN Att DC Attention guided by degree centrality calculated based on node embeddings and softmax() is the logistic regression function, DC() is the degree centrality calculation function, and ReLU() is the activation function. E1 is the sixth parameter to be learned, and E1 is the first randomly initialized node embedding. Let E2 be the seventh parameter to be learned, and E2 be the node embedding of the first randomly initialized node. DCF is the bias vector. ex () is an intermediate function and F ex (x q W SENet The formula for calculating F is F ex (x q W SENet )=σ(W2 SENet σ(W1 SENet x q )), σ is the ReLU function, W2 SENet W1 is the eighth parameter to be learned. SENet W is the ninth parameter to be learned. SENet It is an intermediate parameter and includes W1. SENet and W2 SENet X GDCCN x is the output of the temporal convolutional layer. q X is the output of the temporal convolutional layer. GDCCN The result obtained after compression excitation module and the calculation formula is: TS represents the time length of the network input data, and x(1,t) represents the data of N nodes at time t;

[0094] The load data is input into the temporal convolutional layer to obtain the output of the temporal convolutional layer; then the constructed graph structure A and the output of the temporal convolutional layer are input into the spatial convolutional layer together, and the potential similarity of the user data is used to couple them to obtain the output of the spatial convolutional layer.

[0095] Repeat the above steps several times, and finally use a fully connected layer to read out the power load data of the user data to obtain the prediction results of the user's electricity consumption data.

[0096] S4. Using the electricity consumption dataset constructed in step S2, train the initial short-term power load forecasting model constructed in step S3 to obtain the short-term power load forecasting model; the training specifically includes the following steps:

[0097] The following function is used as the loss function during the training process:

[0098]

[0099] In the formula, n is the total number of training data; Y is the true value; This is a predicted value;

[0100] During training, the Adam optimization algorithm is used to calculate the network error gradient for each parameter in backpropagation, and new network parameters are obtained through the parameter update process. The weights of the network parameters are iteratively calculated until the predetermined minimum loss is reached and the best prediction value is obtained.

[0101] S5. Based on the short-term power load forecasting model obtained in step S4, complete the short-term power load forecasting based on spatiotemporal graph attention.

[0102] The method of the present invention will be further described below with reference to an embodiment:

[0103] The dataset consists of electricity consumption (kWh) data from 321 residences at a power plant in Singapore from 2012 to 2014. Sampling was performed every 15 minutes, and a sliding window with a window size of 4 and a step size of 1 was used to sum the electricity consumption for each residence, yielding the hourly electricity consumption for all 321 residences from 2012 to 2014. The final dataset size was 26304 × 321, where 26304 represents the number of samples and 321 represents the number of residences. The first 70% of the samples were used as the training set, the last 20% as the test set, and the remainder as the validation set. The final training set size was 18412 × 321, the validation set size was 2630 × 321, and the test set size was 5262 × 321. The hyperparameters for model training were set as follows: batch size = 64, historical data length his = 24, prediction step size pre = 24, learning rate lr = 0.001, and number of iterations epochs = 1000.

[0104] Graph modeling—constructing potential spatial dependencies among 321 households:

[0105] Use load data according to formula S ij =X i ·(X j ) T Calculate the similarity among any 321 households and perform maximum-minimum normalization to obtain the similarity matrix S∈R. 321×321 ;

[0106] Setting the nearest neighbor k to 0 results in a completely open graph structure A = O ∈ R. 321×321 O is an all-zero matrix. Calculate the average consistency estimate h and average clustering coefficient ACC of the network with this graph structure.

[0107] Gradually increase the number of neighbors k to 321. In this process, 321 graph structures will be obtained, and the graph structures will gradually become denser. At this time, ACC gradually increases and h gradually decreases. Calculate h and ACC for each of the 321 graph structures, and finally form h and ACC curves. Select the j value corresponding to the intersection point (ratio,k) of the curves as the number of neighbors k. Based on the selected number of neighbors k, construct the graph structure A.

[0108] For each node, randomly select two nodes that are not connected to it and connect them with probability p = 0.5;

[0109] Multi-step load prediction based on spatiotemporal graph attention networks:

[0110] Load data is input into a temporal convolutional layer, and nonlinear fitting is performed on various variables along the time dimension for the electricity consumption of 321 households to obtain X. GDCCN ;

[0111] The constructed graph structure A and the output X of the temporal convolutional layer are combined. GDCCN The input is fed into a spatial convolutional layer, which utilizes the latent spatial dependencies (i.e., similarities) among 321 households to fit the coupling relationships between various variables in the spatial dimension, thus obtaining X. GCN ;

[0112] Repeat the above two steps three times, then use a fully connected layer to read the electricity consumption of 321 residences, obtaining the 24-hour electricity load forecast result Y∈R. 5238×24×321 Where 5238 represents the test set length reduced by 24, 24 represents the prediction step size, and 321 represents the number of residences. Table 1 shows the experimental results of power load prediction using the method of this invention:

[0113] Table 1. Schematic diagram of load forecasting results

[0114]

[0115] As shown in Table 1, the final power load prediction deviation of the prediction method of the present invention is approximately 0.1%. This demonstrates that the method of the present invention has good prediction accuracy and reliability.

[0116] like Figure 2 The diagram shows the functional modules of the system of this invention: The system for implementing the short-term power load forecasting method based on spatiotemporal graph attention disclosed in this invention includes a data acquisition module, a data processing module, a model building module, a model training module, and a load forecasting module; the data acquisition module, data processing module, model building module, model training module, and load forecasting module are connected in series; the data acquisition module is used to acquire historical power load data information of the target area and upload the data to the data processing module; the data processing module is used to process the received data information to obtain a power consumption dataset and upload the data to the model building module; the model building module is used to construct an initial short-term power load forecasting model based on the received data, using the k-nearest neighbor network construction method and spatiotemporal graph attention technology, and upload the data to the model training module; the model training module is used to train the initial short-term power load forecasting model using the power consumption dataset, obtain a short-term power load forecasting model, and upload the data to the load forecasting module; the load forecasting module is used to complete the short-term power load forecasting based on the received data and the obtained short-term power load forecasting model.

Claims

1. A short-term power load forecasting method based on spatiotemporal graph attention, comprising the following steps: S1. Obtain historical power load data for the target area; S2. Process the data obtained in step S1 to obtain the electricity consumption dataset; S3. Based on the k-nearest neighbor network construction method and spatiotemporal graph attention technique, construct an initial model for short-term power load forecasting; specifically, the following steps are included: The constructed initial model for short-term power load forecasting includes a graph structure construction module and a spatiotemporal graph attention module; The graph structure building module is used to build a static graph structure for multivariate time series data in a target region based on the k-nearest neighbor network construction method. The spatiotemporal graph attention module is used to predict the load of a target region based on spatiotemporal graph attention technology and a constructed static graph. The spatiotemporal graph attention module includes temporal convolutional layers, spatial convolutional layers, and fully connected layers; The spatial convolutional layer includes a node attention layer and a graph convolutional layer; the calculation formula for the spatial convolutional layer is expressed as follows: In the formula This is the output matrix of the spatial convolutional layer; Let A be the eigenvalue matrix corresponding to the Laplacian matrix of the adjacency matrix A. Let be the eigenvectors corresponding to the Laplace matrix of the adjacency matrix A; K is the Chebyshev order. These are the parameters to be learned; For use The Chebyshev polynomial was calculated. Let be the input matrix of the spatial convolutional layer and , Attention guided by degree centrality calculated based on node embeddings and , For logistic regression function, The function for calculating degree centrality is... For activation function, The sixth parameter to be learned. Embed the first randomly initialized node. The seventh parameter to be learned. Embedding of nodes for the second random initialization. For bias vectors, It is an intermediate function and The calculation formula is , For ReLU function, The eighth parameter to be learned. The ninth parameter to be learned. intermediate parameters and include and , This is the output of the temporal convolutional layer. Output of the temporal convolutional layer The result obtained after compression excitation module and the calculation formula is: , The duration of network input data. This represents the data from N nodes at time t. The load data is input into the temporal convolutional layer to obtain the output of the temporal convolutional layer; The constructed graph structure A and the output of the temporal convolutional layer are then fed into the spatial convolutional layer together, and the coupling is achieved by utilizing the potential similarity of user data to obtain the output of the spatial convolutional layer. Repeat the above steps several times, and finally use a fully connected layer to read out the power load data of the user data to obtain the prediction results of the user's electricity consumption data. S4. Using the electricity consumption dataset constructed in step S2, train the initial short-term power load forecasting model constructed in step S3 to obtain the short-term power load forecasting model. S5. Based on the short-term power load forecasting model obtained in step S4, complete the short-term power load forecasting based on spatiotemporal graph attention.

2. The short-term power load forecasting method based on spatiotemporal graph attention according to claim 1, characterized in that... Step S2 involves processing the data obtained in step S1 to obtain an electricity consumption dataset, specifically including the following steps: For the historical power load data of the target area obtained in step S1, a sliding window with a set window size and a set step size is used to sum the historical power load data, thereby obtaining the hourly power load of the target area. Then, the obtained data is divided into a training set and a test set. The training set is used to train the model, and the test set is used to test the trained model. Together, the training set and the test set constitute the electricity consumption dataset.

3. The short-term power load forecasting method based on spatiotemporal graph attention according to claim 2, characterized in that... The graph structure construction module specifically includes the following: The similarity between any two electricity users is calculated using the electricity consumption dataset obtained in step S2, using the following formula: In the formula Let be the similarity value between electricity user i and electricity user j; This is the electricity consumption data matrix for electricity user i; This is the electricity consumption data matrix for electricity user j; T is the transpose of the matrix; The calculated similarity values ​​among all electricity users are normalized to obtain a similarity matrix. ; Set an initial value for the neighbor number k; and obtain a completely disconnected graph structure A; The value of the nearest neighbor k is increased from the initial value to the total number of electricity users according to a set step size. During the increase, the corresponding network average consistency estimate h and average clustering coefficient ACC are calculated using the following formula for each increase, and finally the curve of h value is obtained. The curve of ACC value : In the formula The total number of electricity users; Let k be the initial value of the nearest neighbor number; The current value of the nearest neighbor k; For node v in the current graph structure A i k i The actual number of edges between adjacent nodes; For node v i to node v j The minimum distance between them; Based on the curve of the obtained h value The curve of ACC value Take the curve and curve The value of the nearest neighbor k corresponding to the intersection point is used as the final nearest neighbor value. ; Based on neighboring values The following formula is used to construct graph structure A: In the formula Represents a node and nodes The connection status, Represents a node and nodes Connected, Represents a node and nodes disconnect; Represents distance from node The set of the k nearest nodes; Finally, for each node, two other nodes that are not connected to the current node are randomly selected and connected with a set probability p to complete the construction of graph structure A.

4. The short-term power load forecasting method based on spatiotemporal graph attention according to claim 3, characterized in that... The spatiotemporal graph attention module also includes the following: Temporal convolutional layers consist of a DCCN network, gated linear units, and residual modules; The DCCN network employs a CNN network with holes, which can expand the field of view of the convolutional kernels without increasing the network parameters; the process of expanding the convolution is represented as: In the formula This represents the result after performing dilation and convolution on the input data x; Input timing data; To expand the convolution kernel; k is the size of the convolution kernel; These are the kernel weights; Historical data; dr is the inflation ratio; The formula for calculating the temporal convolutional layer is as follows: In the formula This is the output of the temporal convolutional layer; This serves as the input to the temporal convolutional layer. To expand the convolution kernel; For gated convolution; The first parameter to be learned; The second parameter to be learned; For Hadamah accumulation; For ReLU functions; The third parameter to be learned; This is the fourth parameter to be learned.

5. The short-term power load forecasting method based on spatiotemporal graph attention according to claim 4, characterized in that... The training described in step S4 specifically includes the following steps: The following function is used as the loss function for the training process. : In the formula, n is the total number of training data; The actual value; This is a predicted value; During training, the Adam optimization algorithm is used to calculate the network error gradient for each parameter in backpropagation, and new network parameters are obtained through the parameter update process. The weights of the network parameters are iteratively calculated until the predetermined minimum loss is reached and the best prediction value is obtained.

6. A system for implementing the short-term power load forecasting method based on spatiotemporal graph attention as described in any one of claims 1 to 5, characterized in that... It includes a data acquisition module, a data processing module, a model building module, a model training module, and a load forecasting module; the data acquisition module, data processing module, model building module, model training module, and load forecasting module are connected in series; the data acquisition module is used to acquire historical power load data information of the target area and upload the data to the data processing module; The data processing module is used to process the received data to obtain the electricity consumption dataset and upload the data to the model building module. The model building module is used to construct an initial model for short-term power load forecasting based on the received data, using the k-nearest neighbor network construction method and spatiotemporal graph attention technique, and upload the data to the model training module. The model training module is used to train the initial short-term power load forecasting model based on the received data and the electricity consumption dataset, thereby obtaining the short-term power load forecasting model, and then uploading the data to the load forecasting module. The load forecasting module is used to complete short-term power load forecasting based on spatiotemporal graph attention, according to the received data and the obtained short-term power load forecasting model.