Charging station cluster load forecasting method and system with deep integration of exogenous variables
Through the deep integration of the sequential graph neural network and the Transformer model of the cross-attention mechanism, the exogenous and endogenous variable characteristics of the charging station cluster are extracted and processed, which solves the problem of insufficient accuracy of charging station cluster load prediction in the existing technology and achieves More accurate and flexible load forecasting.
Patent Information
- Application Number
- CN202410962169.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Existing technology is difficult to accurately process the multi-dimensional spatiotemporal characteristic data and complex load changes of charging station clusters, resulting in insufficient accuracy of charging station cluster load prediction.
The time series graph neural network is used to extract the data characteristics of exogenous variables and endogenous variables, and the Transformer model of the cross-attention mechanism is used for deep fusion to generate a multivariate comprehensive feature vector for training to achieve real-time prediction of the load of the charging station cluster.
It improves the accuracy and adaptability of charging station cluster load prediction, can more comprehensively reflect the actual operating status of charging station clusters, and enhances the robustness and interpretability of the model.
Smart Images

Figure CN118504792B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of charging station load prediction, and in particular to a charging station cluster load prediction method and system with deep integration of exogenous variables. Background Art
[0002] With the decreasing reserves of traditional fossil energy, the in-depth implementation of energy conservation, environmental protection, energy conservation and emission reduction policies, and the vigorous development of clean energy vehicles such as electric vehicles and the corresponding charging facilities have become an inevitable trend. However, the access of large-scale electric vehicle clusters has brought significant challenges to the safe and stable operation of the distribution network. At the same time, the high charging power and strong load fluctuation of the electric vehicle charging station cluster will further increase the risk of distribution network collapse. Therefore, in order to smooth the load fluctuation of the charging cluster and ensure the safety and stability of the distribution network, it is necessary to carry out accurate load forecasting of electric vehicle charging station clusters and optimize the distribution network dispatching strategy.
[0003] At present, the load forecasting methods for electric vehicle charging station clusters are mainly divided into two categories: mechanism model driven and data driven. Among the mechanism model driven methods, the Monte Carlo method is a more commonly used one. This method generates a variety of possible charging load scenarios by simulating and calculating data such as the driving time and daily mileage of electric vehicles, thereby providing more accurate forecasting results. Compared with the mechanism model driven method, the data-driven method does not require complex model formula deduction and assumption of actual model parameters. By making full use of historical data and exogenous variables, it can accurately capture complex charging demand patterns and load change trends, thereby providing a scientific basis for the optimal layout and operation of electric vehicle charging stations. Therefore, it is urgent to carry out in-depth research on data-driven forecasting models.
[0004] Integrating and extracting the features of exogenous variable data is a key measure to improve the accuracy of load forecasting. The inventors found that the current conventional feature extraction methods cannot simultaneously process the multivariate feature data of charging station clusters with spatiotemporal characteristics. In addition, the load forecasting of charging station clusters often requires a combination of multiple variables, and the existing traditional model prediction methods are difficult to simultaneously process the complex spatiotemporal dependencies of multiple variables. Therefore, there is still room for further improvement in the existing models and methods. Summary of the invention
[0005] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a charging station cluster load prediction method and system with deep fusion of exogenous variables, considering the influence of the exogenous variable data contained in the actual charging station cluster on the prediction accuracy of the endogenous variables, adopting a time series graph neural network and two data segmentation methods to respectively extract the data features of the exogenous variables and the endogenous variables, generate training samples, and adopt a Transformer prediction model based on the cross-attention mechanism for fusion and training. In actual application, real-time data is obtained to realize accurate charging station cluster load prediction.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0007] A first aspect of the present invention provides a charging station cluster load forecasting method with deep integration of exogenous variables.
[0008] The charging station cluster load forecasting method with deep integration of exogenous variables includes the following steps:
[0009] The electric vehicle charging station cluster is regarded as a node group, and the exogenous variable data and endogenous variable data of the node group are obtained. The exogenous variable data includes meteorological data of the node group, comprehensive charging time cost of users, and road traffic flow and geographical distance between nodes. The endogenous variable data includes historical load time series data of each node;
[0010] The time series graph neural network is used to extract the characteristics of exogenous variable data and obtain the spatiotemporal feature vector of the charging station. The load feature vectors of the endogenous variable data set are extracted from the global variable and segmented time series levels to obtain the trend and seasonal feature vectors, as well as the local feature vector of the load.
[0011] The spatiotemporal feature vectors of the charging station, as well as the trend and seasonal feature vectors, are integrated to generate a multivariate comprehensive feature vector. The Transformer prediction model based on the cross-attention mechanism is constructed by training the multivariate comprehensive feature vector and the local feature vector of the load.
[0012] The real-time data of exogenous variables is obtained and input into the trained Transformer prediction model based on the cross-attention mechanism to obtain the load prediction results of the charging station cluster.
[0013] A second aspect of the present invention provides a charging station cluster load forecasting system with deep integration of exogenous variables.
[0014] The charging station cluster load forecasting system with deep integration of exogenous variables includes:
[0015] The data set construction module is configured to: regard the electric vehicle charging station cluster as a node group, obtain exogenous variable data and endogenous variable data of the node group, the exogenous variable data includes meteorological data of the node group, comprehensive charging time cost of users, and road traffic flow and geographical distance between nodes, and the endogenous variable data includes historical load time series data of each node;
[0016] The feature extraction module is configured to: extract the features of exogenous variable data using a time series graph neural network to obtain the spatiotemporal feature vector of the charging station; extract the load feature vector of the endogenous variable data set from the global variable and segmented time series levels to obtain the trend and seasonal feature vectors, as well as the load local feature vector;
[0017] The feature fusion and model training module is configured to: fuse the spatiotemporal feature vectors of the charging station, as well as the trend and seasonal feature vectors, to generate a multivariate comprehensive feature vector, and train a Transformer prediction model based on a cross-attention mechanism using the multivariate comprehensive feature vector and the load local feature vector;
[0018] The prediction module is configured to: obtain real-time data of exogenous variables, input the real-time data of exogenous variables into the trained Transformer prediction model based on the cross-attention mechanism, and obtain the load prediction result of the charging station cluster.
[0019] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the charging station cluster load forecasting method with deep fusion of exogenous variables as described in the first aspect of the present invention.
[0020] The fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the charging station cluster load forecasting method with deep fusion of exogenous variables as described in the first aspect of the present invention are implemented.
[0021] One or more of the above technical solutions have the following beneficial effects:
[0022] (1) The main innovation of the present invention is to use a time-series graph neural network and two data segmentation methods to extract data features of exogenous variables and endogenous variables, generate training samples, and use a Transformer prediction model based on a cross-attention mechanism for fusion and training. In practical applications, real-time data is obtained to achieve accurate charging station cluster load prediction.
[0023] (2) The present invention considers the impact of multi-source exogenous variables on the load prediction accuracy of the charging station cluster in real scenarios, and deeply integrates the data characteristics of exogenous variables and endogenous variables, so that the prediction model can more comprehensively and accurately reflect the actual operating status of the charging station cluster.
[0024] (3) The present invention considers the dynamic spatiotemporal characteristics of charging station clusters and uses a time-series graph neural network to process exogenous variable data. G t , extracting the dynamically fluctuating spatiotemporal feature vectors of charging stations, improving the reliability of feature extraction and the interpretability of the prediction model.
[0025] (4) The present invention processes the endogenous variable data set through two data segmentation methods, extracts load feature vectors from the two levels of global variables and segmented time series, decouples the charging station load curve from the perspective of global variables, extracts trend and seasonal feature vectors, and obtains local feature vectors of load data from the segmented perspective, which helps to accurately characterize the complex dynamic behavior of load data.
[0026] (5) Compared with the original Transformer prediction model, the present invention adopts a multi-head cross-attention mechanism to fuse the multi-dimensional comprehensive feature vector and the load local feature vector, and uses multi-head attention to project the Q, K and V matrices into multiple subspaces. Each subspace performs attention calculation independently, and the final result is obtained after deep fusion and linear transformation, thereby enhancing the robustness of the model.
[0027] (6) The present invention dynamically updates the cross-attention score during matrix fusion based on real-time vehicle flow and user comprehensive time cost data, and uses the optimal Transformer prediction model after score update to output the charging station cluster load prediction result, thereby improving the adaptability and accuracy of the model prediction.
[0028] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0030] Figure 1 This is a flow chart of the method provided in Embodiment 1 of the present invention.
[0031] Figure 2 A schematic diagram of a timing diagram neural network provided in Example 1 of the present invention.
[0032] Figure 3(a) is a schematic diagram of the Transformer prediction model based on the cross-attention mechanism provided in Example 1 of the present invention.
[0033] FIG3( b ) is a schematic diagram of the attention mechanism provided in Embodiment 1 of the present invention.
[0034] Figure 3(c) is a schematic diagram of the multi-head attention mechanism provided in Example 1 of the present invention.
[0035] Figure 4 A schematic diagram of a system provided in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0036] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0037] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.
[0038] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0039] Overall concept:
[0040] The present invention provides a method and system for predicting the load of a charging station cluster with deep fusion of exogenous variables, which deeply integrates exogenous variables with endogenous variables and fully considers the exogenous variable data characteristics and endogenous variable load data characteristics of the charging station cluster:
[0041] The time-series graph neural network is used to extract the characteristics of exogenous variables and obtain the spatiotemporal feature vector of the charging station. Two data segmentation methods are used to decouple the characteristics of endogenous variables, extract the load feature vector from the global variable and segmented time series levels, and extract the trend and seasonal feature vectors from the global variable to obtain the local feature vector of the load data from the segmented perspective.
[0042] Based on the extracted exogenous variable features and endogenous variable features, a multivariate comprehensive feature vector is obtained based on the early feature fusion method, and a training sample set is generated together with the local load features;
[0043] Construct a Transformer prediction model based on the cross-attention mechanism, establish a Transformer prediction model based on the cross-attention mechanism, deeply integrate the spatiotemporal dependency between the multi-dimensional comprehensive feature vector and the load local feature vector, train the prediction model offline, and retain the optimal model parameters;
[0044] When applied online, the real-time exogenous variable information is collected, the cross-attention score during matrix fusion is dynamically updated, and the optimal model parameters are used to output the charging station cluster load prediction results, thereby accurately capturing the dynamic spatiotemporal changes of the charging load and improving the accuracy of the electric vehicle charging station cluster load prediction.
[0045] Among them, the charging station cluster load forecasting method with deep integration of exogenous variables includes the following specific steps:
[0046] (1) Obtain node group meteorological data, user comprehensive charging time cost, and road traffic volume as exogenous variable data sets, and obtain historical load time series data of each node as endogenous variable data sets. After data preprocessing, generate an initial sample set;
[0047] (2) Using a time-series graph neural network to process exogenous variable data, we extract the dynamic and fluctuating spatiotemporal feature vectors of charging stations and obtain the spatiotemporal coupling relationship between exogenous variables.
[0048] (3) Based on two data segmentation methods, load feature vectors are extracted from the global variable and segmented time series levels. The charging station load data curve is decoupled from the global perspective, and the basic fixed trend and seasonal feature vectors are extracted. The load local feature vector is obtained from the load data segmentation perspective.
[0049] (4) An early feature fusion method is used to fuse the dynamically fluctuating spatiotemporal feature vectors of charging stations with the basic fixed trend and seasonal feature vectors to generate a multivariate comprehensive feature vector, which is then concatenated with the local feature vector of the load to jointly generate a training sample set.
[0050] (5) Construct a Transformer prediction model based on the cross-attention mechanism, input the training samples into the encoder and decoder parts of the model to obtain the Q, K and V matrices, further integrate the three through the cross-attention mechanism, and obtain the optimal Transformer prediction model training parameters through offline training;
[0051] (6) When applied online, real-time data of exogenous variables is obtained, the cross-attention scores are dynamically corrected, and the optimal Transformer prediction model after the attention scores are updated is used to output accurate charging station cluster load prediction results.
[0052] Embodiment 1
[0053] like Figure 1 As shown, first, this embodiment will explain the charging station cluster load forecasting method with deep integration of exogenous variables as a whole. It specifically includes the following steps:
[0054] Step 1: Consider the actual electric vehicle charging station cluster as a node group, obtain the node group meteorological data, user comprehensive charging time cost, road traffic flow and geographical distance between nodes as exogenous variable data sets, obtain the historical load time series data of each node as endogenous variable data sets, and generate the initial sample set after data preprocessing;
[0055] Step 2: Use time-series graph neural network to process exogenous variable data and extract the dynamic and fluctuating spatiotemporal feature vectors of charging stations; process endogenous variable data sets based on two data segmentation methods, extract load feature vectors from the global variable and segmented time series levels, decouple the charging station load data curve from a global perspective, extract trend and seasonal feature vectors, and obtain load local feature vectors from a segmented perspective;
[0056] Step 3: Use the early feature fusion method to fuse the spatiotemporal feature vector of the charging station with the trend and seasonal feature vectors to generate a multivariate comprehensive feature vector, which together with the local feature vector of the load constitutes a training sample set;
[0057] Step 4: Construct a Transformer prediction model based on the cross-attention mechanism, input the multivariate comprehensive feature vector into the decoder to obtain the Query (Q) matrix, input the load local feature vector into the encoder to obtain the Key (K) and Value (V) matrices, and further integrate the Q, K and V matrices through the cross-attention mechanism. With the goal of minimizing the load prediction error, train the electric vehicle charging station cluster load prediction model offline to obtain the optimal Transformer prediction model training parameters;
[0058] Step 5: Obtain real-time data of exogenous variables, dynamically correct the cross-attention score, and use the optimal Transformer prediction model after updating the attention score to output the charging station cluster load prediction results online.
[0059] As an optional implementation, the user's comprehensive charging time cost includes electricity price, parking fee, queuing time cost, driving distance cost and charging convenience cost.
[0060] The various time costs have dynamic and random characteristics, which leads to dynamic changes in the comprehensive charging time cost. The calculation method is the sum of several costs:
[0061]
[0062] in, User comprehensive charging time cost; indicates represents the electricity price cost; Indicates parking fee; represents the queuing time cost; represents the travel distance cost; t Indicates a fixed interval of time.
[0063] As an optional implementation, it also includes:
[0064] The exogenous and endogenous variable data sets are preprocessed to remove outliers and fill missing values using linear interpolation. The Z-score normalization method is used to process meteorological data, user comprehensive charging time cost, vehicle flow data, and charging station cluster load data to obtain the initial sample set.
[0065] As an optional implementation, a time series graph neural network is used to process exogenous variable data, specifically:
[0066] The time series graph neural network is used to fully extract the exogenous variable data characteristics of the charging station cluster. t , both introduce spatial graphs G t =( V t , E t ), to represent the spatiotemporal characteristics of the dynamic changes among charging station clusters, where V t is the node of the graph, E t is the edge information of the graph.
[0067] Combine the meteorological data at a certain moment and the user's comprehensive charging time cost as the nodes of the graph V t :
[0068]
[0069] in, Middle i Charging station No. t The node feature vector at the moment; For the i Charging station No. t Meteorological data vector at each moment; For the i Charging station No. t The comprehensive charging time cost of the user at each moment; {·} represents a vector set.
[0070] Get a charging station v i and v j The road traffic information between them is used as the edge information of the graph E t ,Considering that the real-time traffic flow information in the application scenario is dynamically changing, different traffic flows will correspond to different charging station connection relationships, E t It can be expressed as:
[0071]
[0072] in, For the i and j Between charging stations t The edge feature vector at each moment is between 0 and 1 after normalization. The larger the value, the stronger the correlation, and 0 means no connection. Softmax() is a normalization process.
[0073] As an optional implementation, two data segmentation methods are used to process the endogenous variable data set, specifically:
[0074] Get the charging station cluster historical load data set matrix, expressed as:
[0075]
[0076] Where X represents the load data set, including N Charging stations T time steps; Load data sets coded for marking timing and charging stations; is the specific load data set matrix. i , j They are time series index and charging station coding index respectively.
[0077] The first segmentation method focuses on the global time characteristics between load sequences. It uses different charging stations as indexes to segment the load dataset X and obtain the overall load time series of each charging station. , decoupling h i Extract trend and seasonal characteristics of load series.
[0078] The second segmentation method focuses on the local time characteristics within the load sequence and uses the Patch method to segment the load sequence and create the first n Charging stations The set of segment load sequences is expressed as:
[0079]
[0080] in, i is the new time series index, with a segment size of f , the number of segments is .
[0081] As an optional implementation, the decoupling h i Extract the trend and seasonal characteristics of the load series, specifically:
[0082] Design a decoupling function in the model to process the multivariate load sequence and obtain trend and seasonal characteristics. Decouple the slowly changing monotonic characteristics from the original load sequence as the trend part X tr , average pooling is used for moving average, and the padding operation is used to keep the sequence length unchanged, which is expressed as:
[0083]
[0084] in, For the i Load trend characteristics of each charging station; Padding (·) is a data padding method that pads different sequences to the same length; AvgPool (·) is the average pooling method.
[0085] The regular, periodic, and recurring fluctuation characteristics are decoupled from the original load sequence, that is, the non-stationary part of the original sequence, as the seasonal characteristics. X se , expressed as:
[0086]
[0087] in, For the i The seasonal characteristics of the load of the charging station.
[0088] As an optional implementation method, an early feature fusion method is used to fuse the spatiotemporal feature vectors of the charging station with the trend and seasonal feature vectors, specifically:
[0089] Early feature fusion directly combines multiple original features at the beginning of data processing. The method is simple and efficient, and the information integrity is preserved. The multi-source data is fused using the series feature fusion method in early fusion to obtain the multivariate comprehensive feature vector of the charging station cluster at a certain moment, which can be expressed as:
[0090]
[0091] in, Indicates that the charging station cluster is in t The new feature vector of the node at each moment, i.e., the multivariate comprehensive feature vector; Represents the first i Charging station No. t The node feature vector at each moment; Concat(·) represents the series feature fusion method.
[0092] As an optional implementation, a Transformer prediction model based on the cross-attention mechanism is constructed, specifically:
[0093] The Transformer prediction model mainly consists of two parts: the encoder and the decoder. The encoder includes a multi-head attention mechanism layer and a feedforward neural network; the decoder includes a masked self-attention layer, an Encoder-Decoder self-attention layer and a feedforward neural network.
[0094] In the decoder's Encoder-Decoder self-attention layer, a multi-head cross-attention mechanism is used for data fusion. Input encoder to generate Key(K) and Value(V) matrix; cluster charging stations in the first t The new feature vector of the node at time Input the decoder to generate the Query (Q) matrix. The Q, K and V matrices are fused through the cross attention mechanism, and the scaled dot product attention mechanism is used to calculate the attention score between Q and K. The calculated attention score is weighted to the V matrix to obtain the cross attention output of a single head.
[0095] In order to capture richer feature information, a multi-head attention mechanism is used to project the Q, K and V matrices into multiple subspaces respectively, and the attention calculations in the subspaces are performed independently. After the outputs of each subspace are spliced, a linear transformation is performed to obtain the final attention output, which is used to input the Transformer prediction model feedforward neural network to obtain the training output results and complete the training process.
[0096] As an optional implementation, real-time data of exogenous variables is obtained to dynamically correct the cross-attention score, specifically:
[0097] In the real-time charging station cluster load prediction scenario, the user's comprehensive charging time cost and road traffic data change in real time, and the eigenvalues of the Q matrix change dynamically. When the scaled dot product attention mechanism is used to calculate the Q matrix and the K matrix, a new cross-attention score is generated. The scores processed by multiple heads are updated to the Transformer prediction model, and the charging station cluster load prediction results are quickly output.
[0098] In this embodiment, considering the periodic changes of the daily charging load of electric vehicles, the prediction time scale adopts 24-hour short-term prediction, the prediction time interval is set to 1 hour, and the model update time period is set to 24 hours.
[0099] In this embodiment, in step 1, meteorological data, road traffic volume, geographic distance and load time series data are obtained by two methods: field monitoring and acquisition from a historical database. Considering that meteorological data has two forms, character and numerical, the numerical processing method is used to process the meteorological data as shown in Table I:
[0100] Table Ⅰ Meteorological data numerical processing table
[0101]
[0102] In this embodiment, the vehicle flow and load sequence information collected through field monitoring corresponds to the real-time data 2 hours ago, and the meteorological information can be obtained from the official weather forecast website for the current and next 24 hours, with a time interval of 1 hour.
[0103] In this embodiment, the user's comprehensive charging time cost includes electricity price, parking fee, queuing time cost, driving distance cost and charging convenience cost, and is calculated as the sum of several costs:
[0104]
[0105] in, User comprehensive charging time cost; indicates represents the electricity price cost; Indicates parking fee; represents the queuing time cost; represents the travel distance cost; t Indicates a fixed interval of time.
[0106] In this embodiment, data preprocessing includes a linear interpolation method. Considering the real problems that may exist in the process of real-time collection of meteorological, load and traffic flow data, a linear interpolation method is used to fill in missing value data. Assume two known points ( x 1, y 1) and ( x 2, y 2), the formula for linear interpolation is:
[0107]
[0108] In this embodiment, the data preprocessing method also includes a normalization processing method. Considering the diverse data types and different dimensions in the initial sample set, the Z-score normalization method is used to process meteorological data, user comprehensive charging time cost, vehicle flow data, and charging station cluster load data. The expression is as follows:
[0109]
[0110] in, x i is a data point; is the data mean; is the data standard deviation; Z i for x i The Z-score value of
[0111] In the step 2, considering the geographical distribution characteristics of the actual electric vehicle charging station cluster, a time series graph neural network is used to process the exogenous variable data, extract the dynamically fluctuating spatiotemporal feature vectors of the charging stations, and obtain the spatiotemporal coupling relationship between the exogenous variables.
[0112] In this embodiment, the time series graph neural network can fully extract the exogenous variable data features of the charging station cluster. t , introducing the spatial graphG t =( V t , E t ), then the temporal graph neural network can be represented as a graph sequence [ ],in, Indicates τ A graph neural network at each moment is used to represent the spatiotemporal characteristics of the dynamic changes among charging station clusters, such as Figure 2 As shown in the figure, the meteorological data at a certain moment and the user's comprehensive charging time cost are spliced together as nodes of the graph. V t :
[0113]
[0114] in, Middle i Charging station No. t The node feature vector at the moment; For the i Charging station No. t Meteorological data vector at each moment; For the i Charging station No. t The comprehensive charging time cost of the user at each moment; {·} represents a vector set.
[0115] In this embodiment, the charging station is obtained v i and v j The road traffic flow information and distance information between them are used as the edge information of the graph E t Considering that in the application scenario, as the traffic volume increases, the road congestion often shows a nonlinear growth, which leads to drivers being more inclined to find alternative routes or postpone travel. This change in driver willingness is more obvious when the traffic volume is large. In addition, the geographical distance will serve as the basic connection relationship between the two charging stations and will not change over time. Therefore, the connection relationship between charging stations It can be expressed as:
[0116]
[0117] in, T ij Indicates the road traffic volume; D ij Indicates the geographical distance information between charging stations; It indicates driver willingness, which is negatively correlated with traffic volume, and its value is between 0 and 2.
[0118] In this embodiment, the edge adjacency matrix with self-loops in the time sequence graph E t , which can be expressed as:
[0119]
[0120] in, For the i and j Between charging stations t The edge feature vector at each moment is between 0 and 1 after normalization. The larger the value, the stronger the correlation, and 0 indicates no connection. Softmax(·) is the normalization function.
[0121] In this embodiment, for a fixed time point, the dynamic graph will become a static graph. The number of graph neural network layers used in this application is 3, and it is an undirected graph, as shown in the figure Figure 2 The static image is shown in l The layers can be expressed as:
[0122]
[0123] Where D is a diagonal matrix; Represents row and column normalization of the adjacency matrix; Indicates l Layer and l -1 node embedding, , and They are l -1st floor and l The node representation dimension of the layer; is the layered linear transformation matrix; is the ReLU activation function.
[0124] In this embodiment, the feature extraction process of the time series graph neural network is as follows:
[0125] S1. Constructing a sequence of temporal graph neural networks[ , to represent the spatiotemporal characteristics of the dynamic changes among charging station clusters;
[0126] S2, the initial feature input of the graph neural network, taking the meteorological data of the charging station cluster in each time period and the user's comprehensive charging time cost as the node feature vector of the graph , taking the traffic flow, driver willingness and geographical distance characteristics of each time period as the edge features of the graph .
[0127] S3, graph neural network feature extraction process, extracts features from the static graph at each time point in the dynamic graph respectively. The number of neural network layers of each static graph is 3 to obtain the final node representation.
[0128] In the step 2, load characteristic vectors are extracted from the global variable and segmented time series levels based on two data segmentation methods, the charging station load data curve is decoupled from a global perspective, the basic fixed trend and seasonal characteristic vectors are extracted, and the load local characteristic vector is obtained from the load data segmentation perspective.
[0129] In this embodiment, the charging station cluster historical load data set matrix is:
[0130]
[0131] Where X represents the load data set, including N Charging stations T time steps; Load data sets coded for marking timing and charging stations; is a specific load data set matrix. In this embodiment, the first segmentation method focuses on the global time characteristics between load sequences, and uses different charging stations as indexes to segment the load data set X to obtain the overall load time series of each charging station. , decoupling h i Extract trend and seasonal characteristics of load series.
[0132] In this embodiment, a decoupling function is designed to process the multivariate load sequence to obtain trend and seasonal characteristics. The slowly changing monotonic characteristics are decoupled from the original load sequence as the first i Trending part of the charging station load X tr,i , the decoupling method is to use average pooling ( AvgPool ) to perform moving average and combine with filling operation ( Padding ) keeps the sequence length unchanged, expressed as:
[0133]
[0134] In this embodiment, Padding (·) is a data filling method that fills different sequences to the same length. Considering the periodicity and regularity of load changes, the load at the same time of the previous day is used for filling to prevent the model from learning irrelevant features.
[0135] In this embodiment, AvgPool (·) is the average pooling method, which uses a one-dimensional average pooling operation to retain important features. The calculation formula is:
[0136]
[0137] in, Indicates nCharging station t Data for time steps; k is the pooling window size.
[0138] In this embodiment, the regular, periodic, and recurring fluctuation characteristics, that is, the non-stationary part of the original sequence, are decoupled from the original load sequence as the first i Seasonal characteristics of charging station load X se,i , expressed as:
[0139]
[0140] In this embodiment, the second segmentation method focuses on the local time characteristics within the load sequence and uses the Patch method to segment the load sequence. The load sequence is divided into multiple smaller "blocks" or "segments". n Charging stations The set of segment load sequences is expressed as:
[0141]
[0142] in, t is a sequence index of a time period, and the segment size is f , the number of segments is .
[0143] In this embodiment, load segmentation can analyze the time characteristics within each segment and identify patterns that recur within a specific time period, such as the load difference between weekdays and weekends, the impact of holidays, and load peaks and valleys within the day, thereby improving the model's sensitivity to local characteristics.
[0144] In the step three, an early feature fusion method is used to fuse the dynamically fluctuating spatiotemporal feature vector of the charging station with the basic fixed trend and seasonal feature vectors to generate a multivariate comprehensive feature vector, which is then concatenated with the local feature vector of the load to jointly generate a training sample set.
[0145] In this embodiment, considering that the exogenous features of the charging station cluster extracted by the time series graph neural network and the trend and seasonal load features obtained by the first data segmentation method have a coupling relationship, the series feature fusion method in early fusion is used to splice the multi-source data to obtain the multivariate comprehensive feature vector of the charging station cluster at a certain moment, which more accurately reflects the actual situation of each charging station at that moment, and can be expressed as:
[0146]
[0147] in, Indicates that the charging station cluster is in tThe new feature vector of the node at the moment; Represents the first i Charging station No. t The node feature vector at each moment; Concat(·) represents the series feature fusion method, i.e., vector concatenation.
[0148] In this embodiment, the multivariate comprehensive feature vector of the charging station cluster and the local eigenvector of the load Generate a training sample set together. Early feature fusion methods can effectively integrate data features from different sources, build a more comprehensive and accurate training sample set, and improve the model's predictive ability and generalization performance.
[0149] In the step 4, a Transformer prediction model based on the cross-attention mechanism is constructed, and the training sample set is input into the encoder and decoder parts of the model to obtain the Q, K and V matrices. The three are further integrated through the cross-attention mechanism, and offline training is performed to obtain the optimal Transformer prediction model training parameters.
[0150] As shown in Figure 3 (a), the Transformer prediction model mainly consists of four parts: input, output, encoder, and decoder.
[0151] Input part. Considering that the time series data processed in this paper has continuous features, there is no need to use the value embedding layer in the original Transformer to project the original data into a higher-dimensional space. The input part is the data after the multivariate comprehensive feature vector is positionally encoded (PE). The calculation method of position encoding PE is expressed as:
[0152]
[0153] Among them, pos represents the absolute position of the word in the sentence; d model Represents the dimension of the daily comprehensive feature vector; 2 i and 2 i +1 indicates parity, i =0,1,…, d model / 2-1.
[0154] The linear layer of the output part is an ordinary fully connected network, which converts the vector output by the decoder into the output data dimension size to facilitate the input of the prediction model at the next moment.
[0155] The core of the model is the encoder and decoder. NThe encoder module includes a multi-head self-attention mechanism layer and a feedforward neural network; the decoder module includes a masked multi-head self-attention layer, an Encoder-Decoder multi-head cross attention layer and a feedforward neural network.
[0156] The core of the encoder and decoder is the (masked) multi-head attention mechanism layer. As shown in Figure 3 (b) and Figure 3 (c), the matrix inputs of the self-attention layer Q, K, and V in the encoder and decoder are the result of mapping homologous vectors to different dimensional spaces. The matrix inputs of the cross-attention layer Q, K, and V when the encoder and decoder are fused are the result of mapping non-homologous vectors to different dimensional spaces. The masked multi-head attention layer is located in the decoder.
[0157] For the specific calculation process, see the description of model construction and training methods:
[0158] In this embodiment, as shown in FIG. 3(a), FIG. 3(b) and FIG. 3(c), the Transformer model construction and training process is as follows:
[0159] S1, input and initialization part. 70% of the normalized training sample set is used as the training set, and 30% is used as the test set. The load segment local feature vector Input encoder; cluster charging stations in the first t The new feature vector of the node at time Input decoder. Initialize the parameters of the Transformer prediction model, including all weights and biases in the encoder and decoder.
[0160] S2, encoder part. For each training sample, the encoder processes the local features of the load segment, generates the corresponding encoding representation through position encoding, multi-head self-attention module, residual connection and layer normalization, and inputs the node feature vector of the charging station cluster at the tth moment into the decoder. Specifically, the encoder's query Q, key K and value V position vector self-attention encoding is calculated as follows:
[0161]
[0162] in, They are the weight matrices of Q, K, and V in the encoder respectively; is the multivariate comprehensive feature vector; , and are self-attention encodings of the query Q, key K, and value V position vectors, respectively.
[0163] Then, the scaled dot product self-attention score calculation in Figure 3 (b) is performed:
[0164]
[0165] in, is the dimension of matrix K, which is used to scale the dot product and stabilize the gradient size.
[0166] Matrix multiplication yields the feature weighted output of the encoder:
[0167]
[0168] On this basis, in order to capture richer feature information, a multi-head attention mechanism is used to project the Q, K, and V matrices into multiple subspaces respectively, and independently perform attention calculations in the subspaces. After splicing the outputs of each subspace, the final attention output is obtained. The calculation block diagram is shown in Figure 3 (c), and the calculation formula is as follows:
[0169]
[0170] in, h is the number of attention heads; the dimensions of the attention weight matrix are , , ; dim is the time series embedding dimension.
[0171] S3, decoder part. First, the local feature data of the load is masked through the masked multi-head self-attention module before the self-attention calculation is performed. The mask in the mask represents masking, and the code is the value in the tensor. Its size is uncertain, and it generally only contains elements of 1 and 0, indicating that the position is masked or not. Since the entire output result will be positionally encoded at one time during training, in theory, the output of the decoder cannot produce the final result in one go, but is synthesized from the previous result again and again. Therefore, it is necessary to use a mask to process future data. The self-attention calculation in the masked self-attention mechanism is exactly the same as that in the encoder, so it will not be repeated. The output is obtained As the input Q matrix in the subsequent cross-attention mechanism.
[0172] Then, a multi-head cross-attention mechanism is used to fuse the encoder's output K, V matrix and the decoder's input Q matrix, and then input them into the linear layer after being processed by the feedforward neural network. Specifically, the cross-attention encoding of the query Q, key K, and value V position vector in the decoder is calculated as follows:
[0173]
[0174] in, They are the weight matrices of Q, K, and V corresponding to the cross attention mechanism in the decoder; , and Cross-attention encodings for query Q, key K, and value V position vectors, respectively.
[0175] The calculation method in Figure 3(b) is used to perform cross-attention score feature weighting output as follows:
[0176]
[0177] Subsequently, the multi-head cross-attention mechanism in S2 is also used in the Encoder-Decoder multi-head cross-attention layer for data fusion, and the data is input into the feedforward neural network to obtain the calculation error of the training output result, and the model parameters are continuously adjusted according to the error size.
[0178] S4. The mean square error (MSE), mean absolute error (MAE) and mean absolute percentage error (MAPE) error calculation methods are used to calculate the error between the predicted results and the actual results, and the error back propagation algorithm is used to calculate the loss function until the error reaches the expected target.
[0179] In step 5, real-time data of exogenous variables is obtained during online application, the cross-attention score is dynamically corrected, and the optimal Transformer prediction model after the attention score is updated is used to output accurate charging station cluster load prediction results. For online real-time charging station cluster load prediction, the following steps are included:
[0180] S1. Evaluate the dynamic changes of the Q matrix eigenvalues based on the real-time changes of the user's comprehensive charging time cost and road traffic flow data;
[0181] S2. Use the scaled dot product self-attention mechanism to calculate the self-attention score between the QKV matrices in the encoder, and then output it to the decoder as the input of the K and V matrices in the decoder's cross attention mechanism;
[0182] S3, the decoder fuses the Q matrix generated by itself and the K and V matrices input by the encoder to generate a new attention score for one head. The cross-attention score after multiple head splicing transformation will be updated to the Transformer prediction model;
[0183] S4. Use the Transformer prediction model with updated scores to quickly output the charging station cluster load prediction results.
[0184] In this embodiment, the real-time data of exogenous variables include meteorological data, user comprehensive charging time cost, traffic flow data and other real-time data that may affect the charging demand.
[0185] It should be noted that, in other embodiments, the values of the above-mentioned specific parameters can be adjusted or changed according to specific prediction requirements.
[0186] Embodiment 2
[0187] This embodiment provides a charging station cluster load forecasting system with deep integration of exogenous variables.
[0188] The charging station cluster load forecasting system with deep integration of exogenous variables provided in this embodiment includes:
[0189] The data set construction module is configured to: regard the electric vehicle charging station cluster as a node group, obtain exogenous variable data and endogenous variable data of the node group, the exogenous variable data includes meteorological data of the node group, comprehensive charging time cost of users, and road traffic flow and geographical distance between nodes, and the endogenous variable data includes historical load time series data of each node;
[0190] The feature extraction module is configured to: extract the features of exogenous variable data using a time series graph neural network to obtain the spatiotemporal feature vector of the charging station; extract the load feature vector of the endogenous variable data set from the global variable and segmented time series levels to obtain the trend and seasonal feature vectors, as well as the load local feature vector;
[0191] The feature fusion and model training module is configured to: fuse the spatiotemporal feature vectors of the charging station, as well as the trend and seasonal feature vectors, to generate a multivariate comprehensive feature vector, and train a Transformer prediction model based on a cross-attention mechanism using the multivariate comprehensive feature vector and the load local feature vector;
[0192] The prediction module is configured to: obtain real-time data of exogenous variables, input the real-time data of exogenous variables into the trained Transformer prediction model based on the cross-attention mechanism, and obtain the load prediction result of the charging station cluster.
[0193] More specifically, Figure 4 As shown, in this embodiment, the data set construction module specifically further includes an information storage module and a data processing module, the feature extraction module further includes an exogenous variable feature extraction module and an endogenous variable feature extraction module, and the feature fusion and model training module further includes a feature fusion and sample generation module, and a model construction module:
[0194] An information storage module is configured to collect original data such as geographic distance, meteorological data, charging electricity price and historical load data, and store model parameters and intermediate variable data as in the first embodiment;
[0195] The data processing module is configured to process different types of raw data. After removing outliers and filling missing values, it uses the Z-score normalization method to process meteorological data, vehicle flow and load data, and extracts endogenous load data features from both the segmented time series and global variable levels;
[0196] The exogenous variable feature extraction module is configured to extract the spatiotemporal features of the continuous changes between the charging station clusters using a time-series graph neural network. The module stores the exogenous variable data obtained by the data processing module into the node features and edge features of the graph, and captures the complex relationship and change pattern of the charging station cluster in the time and space dimensions as a dynamic fluctuation feature;
[0197] The endogenous variable feature extraction module is configured to design trend and seasonal decomposition functions to extract monotonicity and periodicity features from the overall load series of the charging station cluster as basic fixed features;
[0198] The feature fusion and sample generation module is configured to use an early feature fusion method to fuse the spatiotemporal feature vectors of the charging station and the trend and seasonal feature vectors to generate a multivariate comprehensive feature vector, and to generate a training sample set together with the local feature of the load;
[0199] The model building module is configured to build a Transformer prediction model based on the cross-attention mechanism, which includes an encoder and a decoder. It further integrates and analyzes the multivariate comprehensive feature vector and the load local feature vector, trains the prediction model offline, and retains the optimal model parameters.
[0200] The real-time prediction module is configured to collect real-time exogenous variable information in the real-time charging station cluster load prediction scenario, dynamically update the cross-attention score during matrix fusion, and use the optimal model parameters to output the charging station cluster load prediction results.
[0201] Embodiment 3
[0202] The purpose of this embodiment is to provide a computer-readable storage medium.
[0203] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the charging station cluster load forecasting method with deep fusion of exogenous variables as described in Example 1 of the present disclosure.
[0204] Embodiment 4
[0205] The purpose of this embodiment is to provide an electronic device.
[0206] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, the steps in the charging station cluster load prediction method with deep fusion of exogenous variables as described in Example 1 of the present disclosure are implemented.
[0207] The steps involved in the apparatuses of the above embodiments 2, 3 and 4 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.
[0208] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0209] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. Charging station cluster load forecasting method with deep integration of exogenous variables, It is characterized in that The following steps are involved: The electric vehicle charging station cluster is regarded as a node group, and the exogenous variable data and endogenous variable data of the node group are obtained. The exogenous variable data includes meteorological data of the node group, comprehensive charging time cost of users, and road traffic flow and geographical distance between nodes. The endogenous variable data includes historical load time series data of each node; The time-series graph neural network is used to extract the data features of exogenous variables and obtain the spatiotemporal feature vector of the charging station. Extract the load characteristic vectors of the endogenous variable data set from the global variable and segmented time series levels respectively, and obtain the trend and seasonal characteristic vectors, as well as the local characteristic vectors of the load; The load characteristic vectors of the endogenous variable data set are extracted from the global variable and segmented time series levels, including: Get the charging station cluster historical load dataset X, including N Charging stations T time steps; Focusing on the global time characteristics between load series, the first segmentation method is adopted to segment the load data set X with different charging stations as indexes to obtain the overall load time series of each charging station, decouple the overall load time series of each charging station, and extract the trend and seasonal feature vectors of the load time series; Focusing on the local time characteristics within the load sequence, the second segmentation method is used to segment the load sequence and create the first n Charging stations Segment load sequence set, based on the n Charging stations Extract local feature vector of load from segment load sequence set; The spatiotemporal feature vectors of the charging station, as well as the trend and seasonal feature vectors, are integrated to generate a multivariate comprehensive feature vector. The Transformer prediction model based on the cross-attention mechanism is constructed by training the multivariate comprehensive feature vector and the local feature vector of the load. The real-time data of exogenous variables is obtained and input into the trained Transformer prediction model based on the cross-attention mechanism to obtain the load prediction results of the charging station cluster.
2. The charging station cluster load forecasting method with deep fusion of exogenous variables as claimed in claim 1, It is characterized in that The user's comprehensive charging time cost is the sum of electricity price cost, parking fee, queuing time cost and driving distance cost.
3. The charging station cluster load forecasting method with deep fusion of exogenous variables as claimed in claim 1, It is characterized in that The time series graph neural network is used to extract the features of exogenous variable data, including: For each fixed time interval t , both introduce spatial graphs G t =( V t , E t ); Combine the meteorological data at a certain moment and the user's comprehensive charging time cost as nodes in the spatial graph V t , get charging station v i and v j The road traffic flow information and distance information between them are used as the edge information of the spatial graph E t ; Feature extraction is performed on each spatial graph to obtain the spatiotemporal feature vector of the charging station.
4. The charging station cluster load forecasting method with deep fusion of exogenous variables as claimed in claim 1, It is characterized in that Decouple the overall load time series of each charging station, including: Design decoupling functions; The load time series is averaged and averaged by moving average, and the filling operation is used to keep the sequence length unchanged, decoupling its monotonic features as trend features. X tr ; Decoupling from the load time series to obtain regular, periodic, and recurring fluctuation characteristics, that is, the non-stationary part of the original series, as seasonal characteristics X se .
5. The charging station cluster load forecasting method with deep fusion of exogenous variables as claimed in claim 1, It is characterized in that A series of feature fusion methods are used to fuse the spatiotemporal feature vectors, as well as the trend and seasonal feature vectors of charging stations to generate a multivariate comprehensive feature vector.
6. The charging station cluster load forecasting method with deep fusion of exogenous variables as claimed in claim 1, It is characterized in that The Transformer prediction model based on the cross-attention mechanism is constructed by training multi-dimensional comprehensive feature vectors and load local feature vectors, including: The load local feature vector and multivariate comprehensive feature vector are respectively input into the encoder and decoder of the Transformer prediction model based on the cross attention mechanism to generate K and V matrices, as well as the Q matrix; The Q, K, and V matrices are fused through the cross-attention mechanism, the attention score between Q and K is calculated, and the calculated attention score is weighted to the V matrix to obtain the cross-attention output of a single head; A multi-head attention mechanism is used to project the Q, K, and V matrices into multiple subspaces respectively, and the attention calculations in the subspaces are performed independently. After splicing the outputs of each subspace, a linear transformation is performed to obtain the final attention output. The final attention output is input into the feedforward neural network to obtain the training output result and complete the training process.
7. A charging station cluster load forecasting system with deep integration of exogenous variables, characterized by including: The data set construction module is configured to: regard the electric vehicle charging station cluster as a node group, obtain exogenous variable data and endogenous variable data of the node group, the exogenous variable data includes meteorological data of the node group, comprehensive charging time cost of users, and road traffic flow and geographical distance between nodes, and the endogenous variable data includes historical load time series data of each node; The feature extraction module is configured to: extract the features of exogenous variable data using a time series graph neural network to obtain the spatiotemporal feature vector of the charging station; extract the load feature vector of the endogenous variable data set from the global variable and segmented time series levels to obtain the trend and seasonal feature vectors, as well as the load local feature vector; Extract the load feature vector of the endogenous variable data set from the global variable and segmented time series levels, including: Obtain the historical load data set X of the charging station cluster, including N Charging stations T time steps; focus on the global time characteristics between load sequences, use the first segmentation method, use different charging stations as indexes, segment the load data set X, obtain the overall load time series of each charging station, decouple the overall load time series of each charging station, and extract the trend and seasonal feature vectors of the load time series; Focusing on the local time characteristics within the load sequence, the second segmentation method is used to segment the load sequence and create the first n Charging stations Segment load sequence set, based on the n Charging stations Extract local feature vector of load from segment load sequence set; The feature fusion and model training module is configured to: fuse the spatiotemporal feature vectors of the charging station, as well as the trend and seasonal feature vectors, to generate a multivariate comprehensive feature vector, and train a Transformer prediction model based on a cross-attention mechanism using the multivariate comprehensive feature vector and the load local feature vector; The prediction module is configured to: obtain real-time data of exogenous variables, input the real-time data of exogenous variables into the trained Transformer prediction model based on the cross-attention mechanism, and obtain the load prediction result of the charging station cluster.
8. The charging station cluster load forecasting system with deep integration of exogenous variables as claimed in claim 7, It is characterized in that The user's comprehensive charging time cost is the sum of electricity price cost, parking fee, queuing time cost and driving distance cost.
9. A computer-readable storage medium having a program stored thereon, It is characterized in that When the program is executed by a processor, the steps of the charging station cluster load forecasting method with deep integration of exogenous variables as described in any one of claims 1 to 6 are implemented.
10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps in the charging station cluster load forecasting method with deep integration of exogenous variables as described in any one of claims 1-6 are implemented.
Citation Information
Patent Citations
Method for predicting spatial-temporal dynamic distribution of electric vehicle charging loads
AU2021106177A4
Station network interaction method based on charging demand and energy storage adjustment
CN113487131A
Charging load prediction method and system for electric vehicle charging station, terminal and medium
CN114444803A
Charging station power load adjustable potential prediction method and related device
CN116307073A
Urban charging load space-time prediction method based on voltage class classification
CN117473461A
