Urban electric vehicle charging demand prediction method and system based on heterogeneous multi-graph convolutional network fusion
Through the heterogeneous multi-graph convolution network fusion method, the shared characteristics of electric vehicle charging demand are extracted and the multi-graph structure is constructed, which solves the problem of insufficient representation ability of electric vehicle charging demand prediction methods in the existing technology in space-time relationships, and achieves more accurate and scalable charging demand forecasts.
Patent Information
- Application Number
- CN202411294920.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-09-14
AI Technical Summary
The existing electric vehicle charging demand forecasting method lacks the characterization ability in modeling multiple spatiotemporal relationships of electric vehicle charging demand, which has affected its effectiveness and accuracy in practical applications and has failed to effectively capture different vehicle types. interactions and overall impact of regional charging demand.
Using a fusion method based on heterogeneous multi-graph convolutional network, by constructing a multi-vehicle shared feature extraction module and a heterogeneous multi-graph spatiotemporal prediction module, the shared features of different types of electric vehicles are extracted, and the historical charging demand graph and POI similarity are constructed. The quality graph and dynamic vehicle mobile graph use graph convolution network to capture multiple space-time dependencies to improve prediction accuracy and scalability.
It effectively improves the accuracy and scalability of charging demand forecasts for multiple types of electric vehicles, adapts to the real world scenarios where multiple types of electric vehicles coexist, and improves prediction performance and generalization capabilities.
Smart Images

