A method for predicting charging demand of electric vehicles

By constructing a bidirectional gated collaborative network of dynamic heterogeneous graph networks and large language models, the cross-modal alignment problem of the coupling relationship between traffic flow dynamic characteristics and text semantics in electric vehicle charging demand prediction is solved, accurate prediction of charging demand is achieved, and charging station resource allocation and user experience are optimized.

CN120450169BActive Publication Date: 2025-09-30UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510953857.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-09-30
Estimated Expiration
2045-07-11

AI Technical Summary

Technical Problem

Existing electric vehicle charging prediction technology cannot effectively capture the dynamic coupling relationship between the time-varying characteristics of traffic flow and text semantics, resulting in design defects of the cross-modal alignment mechanism, making it impossible to achieve accurate charging demand prediction, affecting the resource allocation of charging stations and user experience.

Method used

A bidirectional gated collaborative deep network based on a dynamic heterogeneous graph network and a large language model is constructed. Through the dynamic characteristics of traffic flow and the large language model of bidirectional cross-modal gating collaboration, accurate prediction of urban charging demand is achieved.

Benefits of technology

Through the adaptive weight adjustment mechanism, the traffic fluctuation characteristics are captured, multi-scale spatiotemporal features are extracted, and the natural language description of the traffic scene and the spatiotemporal graph structure are deeply aligned to improve the resource allocation efficiency of charging stations and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120450169B_ABST
    Figure CN120450169B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of charging demand prediction for charging stations, and discloses a method for predicting charging demand for electric vehicles, comprising: constructing a heterogeneous dynamic adjacency matrix comprising a road structure coupling matrix, a traffic flow evolution matrix, and a charging demand reachability correction matrix; inputting traffic flow data and the heterogeneous dynamic adjacency matrix into a multi-order gated graph network to obtain graph features; inputting the graph features and the word embeddings of a large language model into a bidirectional cross-modal gated collaborative network to align the graph features and the word embeddings; inputting the output of the bidirectional cross-modal gated collaborative network into the large language model, and outputting the charging demand prediction results through a fully connected layer; optimizing the model parameters through a training set, and generating charging demand prediction results for each charging station in the future time period based on a test set. The present invention solves the pain points of traditional methods, such as insufficient adaptability to the dynamic evolution of traffic systems and fragmented fusion of multi-source information, and provides reliable technical support for charging demand prediction and charging station resource optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of charging demand prediction for charging stations, and in particular to a method for predicting charging demand for electric vehicles. Background Art

[0002] The widespread adoption of electric vehicles has exacerbated the challenge of uneven spatial and temporal distribution of charging demand. The coexistence of "lack of charging piles" and "idle resources" at charging stations not only hinders user experience but also threatens the balance of supply and demand on the power grid. Accurately predicting charging demand is a key prerequisite for optimizing the layout of charging facilities and achieving coordinated scheduling of vehicles, charging piles, and the grid. Traffic flow, as the physical carrier of vehicle movement, directly shapes the spatial and temporal distribution and dynamic evolution of charging demand. Therefore, building a charging demand prediction model driven by the dynamic characteristics of traffic flow has become an inevitable choice to address this challenge.

[0003] Existing electric vehicle charging prediction technologies are mainly divided into two categories, namely, mechanism-based modeling methods and data-driven methods. Mechanism-based modeling methods are often highly complex and require a large number of assumptions, making it difficult to provide high-quality charging demand forecasting support for the efficient operation of actual charging stations. Existing data-driven technologies are mostly divided into pure time series prediction methods and spatiotemporal joint prediction methods. Existing pure time series prediction methods overly rely on the autoregressive characteristics of historical charging load data, severing the causal relationship between the dynamic characteristics of traffic flow and charging demand, resulting in poor results in cross-regional demand forecasting. Although existing spatiotemporal combined technologies introduce spatial information, most of them use static graph structures and cannot characterize the impact of dynamic changes in traffic flow on charging demand.

[0004] Large language models, with their powerful cross-modal semantic understanding and long-term context modeling capabilities, have demonstrated breakthrough performance in spatiotemporal sequence tasks such as weather forecasting and traffic flow analysis. However, in the field of electric vehicle charging demand forecasting, there is currently a lack of technology that effectively combines dynamic graph networks and large language models to perform charging demand forecasting. The core bottleneck lies in the design flaws of the cross-modal alignment mechanism. Existing technologies typically use shallow cross-attention techniques or simply concatenate text word embedding vectors with spatiotemporal features. This static interaction model fails to capture the dynamic coupling between the time-varying characteristics of traffic flow and text semantics, resulting in spatiotemporal misalignment between modalities. Summary of the Invention

