Regional charging and discharging load collaborative prediction method based on dynamic spatio-temporal graph neural network
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
- Filing Date
- 2026-05-11
- Publication Date
- 2026-08-07
AI Technical Summary
[0007]本发明要解决的技术问题是:现有技术存在的预测精度有限、难以同时建模空间与时间依赖关系等缺陷
[0026] The technical solution of this invention provides a regional charging and discharging load collaborative prediction method based on dynamic spatiotemporal graph neural network. By dynamically modeling the spatiotemporal relationship between charging and discharging regions and combining the charging behavior characteristics of electric vehicles, it can achieve high-precision prediction of regional load, which can effectively improve the stability of power grid operation and the scientific nature of scheduling.
Smart Images

Figure CN122532885A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power load forecasting technology, specifically relating to a regional charging and discharging load collaborative forecasting method based on a dynamic spatiotemporal graph neural network. Background Technology
[0002] With the continuous growth of the overall number of electric vehicles in society, especially the number of pure electric ride-hailing vehicles, the large-scale, disorderly access of EVs has led to high volatility and strong randomness in the regional power grid load. This not only poses a potential threat to the safe operation of the power grid but also presents a significant challenge to the long-term accuracy of EV charging station load forecasting. Dynamic forecasting of EV charging station load is not only an important foundation for conducting power grid load planning research but also a prerequisite for achieving orderly and precise guidance of EV charging. It is of great significance for promoting the scientific layout and rational planning of charging infrastructure.
[0003] Existing electric vehicle charging load prediction methods mainly fall into two categories:
[0004] One type is prediction methods based on mathematical modeling. When time or space factors need to be considered simultaneously, the model structure is often too complex, and the prediction accuracy is difficult to guarantee.
[0005] Another category is statistical learning methods based on historical data. These include time-series statistical methods, machine learning-based prediction methods, and deep learning-based prediction methods. Traditional time-series methods (such as the ARIMA model) can describe the temporal correlation of loads, but they lack adaptability when handling nonlinear features and cannot capture spatial dependencies. Machine learning methods have improved prediction accuracy to some extent and are gradually becoming the main application approach, but their modeling capabilities are limited. Deep learning methods, through multi-layer neural network structures, possess strong nonlinear fitting capabilities and perform well under large-scale data conditions, but they still lack a unified modeling capability for temporal and spatial dependencies.
[0006] In summary, existing technologies generally suffer from limited prediction accuracy and difficulty in simultaneously taking into account time and space dependence, thus failing to meet the need for accurate prediction of load in electric vehicle charging and discharging areas under dynamic spatiotemporal changes. Summary of the Invention
[0007] The technical problem to be solved by the present invention is that the existing technology has defects such as limited prediction accuracy and difficulty in simultaneously modeling spatial and temporal dependencies.
[0008] To address the aforementioned technical problems, the present invention provides a method for coordinated prediction of regional charge and discharge loads based on a dynamic spatiotemporal graph neural network, comprising the following steps: The charging and discharging nodes are mapped to nodes, and the spatiotemporal correlation feature data and external influencing factor data are used as node feature attributes. The connection edges between nodes are constructed based on preset dynamic correlation rules or a weighted function of geographical distance and load correlation. The preset dynamic association rules are as follows: If the Euclidean distance between the geographic coordinates in the node feature attributes of two nodes is less than the preset geographic distance threshold, then a connection edge is established based on spatial proximity. If the Euclidean distance between the geographic coordinates in the node feature attributes between nodes is greater than or equal to the preset geographic distance threshold, then when the correlation coefficient of the historical load data in the node feature attributes between the two nodes is higher than the preset correlation threshold, a connection edge is established based on the load correlation. If the above rules are exceeded, the weights of the edges are determined by a weighting function based on geographical distance and load correlation, connecting edges are established, and the graph structure is extracted to obtain a dynamic spatiotemporal graph structure sequence; After obtaining the first, second, and third mapped data, a graph structure is built based on nodes, node feature attributes, and connecting edges. Within a preset time step, the graph structure is truncated to obtain a dynamic spatiotemporal graph structure sequence. The numerical continuous features related to historical load data, electricity price information, and meteorological environment data in the dynamic spatiotemporal map structure sequence are mapped to the hidden feature space to obtain the first mapped data. The multi-type discrete category features related to date type and surrounding points of interest features in the dynamic spatiotemporal map structure sequence are converted into high-dimensional sparse binary vectors and then mapped to low-dimensional dense feature vectors to obtain the second mapped data. The geographic coordinate information in the dynamic spatiotemporal map structure sequence is mapped to continuous feature vectors that can perceive the absolute position of nodes in space and their relative distance constraints to obtain the third mapped data. Based on the similarity measures of the first, second, and third mapped data, a load correlation adjacency matrix is constructed. Based on the similarity measure of the second mapped data, a functional coupling adjacency matrix is constructed. Based on the similarity measure of the third mapped data, a geographic distance adjacency matrix is constructed. After performing graph convolution to obtain multi-dimensional spatial features, a weighted fusion is achieved through a cross-channel attention mechanism to finally form a comprehensive spatial feature. Based on the short-term fluctuations, periodic changes, and long-term trend characteristics of historical load data in the dynamic spatiotemporal graph structure sequence, trend terms, periodic terms, and residual terms are obtained and modeled to obtain trend characteristics, periodic characteristics, and residual characteristics as time features. By fusing spatial and temporal features, a spatiotemporal fusion feature is obtained. Based on the spatiotemporal fusion feature, the load forecast values of each charging and discharging node and the total regional load forecast value are obtained within a specific future time period.
[0009] Preferably, the geographic coordinate information includes the longitude and latitude of the charging station; the historical load data is used to describe load changes under different meteorological conditions, different time periods, and different electricity pricing policies; the electricity price information is used to describe the unit electricity price corresponding to the user's charging operation; the date type is used to describe the work or rest attribute of the date; the meteorological environment data includes the daily maximum temperature, daily minimum temperature, daily average temperature, average relative humidity, and daily cumulative rainfall of the collection area; and the surrounding points of interest features are used to describe the quantity, density, and type distribution of various facilities within a certain service radius of the charging station, so as to indirectly characterize the charging demand potential and user behavior patterns of the area.
[0010] Preferably, the preprocessing includes: If outlier data occurs at extreme values or has significant characteristics such as spikes, it is as follows:
[0011] The vertical processing method is selected to correct outliers, and the formula is as follows:
[0012] If abnormal data appears during a stable phase of the curve, select the two data points before and after it as a baseline, and use the following formula:
[0013] If all inequalities are true, determine if it is an outlier. Use the leveling method to handle outliers and calculate the correction value, as shown in the formula below:
[0014] In the formula, Input data for the load node of the i-th charging station at time t. Let A be the average load over the past week at time t, and let A be the set threshold.
[0015] Preferably, the weight formula for the edge is as follows:
[0016] in, Let be the distance function. This is the load correlation function. and These are non-negative weighting coefficients.
[0017] Preferably, the trend feature formula is as follows: .
[0018] Among them, z t r is an update gate used to control the inheritance of past information from the current state.t This is a reset gate used to determine the role of historical information in the current state. Candidate state; The updated gate formula is as follows:
[0019] Among them, X trend It mainly reflects the overall direction of change in charging load, such as long-term fluctuations caused by seasonal or policy adjustments.
[0020] Preferably, the periodic characteristic formula is as follows: , Among them, H periodic This mainly reflects the periodic fluctuations in charging load. Q is the query vector, K is the key vector, and V is the value. The dimension of the key vector.
[0021] Preferably, the residual characteristic formula is as follows:
[0022] Among them, depthwise convolution is used to extract local features within a channel, and pointwise convolution is used to adjust the channel dimensions. residual It mainly depicts short-term, sudden dynamics.
[0023] Preferably, the dynamic association rule is as follows: If the Euclidean distance between the geographic coordinates in the node feature attributes of two nodes is less than the preset geographic distance threshold, then a connection edge is established based on spatial proximity. If the Euclidean distance between the geographic coordinates in the node feature attributes between nodes is greater than or equal to the preset geographic distance threshold, then when the correlation coefficient of the historical load data in the node feature attributes between the two nodes is higher than the preset correlation threshold, a connection edge is established based on the load correlation.
[0024] Preferably, the calculation steps for the first mapped data, the second mapped data, and the third mapped data are as follows: The relevant numerical continuous features of historical load data, electricity price information, and meteorological environment data in the dynamic spatiotemporal graph structure sequence are mapped to the hidden feature space to obtain the data after the first mapping. The date type and surrounding interest point features in the dynamic spatiotemporal graph structure sequence are converted into high-dimensional sparse binary vectors and then mapped to low-dimensional dense feature vectors to obtain the second mapped data. The geographic coordinate information in the dynamic spatiotemporal graph structure sequence is mapped into a continuous feature vector that can perceive the absolute position of the node in space and its relative distance constraints, resulting in the third mapped data.
[0025] Preferably, based on the short-term fluctuations, periodic changes, and long-term trend characteristics of historical load data in the dynamic spatiotemporal graph structure sequence, the trend term, periodic term, and residual term are obtained, and the trend characteristics, periodic characteristics, and residual characteristics are modeled as time characteristics.
[0026] The technical solution of this invention provides a regional charging and discharging load collaborative prediction method based on dynamic spatiotemporal graph neural network. By dynamically modeling the spatiotemporal relationship between charging and discharging regions and combining the charging behavior characteristics of electric vehicles, it can achieve high-precision prediction of regional load, which can effectively improve the stability of power grid operation and the scientific nature of scheduling. Attached Figure Description
[0027] Figure 1 This is an algorithm flowchart of a charging and discharging area load collaborative prediction method based on a dynamic spatiotemporal graph neural network provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the dynamic spatiotemporal diagram structure of the load in the charging and discharging region provided in an embodiment of the present invention; Figure 3 This is an overall framework diagram of a charging and discharging area load collaborative prediction system based on a dynamic spatiotemporal graph neural network provided in an embodiment of the present invention. Detailed Implementation
[0028] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.
[0029] Accurately predicting the load on electric vehicle (EV) charging stations is crucial for EV users to select the optimal charging station and for ensuring the safe and efficient operation of the power grid. The charging loads of different charging stations within the same area are interconnected. However, predicting the charging load of a single charging station using traditional time-series methods is insufficient.
[0030] like Figure 1 As shown, this embodiment of the invention provides a method for coordinated prediction of regional charging and discharging loads based on a dynamic spatiotemporal graph neural network, comprising the following steps: Nodes represent charging stations and are interconnected by edges. Each node has a unique identifier and can be accompanied by attribute information. Edges are used to describe the relationships between nodes and can be directional. Directed graphs and undirected graphs are distinguished by the directional characteristics of the edges. Attributes can be of any data type and are used to describe the characteristics of nodes or edges. Null values are allowed.
[0031] Data acquisition and preprocessing: acquire historical load data, spatiotemporal correlation characteristic data and external influencing factor data of each charging and discharging node in the target area, and preprocess them to form a standardized dataset.
[0032] The spatiotemporal correlation feature data includes the geographic coordinate information of each node; the external influencing factor data includes at least one of the following: electricity price information, date type, meteorological environment data, and surrounding point of interest (POI) features.
[0033] The geographic coordinate information specifically refers to the longitude and latitude of the charging station, used to identify its geographical location, denoted as λi,t,1=(Lon,Lat). Historical load data refers to data covering load changes under different meteorological conditions, different time periods, and different electricity pricing policies, reflecting the multi-factor coupling characteristics of load fluctuations. The active power value of the i-th charging station load node at time t is denoted as λi,t,2, with a sampling frequency of one sampling point every 15 minutes, for a total of 96 sampling points per day. Charging price data refers to the unit electricity price corresponding to the user's charging operation at the i-th charging station load node at time t, denoted as λi,t,3; this data can be time-of-use pricing or dynamic pricing. Date type data is used to distinguish the working or rest attributes of the date, defined as a binary variable: weekdays are identified as λi,t,4=0, and rest days (including weekends and statutory holidays) are identified as λi,t,4=1. Meteorological data includes the daily maximum temperature (Tmax), daily minimum temperature (Tmin), daily average temperature (Tavg), average relative humidity (Havg), and daily cumulative rainfall (Rsum) of the collection area. This data originates from local meteorological monitoring stations or authoritative meteorological data service interfaces, and is denoted as λi,t,5=(Tmax,Tmin,Tavg,Havg,Rsum,...). Points of Interest (POI) feature data specifically refers to the quantity, density, and type distribution of various facilities within a certain service radius of the charging station. Facility types include at least residential areas, commercial complexes, office parks, transportation hubs, and public parking lots. This feature is used to indirectly characterize the charging demand potential and user behavior patterns in the area. For any station i, the statistical formula for the POI (Point of Interest) feature is: λi,t,6=Xp,i={{count(p)|p∈Ph}|Ph=1,2,3,4,5,...h} In the formula: Xp,i represents the POI characteristics of load node i of the charging station, p represents a certain type of POI, Ph represents the h-th type of POI (P1=residential area, P2=commercial complex, P3=office park, P4=transportation hub, P5=public parking lot, etc.), count(p) represents counting the number of all the same p. POI data mainly provides important spatial characteristic information for the electricity user, effectively reflecting the characteristics of the surrounding area and the types of electricity users. By counting the types and total number of surrounding POIs, the POI characteristics are quantitatively expressed, making them easy to use in the prediction model.
[0034] The preprocessing includes: If outlier data occurs at extreme values or has significant characteristics such as spikes, it is as follows:
[0035] In the formula: Input data for the load node of the i-th charging station at time t; Let A be the average load over the past week at time t; A is the set threshold, which is set with reference to the actual situation. The vertical processing method is selected to correct outliers, and the formula is as follows:
[0036] If abnormal data appears during a stable phase of the curve, select the two data points before and after it as a baseline, and use the following formula:
[0037] If all inequalities are true, determine if it is an outlier. Use the leveling method to handle outliers and calculate the correction value, as shown in the formula below:
[0038] Missing values in the time and space dimensions are imputed separately, as follows: For missing data in the time dimension, the loading value at the missing time t. The data is filled in using a weighted fitting method based on observations from nearby time points, with the weights decreasing over time. The formula is as follows:
[0039] in, This represents the set of time windows adjacent to time t. For Gaussian kernel weights, The parameter is used for smoothing. This method ensures the continuity and smoothness of the interpolation results over time.
[0040] To address the missing data in the spatial dimension, interpolation methods based on spatial correlation use the observations of its neighboring nodes to estimate and fill in the gaps.
[0041] For numerical non-negative continuous data, Z-Score standardization is applied, as shown in the following formula:
[0042] in This is a normalized value, making the data distribution closer to normal, in order to reduce skewness and variance instability.
[0043] The geographic coordinate data and surrounding Points of Interest (POI) features are processed using max-min normalization, as shown in the following formula:
[0044] In the formula, X is the normalized value, and xmin and xmax are the maximum and minimum values in the data.
[0045] To reveal the interrelationships among charging stations, the geographical locations of 11 charging stations in a certain area were selected to construct a [database / database]. Figure 2 The diagram shows the spatiotemporal information of the charging load.
[0046] Dynamic spatiotemporal graph structure construction: Based on the standardized dataset, a dynamically evolving spatiotemporal graph structure sequence is constructed; each charging / discharging node is mapped to a node in the graph structure. Edges between nodes are constructed based on preset dynamic association rules. And form an adjacency matrix A that represents the spatial relationships between nodes.
[0047] To characterize the temporal evolution of charging station load, the spatiotemporal graph structure employs a sliding time window that moves with the time step. Node features are updated in real-time based on the latest collected data on load, electricity price, weather, and POI. The edge set is dynamically adjusted based on the strength of association between nodes: edges are removed when the association strength is below the deletion threshold and new edges are created when it exceeds the addition threshold. The adjacency matrix is updated synchronously with changes in nodes and edges. To characterize the temporal evolution of charging station load, a sliding time window is used to obtain a temporally continuous dynamic graph structure G1, G2, ..., Gt. By fusing spatiotemporal features and graph structure information, accurate prediction of regional charging load (prediction of total charging demand and charging demand of each station in the future) is achieved.
[0048] To reveal the interrelationships among charging stations, a spatiotemporal information graph of charging load is constructed, and a weighted graph is modeled for N charging stations. , Represents a set of nodes. K represents the set of edges between nodes, and K is a weighted matrix describing the adjacency relationship between nodes, reflecting the correlation between sites in terms of geographical location, load pattern and functional characteristics.
[0049] In this invention, a graph structure is used to effectively characterize the spatiotemporal coupling relationship and mutual influence of power loads between different charging stations. The graph structure comprises three basic elements: nodes, edges, and attributes. Nodes represent charging and discharging nodes, connected by edges, and each node has a unique identifier; edges describe node characteristics and may have directionality; directed and undirected graphs are distinguished by the directional characteristics of their edges; attributes can be of any data type and are used to describe the characteristics of nodes or edges, and can be empty.
[0050] The existence and weight of edges reflect the correlation between two charging stations in terms of geographical location, load pattern, or functional characteristics. The edges are constructed as follows: The dynamic association rules for constructing edges in the construction of the dynamic spatiotemporal graph structure include: Regarding the existence of edges, the existence of edge eij is determined by a comprehensive rule based on spatial proximity and functional relevance. The proximity rule based on the geographical distance between nodes is: if the Euclidean distance d(i,j) between two nodes (node vi and node vj) is less than the preset geographical distance threshold R, then a connection edge is established based on spatial proximity. This rule captures the direct competition or synergy effect caused by geographical proximity. If the edges are based on load correlation, even if the geographical distance is large, the similarity rule based on the correlation of the historical load sequences of the nodes is applied: if the correlation coefficient of the historical load sequences of two nodes within a specific time window is high... If (i,j) is higher than the preset correlation threshold S, then a connection edge is established based on the load correlation.
[0051] Edges connecting two load points are determined based on hybrid rules. The weights of the edges are determined by a weighted function based on geographical distance and load correlation, with the weights defined as follows:
[0052] in, Let be the distance function. This is the load correlation function. and The weighting coefficients are non-negative, and + =1.
[0053] The adjacency matrix in the dynamic spatiotemporal graph structure is constructed based on the existence and weight of the edges, and is dynamically updated as the relationships between nodes change. An attention mechanism is used to achieve adaptive updating of the spatial features of the charging station. The weighted adjacency matrix is defined as follows:
[0054] Among them W ij This represents the strength of the connection between the two nodes, and the attention weights of nodes i and j at time t.
[0055] Dynamic spatiotemporal graph neural network model prediction: Input the dynamic spatiotemporal graph structure sequence into the pre-trained dynamic spatiotemporal graph neural network model, and output the load prediction value of each charging and discharging node and the total regional load prediction value within a specific future time period.
[0056] The dynamic spatiotemporal graph neural network model is a deep learning architecture specifically designed for processing spatiotemporal graph data. Its core objective is to learn the temporal dynamics of nodes themselves and the spatial relationships between nodes from the dynamic graph structure G1, G2, ..., Gt, and ultimately achieve collaborative prediction. The model consists of the following core modules: It includes a dedicated feature embedding module that takes a dynamic graph structure G1, G2, ..., Gt as input and performs differential encoding on features of different properties to obtain differentially encoded data.
[0057] For embedding numerical continuous features, such as historical charging and discharging load values, charging prices, temperature, and humidity, a learnable linear transformation layer is used to map them to a unified hidden feature space. This operation not only normalizes the feature scale but also helps the model capture the complex nonlinear relationship between these continuous variables and the target load. For embedding categorical features, such as date types and multi-type discrete categorical features extracted from POI data, one-hot encoding is first used to convert them into high-dimensional sparse binary vectors. Then, an embedding layer maps them to low-dimensional dense feature vectors. This method effectively avoids the model misjudging the order relationship between categories and improves computational efficiency. For embedding spatial location features, such as the latitude and longitude coordinates of charging stations, in addition to being used to calculate edge weights when constructing the graph structure, they are also embedded and encoded as inherent spatial attributes of nodes. Positional encoding technology is used to map latitude and longitude coordinate values into continuous feature vectors for specialized embedding processing. This allows the model to explicitly perceive the absolute position of nodes in space and their relative distance constraints, thereby enhancing the model's spatial generalization ability while preserving its spatial semantic information.
[0058] The dynamic spatiotemporal graph neural network model includes at least a spatial feature extraction module for capturing dynamic spatial dependencies between nodes, and a temporal feature extraction module for capturing the temporal evolution of the load of a node itself.
[0059] The spatial feature extraction module in the dynamic spatiotemporal graph neural network model prediction adopts a graph attention network (GAT) or graph convolutional network (GCN) architecture and introduces an attention mechanism to dynamically learn the correlation weights between nodes, thereby achieving adaptive extraction of spatial features. This is used to model the dynamic correlation of the charging station network in the spatial dimension, that is, how the load change of a station is affected by its neighboring stations and the surrounding environment.
[0060] Unlike common Euclidean space-based convolution methods, the spatial feature extraction module models the spatial dynamic correlation of charging station networks, capturing the mechanism by which station load is affected by neighbors and the surrounding environment. Addressing the non-Euclidean characteristics (irregularity) of charging station distribution and the dynamic changes in edge weights, a multi-channel, multi-level graph convolution and attention fusion mechanism is employed. Multiple adjacency matrices are constructed based on different similarity metrics, and graph convolutions are performed separately to obtain multi-dimensional spatial features. Then, a cross-channel attention mechanism is used to achieve weighted fusion, ultimately forming a comprehensive spatial feature representation.
[0061] In the implementation process, firstly, a multi-adjacency matrix is constructed based on different similarity metrics according to the weighted matrix, including the geographical distance adjacency matrix Ad, the load correlation adjacency matrix Aρ, and the functional coupling adjacency matrix Aw.
[0062] Graph convolution operations are performed on the adjacency matrices to obtain spatial feature embeddings of different dimensions; then, the features of each channel are weighted and fused through a cross-channel attention mechanism to achieve a comprehensive expression of multi-scale spatial information.
[0063] To further enhance the model's ability to model complex spatial interactions, this module introduces a dynamic graph attention mechanism. Its core idea is to dynamically update edge weights at each time step, as shown in the following equation: ,in, Let represent the attention weights of nodes i and j at time t, || denotes the vector concatenation operation LeakyReLU as the activation function to enhance the nonlinear expressive power of the model, and W and a are learnable parameters.
[0064] This module uses feature aggregation and attention mechanisms to achieve adaptive weighted fusion of neighbor node information, and uses the attention mechanism to dynamically update the spatial feature representation of the charging station accordingly.
[0065] By using feature aggregation operations to weight and synthesize the features of neighboring nodes, this module can effectively capture the non-uniform dependency relationships and dynamic spatial evolution patterns among charging stations.
[0066] The temporal feature extraction module employs a combination of models, including recurrent neural networks, temporal convolutional networks, and a self-attention-based temporal model, to extract the evolutionary features of electric vehicle charging load over time. This includes information at different time scales, such as short-term fluctuations, periodic changes, and long-term trend characteristics of node loads. A multi-scale temporal feature extraction method is used to perform multi-scale decomposition, resulting in a trend term (Xtrend), a periodic term (Xperiodic), and a residual term (Xresidual). Targeted feature modeling is then performed on the trend, periodic, and residual features to obtain the trend features, periodic features, and residual features, respectively.
[0067] For trend features, this invention uses a gated recurrent unit (GRU) for modeling, selectively saving historical information through update and reset gates, resulting in trend features represented as follows: This allows for the capture of long-term dependencies.
[0068] z t To update the gate, the calculation formula is as follows: Used to control the inheritance of past information from the current state; r t To reset the door, the calculation formula is: This is used to determine the role of historical information in the current state; For candidate states, the calculation formula is: Xtrend primarily reflects the overall direction of change in charging load, such as long-term fluctuations caused by seasonality or policy adjustments.
[0069] For periodic features, the periodic feature is expressed as:
[0070] H periodic This mainly reflects the periodic fluctuations in charging load, such as the difference between daytime and nighttime or between weekdays and rest days. An attention mechanism is used for modeling in this part to assign differentiated weights at different time points, thereby highlighting the impact of critical moments. The specific calculation steps are as follows: First, define the input data as The training weight matrix is , and It is The parameters used for the linear transformation need to be learned, and are as follows: ,key Sum Secondly, perform a dot product between the query vector Q and the key vector K. To avoid the dot product result being too large, divide it by the square root of the key vector dimension. Finally, the results are processed using the SoftMax function to normalize the probability distribution, and the attention score is weighted and summed with the value vector to obtain the attention output. .
[0071] Based on the steps described above, it can be observed that each part of the input sequence is weighted using attention scores, thereby generating a vector representing the relevance of information. This processing method not only significantly enhances the information representation capability of the input vector but also enables parallel computation of information at all positions. This effectively reduces computational complexity and improves model training efficiency, providing strong support for model optimization and application.
[0072] For residual characteristics, X residual This approach primarily characterizes short-term, sudden dynamics, such as the impact of concentrated charging during holidays or extreme weather on the load. These features typically exhibit high-frequency fluctuations. A lightweight convolutional neural network (CNN) combined with a residual structure is used to improve the ability to capture short-term anomalies. In the convolutional implementation, a depthwise separable convolutional structure is employed to reduce computational overhead while maintaining the ability to extract local features. The calculation formula is as follows: Depthwise convolution is used to extract local features within a channel, while pointwise convolution is used to adjust the channel dimensions. Additionally, residual connections are introduced into the multi-layer convolutional structure to reduce information loss in deep networks. .
[0073] This module can effectively extract short-term fluctuation features while ensuring computational efficiency, enabling the model to maintain good predictive stability when facing sudden load changes.
[0074] The dynamic spatiotemporal graph neural network model also includes a spatiotemporal feature fusion module, which is used to fuse the spatial features output by the spatial feature extraction module and the temporal features output by the temporal feature extraction module to generate comprehensive spatiotemporal fusion features for prediction output.
[0075] In the process of temporal feature fusion, directly concatenating trend features, periodic features, and residual features at different scales may lead to information redundancy or conflicts between features. To address these issues, a gating-based fusion strategy is adopted, which assigns learnable weights to multi-scale temporal features and performs weighted combination. , .
[0076] Where W is a trainable parameter, and the Softmax operation is used to ensure the normalization of the fusion weights.
[0077] The model can dynamically adjust the contribution ratio of features at each time scale based on the differences in input data, resulting in a unified time-series feature table integrated through a gating fusion mechanism. This indicates that it simultaneously retains key information about long-term trends, cyclical patterns, and short-term dynamics.
[0078] To promote deep interaction between spatial features and multi-scale temporal features, spatial feature H... spatial As the query vector Q, the processed multi-scale temporal features H tempor As the key vector K and value vector V, they are input to the attention module for computation. The multi-head attention mechanism extracts feature interaction information from different subspaces in parallel through multiple independent attention heads. The computation process of each attention head can be represented as follows: The calculation for each attention head is as follows: This mechanism can characterize the complex dependencies of spatiotemporal features in multiple subspaces, thereby enhancing the model's understanding of spatiotemporal dynamics and generating the spatiotemporal fused feature representation Hfused.
[0079] The aforementioned fusion strategy effectively integrates spatial correlation and multi-scale temporal information, fully explores the intrinsic connections between spatiotemporal features, and thus improves the accuracy and robustness of the load forecasting model.
[0080] The model prediction and optimization module is responsible for load prediction based on the spatiotemporal fusion feature Hfused and for improving model performance through optimization algorithms. This module consists of three sub-modules: prediction, optimization, and output. The prediction module is a multilayer perceptron structure consisting of an input layer, a hidden layer, and an output layer.
[0081] The input layer receives the spatiotemporal fusion feature Hfused; the hidden layer contains L fully connected layers, using the GELU activation function to enhance nonlinear expressive power. Its forward propagation process is as follows: ,in and Here, represents the weight matrix and bias term of layer l, respectively. To improve the model's generalization ability, a DropPath regularization strategy is introduced between hidden layers, randomly discarding the entire neuron path to simulate the uncertainty of the network structure. The output layer maps the high-dimensional features to a 2×ΔT high-dimensional prediction result through a linear transformation, corresponding to the predicted charging and discharging load values for the next ΔT time steps. .
[0082] To achieve flexible and accurate multi-step prediction, a multi-step prediction collaboration mechanism is adopted, as follows: The entire predicted sequence is output directly in one go, maintaining temporal consistency. The prediction of the entire future ΔT steps is treated as a single output task, and the complete predicted sequence is generated in one go through a linear output layer. Its output can be represented as... , where fout is a linear transformation function. This method helps to maintain the temporal consistency of the predicted sequence and avoid error accumulation.
[0083] The multi-scale prediction decomposes the ΔT step prediction into three scales: short-term, medium-term, and long-term. Each scale is predicted through an independent sub-network and then gated and fused. Finally, the results of each scale are integrated through a gated fusion mechanism to address the load change patterns at different time scales. This design achieves accurate and coordinated prediction of charging and discharging loads, providing a reliable basis for power grid dispatch.
[0084] Through the aforementioned structural design and prediction mechanism, this prediction module achieves accurate and coordinated prediction of regional charging and discharging loads, providing a reliable basis for power grid dispatch.
[0085] The optimization module trains the model parameters by defining an objective function and an optimization algorithm. To improve prediction accuracy and enhance model generalization ability, Huber loss is used as the main optimization objective. This function combines the advantages of mean squared error (MSE) and mean absolute error (MAE), and is more robust to outliers. Its mathematical expression is: .
[0086] Where y is the true value. δ is the predicted value, and δ is the threshold parameter that controls the transition point of the error from quadratic loss to linear loss.
[0087] To effectively prevent overfitting, a strategy combining label smoothing regularization and random weight averaging is adopted.
[0088] Label smoothing reduces the confidence level of the model to the training labels by softening the one-hot encoding of the true labels. Its expression is: , where r is the smoothing factor and K is the number of categories.
[0089] The optimization process employs the Lion optimizer, a sign-function-based optimization algorithm characterized by high memory efficiency and few hyperparameters. Its parameter update rule is as follows: , of which The momentum term, λ is the weighted decay coefficient, and sign is the sign function.
[0090] During training, linear warm start and cosine annealing learning rate scheduling are adopted. The learning rate is linearly increased to the initial value in the first few training cycles, and then decayed according to the cosine function. In the later stage, random weight averaging is introduced to obtain a flatter loss surface by maintaining the moving average of the model weights. This effectively balances training stability and convergence performance, and effectively improves the model's generalization ability and robustness.
[0091] The model output module uses a linear transformation to convert the model output to a dimension of 1. of Turn to Predicted value Where T represents the prediction duration and N represents the number of variables. The conversion formula is: .
[0092] Here, Ws and Wt are both learnable parameters. The dimension of Ws is... , represents the matrix that is linearly projected along the variable dimension, where Wt has dimensions of . , representing the matrix projected along the time dimension. The predicted data is obtained. , where N represents the number of variables, L represents the length of the input sequence, and T represents the prediction range.
[0093] This model, through the organic synergy of temporal convolution and dynamic graph attention, constitutes a powerful spatiotemporal signal processor, which can fully explore the spatiotemporal evolution of electric vehicle load and provide a reliable basis for precise grid scheduling.
[0094] In summary, the model constructed in this invention is based on dynamic graph neural network technology, forming an efficient spatiotemporal data processing architecture that can deeply explore the spatiotemporal evolution of electric vehicle charging and discharging loads, thereby providing a reliable technical basis for the precise scheduling and optimized operation of the power grid.
[0095] Compared with existing technologies, this invention has the following advantages: For the first time, this invention introduces a dynamic spatiotemporal graph neural network modeling framework into electric vehicle charging and discharging load prediction. By constructing a spatiotemporal graph structure that can be dynamically updated over time, it effectively represents the spatial correlation between charging stations and the temporal dependency of load evolution. Compared with traditional methods that rely on single time series modeling or static spatial correlation modeling, this invention can achieve deep fusion of spatial features and multi-scale temporal features, thereby significantly improving the accuracy and stability of prediction. Furthermore, the multi-task prediction and optimization mechanism designed in this invention can simultaneously output node-level load and regional total load prediction results, meeting the dual needs of electric vehicle charging operation and grid dispatch, and possessing stronger practicality and promotional value.
[0096] like Figure 3As shown, embodiments of the present invention also provide a regional charge-discharge load collaborative prediction system based on a dynamic spatiotemporal graph neural network, comprising: The data acquisition and preprocessing module is used to acquire historical load data, spatiotemporal correlation characteristic data, and external influencing factor data of each charging and discharging node in the target area, and to preprocess them to form a standardized dataset. The dynamic spatiotemporal graph structure construction module is used to construct a dynamically evolving spatiotemporal graph structure sequence based on the standardized dataset; map each charging and discharging node to a node in the graph structure, construct edges between nodes based on preset dynamic association rules, and form an adjacency matrix representing the spatial association relationship between nodes. The collaborative prediction module is used to input the dynamic spatiotemporal graph structure sequence into a pre-trained dynamic spatiotemporal graph neural network model and output the load prediction values of each charging and discharging node and the total regional load prediction value within a specific future time period.
[0097] The dynamic spatiotemporal graph neural network model is constructed based on a graph neural network architecture that includes a spatial feature extraction module and a temporal feature extraction module. The adjacency matrix of the spatiotemporal graph structure sequence serves as the basic structural data input of the graph neural network.
Claims
1. A method for coordinated prediction of regional charge and discharge load based on dynamic spatiotemporal graph neural networks, characterized in that, Includes the following steps: Historical load data, spatiotemporal correlation feature data, and external influencing factor data of charging and discharging nodes are acquired and preprocessed to form a standardized dataset. The spatiotemporal correlation feature data includes the geographic coordinate information of each charging and discharging node, and the external influencing factor data includes electricity price information, date type, meteorological environment data, and surrounding point of interest features. The charging and discharging nodes are mapped to nodes, and the spatiotemporal correlation feature data and external influencing factor data are used as node feature attributes. The connection edges between nodes are constructed based on preset dynamic correlation rules or a weighted function of geographical distance and load correlation. The preset dynamic association rules are as follows: If the Euclidean distance between the geographic coordinates in the node feature attributes of two nodes is less than the preset geographic distance threshold, then a connection edge is established based on spatial proximity. If the Euclidean distance between the geographic coordinates in the node feature attributes between nodes is greater than or equal to the preset geographic distance threshold, then when the correlation coefficient of the historical load data in the node feature attributes between the two nodes is higher than the preset correlation threshold, a connection edge is established based on the load correlation. If the above rules are exceeded, the weights of the edges are determined by a weighting function based on geographical distance and load correlation, connecting edges are established, and the graph structure is extracted to obtain a dynamic spatiotemporal graph structure sequence; After obtaining the first, second, and third mapped data, a graph structure is built based on nodes, node feature attributes, and connecting edges. Within a preset time step, the graph structure is truncated to obtain a dynamic spatiotemporal graph structure sequence. The numerical continuous features related to historical load data, electricity price information, and meteorological environment data in the dynamic spatiotemporal map structure sequence are mapped to the hidden feature space to obtain the first mapped data. The multi-type discrete category features related to date type and surrounding points of interest features in the dynamic spatiotemporal map structure sequence are converted into high-dimensional sparse binary vectors and then mapped to low-dimensional dense feature vectors to obtain the second mapped data. The geographic coordinate information in the dynamic spatiotemporal map structure sequence is mapped to continuous feature vectors that can perceive the absolute position of nodes in space and their relative distance constraints to obtain the third mapped data. Based on the similarity measures of the first, second, and third mapped data, a load correlation adjacency matrix is constructed. Based on the similarity measure of the second mapped data, a functional coupling adjacency matrix is constructed. Based on the similarity measure of the third mapped data, a geographic distance adjacency matrix is constructed. After performing graph convolution to obtain multi-dimensional spatial features, a weighted fusion is achieved through a cross-channel attention mechanism to finally form a comprehensive spatial feature. Based on the short-term fluctuations, periodic changes, and long-term trend characteristics of historical load data in the dynamic spatiotemporal graph structure sequence, trend terms, periodic terms, and residual terms are obtained and modeled to obtain trend characteristics, periodic characteristics, and residual characteristics as time features. By fusing spatial and temporal features, a spatiotemporal fusion feature is obtained. Based on the spatiotemporal fusion feature, the load forecast values of each charging and discharging node and the total regional load forecast value are obtained within a specific future time period.
2. The regional charge-discharge load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The geographic coordinate information includes the longitude and latitude of the charging station. The historical load data describes the load changes under different meteorological conditions, time periods, and electricity pricing policies. The electricity price information describes the unit electricity price corresponding to the user's charging operation. The date type describes the work or rest attribute of the date. The meteorological environment data includes the daily maximum temperature, daily minimum temperature, daily average temperature, average relative humidity, and daily cumulative rainfall in the collection area. The surrounding points of interest features describe the quantity, density, and type distribution of various facilities within a certain service radius of the charging station, so as to indirectly characterize the charging demand potential and user behavior patterns in the area.
3. The regional charging and discharging load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The preprocessing includes: If outlier data occurs at extreme values or has significant characteristics such as spikes, it is as follows: The vertical processing method is selected to correct outliers, and the formula is as follows: If abnormal data appears during a stable phase of the curve, select the two data points before and after it as a baseline, and use the following formula: If all inequalities are true, determine if it is an outlier. Use the leveling method to handle outliers and calculate the correction value, as shown in the formula below: In the formula, Input data for the load node of the i-th charging station at time t. Let A be the average load over the past week at time t, and let A be the set threshold.
4. The regional charge-discharge load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The weight formula for the edge is as follows: in, Let it be a distance function. This is the load correlation function. and These are non-negative weighting coefficients.
5. The regional charge-discharge load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The formula for the trend characteristic is as follows: 。 Among them, z t r is an update gate used to control the inheritance of past information from the current state. t This is a reset gate used to determine the role of historical information in the current state. Candidate state; The updated gate formula is as follows: Among them, X trend It mainly reflects the overall direction of change in charging load, such as long-term fluctuations caused by seasonal or policy adjustments.
6. The regional charge-discharge load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The periodic characteristic formula is as follows: , Among them, H periodic This mainly reflects the periodic fluctuations in charging load. Q is the query vector, K is the key vector, and V is the value. The dimension of the key vector.
7. The regional charge-discharge load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The residual characteristic formula is as follows: Among them, depthwise convolution is used to extract local features within a channel, and pointwise convolution is used to adjust the channel dimensions. residual It mainly depicts short-term, sudden dynamics.
8. The regional charge-discharge load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The dynamic association rules are as follows: If the Euclidean distance between the geographic coordinates in the node feature attributes of two nodes is less than the preset geographic distance threshold, then a connection edge is established based on spatial proximity. If the Euclidean distance between the geographic coordinates in the node feature attributes between nodes is greater than or equal to the preset geographic distance threshold, then when the correlation coefficient of the historical load data in the node feature attributes between the two nodes is higher than the preset correlation threshold, a connection edge is established based on the load correlation.
9. The regional charging and discharging load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, The calculation steps for the first mapped data, the second mapped data, and the third mapped data are as follows: The relevant numerical continuous features of historical load data, electricity price information, and meteorological environment data in the dynamic spatiotemporal graph structure sequence are mapped to the hidden feature space to obtain the data after the first mapping. The date type and surrounding interest point features in the dynamic spatiotemporal graph structure sequence are converted into high-dimensional sparse binary vectors and then mapped to low-dimensional dense feature vectors to obtain the second mapped data. The geographic coordinate information in the dynamic spatiotemporal graph structure sequence is mapped into a continuous feature vector that can perceive the absolute position of the node in space and its relative distance constraints, resulting in the third mapped data.
10. The regional charge-discharge load collaborative prediction method based on dynamic spatiotemporal graph neural network as described in claim 1, characterized in that, Based on the short-term fluctuations, periodic changes, and long-term trend characteristics of historical load data in the dynamic spatiotemporal graph structure sequence, the trend term, periodic term, and residual term are obtained and modeled to obtain trend characteristics, periodic characteristics, and residual characteristics as time characteristics.