Figure CN119273046A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of charging demand prediction, and in particular to a method and system for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion. Background Art
[0002] With the continuous increase of global carbon emissions and the urgent need for sustainable solutions, reducing fossil fuel consumption and achieving "carbon neutrality" has become a common goal of many national governments. As a key alternative to traditional gasoline vehicles, electric vehicles (EVs) are becoming increasingly popular and widely used by the public. This shift towards a green and intelligent transportation system has prompted urban areas to rapidly deploy charging infrastructure. As the number of electric vehicles continues to grow, it becomes particularly important to accurately predict urban charging demand, which is not only crucial to understanding regional power load changes and dispatching energy distribution, but also important for grid operators to take effective measures, such as dynamic pricing.
[0003] At present, a large number of studies have been carried out in the field of EV charging demand prediction, covering statistical methods, time series prediction methods, spatiotemporal prediction methods, etc. However, existing EV charging demand prediction studies often focus only on a single type of vehicle, such as taxis or buses, while ignoring the interrelationships between different vehicle types and their overall impact on regional charging demand. In addition, most studies fail to fully consider the multiple spatiotemporal dependencies of EV charging demand, including the multiple impacts of historical charging demand, regional points of interest (hereinafter referred to as POIs), and vehicle mobility on charging demand. Therefore, existing charging demand prediction methods have significant limitations in capturing the interaction of charging demand between different vehicle types, and their scalability and generalization capabilities are also limited in real urban environments where multiple types of EVs coexist. In addition, due to the insufficient representation ability of existing methods in modeling the multiple spatiotemporal relationships of EV charging demand, their effectiveness and accuracy in practical applications are also affected. Summary of the invention
[0004] The present invention provides a method and system for predicting urban electric vehicle charging demand based on heterogeneous multi-graph convolutional network fusion, which is used to solve the problem that the existing methods have insufficient representation ability in modeling the multiple spatiotemporal relationships of electric vehicle charging demand, resulting in their effectiveness and accuracy in practical applications being affected.
[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:
[0006] In a first aspect, the present application provides a method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion, comprising:
[0007] S1: Construct multi-vehicle sharing feature extraction module;
[0008] S2: Inputting various types of electric vehicle charging demand data into the multi-vehicle shared feature extraction module, and obtaining fusion features output by the shared feature extraction module;
[0009] S3: Build and train a heterogeneous multi-graph spatiotemporal prediction module;
[0010] S4: Inputting the charging demand data of various types of electric vehicles and the fusion features into the trained heterogeneous multi-graph spatiotemporal prediction module to obtain the charging demand of various types of electric vehicles at the prediction time.
[0011] In the second aspect, the present application also provides an urban electric vehicle charging demand prediction system based on the fusion of heterogeneous multi-graph convolutional networks, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.
[0012] The present invention has the following beneficial effects:
[0013] The urban electric vehicle charging demand prediction method based on heterogeneous multi-graph convolutional network fusion provided in this application focuses on the charging demand prediction of electric vehicles of various vehicle types. By adopting multi-task learning technology, it effectively extracts the shared features of different types of electric vehicle charging demand data, thereby exploring the potential correlation between different types of electric vehicle charging modes. Compared with the charging demand prediction of a single type of electric vehicle, the charging demand prediction of electric vehicles of multiple vehicle types effectively improves the prediction performance; it can adapt to the scenarios in the real world where multiple types of electric vehicles coexist and influence each other, and improves scalability and generalization.
[0014] In a further technical solution, the multiple spatiotemporal relationships of electric vehicle charging demand are mined and revealed from multiple dimensions, and the impact of historical charging demand, POIs in different regions, and vehicle mobility patterns on charging demand are constructed into three types of graph structures respectively. This enables the model to effectively learn the various factors affecting charging demand from heterogeneous multi-graphs, thereby improving the accuracy of charging demand prediction.
[0015] In a further technical solution, three different types of graphs, namely the historical charging demand graph, the POI similarity graph and the dynamic vehicle movement graph, are effectively fused using a graph convolutional network to capture a variety of spatiotemporal dependencies and improve the reliability of electric vehicle charging demand prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings constituting a part of this application 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 an improper limitation of the present invention. In the drawings:
[0017] Figure 1 A flowchart of a method for predicting urban electric vehicle charging demand based on heterogeneous multi-graph convolutional network fusion provided in this application;
[0018] Figure 2 It is a framework diagram of a model (EVCha) for predicting charging demands of multiple types of electric vehicles in an embodiment of the present invention.
[0019] Figure 3 This is a comparison chart of the charging demand prediction results of the EVCha model in an embodiment of the present invention for different regions on the 2021Q2 dataset and other baseline models.
[0020] Figure 4 This is a comparison chart of the charging demand prediction results of the EVCha model in an embodiment of the present invention for different regions on the 2022Q1 dataset and other baseline models.
[0021] Figure 5 This is a comparison chart of the charging demand prediction results of the EVCha model in an embodiment of the present invention for different time periods on the 2021Q2 dataset and other baseline models.
[0022] Figure 6 This is a comparison chart of the charging demand prediction results of the EVCha model in an embodiment of the present invention for different time periods on the 2022Q1 dataset and other baseline models. DETAILED DESCRIPTION
[0023] In order to facilitate the understanding of the present invention, the present invention will be described more comprehensively and meticulously below in conjunction with the accompanying drawings and preferred embodiments of the present invention, but the protection scope of the present invention is not limited to the following specific embodiments.
[0024] Unless otherwise defined, all professional terms used below have the same meanings as those generally understood by those skilled in the art. The professional terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the scope of protection of the present invention.
[0025] Unless otherwise specified, various raw materials, reagents, instruments and equipment used in the present invention can be purchased from the market or prepared by existing methods.
[0026] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.
[0027] See also Figure 1 , the present application provides a method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion, comprising:
[0028] S1: Construct multi-vehicle sharing feature extraction module;
[0029] S2: Inputting various types of electric vehicle charging demand data into the multi-vehicle shared feature extraction module, and obtaining fusion features output by the shared feature extraction module;
[0030] S3: Build and train a heterogeneous multi-graph spatiotemporal prediction module;
[0031] S4: Inputting the charging demand data of various types of electric vehicles and the fusion features into the trained heterogeneous multi-graph spatiotemporal prediction module to obtain the charging demand of various types of electric vehicles at the prediction time.
[0032] The above-mentioned urban electric vehicle charging demand prediction method based on heterogeneous multi-graph convolutional network fusion focuses on the charging demand prediction of electric vehicles of various vehicle types. By adopting multi-task learning technology, it effectively extracts the shared features of different types of electric vehicle charging demand data, thereby exploring the potential correlation between different types of electric vehicle charging modes. Compared with the charging demand prediction of a single type of electric vehicle, the charging demand prediction of electric vehicles of multiple vehicle types effectively improves the prediction performance; it can adapt to the scenarios in the real world where multiple types of electric vehicles coexist and influence each other, and improves scalability and generalization.
[0033] Since different types of electric vehicles show similar charging demand patterns in the time dimension, and these similar features are conducive to improving model performance, similar features in the time dimension can be extracted and fused from multiple types of electric vehicle charging demand data.
[0034] The processing flow of the multi-vehicle sharing feature extraction module includes three steps: cosine similarity calculation, adaptive similarity threshold learning, and feature extraction. The input of the multi-vehicle sharing feature extraction module is charging demand data of various types of electric vehicles. where k i Represents different types of electric vehicles. The following takes two types of electric vehicle charging requirements as an example, namely and The output is the fusion feature F. The processing steps of the multi-vehicle sharing feature extraction module constructed in S1 are as follows:
[0035] S1.1 Cosine similarity calculation: Use cosine similarity to calculate the similarity of two charging demand time series. and As input, the cosine similarity is calculated to obtain the global similarity value S of the charging demand of these two types of electric vehicles, which reflects the global similarity of all time steps. In the actual prediction of electric vehicle charging demand, the historical charging demand data of a specific length of time step is generally used to predict the charging demand of future time steps. Therefore, it is also necessary to calculate the cosine similarity of the historical charging demand data of a specific length of time step. Here, and To represent the historical charging demand data of a specific length time step of different types of electric vehicles, the data is used as input to calculate the cosine similarity to obtain the local similarity value s. The specific length time step may refer to selecting a time step of 24 hours, which is only an example and not limited here.
[0036] S1.2 Adaptive similarity threshold learning: The adaptive similarity threshold learning includes two fully connected layers, ReLU activation function, and Sigmod function. The global similarity value S obtained in S1.1 is used as the input of the adaptive similarity threshold learning. It first passes through the first fully connected layer and the ReLU activation function, and then the obtained value is used as the input of the second fully connected layer. Then, it passes through the Sigmod function to obtain the threshold T, which is used as the condition for judging whether to extract similarity features.
[0037] S1.3 Feature extraction: The feature extraction includes two strategies, namely, similarity feature extraction strategy and simple addition strategy. When the local similarity value s in S1.1 is greater than the threshold T in S1.2, the similarity feature extraction strategy is adopted, that is, the historical charging demand data of the two types of electric vehicles are extracted. and Add and pass the Softmax function to get the fusion feature F; when the local similarity value s in S1.1 is not greater than the threshold T in S1.2, a simple addition strategy is adopted, that is, the historical charging demand data of the two types of electric vehicles and Directly add them together to get the fusion feature F. According to the similarity of the electric vehicle charging demand data, two different feature extraction strategies are used to flexibly extract the fusion features, thereby improving the accuracy and stability of the prediction.
[0038] It is worth pointing out that the heterogeneous multi-graph spatiotemporal prediction module constructed in S3 is used for multi-graph spatiotemporal prediction of charging demand for each type of electric vehicle, that is, the module is initialized independently for each type of electric vehicle, and its parameters are not shared. This module can effectively capture the static and dynamic spatiotemporal dependencies between regions, including historical charging demand similarity, POI similarity, and vehicle mobility.
[0039] The heterogeneous multi-graph spatiotemporal prediction module includes a spatiotemporal attention block, a heterogeneous multi-graph building block, a spatial graph convolution block, and a temporal learning block. Each module is described in detail below:
[0040] The spatiotemporal attention block described in S3.1 includes two temporal attention blocks with the same structure, a fusion module and a spatial attention block. The input is the charging demand data of electric vehicles. The fusion feature F obtained by the multi-vehicle shared feature extraction module in S1 is output as the spatiotemporal attention weight matrix The specific implementation steps are as follows:
[0041] Each time attention block contains a multi-head attention structure, Concat function, linear transformation, and layer normalization. The multi-head attention structure consists of multiple self-attention blocks, and each self-attention block calculates the attention weight through the scaled dot product attention mechanism. First, With W i Q , W i K and W i V Multiply them to get Q i , K i and V i , where W i Q , W i K and W i V are three different weight matrices, which are randomly initialized, continuously learned and updated during model training, and then K i After transposition and Q i After multiplication, divide by where d k It's Q i ,Ki and V i The common dimension of the three is then obtained through the Softmax function to obtain the attention weight of each head, and then combined with V i Multiply to get the output of each head's self-attention block. Since the multi-head attention structure consists of multiple heads' self-attention blocks, it will contain multiple output results. The Concat function is needed to concatenate the output results of all heads, and then perform a linear transformation to combine the results with the original input. Add and apply layer normalization to get the final result For another temporal attention block with the same structure, the principle is the same as above. The input is the fusion feature F obtained by the multi-vehicle sharing feature extraction module in S1, and the output is Z F This step captures the temporal relationship between sequences through a multi-head self-attention mechanism, thereby effectively identifying temporal trends.
[0042] After the above steps, the output results of the two time attention blocks are and Z F , which is used as the input of the fusion module. The fusion module includes a Concat function and a convolution layer. and Z F After connecting with the Concat function, it is converted through the convolution layer to obtain the time attention tensor The temporal attention tensor It contains both rich temporal features and similar features of charging requirements for different types of vehicles.
[0043] The spatial attention block includes multi-head parallel attention calculation and Softmax function, and the input is the final result of the above fusion module, that is, the temporal attention tensor. The output is the spatiotemporal attention weight matrix The temporal attention tensor The projection is linearly transformed and segmented into multiple heads. Each head calculates the attention score in parallel. The calculation method of the attention score is the same as the above-mentioned time attention block, and the scaled dot product attention mechanism is also adopted. Then the obtained result is normalized by the Softmax function to obtain the spatiotemporal attention weight matrix
[0044] The heterogeneous multi-graph construction block described in S3.2 includes the construction of the historical charging demand graph, the construction of the POI similarity graph, and the construction of the vehicle movement graph, which respectively generate the historical charging demand graph POI Similarity Graph and dynamic vehicle movement diagram By fully modeling the multiple correlations of spatial regions from different angles, various spatial correlations can be effectively mined.
[0045] The historical charging demand graph is constructed to reveal the potential correlation of charging demand between different regions, because charging demand often shows time correlation with historical observations. is the historical charging demand graph, where the vertex set represents all regions, and ε C Represents a set of edges, each edge value is 0 or 1, and the value depends on the similarity of the historical charging demand of the two points (i.e., the two regions). The similarity of the historical charging demand is measured by the Pearson correlation coefficient of the historical charging demand data of the two regions. If the value is greater than the set threshold, the edge value is 1, otherwise it is 0. The threshold is set according to the charging demand data of the actual vehicle type, such as the 75% quantile value of the correlation coefficient of all data.
[0046] The POI similarity graph is constructed to capture the functional similarities between different regions. When predicting the charging demand of a region, it is reasonable to refer to other regions with similar functional areas. is a POI similarity graph, where the vertex set represents all regions, and ε P Represents a set of edges, the value of each edge depends on the POI similarity of the two points (i.e., two areas). The value of POI similarity is obtained by calculating the cosine similarity of the POI vectors of the two areas. The dimension of the POI vector is equal to the number of POI categories in the area, and the value of each dimension represents the number of POIs of this category in the area.
[0047] The vehicle mobility graph is constructed to capture the impact of vehicle mobility on charging demand, for example areas with higher vehicle density tend to have greater charging demand due to increased mobility frequency. is the vehicle movement graph. Since the movement behavior of vehicles changes over time, each time step should correspond to a dynamic vehicle movement graph. The vertex set represents all regions, and Represents the set of all edges at the t-th time step. The value of each edge depends on the number of vehicle transfers between the two points (i.e., the two areas), that is, the number of vehicles moving from one area to another at the t-th time step.
[0048] The spatial graph convolution block in S3.3 includes three parallel graph convolutional network (GCN) layers, whose input includes electric vehicle charging demand data S3.1 Spatiotemporal attention weight matrix obtained in the spatiotemporal attention block and the three graphs obtained in the heterogeneous multi-graph building block S3.2 (i.e., historical charging demand graph POI Similarity Graph and dynamic vehicle movement diagram ), the output is a multi-dimensional spatiotemporal feature tensor H.
[0049] In the three parallel GCN layers, each GCN layer combines the weight matrix and the corresponding graph for graph convolution, and each GCN layer corresponds to a graph. First, using the historical charging demand graph Calculate the initial Chebyshev polynomial T l Then, for each GCN layer, the corresponding graph Respectively with the spatiotemporal attention weight matrix Add, and after passing through the Softmax function, combine with the initial Chebyshev polynomial T l Multiply them together to get the lth order Chebyshe polynomial containing each graph and weight matrix and In order to better combine the dynamic properties of the nodes, the electric vehicle charging demand data is convolved at each time step t. In each GCN layer, the Chebyshev polynomials of order L are used (respectively and ) Perform graph convolution aggregation on the charging demand data of electric vehicles at the tth time step, and then add the results of the three GCN layers as the graph convolution result of the tth time step. Perform the above steps for all time steps, and finally concatenate the results of all time steps and pass them through the ReLU function to obtain the multi-dimensional spatiotemporal feature tensor H.
[0050] The temporal learning block described in S3.4 includes three gated convolutional neural network (GatedCNN) layers with different convolution kernel sizes, a Concat splicing layer, two fully connected layers, and a convolution layer. The input of this module is the multi-dimensional spatiotemporal feature tensor H of the spatial graph convolution block in S3.3 above, and the output is the charging demand of electric vehicles at the predicted moment. By introducing the gating mechanism, this module can better learn and select important features, and multiple convolution kernels can effectively capture features of different time scales. The specific implementation steps are as follows:
[0051] The convolution kernel sizes of the three Gated CNN layers are set to 3, 5, and 7, respectively, and the multidimensional spatiotemporal feature tensor H of the above spatial graph convolution block is used as the input of each Gated CNN layer to obtain the output Then, these three outputs are processed by the Concat layer and passed through the first fully connected layer to obtain the output H out Then, H out The dimension is adjusted through the convolutional layer, and finally the charging demand of the electric vehicle at the predicted time is obtained through the second fully connected layer.
[0052] Furthermore, the above-mentioned urban electric vehicle charging demand prediction method based on heterogeneous multi-graph convolutional network fusion also includes using charging demand data of multiple types of electric vehicles for model training and prediction.
[0053] Before model training, the charging demand data of multiple types of electric vehicles are divided into training set, validation set, and test set in a ratio of 6:2:2. In the model training stage, the relevant data are respectively extracted through S1 for the shared features of the charging demand of multiple types of vehicles, and then the charging demand of each type of vehicle is predicted in S3. At this point, the charging demand of multiple types of vehicles at the predicted moment will be obtained, and the predicted results will be compared with the actual results, and the Huber loss function corresponding to each type of vehicle will be calculated. Then, the loss functions of all vehicle types are added in a certain ratio (for example, the ratio of two vehicles is 1:1) to obtain the total loss. The gradient of the total loss is calculated by the back propagation algorithm, and the model parameters are updated by gradient descent. After each training cycle, the model obtained in the current training cycle will be evaluated on the validation set. When the performance of the validation set no longer improves, the training will be stopped to obtain the model with the best performance.
[0054] In the model prediction stage, the data of the test set is input into the trained model to obtain the charging demand of multiple types of electric vehicles at the prediction time.
[0055] In summary, this example constructs a multi-vehicle sharing feature extraction module and a heterogeneous multi-graph spatiotemporal prediction module, and adopts multi-task learning, graph convolutional neural network, multi-head attention mechanism, gated convolutional neural network and other technologies to comprehensively consider the mutual influence of charging demand of multiple types of electric vehicles, and combines historical charging demand, regional POI, vehicle mobility and other influencing factors to effectively capture complex spatiotemporal relationships, thereby achieving a joint prediction of charging demand of multiple types of electric vehicles. This method not only considers multiple factors affecting charging demand, but also effectively improves the accuracy of charging demand prediction of multiple types of electric vehicles by extracting the similarity of charging demand of different types of vehicles.
[0056] Below, a complete example is used to describe in detail the above-mentioned urban electric vehicle charging demand prediction method based on heterogeneous multi-graph convolutional network fusion:
[0057] 1. Data Preprocessing
[0058] The electric vehicle operation dataset used in this example is derived from real data from a large city in my country, covering two time periods, April to June 2021 (hereinafter referred to as 2021Q2) and January to March 2022 (hereinafter referred to as 2022Q1). The dataset contains two different types of data, namely vehicle movement data and vehicle charging data. The vehicle movement data describes the information of the start and end of each trip of the electric vehicle, and the vehicle charging data records the charging information of each electric vehicle. The dataset contains 29,717 electric vehicles and 11.48 million records.
[0059] Data preprocessing includes the following three aspects:
[0060] First, the vehicle movement data and vehicle charging data are preprocessed. Since the data has problems such as duplicate records, incorrect field values, and missing individual fields, the data needs to be preprocessed such as cleaning and filling. The preprocessed vehicle movement data contains 8 fields, namely the vehicle ID number, vehicle type (taxi or private car), start and end time of the trip, and the GPS longitude and latitude coordinates of the start and end locations. The preprocessed vehicle charging data includes 8 fields, namely the vehicle ID number, charging start and end time, GPS longitude and latitude coordinates of the vehicle charging location, vehicle type (taxi or private car), and the power before and after charging (SOC).
[0061] The second is to divide the pre-processed vehicle mobility data and vehicle charging data based on the region. In this example, the city is divided into 138 grid areas of equal size, each of which is 7km×7km in size. Subsequently, the vehicle mobility data and vehicle charging data are mapped to different grid areas and processed respectively. The charging data of the same vehicle type in the same area are aggregated to obtain the charging demand of a specific vehicle type (taxis or private cars) in the area. The mobility data of the same vehicle type transferred from one area to another is aggregated to generate mobility data of a specific vehicle type (taxis or private cars) between the two areas.
[0062] Third, preprocess the POI data. Since this example aims to predict the charging demand of electric vehicles in various regions, it is necessary to map the POI data to each region, count the number of POIs of different categories in each region, and generate the POI vector of the region.
[0063] In this example, the above dataset is divided into a training set, a validation set, and a test set in a ratio of 6:2:2.
[0064] 2. Constructing a multi-vehicle sharing feature extraction module
[0065] Different types of vehicles have different usage patterns and operating characteristics, but they also have some similarities. For example, private cars and taxis in the same area tend to charge during non-peak hours and less congested hours, and they show similar charging demand patterns in the time dimension. Identifying and sharing these similar characteristics can help improve the performance of the model. Therefore, this example constructs Figure 2 The “multi-vehicle shared feature extraction module” shown uses a multi-task learning-based method to capture similar temporal features of different vehicles and share features with each other.
[0066] In order to select representative sequence features, the cosine similarity function is first used to calculate the similarity between two time series. Intuitively, sequences with similar data distribution can share features to improve the performance of task learning. Cosine similarity can be calculated by the following formula:
[0067]
[0068] The charging demand data of different types of electric vehicles (Private car) and (taxi) as input, calculate the global similarity value S; the historical charging demand data of different types of electric vehicles in a specific length time step (24 hours in this example) and As input, a local similarity value s is obtained.
[0069] However, only sharing of sequence features with similarity above a certain threshold can promote the learning performance of multiple types of vehicles. Therefore, adaptive similarity threshold learning is used to determine the threshold. The adaptive similarity threshold learning includes two fully connected layers, ReLU activation function, and Sigmod function. The global similarity value S is used as the input of the adaptive similarity threshold learning. It first passes through the first fully connected layer and the ReLU activation function, and then the obtained value is used as the input of the second fully connected layer. Then, the threshold T is obtained through the Sigmod function, which is expressed as follows:
[0070] T=σ(w2·(ReLU(w1·S+b1))+b2_(2)
[0071] Among them, w1 and b1 are the weight matrix and bias vector of the first fully connected layer, respectively, which are used to convert the global similarity value S into an intermediate feature representation; and w2 and b2 are the weight matrix and bias vector of the second fully connected layer, respectively, which are used to convert the output of the first fully connected layer into the input of the Sigmod function. The threshold T is used as a condition for determining whether to extract similarity features.
[0072] Next, two strategies are used to extract shared features from two sequences from different vehicles: similarity feature extraction strategy and simple addition strategy. When the local similarity value s is higher than the threshold T, the similarity feature extraction strategy is used to extract the correlation of key time steps in the sequence and enhance the significance of the time steps corresponding to the similar distribution; when the local similarity value s is lower than the threshold T, the two sequences are simply added. The output of the above two strategies is the fusion feature F, which can be expressed as:
[0073]
[0074] Among them, w a is a learnable weight parameter.
[0075] 3. Spatial-temporal attention blocks
[0076] The charging demand of electric vehicles shows significant characteristics in the time and space dimensions. In order to effectively capture the time and space dependencies of electric vehicle charging demand, this example combines time attention and space attention in the time and space attention module to generate time and space attention weights. This weight will be used as the input of the spatial convolution block in step 5.
[0077] The spatiotemporal attention block includes two temporal attention blocks with the same structure, a fusion module and a spatial attention block.
[0078] Each time attention block uses a multi-head self-attention mechanism, which can effectively capture time trends. For each head of the self-attention block, the scaled dot product attention is used to calculate the attention weight, which is calculated as follows:
[0079]
[0080] Among them, X is the input data, and They are three different weight matrices, d k It's Q i ,K i and V i Since the multi-head self-attention mechanism contains multiple output results, the output results of all heads are concatenated through the Concat function, and then the output of the multi-head self-attention mechanism is obtained through linear transformation, which is then added to the original input X and layer normalization is applied to obtain the result of the time attention block:
[0081] Z = LayerNorm(X + Concat[head i ,…,head h ]W O )(5)
[0082] Among them, W Ois the linear transformation matrix.
[0083] For this module, the input is and F, where is the charging demand data of each vehicle, and F is the fusion feature obtained by the multi-vehicle sharing feature extraction module. After F and F are input into two time attention blocks respectively, we get and Z F , and use it as the input of the fusion module. The fusion module includes a Concat function and a convolution layer. and Z F After connecting with the Concat function, it is converted through the convolution layer to obtain the time attention tensor The specific formula is as follows:
[0084]
[0085] The spatial attention block includes multi-head parallel attention calculation and Softmax function, and the input is the final result of the above fusion module, that is, the temporal attention tensor. The output is the spatiotemporal attention weight matrix
[0086] 4. Heterogeneous Multi-Graph Building Blocks
[0087] In charging demand forecasting, relying solely on time series data may not fully reflect the complex spatiotemporal dependencies of charging demand. Therefore, a multi-graph mechanism is proposed to consider the correlation between regions from different perspectives.
[0088] The heterogeneous multi-graph construction block includes the construction of the historical charging demand graph, the construction of the POI similarity graph, and the construction of the vehicle movement graph, and the historical charging demand graph G C , POI similarity graph G P and dynamic vehicle movement diagram
[0089] The historical charging demand graph can reveal the potential correlation of charging demand between different regions. C =(V,ε C ) is the historical charging demand graph, where the vertex set V represents all regions, and ε C represents the set of edges, ε C Each element in Defined as region r i and r j Similarity of historical charging demand:
[0090]
[0091] in, Represents region ri and r j The historical charging demand sequence, It means calculating their Pearson correlation coefficient, and θ is the correlation coefficient threshold.
[0092] The POI similarity graph can capture the functional similarity between different regions. Define G P =(V,ε p ) is the POI similarity graph, ε p Each element in Defined as region r i and r j POI similarity:
[0093]
[0094] in Represents region r i and r j The POI vector, The cosine similarity of the POI vectors of these two regions is calculated.
[0095] The vehicle mobility graph can capture the impact of vehicle mobility on charging demand. For example, areas with higher vehicle density tend to have greater charging demand due to increased mobility frequency. The dynamic vehicle mobility graph for each time interval is defined as in Each element represents the number of vehicles moving from one area to another at time step t.
[0096] 5. Spatial Graph Convolution Block
[0097] Graph convolutional networks (GCNs) can effectively aggregate neighbor node information and capture complex relationships between nodes. In this example, in order to enhance the feature learning effect, a multi-graph mechanism and spatiotemporal attention weights are combined to dynamically adjust the aggregation operation in the graph convolutional network. The spatial graph convolution block includes three parallel GCN layers, each of which combines a weight matrix and a type of graph to perform a graph convolution operation.
[0098] First, using the historical charging demand graph G C Calculate the initial Chebyshev polynomial T1. Then, in each GCN layer, the corresponding graph G C , G p , Respectively with the spatiotemporal attention weight matrix Add, and after passing through the Softmax function, combine with the initial Chebyshev polynomial T lMultiply them together to get the lth order Chebyshe polynomial containing each graph and weight matrix and
[0100] In order to better combine the dynamic properties of the nodes, the next step is to perform graph convolution on the electric vehicle charging demand data at each time step t. In each GCN layer, the L-order Chebyshev polynomials (respectively and ) Aggregate the charging demand data of electric vehicles through graph convolution, and then add the results of the three GCN layers to obtain the graph convolution result of the tth time step. The formula is as follows:
[0101]
[0102] In the formula, Θ l represents the learnable weight value, is the charging demand at each time step;
[0103] The above steps are performed for all time steps, and the obtained graph convolution results are concatenated. After passing through the ReLU activation function, a multi-dimensional spatiotemporal feature tensor H is obtained. The formula is as follows:
[0104]
[0105] 6. Time Learning Blocks
[0106] In order to effectively extract features at different time scales, the temporal learning block uses multiple gated convolutional neural networks (Gated CNNs) with different convolution kernels. Gated CNN controls the transmission of features through a gating mechanism, which helps the model learn key features and suppress noise. In addition, Gated CNNs with different convolution kernel sizes can capture features at multiple time scales.
[0107] The temporal learning block shown includes three Gated CNN layers, whose convolution kernel sizes are set to 3, 5, and 7 respectively. The multi-dimensional spatiotemporal feature tensor H obtained from the spatial graph convolution block is used as the input of each Gated CNN layer. The implementation of each Gated CNN is as follows:
[0108]
[0109] Among them, W i and V i is the weight matrix of the i-th convolution kernel, b i and c i represents the bias term of the i-th convolution kernel, represents element-by-element multiplication, * represents convolution operation, b i and ci is the bias term, W i and V i is the size of the convolution kernel, and σ is the sigmoid activation function. After the above operations, the output results of Gated CNN with different convolution kernels are and Then, after concatenation using the Concat function, the summarized output is obtained through the fully connected layer:
[0110]
[0111] In the formula, FC represents the fully connected layer.
[0112] Finally, H out After the input is processed by the final convolutional layer, the dimension is adjusted and the output is generated through the fully connected layer to obtain the charging demand of the electric vehicle at the final prediction moment.
[0113] 7. Model training and prediction
[0114] During the model training phase, the training set of electric vehicle charging demand data is input into the model, and the shared feature extraction, spatiotemporal attention block, heterogeneous multi-graph building block, spatial convolution block and temporal learning block of various types of vehicle charging demands are processed in sequence to fully capture the complex spatiotemporal dependencies of the charging demand sequence, and finally generate the charging demand results at the predicted time. Subsequently, the charging demand predicted by the model is compared with the actual charging demand, and the corresponding Huber loss function is calculated for each vehicle type. Under the multi-task learning framework, the losses of different types of vehicles are weighted and summed according to a certain weight ratio to obtain the total loss function:
[0115]
[0116] in is the loss function of a private car, is the loss function of the taxi, and λ is the weight coefficient. The gradient of the total loss is calculated by the back propagation algorithm, and the model parameters are updated using gradient descent. After each training cycle, the model obtained in the current training cycle will be evaluated on the validation set. If the performance on the validation set does not improve, the training will be stopped to obtain the model with the best performance.
[0117] In the model prediction stage, the data of the test set is input into the above-mentioned trained model to obtain the charging demand of multiple types of electric vehicles at the prediction time.
[0118] 8. Model Performance Evaluation
[0119] In order to verify the prediction performance of the multi-type electric vehicle charging demand prediction model (EVCha) proposed in this example, the historical average (HA), long short-term memory network (LSTM), spatiotemporal multi-graph convolutional network (ST-MGCN), adaptive graph convolutional recurrent network (AGCRN), spatiotemporal fusion graph neural network (STFGNN), decoupled dynamic spatiotemporal graph neural network (D-MGCN) and other models are selected. 2 Eight methods, including STGNN, spatiotemporal self-supervised learning (ST-SSL), and self-supervised spatiotemporal bottleneck attention network (SSTBAN), are used as the comparison baselines for the experiment. The comparison baseline models are as follows:
[0120] Historical Average (HA): The prediction is based on the average charging demand at the same time interval in the training set.
[0121] Long Short-Term Memory Network (LSTM): By introducing forgetting, input and output gating mechanisms, it can capture long-term and short-term dependencies and is a commonly used time series prediction model.
[0122] Spatio-Temporal Multi-Graph Convolutional Network (ST-MGCN): The non-Euclidean correlations between regions are encoded into multiple graphs and modeled via multi-graph convolutions and context-gated recurrent neural networks to enhance temporal correlations.
[0123] Adaptive Graph Convolutional Recurrent Network (AGCRN): Enhances traditional graph convolutions by adaptive modules and combines them into a recurrent network to capture spatiotemporal correlations.
[0124] Spatiotemporal Fusion Graph Neural Network (STFGNN): It is an integration of the STFGN module and a novel gated CNN module to capture hidden spatial dependencies through the data-driven graph and its further fusion with the given spatial graph.
[0125] Decoupled Dynamic Spatiotemporal Graph Neural Network (D 2 STGNN): After separating the diffuse and intrinsic traffic information, they are processed by the diffuse module and the intrinsic module respectively, and the dynamic characteristics of the traffic network are learned through a dynamic graph learning module.
[0126] Spatiotemporal Self-Supervised Learning (ST-SSL): Through the paradigm of spatiotemporal self-supervised learning, the traffic pattern representation is enhanced to reflect the spatiotemporal heterogeneity.
[0127] Self-Supervised Spatio-Temporal Bottleneck Attention Network (SSTBAN): follows a multi-task framework and aims to solve the long-term traffic forecasting problem.
[0128] The two evaluation indicators selected are MAE and EMSE, as follows:
[0129]
[0130] Among them, yi represents the actual charging demand value of the i-th sample, represents the charging demand forecast value of the i-th sample, and n represents the total number of samples.
[0131] The performance of the model proposed in this example will be verified and compared from multiple perspectives, including the following experimental results:
[0132] (1) Baseline performance comparison
[0133] The proposed EVCha model was experimented on the above datasets, and the performance of the EVCha model and other baseline models on the two evaluation indicators of MAE and RMSE were compared. The experimental results are shown in Tables 1 and 2, where Table 1 shows the overall performance of the 2021Q2 dataset and Table 2 shows the overall performance of the 2022Q1 dataset.
[0134] Table 1 Overall performance of the 2021Q2 dataset
[0135]
[0136]
[0137] Table 2 Overall performance of the 2022Q1 dataset
[0138]
[0139] It can be seen from Tables 1 and 2 that compared with other baselines, the EVCha model outperforms other baseline models in MAE and RMSE, which verifies the superiority of the EVCha model in the task of predicting charging demand for multiple types of electric vehicles.
[0140] (2) Spatial dimension prediction performance verification
[0141] In order to further verify the prediction performance of the EVCha model in different regions, a box plot was drawn for the performance of the charging demand in all regions in terms of the RMSE evaluation index. Figure 3 and Figure 4 The RMSE box plots of different vehicle types (taxis and private cars) on the datasets 2021Q2 and 2022Q1 are shown respectively. Figure 3-4 It can be observed that the RMSE results of the EVCha model for taxis and private cars are significantly lower than those of other models, indicating that the EVCha model has achieved good prediction performance in all regions.
[0142] (3) Comparison of prediction performance in the time dimension
[0143] In order to further verify the prediction performance of the EVCha model in the time dimension, a day was divided into four different time periods (0:00-6:00, 7:00-12:00, 13:00-18:00, 19:00-23:00), and the RMSE performance of the model was compared and analyzed within these time periods. Figure 5 and Figure 6 The RMSE performance of each model in different time periods on the datasets 2021Q2 and 2022Q1 is shown respectively. For the sake of simplicity, only the top three baseline models with better performance are selected for comparison with the EVCha model. The results show that EVCha performs better than other baseline models in most time periods, indicating that it can effectively predict the charging demand of electric vehicles in different time periods.
[0144] (4) Ablation experiment
[0145] In order to evaluate the design effectiveness of different components in the EVCha model, an ablation experiment was conducted to observe the impact on the model performance by removing certain components in turn. The components that were ablated include: 1) removing the vehicle movement graph; 2) removing the historical charging demand graph; 3) removing the POI similarity graph; 4) using single-task learning; 5) removing multi-layer Gated CNN and only using a single-layer GatedCNN layer.
[0146] Table 3 Ablation results of each component of the 2021Q2 and 2022Q1 datasets
[0147]
[0148] Table 3 shows the results of ablation experiments on the two datasets, 2021Q2 and 2022Q1. It can be seen from the table that removing any component will lead to a decline in model performance, especially removing different heterogeneous graphs, which significantly reduces the prediction accuracy of the model, indicating that fusing multiple heterogeneous graphs is crucial to improving prediction performance. In addition, compared with the multi-type vehicle prediction of the EVCha model, single-task learning, that is, predicting the charging needs of taxis or private cars alone, also reduces the performance, proving the effectiveness of shared feature extraction in multi-task learning. In addition, the performance of using only a single-layer Gated CNN is not as good as using a multi-layer Gated CNN, which further verifies the effectiveness of the multi-Gated CNN structure in temporal feature learning.
[0149] The present application also provides a system for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program. The system for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion can implement various embodiments of the above-mentioned method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion, and can achieve the same beneficial effects, which will not be described in detail here.
[0150] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A method for predicting urban electric vehicle charging demand based on heterogeneous multi-graph convolutional network fusion, characterized in that: include: S1: Construct multi-vehicle sharing feature extraction module; S2: Inputting various types of electric vehicle charging demand data into the multi-vehicle shared feature extraction module, and obtaining fusion features output by the shared feature extraction module; S3: Build and train a heterogeneous multi-graph spatiotemporal prediction module; S4: Inputting the charging demand data of various types of electric vehicles and the fusion features into the trained heterogeneous multi-graph spatiotemporal prediction module to obtain the charging demand of various types of electric vehicles at the prediction time.
2. The urban electric vehicle charging demand prediction method based on heterogeneous multi-graph convolutional network fusion according to claim 1 is characterized in that: The S2 includes: S21: Calculate the cosine similarity of the N charging demand time series using cosine similarity to obtain a global similarity value and a local similarity value; S22: Calculate a threshold T according to the global similarity value; S23: When the local similarity value is greater than the threshold T, a similarity feature extraction strategy is adopted to obtain a fusion feature; when the local similarity value is not greater than the threshold T, an addition strategy is adopted to obtain a fusion feature.
3. The method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion according to claim 2 is characterized in that: The S21 includes: Taking different types of electric vehicle charging demand data as input, the cosine similarity is calculated to obtain the global similarity value of the two types of electric vehicle charging demands; The cosine similarity of the historical charging demand data of a set length time step is calculated to obtain the local similarity value.
4. The method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion according to claim 2 is characterized in that: The S22 includes: The global similarity value is used as the input of the adaptive similarity threshold learning, first passing through the first fully connected layer and the ReLU activation function, and then the obtained value is used as the input of the second fully connected layer, and then the threshold T is obtained through the Sigmod function. The threshold T is used as the condition for judging whether to extract similarity features.
5. The method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion according to claim 2 is characterized in that: The similarity feature extraction strategy satisfies: historical charging demand data of N types of electric vehicles are added together and fused features are obtained after passing through the Softmax function; The addition strategy satisfies: historical charging demand data of N types of electric vehicles and Directly add them together to get the fusion features.
6. The method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion according to claim 1 is characterized in that: The heterogeneous multi-graph spatiotemporal prediction module includes: a spatiotemporal attention block, a heterogeneous multi-graph building block, a spatial graph convolution block, and a temporal learning block; The S4 includes: S41: Inputting the multiple types of electric vehicle charging demand data and the fusion features into the spatiotemporal attention block, and obtaining the spatiotemporal attention weight matrix output by the spatiotemporal attention block; S42: Generate a historical charging demand graph, a POI similarity graph, and a dynamic vehicle movement graph using the heterogeneous multi-graph building block; S43: Inputting the spatiotemporal attention weight matrix, the historical charging demand graph, the POI similarity graph, and the dynamic vehicle movement graph into the spatial graph convolution block, and obtaining the multi-dimensional spatiotemporal feature tensor output by the spatial graph convolution block; S44: Input the multi-dimensional spatiotemporal feature tensor into the time learning block, and obtain the electric vehicle charging demand at the predicted time output by the time learning block.
7. The method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion according to claim 6 is characterized in that: The temporal attention block includes a first temporal attention block, a second temporal attention block, a fusion module and a spatial attention block; The S41 includes: Input the multiple types of electric vehicle charging demand data into the first time attention block, and obtain the output of the first time attention block Input the fused features into the second time attention block, and obtain the Z output by the second time attention block F ; The and the Z F As the input of the fusion module, it is connected through the Concat function of the fusion module and then transformed through the convolution layer of the fusion module to obtain the temporal attention tensor; The temporal attention tensor is input into the spatial attention block, and the spatial attention block projects the temporal attention tensor into multiple heads for linear transformation and segmentation. The result is then normalized by the Softmax function of the spatial attention block to obtain the spatiotemporal attention weight matrix.
8. The method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion according to claim 6 is characterized in that: The historical charging demand graph is used to indicate the potential correlation of charging demands between different regions, satisfying the following relationship: Among them, the vertex set represents all regions, ε C Represents a set of edges, each edge has a value of 0 or 1; The POI similarity graph is used to indicate the functional similarity between different regions, satisfying the following relationship: Among them, the vertex set represents all regions, and ε P represents a set of edges; The dynamic vehicle mobility graph is used to indicate the impact of vehicle mobility on charging demand, satisfying the following relationship: Among them, the vertex set Representing all regions, represents the set of all edges at the t-th time step; The spatial graph convolution block includes three parallel graph convolutional network layers GCN; The S43 includes: Using the historical charging demand graph G C Calculate the initial Chebyshev polynomial T l ; For each GCN layer, the corresponding historical charging demand graph, POI similarity graph, and dynamic vehicle movement graph are added to the spatiotemporal attention weight matrix, and then combined with the initial Chebyshev polynomial T after the Softmax function. l Multiply them together to get the lth order Chebyshe polynomial containing each graph and weight matrix and A total of L levels; At each time step t, graph convolution is performed on the electric vehicle charging demand data. In each GCN layer, the L-order Chebyshev polynomial is used to perform graph convolution aggregation on the electric vehicle charging demand data at the t-th time step, and then the results of the three GCN layers are added as the graph convolution result of the t-th time step; The above steps are performed for all time steps. Finally, the results of all time steps are concatenated and passed through the ReLU function to obtain a multi-dimensional spatiotemporal feature tensor.
9. The method for predicting charging demand of urban electric vehicles based on heterogeneous multi-graph convolutional network fusion according to claim 6 is characterized in that: The temporal learning block includes three gated convolutional neural network layers GatedCNN with different convolution kernel sizes, a Concat splicing layer, two fully connected layers and a convolution layer; The S44 includes: The multidimensional spatiotemporal feature tensor is used as the input of each Gated CNN layer to obtain the output The three outputs are processed by the Concat layer and then passed through the first fully connected layer to obtain the output H out ; H out The dimension is adjusted through the convolutional layer, and finally the charging demand of the electric vehicle at the predicted time is obtained through the second fully connected layer.
10. A city electric vehicle charging demand prediction system based on heterogeneous multi-graph convolutional network fusion, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Electric vehicle charging load prediction method based on user behaviors
CN115345351A
Urban road vehicle speed prediction method
CN116486611A
Power consumption demand prediction method and system
CN116663871A
Electric vehicle charging station load prediction method and system of time-space multi-graph convolutional network based on attention
CN117273076A
Electric vehicle charging load space-time distribution prediction method based on neural network model
CN118014630A