[0005] To solve the above technical problems, the present invention provides a method for predicting electric vehicle charging demand. It constructs a deep network based on the bidirectional gating collaboration of a dynamic heterogeneous graph network and a large language model. Through the large language model that combines the dynamic characteristics of traffic flow with bidirectional cross-modal gating collaboration, it can achieve accurate prediction of urban charging demand, thereby providing support for the rational resource allocation of charging stations, improving service efficiency and shortening charging waiting time.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0007] A method for predicting charging demand of electric vehicles, comprising:

[0008] Collect historical traffic flow data for n roads in the target area and historical order data for each charging station; divide the collected data into training and test sets;

[0009] Construct a heterogeneous dynamic adjacency matrix consisting of a road structure coupling matrix, a traffic flow evolution matrix, and a charging demand reachability correction matrix;

[0010] Traffic flow data and heterogeneous dynamic adjacency matrices are input into a multi-order gated graph network. First-order propagation is performed to capture direct connections, second-order propagation is performed to capture indirect connections, and sparse adjacency hierarchical aggregation is performed to retain key paths. Graph features are then fused.

[0011] The graph features and word embeddings of the large language model are input into a bidirectional cross-modal gated collaborative network, and the graph features and word embeddings are aligned through word embedding dimensionality reduction, graph feature-driven word embedding modulation, graph feature optimization with word embedding feedback, and heterogeneous feature tensor interaction.

[0012] The output of the bidirectional cross-modal gated collaborative network is input into the large language model, and the charging demand prediction result is output through the fully connected layer;

[0013] The parameters of the prediction model composed of a multi-order gated graph network and a bidirectional cross-modal gated collaborative network are optimized through the training set, and the charging demand prediction results for each charging station in the future period are generated based on the test set.

[0014] In one embodiment, the road structure coupling matrix for:

[0015] ;

[0016] is the static road topology matrix, ; For the road and roads The geometric center distance, is the attenuation coefficient; represents the projection matrix from the road to the charging station, Represents the projection matrix from the charging station to the road; the attenuation coefficient The calculation method is:

[0017] ;

[0018] in, is the length of the typical peak hour period of the road, 、 are the maximum and minimum historical traffic values ​​of the road, is a constant.

[0019] In one embodiment, the projection matrix from the road to the charging station ;

[0020] Projection matrix from charging station to road ;

[0021] is the charging demand reachability matrix, Elements in ;

[0022] is the learnable weight matrix, is the softmax function; is the shortest distance from road i to charging station k, is the flow from road j to charging station k at time t.

[0023] In one embodiment, the traffic flow evolution matrix for:

[0024] ;

[0025] is the traffic dynamic flow matrix, Elements in ;

[0026] in, is the flow from road i to road j at time t, It means to find the maximum value, Indicates flow rate, represents the sigmoid function, is the attenuation coefficient; Represents the current moment The time difference from the historical traffic peak time, The peak traffic moment of the past day.

[0027] In one embodiment, the charging demand reachability correction matrix is ​​recorded as , Elements in ; represents the serviceable vehicle capacity of charging station k, is the shortest distance from road i to charging station k, Represents the attenuation coefficient.

[0028] In one embodiment, the heterogeneous dynamic adjacency matrix for: ;in, represents the road structure coupling matrix, is the traffic flow evolution matrix, is the charging demand reachability correction matrix, 、 、 are the weight items of the road structure coupling matrix, traffic flow evolution matrix and charging demand reachability correction matrix respectively;

[0029] Weight term of road structure coupling matrix The calculation method is: ,in 、 is the learnable weight parameter, is the global flow rate change rate, is the local flow difference;

[0030] The global flow rate change rate is calculated as follows: , is the total traffic volume of the entire road network at the current moment, is the average traffic volume at the same time in the past week. is the standard deviation of traffic at the same time in the past week;

[0031] The local flow difference is calculated as follows: ,in is the average flow of adjacent nodes;

[0032] The weight of the traffic flow evolution matrix The calculation method is: .

[0033] In one embodiment, the traffic flow data and the heterogeneous dynamic adjacency matrix are input into a multi-order gated graph network, and first-order propagation is performed to capture direct associations, second-order propagation is performed to capture indirect associations, and sparse adjacency hierarchical aggregation is performed to retain key paths, and graph features are obtained by fusion, specifically including:

[0034] The traffic flow data is , is the traffic flow characteristic matrix at time t, is the initial charging station feature matrix;

[0035] The heterogeneous dynamic adjacency matrix is ​​first logarithmically scaled and sparsely masked before being input into the multi-order gated graph network to generate an adjacency tensor. ;

[0036] The multi-order gated graph network includes hierarchical aggregation of first-order propagation, second-order propagation and sparse adjacency;

[0037] The result of the first-order propagation ; is the learnable weight matrix, is the activation function, which captures direct correlation through first-order propagation;

[0038] The result of the second-order propagation , is the sigmoid function, is the learnable weight matrix, It is the Hadamard element-wise multiplication, capturing indirect correlation through second-order gating;

[0039] The result of the hierarchical aggregation of sparse adjacency , wherein the traffic flow data is graph data, and each node in the graph data represents a road, It means that for each node, the k edges with the largest weight are retained and the rest of the edges are set to zero. is the learnable weight matrix; represents the average pooling operation;

[0040] The graph features are obtained by fusing the results of first-order propagation, second-order propagation and hierarchical aggregation of sparse adjacency. , Representation layer normalization operation.

[0041] In one embodiment, the word embedding dimensionality reduction specifically includes:

[0042] Select a large language model and obtain the corresponding word embedding tensor , project the word embedding tensor down to get the reduced-dimensional word embedding ,in is a learnable dimensionality reduction matrix;

[0043] Expand the reduced-dimensional word embedding and align it with the graph features to obtain the expanded word embedding , For extended operations;

[0044] The graph feature-driven word embedding modulation specifically includes:

[0045] Get graph features The projection matrix ,in, are learnable weights, for The second dimension, represent The first dimension, Indicates the number of channels;

[0046] Apply dimension permutation to the projection matrix of the graph features , get the permutation projection matrix ;

[0047] based on Project the graph features again to obtain the re-projection matrix of the graph features ,in is a learnable projection matrix;

[0048] Multiply the reprojection matrix and the expanded word embedding to modulate the word embedding and obtain the modulated word embedding ;

[0049] Perform tensor contraction on the modulated word embedding to obtain the contracted word embedding ,in This is the operation that averages the first dimension.

[0050] In one embodiment, the graph feature optimization of the word embedding feedback specifically includes:

[0051] Perform dimension-raising projection on the contracted word embedding to obtain the dimension-raising word embedding ,in is the learnable weight matrix, It is the third dimension of graph features;

[0052] The raised-dimensional word embedding is projected again to obtain the second raised-dimensional word embedding ,in, is the learnable weight matrix;

[0053] Embed the second dimension word into the expanded dimension to get the expanded word embedding ;

[0054] By expanding word embedding and the graph features Multiply to optimize the graph features and obtain the optimized graph features ;

[0055] The heterogeneous feature tensor interaction specifically includes:

[0056] Generate intermodal modulation gates: , ,in, represents the intermodal modulation gate, is a learnable weight term, is a learnable bias term;

[0057] Constructing cross-modal focused triples: , and ; Q represents the graph-driven query tensor, K represents the gated semantic key tensor, and V represents the gated semantic value tensor; Represent the learnable weight matrices respectively;

[0058] Perform focal computations for probabilistic simplex constraints: ; represents the output of the bidirectional cross-modal gated collaborative network, express Dimensions, Represents the softmax function.

[0059] In one embodiment, the step of inputting the output of the bidirectional cross-modal gated collaborative network into a large language model and outputting the charging demand prediction result via a fully connected layer specifically includes:

[0060] The output of the bidirectional cross-modal gating collaborative network Input into the large language model, the decoder of the large language model Get the large language model output ;

[0061] The processing strategy of the large language model includes freezing the large language model and partially fine-tuning it; then the output of the large language model is input into the fully connected layer to obtain the charging demand prediction result. ;in is the learnable weight matrix, is the offset term.

[0062] Compared with the prior art, the beneficial technical effects of the present invention are:

[0063] The charging demand prediction method proposed in this paper achieves excellent charging station charging prediction results through the synergistic combination of heterogeneous dynamic adjacency matrix modeling, multi-order gated graph network feature fusion, and bidirectional cross-modal graph embedding-word embedding collaboration. The method first constructs a heterogeneous dynamic adjacency matrix that integrates the road structure coupling matrix, the traffic flow evolution matrix, and the charging demand reachability correction matrix. An adaptive weight adjustment mechanism is used to capture traffic flow fluctuations in scenarios such as morning and evening rush hours and emergencies. Secondly, a multi-order gated graph network is used to extract multi-scale spatiotemporal features by balancing local feature perception with long-range dependency modeling. Furthermore, a bidirectional collaboration mechanism between language models and graph features is introduced to deeply align natural language descriptions of traffic scenarios with spatiotemporal graph structures, leveraging semantic knowledge to enhance the model's understanding of complex traffic scenarios. This method innovatively combines dynamic graph computation with cross-modal reasoning based on a large language model, addressing the shortcomings of traditional methods, such as their lack of adaptability to the dynamic evolution of traffic systems and the fragmented fusion of multi-source information. This provides reliable technical support for charging demand prediction and charging station resource optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 4 is a flow chart of a method in an embodiment of the present invention.

[0065] Figure 2 Schematic diagram of a prediction model in an embodiment of the present invention.

[0066] Figure 3 This is a comparison chart of the predicted value and the actual value of the charging demand of charging station No. 1 in the next hour based on the test set in an embodiment of the present invention.

[0067] Figure 4 This is a comparison chart of the predicted value and the actual value of the charging demand of Charging Station No. 2 in the next hour based on the test set in an embodiment of the present invention.

[0068] Figure 5 This is a comparison chart of the predicted value and the actual value of the charging demand of Charging Station No. 1 on the third day in the future based on the test set in an embodiment of the present invention.

[0069] Figure 6 This is a comparison chart of the predicted value and the actual value of the charging demand of Charging Station No. 2 on the third day in the future based on the test set in an embodiment of the present invention. DETAILED DESCRIPTION

[0070] A preferred embodiment of the present invention will be described in detail below with reference to the accompanying drawings.

[0071] The spatiotemporal randomness and dynamic coupling of electric vehicle charging behavior lead to charging service systems facing a series of challenges: inaccurate planning, delayed response, and resource imbalance. The unpredictability of charging hotspots makes it difficult to match facility layouts with actual user needs, exacerbating the supply-demand mismatch. The immediacy and suddenness of user charging behavior cause service response mechanisms to lag, significantly impacting user experience and operational efficiency. The lack of synergy in the dynamic interaction between vehicle, charging pile, and network further amplifies the negative impact of energy loss and inefficient facility operation. This invention, by accurately predicting charging demand over a period of time, can provide positive support for solving the above problems.

[0072] A method for predicting charging demand of electric vehicles, comprising:

[0073] Collect historical traffic flow data for n roads in the target area and historical order data for each charging station; divide the collected data into training and test sets;

[0074] Construct a heterogeneous dynamic adjacency matrix consisting of a road structure coupling matrix, a traffic flow evolution matrix, and a charging demand reachability correction matrix;

[0075] Traffic flow data and heterogeneous dynamic adjacency matrices are input into a multi-order gated graph network. First-order propagation is performed to capture direct connections, second-order propagation is performed to capture indirect connections, and sparse adjacency hierarchical aggregation is performed to retain key paths. Graph features are then fused.

[0076] The graph features and word embeddings of the large language model are input into a bidirectional cross-modal gated collaborative network, and the graph features and word embeddings are aligned through word embedding dimensionality reduction, graph feature-driven word embedding modulation, graph feature optimization with word embedding feedback, and heterogeneous feature tensor interaction.

[0077] The output of the bidirectional cross-modal gated collaborative network is input into the large language model, and the charging demand prediction result is output through the fully connected layer;

[0078] The parameters of the prediction model composed of a multi-order gated graph network and a bidirectional cross-modal gated collaborative network are optimized through the training set, and the charging demand prediction results for each charging station in the future period are generated based on the test set.

[0079] like Figure 1 As shown, the prediction model of the present invention first collects data, then performs data preprocessing, and then constructs a road structure coupling matrix, a traffic flow evolution matrix, and a charging demand reachability correction matrix. Feature extraction and model training are then performed. The loss function value and the number of training rounds determine whether the training stop condition has been met. If so, prediction is performed; if not, the model returns to feature extraction and repeats the above steps.

[0080] Figure 2 This is a schematic diagram of the prediction model of the present invention. First, traffic flow data, as well as a road structure coupling matrix, a traffic flow evolution matrix, and a charging demand reachability correction matrix are prepared. The road structure coupling matrix, traffic flow evolution matrix, and charging demand reachability correction matrix are constructed as a heterogeneous dynamic adjacency matrix. The traffic flow data and heterogeneous dynamic adjacency matrix are then input into a multi-order gated graph network. The output of the multi-order gated graph network is then subjected to bidirectional cross-modal gating coordination with the word embeddings of a large language model. The results are then sequentially input into the large language model and the fully connected layer to obtain the final prediction result.

[0081] The following describes the technical solution of the present invention in detail by taking the traffic flow of the main roads in a certain area of ​​a city and the charging order data of the surrounding charging stations as an example.

[0082] Collect historical traffic flow data and distance relationship data of n roads in a certain area of ​​a city; statistically predict historical order data of m charging stations in the area, as well as distance data from n roads to m charging stations.

[0083] For the collected data, set the characteristic time step l, use the traffic flow data of l time steps as features, and use the charging station order data of the l+1th time step as labels.

[0084] The obtained traffic road data is normalized.

[0085] The obtained traffic flow data and charging station order data are divided into training sample set, verification sample set and test sample set.

[0086] In one embodiment, the road structure coupling matrix for:

[0087] ;

[0088] is the static road topology matrix, ; is the road length, is the attenuation coefficient; represents the projection matrix from the road to the charging station, The projection matrix representing the charging station to the road.

[0089] In one embodiment, the attenuation coefficient The calculation method is:

[0090] ;

[0091] in, is the length of the typical peak hour period of the road, 、 are the maximum and minimum historical traffic values ​​of the road, is a constant.

[0092] In one embodiment, the projection matrix from the road to the charging station ;

[0093] Projection matrix from charging station to road

[0094] is the charging demand reachability matrix, Elements in ;

[0095] is the learnable weight matrix, is the softmax function; where is the shortest distance from road i to charging station k, is the flow from road j to charging station k at time t.

[0096] In one embodiment, the traffic flow evolution matrix for:

[0097] ;

[0098] is the traffic dynamic flow matrix, Elements in ;

[0099] in, is the flow from road i to road j at time t, It means to find the maximum value, Indicates flow rate, represents the sigmoid function, is the attenuation coefficient; Represents the current moment The time difference from the historical traffic peak time, The peak traffic moment of the past day.

[0100] In one embodiment, the charging demand reachability correction matrix is ​​recorded as , Elements in ; represents the serviceable vehicle capacity of charging station k, is the shortest distance from road i to charging station k, Represents the attenuation coefficient.

[0101] In one embodiment, the heterogeneous dynamic adjacency matrix for: ;in, represents the road structure coupling matrix, is the traffic flow evolution matrix, is the charging demand reachability correction matrix, 、 、 are the weight items of the road structure coupling matrix, traffic flow evolution matrix and charging demand reachability correction matrix respectively;

[0102] Weight term of road structure coupling matrix The calculation method is: ,in 、 is a learnable weight parameter, is the global flow rate change rate, is the local flow difference;

[0103] The global flow rate change rate is calculated as follows: , is the total traffic volume of the entire road network at the current moment, is the average traffic volume at the same time in the past week. is the standard deviation of traffic at the same time in the past week;

[0104] The local flow difference is calculated as follows: ,in is the average flow of adjacent nodes;

[0105] The weight of the traffic flow evolution matrix The calculation method is: .

[0106] In one embodiment, the traffic flow data and the heterogeneous dynamic adjacency matrix are input into a multi-order gated graph network, and first-order propagation is performed to capture direct associations, second-order gated propagation is performed to capture indirect associations, and sparse adjacency hierarchical aggregation is performed to retain key paths, and graph features are obtained by fusion, specifically including:

[0107] The traffic flow data is , is the traffic flow characteristic matrix at time t, is the charging station feature matrix; when the charging station information is unknown during the training phase, 0 is used as the charging station feature. Traffic flow feature matrix Contains traffic flow data, average vehicle speed, and congestion mileage information for each road at time t.

[0108] The heterogeneous dynamic adjacency matrix is ​​logarithmically scaled and sparsely masked before being input into the multi-order gated graph network to generate a stable and efficient adjacency tensor. ; ,in To normalize the operation and prevent gradient instability, the logarithmic function can suppress the influence of extreme values. It is a distance-based sparse mask to reduce noise interference.

[0109] The multi-order gated graph network includes three layers of processing, namely first-order propagation, second-order propagation and hierarchical aggregation of sparse adjacency.

[0110] The result of the first-order propagation ; is the learnable weight matrix, is the activation function, which captures direct correlation through first-order propagation; direct correlation is the correlation relationship between traffic flows between adjacent roads that affect each other.

[0111] The result of the second-order propagation , is the sigmoid function, is the learnable weight matrix, It is the Hadamard element-wise multiplication, and the indirect correlation is captured by the second-order gating; the indirect correlation refers to the potential influence relationship between road traffic flows formed by indirect connection paths.

[0112] The result of the hierarchical aggregation of sparse adjacency ,in, It means that for each node, the k edges with the largest weight are retained and the rest of the edges are set to zero. This operation can reduce the computational complexity and suppress the interference of noise edges. is the learnable weight matrix; Represents the average pooling operation; the hierarchical aggregation of sparse adjacencies in the third layer can preserve the critical path.

[0113] The graph features are obtained by fusing the results of first-order propagation, second-order propagation and hierarchical aggregation of sparse adjacency. .

[0114] Specifically, the output of the multi-order gated graph network and the word embedding of the large language model (LLM) used are input into the designed bidirectional cross-modal gated collaborative network, so that the graph features extracted by the multi-order gated graph network and the word embedding of the LLM can be deeply integrated, thereby laying the foundation for the LLM to understand the graph features.

[0115] The bidirectional cross-modal gated collaboration includes first reducing the dimensionality of word embeddings, then performing graph feature-dominated word embedding modulation, then performing graph feature optimization with word embedding feedback, and finally performing heterogeneous feature tensor interaction to align graph features and LLM word embeddings.

[0116] In one embodiment, the word embedding dimensionality reduction specifically includes:

[0117] Select a large language model and obtain the corresponding word embedding tensor , project the word embedding tensor down to get the reduced-dimensional word embedding ,in is a learnable dimensionality reduction matrix;

[0118] Expand the reduced-dimensional word embedding and align it with the graph features to obtain the expanded word embedding , For extended operations.

[0119] The graph feature-driven word embedding modulation specifically includes:

[0120] Get the projection matrix of the graph feature ,in, are learnable weights, for The second dimension, represent First dimension;

[0121] Apply dimension permutation to the projection matrix of the graph features , get the permutation projection matrix ;

[0122] based on Project the graph features again and get ,in is a learnable projection matrix;

[0123] Multiply the projected graph features and the expanded word embedding to modulate the word embedding to obtain the modulated word embedding ;

[0124] Perform tensor contraction on the modulated word embedding to obtain the contracted word embedding ,in This is the operation that averages the first dimension.

[0125] In one embodiment, the graph feature optimization of the word embedding feedback specifically includes:

[0126] Perform dimension-raising projection on the contracted word embedding to obtain the dimension-raising word embedding ,in is the learnable weight matrix, g is the third dimension of the graph feature;

[0127] The raised-dimensional word embedding is projected again to obtain the second raised-dimensional word embedding ,in, is the learnable weight matrix;

[0128] Embed the second dimension word into the expanded dimension to get the expanded word embedding ;

[0129] By expanding word embedding and the graph features Multiply to optimize the graph features and obtain the optimized graph features ;

[0130] The heterogeneous feature tensor interaction specifically includes:

[0131] Generate intermodal modulation gates: , ,in, represents the intermodal modulation gate, is a learnable weight term, is a learnable bias term;

[0132] Constructing cross-modal focused triples: , and ; Q represents the graph-driven query tensor, K represents the gated semantic key tensor, and V represents the gated semantic value tensor; Represent the learnable weight matrices respectively;

[0133] Perform focal computations for probabilistic simplex constraints: ; represents the output of the bidirectional cross-modal gated collaborative network, express Dimensions, Represents the softmax function.

[0134] In one embodiment, the step of inputting the output of the bidirectional cross-modal gated collaborative network into a large language model and outputting the charging demand prediction result via a fully connected layer specifically includes:

[0135] The output of the bidirectional cross-modal gating collaborative network Input into the large language model, the decoder of the large language model Get the large language model output ;

[0136] The processing strategy of the large language model includes freezing the large language model and partially fine-tuning it; then the output of the large language model is input into the fully connected layer to obtain the charging demand prediction result. ;in is the learnable weight matrix, is the offset term.

[0137] The present invention trains the model on the training set and verifies it on the validation set to optimize the model parameters.

[0138] Specifically, the steps for predicting battery swapping demand at battery swap stations are divided into two stages: training stage and prediction stage.

[0139] (1) The training phase includes:

[0140] Standardize the traffic flow data obtained

[0141] The Adam gradient descent algorithm is used to calculate and train the parameters of the prediction model composed of a multi-order gated graph network and a bidirectional cross-modal gated collaborative network.

[0142] (2) The forecasting stage includes:

[0143] Take the test set data as input data;

[0144] Call the prediction model trained in the training phase to make predictions. The prediction model structure is as follows: Figure 2 shown.

[0145] The implementation process of the two stages is described in detail below.

[0146] (1) Training phase:

[0147] Step 1-1: Collect traffic flow data for a specific area of ​​a city and organize it every m minutes, using the charging demand data at the m+1th minute as a label. Construct a road structure coupling matrix, a traffic flow evolution matrix, and a charging demand reachability correction matrix.

[0148] Step 1-2: Normalize the traffic flow data.

[0149] Step 1-3: Divide the normalized traffic flow data into training set, validation set and test set.

[0150] Steps 1-4: Dynamically merge the constructed road structure coupling matrix, traffic flow evolution matrix, and charging demand reachability correction matrix into a heterogeneous dynamic adjacency matrix.

[0151] Step 1-5: Input the heterogeneous dynamic adjacency matrix and traffic flow data in step 1-4 into the multi-order gated graph network, and perform first-order propagation, second-order propagation and sparse adjacency hierarchical aggregation in sequence to obtain graph features.

[0152] Step 1-6: Input the graph features obtained in steps 1-5 and the word embedding of the large language model into the bidirectional cross-modal gated collaborative network.

[0153] Step 1-7: Input the word embedding of the large language model of steps 1-6 into the bidirectional cross-modal gated collaborative network for dimensionality reduction.

[0154] Step 1-8: Perform graph feature-dominated word embedding modulation on the word embedding obtained in steps 1-7.

[0155] Step 1-9: Use the word embedding in step 1-8 to optimize the graph features in step 1-6 based on the word embedding feedback.

[0156] Step 1-10: Generate intermodal modulation gates based on the graph features obtained in step 1-9.

[0157] Step 1-11: Construct a cross-modal focused triplet based on the inter-modal modulation gate obtained in step 1-10 and the graph features obtained in step 1-9.

[0158] Step 1-12: Perform probabilistic simplex-constrained focus calculation on the cross-modal focus triples obtained in step 1-11.

[0159] Step 1-13: Input the results of step 1-12 into the large language model.

[0160] Step 1-14: Input the output of step 1-13 into the fully connected layer to obtain the output as the prediction result.

[0161] Step 1-15: Construct cross entropy loss as the loss function, set the optimizer's optimization function to "Adam", the evaluation metrics to "mean absolute error (MAE)" and "root mean square error (‌RMSE)", the number of training batches to batch_size to 64, and the number of iterations to 40.

[0162] Step 1-16: Use the Adam gradient descent algorithm to calculate and train the prediction model parameters. During training, set the display of the training loss and validation val_loss.

[0163] Step 1-17: If the loss function constructed by the settings generated by training the prediction model no longer decreases or reaches the maximum number of iterations, interrupt the prediction model training, otherwise jump to step 1-4.

[0164] (2) Forecasting stage:

[0165] Step 2-1: Input the test data into the prediction model trained in the training phase.

[0166] Step 2-2: Output the predicted charging demand of n charging stations.

[0167] Compare the curve of predicted value and true value on the test set, see Figures 3 to 6 .

[0168] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0169] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. It is intended that all variations within the meaning and range of equivalents of the claims be embraced herein, and any reference signs in the claims should not be construed as limiting the claims to which they relate.

[0170] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.

Claims

1. A method for predicting charging demand of electric vehicles, characterized in that: include: Collect historical traffic flow data of n roads in the target area and historical order data of each charging station; Divide the collected data into training set and test set; Construct a heterogeneous dynamic adjacency matrix including a road structure coupling matrix, a traffic flow evolution matrix, and a charging demand reachability correction matrix; the heterogeneous dynamic adjacency matrix for: ;in, represents the road structure coupling matrix, is the traffic flow evolution matrix, is the charging demand reachability correction matrix, 、 、 are the weight items of the road structure coupling matrix, traffic flow evolution matrix and charging demand reachability correction matrix respectively; the weight items of the road structure coupling matrix The calculation method is: ,in 、 is the learnable weight parameter, is the global flow rate change rate, is the local flow difference; the global flow change rate is calculated as follows: , is the total traffic volume of the entire road network at the current moment, is the average traffic volume at the same time in the past week. is the standard deviation of traffic flow at the same time in the past week; the local traffic difference is calculated as follows: ,in is the average flow of adjacent nodes; the weight of the traffic flow evolution matrix The calculation method is: ; Traffic flow data and heterogeneous dynamic adjacency matrix are input into the multi-order gated graph network, and first-order propagation is performed to capture direct associations, second-order propagation is performed to capture indirect associations, and sparse adjacency hierarchical aggregation is performed to retain key paths, and graph features are obtained by fusion, specifically including: the traffic flow data is , is the traffic flow characteristic matrix at time t, is the initial charging station feature matrix; the heterogeneous dynamic adjacency matrix is ​​first logarithmically scaled and sparsely masked before being input into the multi-order gated graph network to generate the adjacency tensor The multi-order gated graph network includes hierarchical aggregation of first-order propagation, second-order propagation and sparse adjacency; the result of the first-order propagation ; is the learnable weight matrix, is the activation function, which captures direct correlation through first-order propagation; the result of the second-order propagation , is the sigmoid function, is the learnable weight matrix, is the Hadamard element-wise multiplication, capturing indirect correlations through second-order gating; the result of the hierarchical aggregation of sparse adjacencies , wherein the traffic flow data is graph data, and each node in the graph data represents a road, It means that for each node, the k edges with the largest weight are retained and the rest of the edges are set to zero. is the learnable weight matrix; Represents the average pooling operation; the results of the first-order propagation, second-order propagation and sparse adjacency hierarchical aggregation are combined to obtain the graph features , Representation layer normalization operation; The graph features and word embeddings of the large language model are input into a bidirectional cross-modal gated collaborative network, and the graph features and word embeddings are aligned through word embedding dimensionality reduction, graph feature-driven word embedding modulation, graph feature optimization with word embedding feedback, and heterogeneous feature tensor interaction. The output of the bidirectional cross-modal gated collaborative network is input into the large language model, and the charging demand prediction result is output through the fully connected layer; The parameters of the prediction model composed of a multi-order gated graph network and a bidirectional cross-modal gated collaborative network are optimized through the training set, and the charging demand prediction results for each charging station in the future period are generated based on the test set.

2. The electric vehicle charging demand prediction method according to claim 1, characterized in that: The road structure coupling matrix for: ; is the static road topology matrix, ; For the road and roads The geometric center distance, is the attenuation coefficient; represents the projection matrix from the road to the charging station, Represents the projection matrix from the charging station to the road; the attenuation coefficient The calculation method is: ; in, is the length of the typical peak hour period on the road, 、 are the maximum and minimum historical traffic values ​​of the road, is a constant.

3. The electric vehicle charging demand prediction method according to claim 2, characterized in that: Projection matrix from road to charging station ; Projection matrix from charging station to road ; is the charging demand reachability matrix, Elements in ; is the learnable weight matrix, is the softmax function; is the shortest distance from road i to charging station k, is the flow from road j to charging station k at time t.

4. The electric vehicle charging demand prediction method according to claim 1, characterized in that: The traffic flow evolution matrix for: ; is the traffic dynamic flow matrix, Elements in ; in, is the flow from road i to road j at time t, It means to find the maximum value, Indicates flow rate, represents the sigmoid function, is the attenuation coefficient; Represents the current moment The time difference from the historical traffic peak time, The peak traffic moment of the past day.

5. The electric vehicle charging demand prediction method according to claim 1, characterized in that: The charging demand reachable correction matrix is ​​recorded as , Elements in ; represents the serviceable vehicle capacity of charging station k, is the shortest distance from road i to charging station k, Represents the attenuation coefficient.

6. The electric vehicle charging demand prediction method according to claim 1, characterized in that: The word embedding dimensionality reduction specifically includes: Select a large language model and obtain the corresponding word embedding tensor , project the word embedding tensor down to get the reduced-dimensional word embedding ,in is a learnable dimensionality reduction matrix; Expand the reduced-dimensional word embedding and align it with the graph features to obtain the expanded word embedding , For extended operations; The graph feature-driven word embedding modulation specifically includes: Get graph features The projection matrix ,in, are learnable weights, for The second dimension, represent The first dimension, Indicates the number of channels; Apply dimension permutation to the projection matrix of the graph features , get the permutation projection matrix ; based on Project the graph features again to obtain the re-projection matrix of the graph features ,in is a learnable projection matrix; Multiply the reprojection matrix and the expanded word embedding to modulate the word embedding and obtain the modulated word embedding ; Perform tensor contraction on the modulated word embedding to obtain the contracted word embedding ,in This is the operation that averages the first dimension.

7. The electric vehicle charging demand prediction method according to claim 6, characterized in that: The graph feature optimization of the word embedding feedback specifically includes: Perform dimension-raising projection on the contracted word embedding to obtain the dimension-raising word embedding ,in is the learnable weight matrix, It is the third dimension of graph features; The raised-dimensional word embedding is projected again to obtain the second raised-dimensional word embedding ,in, is the learnable weight matrix; Embed the second dimension word into the expanded dimension to get the expanded word embedding ; By expanding word embedding and the graph features Multiply to optimize the graph features and obtain the optimized graph features ; The heterogeneous feature tensor interaction specifically includes: Generate intermodal modulation gates: , ,in, represents the intermodal modulation gate, is a learnable weight term, is a learnable bias term; Constructing cross-modal focused triples: , and ; Q represents the graph-driven query tensor, K represents the gated semantic key tensor, and V represents the gated semantic value tensor; Represent the learnable weight matrices respectively; Perform focal computations for probabilistic simplex constraints: ; represents the output of the bidirectional cross-modal gated collaborative network, express Dimensions, Represents the softmax function.

8. The electric vehicle charging demand prediction method according to claim 1, characterized in that: The output of the bidirectional cross-modal gated collaborative network is input into the large language model, and the charging demand prediction result is output through the fully connected layer, specifically including: The output of the bidirectional cross-modal gating collaborative network Input into the large language model, the decoder of the large language model Get the large language model output ; The processing strategy of the large language model includes freezing the large language model and partially fine-tuning it; then the output of the large language model is input into the fully connected layer to obtain the charging demand prediction result. ;in is the learnable weight matrix, is the offset term.