Research on Electric Vehicle Charging Load Forecasting and Optimization Strategies

With the transformation of the global energy structure and the rapid development of the electric vehicle market, accurate charging load forecasting and charging demand prediction have become essential research directions in modern power systems. The widespread adoption of electric cars has not only intensified the pressure on existing charging infrastructure but also introduced new challenges for energy management and power system dispatching. Vehicle-to-grid (V2G) technology, as an innovative bidirectional energy interaction solution, offers a promising pathway to alleviate these pressures by enabling electric cars to serve not only as loads but also as distributed energy storage units that can feed electricity back to the grid. In this context, three core problems demand in-depth investigation: how to accurately forecast the charging load of electric cars with high randomness, how to predict the spatiotemporal charging demand of electric cars in urban environments, and how to develop reasonable charging-discharging strategies that balance both user interests and grid stability. This thesis addresses these challenges systematically, with the goal of providing theoretical foundations and technical support for the coordinated operation of electric cars and the power grid.

1. Background and Literature Review

The number of electric cars worldwide has been growing at an unprecedented pace, driven by carbon neutrality goals and advances in battery technology. However, the uncoordinated charging behaviors of large-scale electric cars can cause severe peak loads on distribution networks, voltage deviations, and frequency instability. Research on electric car charging load forecasting can be broadly divided into two categories: traditional model-based approaches and deep learning-based approaches. The former includes time series analysis, regression analysis, wavelet analysis, similar-day methods, and Monte Carlo simulation. Although these methods can capture the basic statistical characteristics of charging load, they often fail to handle the non-stationary and highly stochastic nature of electric car load data. Meanwhile, deep learning models, particularly recurrent neural networks (RNNs) such as long short-term memory (LSTM) and gated recurrent units (GRU), have been widely adopted for time series forecasting of electric car charging load. However, these approaches frequently suffer from insufficient extraction of deep multi-scale features and limited accuracy.

For charging demand forecasting, existing research initially applied temporal models such as RNN and Transformer to predict the future occupancy status of charging stations. Nevertheless, these studies rarely incorporated the spatial correlations among charging stations, such as geographic proximity, functional similarity of urban areas, and road connectivity. More recent efforts have introduced graph neural networks (GNNs), including graph convolutional networks (GCN) and graph attention networks (GAT), to model these spatial relationships. While promising, these methods still exhibit insufficient fusion of temporal information and spatial features, especially under dynamic conditions such as price changes and regional demand shifts.

Regarding charging-discharging strategies for electric cars, a large number of optimization models have been proposed. Some works aim to minimize charging costs through time-of-use tariffs, while others focus on peak shaving and valley filling from the perspective of grid operation. Yet, many strategies fail to fully account for the economic benefits of electric car users, particularly in terms of discharging revenue, battery degradation compensation, and time rewards for participating in V2G programs. Moreover, the differences between charging and discharging prices are often overlooked, which reduces the willingness of users to discharge their electric cars during peak hours. In light of these gaps, this thesis develops: (1) an improved charging load forecasting framework based on optimized variational mode decomposition (VMD), attention mechanisms, and multi-scale temporal convolutional networks (TCN); (2) a spatiotemporal charging demand prediction framework that deeply integrates spatial dependency with temporal dynamics; and (3) a multi-objective charging-discharging scheduling strategy incorporating comprehensively quantified user-side costs and grid-side objectives.

2. Relevant Theoretical Foundations

To clearly contextualize the three proposed frameworks, it is necessary to introduce several critical building blocks: TCN, attention mechanisms, VMD, GAT, bidirectional gated recurrent units (BiGRU), and V2G technology. The key definitions are summarized below.

2.1 Temporal Convolutional Network

TCN is designed to capture long-range dependencies in time series through causal convolutions and dilatation. The dilated causal convolution for an input sequence \(\mathbf{h}\) is formulated as:

\[
\mathbf{F}(t) = \sum_{i=0}^{k_l-1} c(i) \cdot \mathbf{h}(t – dr \cdot i)
\]

where \(k_l\) refers to the convolution kernel size, \(dr\) represents the dilatation rate governing the coverage of a temporal window, and \(c(i)\) denotes the weight at position \(i\). Compared with RNN, TCN enables parallel computation and avoids gradient vanishing or explosion issues, making it appropriate for large-scale electric car charging load data.

2.2 Attention Mechanism

The attention mechanism allows neural models to measure the relative importance of temporal steps or feature channels. For the temporal dimension, the attention weight at time step \(t\) is generally computed via a learned scoring function followed by a softmax operation:

\[
\alpha_t = \frac{\exp(\mathrm{score}(\mathbf{h}_t))}{\sum_{j=1}^{T}\exp(\mathrm{score}(\mathbf{h}_j))}
\]

The channel attention mechanism, in contrast, first compresses the spatial information by global average pooling and then uses multilayer perceptron layers to generate channel-wise weights. Given an intermediate feature map \(\mathbf{F}\), the output is given by:

\[
\mathbf{F}’ = \mathbf{F} \otimes \sigma(\mathrm{MLP}(\mathrm{GAP}(\mathbf{F})))
\]

where

\[
\sigma(x) = \frac{1}{1 + e^{-x}}
\]

is the sigmoid activation function and GAP denotes global average pooling.

2.3 Variational Mode Decomposition

VMD is an adaptive signal processing technique. It decomposes a complicated input signal into \(K\) intrinsic mode functions (IMFs) with limited bandwidth. The decomposition is achieved by solving a constrained variational problem:

\[
\min_{\{u_k\},\{\omega_k\}} \left\{ \sum_{k=1}^{K} \left\| \partial_t \left[ \left( \delta(t) + \frac{j}{\pi t} \right) u_k(t) \right] e^{-j\omega_k t} \right\|_2^2 \right\}
\]

subject to the constraint \(\sum_{k=1}^{K} u_k(t) = Y(t)\), where \(u_k(t)\) denotes the \(k\)-th decomposed component, \(\omega_k\) denotes its center frequency, \(Y(t)\) is the input charging load sequence, \(K\) is the number of modes, and \(\alpha\) is the penalty factor. An augmented Lagrangian function is constructed and solved iteratively with the alternating direction method of multipliers (ADMM). In this study, the whale optimization algorithm (WOA) is employed to optimize the key parameters \(K\) and \(\alpha\) because the decomposition quality strongly depends on this parameter pair, and inappropriate values may lead to under-decomposition or over-decomposition.

2.4 Graph Attention Network

For charging demand prediction, charging stations and their neighboring regions can be naturally treated as nodes of a graph. GAT computes attention coefficients between node \(i\) and node \(j\) as:

\[
e_{ij} = \mathrm{LeakyReLU}\left( a^T [ \mathbf{W}\mathbf{h}_i \| \mathbf{W}\mathbf{h}_j ] \right)
\]

with normalized coefficients:

\[
\alpha_{ij} = \frac{\exp(e_{ij})}{\sum_{k \in N(i)} \exp(e_{ik})}
\]

The updated node feature is then:

\[
\mathbf{h}_i’ = \sigma\left( \sum_{j \in N(i)} \alpha_{ij} \mathbf{W} \mathbf{h}_j \right)
\]

In the proposed charging demand prediction model, multi-head attention and adaptive weighting strategies are further introduced. The head outputs are not simply averaged, but instead are linearly aggregated with learnable weights, thus enabling the model to treat each attention head flexibly and selectively. A two-layer improved GAT is adopted, and a residual connection is constructed between the initial input features obtained from the CNN module and the outputs from each GAT layer, ensuring that low-level information is not lost during propagation.

2.5 Bidirectional Gated Recurrent Unit

BiGRU processes an input sequence forward and backward simultaneously. For the forward direction, the update gate \(z_t^f\), reset gate \(r_t^f\), and candidate hidden state \(\tilde{h}_t^f\) are given by:

\[
z_t^f = \sigma\left( W_z^f \mathbf{G}_t + U_z^f h_{t-1}^f + b_z^f \right)
\]

\[
r_t^f = \sigma\left( W_r^f \mathbf{G}_t + U_r^f h_{t-1}^f + b_r^f \right)
\]

\[
\tilde{h}_t^f = \tanh\left( W_h^f \mathbf{G}_t + U_h^f (r_t^f \odot h_{t-1}^f ) + b_h^f \right)
\]

\[
h_t^f = (1 – z_t^f)\odot h_{t-1}^f + z_t^f \odot \tilde{h}_t^f
\]

The backward states \(h_t^b\) are calculated analogously along the reversed direction. The final hidden state at time step \(t\) is obtained by:

\[
H_t = h_t^f \| h_t^b
\]

where \(\|\) represents the concatenation operation. This structure enables the model to fuse future context with historical observations, which is particularly beneficial for electric car charging demand prediction where demand patterns may be influenced by both recent past and upcoming trends.

2.6 Evaluation Metrics

To quantitatively evaluate the model performance, several standard metrics are employed in this thesis: mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), relative absolute error (RAE), and the coefficient of determination \(R^2\). These metrics are defined below, where \(\hat{y}_i\) is the predicted value, \(y_i\) is the ground truth, and \(n\) is the total number of test samples.

\[
\mathrm{MSE} = \frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2
\]

\[
\mathrm{RMSE} = \sqrt{ \frac{1}{n} \sum_{i=1}^{n} (y_i – \hat{y}_i)^2 }
\]

\[
\mathrm{MAE} = \frac{1}{n} \sum_{i=1}^{n} |y_i – \hat{y}_i|
\]

\[
\mathrm{MAPE} = \frac{100\%}{n} \sum_{i=1}^{n} \left| \frac{y_i – \hat{y}_i}{y_i} \right|
\]

\[
\mathrm{RAE} = \frac{\sum_{i=1}^{n} |y_i – \hat{y}_i|}{\sum_{i=1}^{n} |y_i – \bar{y}|}
\]

\[
R^2 = 1 – \frac{\sum_{i=1}^{n} (y_i – \hat{y}_i)^2}{\sum_{i=1}^{n} (y_i – \bar{y})^2}
\]

Among these metrics, lower MSE, RMSE, MAE, MAPE and RAE values represent better predictive performance, while a higher \(R^2\) indicates that the model explains a greater proportion of the variance in the observed data.

3. Forecasting Electric Car Charging Load with Attention-Enhanced Multi-Scale TCN

3.1 Proposed Load Forecasting Framework

This framework is designed to address the high noise, irregular fluctuations, and multiple periodicities embedded in the charging load series of electric cars. The prediction architecture comprises four stages: data preprocessing, WOA-based VMD decomposition, feature engineering, and multi-scale attention-based TCN prediction. The overall workflow shown in the proposed framework is structured as follows:

First, the original charging records from electric cars and meteorological observations are aggregated at hourly resolution. Second, the meteorological features that have the highest linear influence on electric car charging load are selected through a multivariate regression analysis. Third, the original charging load sequence of electric cars is decomposed into several variational mode components, whose parameters are optimized by WOA. Fourth, the decomposed components are fed into three parallel improved TCN residual blocks with different kernel sizes and dilation rates, thus capturing patterns at distinct temporal scales. After that, the outputs from these residual blocks are fused through an attention layer, and the result is mapped to the target forecast output through several fully connected layers. Finally, the predicted components are summed to reconstruct the overall charging load prediction.

3.2 Meteorological Feature Selection

The charging behavior of electric cars is not solely determined by historical load patterns. Factors such as temperature, precipitation, air pressure, and humidity may influence whether users decide to charge their electric cars in a given hour. However, excessive meteorological inputs introduce unnecessary noise and increase computational burden. A linear multivariate regression is built as follows:

\[
Y = a_1 W_1 + a_2 W_2 + \cdots + a_s W_s + b
\]

where \(Y\) denotes the hourly charging load of electric cars, \(W_i\) denotes the \(i\)-th meteorological feature, \(a_i\) is the corresponding regression coefficient, and \(b\) is the intercept. If the absolute value \(|a_i|\) is greater than a predetermined threshold, the corresponding meteorological feature will be retained. In the experiments on the ElaadNL open dataset, which records the charging behavior of electric cars over several months, the features of temperature, atmospheric pressure, pressure change, and wind speed were ultimately included as auxiliary input features.

3.3 WOA-Optimized VMD for Charging Load Decomposition

The charging load of electric cars is essentially the superposition of a smooth base component, quasi-periodic fluctuations caused by daily commuting rhythms or time-of-use pricing, and stochastic disturbances caused by random user decisions. Directly feeding the original sequence to a deep model forces the network to simultaneously learn very different frequency components, which often makes the training process difficult. VMD alleviates this problem by decomposing the non-stationary load sequence into \(K\) band-limited IMF components, each of which behaves in a more regular way.

In the implemented WOA-VMD procedure, each whale searches the two-dimensional parameter space defined by the pair \((K, \alpha)\), where \(K\) is the number of modes and \(\alpha\) is the bandwidth penalty. The fitness of each candidate is determined by the minimal envelope entropy of the decomposition result. Assuming the current position vector of a whale is \(L_n = (K, \alpha)\), the position updates follow the mechanics below. When \(R \geq 0.5\), the whale updates its position using a spiral equation:

\[
L_n^{t+1} = L_{best}^{t} + |L_{best}^{t} – L_n^{t}| \cdot e^{r_1} \cos(2\pi r_1)
\]

When \(R < 0.5\) and \(\beta < 1\), the whale updates its position toward the current best individual:

\[
\Delta L_n^{t} = |\gamma L_{best}^{t} – L_n^{t}|
\]

\[
L_n^{t+1} = L_{best}^{t} – \beta \Delta L_n^{t}
\]

where \(\beta\) is given by \(\beta = 2\theta \cdot r_2 – \theta\), \(\theta = 2 – 2t/t_{\max}\), and \(\gamma = 2r_3\), with \(r_2\) and \(r_3\) being random numbers between 0 and 1. If \(R < 0.5\) and \(\beta \geq 1\), a random search strategy is employed:

\[
\Delta L_n^{t} = |\gamma L_{rand}^{t} – L_n^{t}|
\]

\[
L_n^{t+1} = L_{rand}^{t} – \beta \Delta L_n^{t}
\]

After iterating to the maximum allowed number of generations, the optimal parameters are determined. In this study, the optimal parameter pair was found to be \(K = 5\) and \(\alpha = 2000\). The resulting decomposition contains five components: the first component represents the mainly smooth and stable base portion of the electric car load, the second component has moderate periodicity, while the remaining high-frequency components correspond to stochastic charging events driven by irregular user behavior.

3.4 Attention-based TCN Residual Block

Although conventional TCN exhibits advantages over RNN architectures, its original residual structure may not be flexible enough to emphasize important time steps and channel relationships in electric car charging load data. Therefore, an improved residual block is designed by introducing: (1) a gated linear mechanism that controls the information flow in a learnable way; (2) temporal attention that adaptively highlights critical historical intervals; and (3) channel attention that recalibrates the importance of feature channels. The process can be mathematically formulated as follows.

Given the input load tensor \(\mathbf{X}\), the first dilated causal convolution produces \(\mathbf{H}_1\):

\[
\mathbf{H}_1 = \mathrm{ReLU}(\mathbf{W}_1 * \mathbf{X} + \mathbf{b}_1)
\]

A gating mechanism is then applied by generating an update signal and a reset signal:

\[
\mathbf{g}_{up} = \sigma(\mathbf{W}_{up} * \mathbf{H}_1 + \mathbf{b}_{up})
\]

\[
\mathbf{g}_{reset} = \sigma(\mathbf{W}_{reset} * \mathbf{H}_1 + \mathbf{b}_{reset})
\]

\[
\tilde{\mathbf{H}}_1 = \mathbf{g}_{reset} \odot \mathbf{H}_1
\]

\[
\mathbf{H}_1′ = (1 – \mathbf{g}_{up}) \odot \mathbf{H}_1 + \mathbf{g}_{up} \odot \tilde{\mathbf{H}}_1
\]

Here

\[
\mathrm{ReLU}(x) = \max(0, x)
\]

and \(\odot\) indicates element-wise multiplication. After dropout and another dilated convolution mixed with residual connections, the feature is passed through a temporal attention component:

\[
s_{time} = \mathrm{Softmax}\left( \mathrm{Flatten}\left( \tanh(\mathbf{W}_{time} * \mathbf{H} + \mathbf{C}_{time}) \right) \right)
\]

where \(\mathbf{C}_{time}\) is the bias term. The weighted temporal feature is then recalibrated in the channel dimension. The global average pooling operation is used to aggregate each channel into a scalar; then two dense layers produce the channel attention scores:

\[
s_{channel} = \mathrm{Dense}(\mathrm{Dense}(\mathrm{GAP}(\mathbf{F}_{time})))
\]

The output of the whole residual block is finally combined with the original residual connection:

\[
\mathrm{Res} = \mathbf{X} + \mathbf{F}_{channel}
\]

where \(\mathbf{F}_{channel}\) is the channel-recalibrated representation. This attention-based residual block enables the model to select the most informative periods and features for predicting future charging load of electric cars.

3.5 Multi-Scale Feature Fusion

Electric car charging load signals are intrinsically composed of patterns with different periods. For instance, the load has a strong intra-day dependence and might also have a weekly cycle, as users tend to drive electric cars differently on weekdays versus weekends. Rather than using a single temporal convolution layer, the proposed model simultaneously applies several attention-based TCN blocks with various kernel sizes and dilation rates to the same input. The outputs are combined as:

\[
\mathrm{Res}_{multi} = \mathrm{Res}_1 + \mathrm{Res}_2 + \mathrm{Res}_3
\]

where \(\mathrm{Res}_1\), \(\mathrm{Res}_2\), and \(\mathrm{Res}_3\) are the outputs of three different attention-based TCN residual blocks. The fused representation \(\mathrm{Res}_{multi}\) is subsequently processed using an attention layer to obtain the dynamically weighted vector \(\mathbf{A}_d\):

\[
\mathbf{A}_d = \mathrm{Dense}\left( \mathrm{Softmax}\left( \mathrm{Permute}(\mathrm{Res}_{multi}) \right) \right)
\]

\[
\mathbf{F}_{fusion} = \mathrm{Res}_{multi} \cdot \mathbf{A}_d
\]

Finally, after a dropout and flatten operation, the feature is mapped to the forecast output through three dense layers.

3.6 Experimental Results and Discussion for Charging Load

The used dataset is based on a public charging records set from the ElaadNL project, in the Netherlands. It contains charging sessions of many electric cars over the first half of 2019. The corresponding meteorological data are retrieved from public weather station records. The charging records are aggregated by each hour, generating a load time series at a granularity suitable for short-term load forecasting of electric cars.

To validate the effectiveness of this framework, several deep learning baseline models are selected, including GRU, LSTM, CNN-AT-LSTM, FCA-TCN, EMD-LSTM, VMD-CNN, VMD-LSTM, and a recently proposed ICEEMDAN-based TCN-attention-BiGRU model. All experiments are conducted under the same training-testing split. The model hyperparameters are given below.

Hyperparameter Value Description
filter size 3 / 5 / 7 Convolution kernel size for three residual blocks
dilatation rate 1 / 2 / 4 Dilation coefficient used in residual blocks
epochs 50 Number of full training passes
optimizer Adam Gradient descent algorithm
loss function MAE Mean absolute error
learning rate 0.001 Step size for parameter updates

Quantitative comparisons between the proposed approach and all baseline models are listed in the following table.

Model MSE / kW² MAE / kW \(R^2\)
GRU 46.28 5.02 0.618
LSTM 43.26 4.89 0.643
CNN-Attention-LSTM 41.15 4.67 0.653
FCA-TCN 47.33 4.97 0.609
EMD-LSTM 25.84 3.80 0.787
VMD-CNN 7.31 2.05 0.937
VMD-LSTM 4.53 1.63 0.960
ITCN-AT-BiGRU 3.43 1.42 0.970
Proposed method 1.47 0.91 0.987

The table shows that the proposed method reduces the MSE substantially compared to all earlier models. For example, when compared with the classical GRU model, MSE falls by more than 96 percent, and \(R^2\) rises from 0.618 to 0.987. Compared with VMD-LSTM and ITCN-AT-BiGRU, the proposed method lowers MAE by 44.17 percent and 35.92 percent respectively, verifying that the introduction of attention-enhanced residual blocks and multi-scale fusion is favorable for extracting deep features from electric car charging load signals.

Ablation studies were designed by removing each meaningful component step by step. The models are abbreviated as:

TCN: the original temporal convolution network.

VT: VMD-based decomposition followed by the original TCN.

VT-IR: with improved residual blocks based on VT.

VT-MSR: with multi-scale residual blocks based on VT.

The full model includes all components. The results of the ablation study are summarized below.

Model MSE / kW² MAE / kW \(R^2\)
TCN 47.55 4.97 0.607
VT 7.59 2.09 0.934
VT-IR 2.39 1.21 0.980
VT-MSR 1.67 1.01 0.985
Proposed complete model 1.47 0.91 0.987

The ablation comparison reveals that VMD preprocessing is responsible for a remarkable decrease in prediction error, whereas the attention-based residual block and the multi-scale parallel architecture each further contribute to improving forecast accuracy. Consequently, the complete model demonstrates the best performance and the highest robustness among all evaluated variants.

4. Charging Demand Forecasting of Electric Cars Based on Spatiotemporal Information

4.1 Overview of the Proposed Architecture

In this section, the focus shifts from aggregate charging load to the charging demand forecasting of electric cars in small traffic zones. The charging demand is represented by the occupancy status of public charging piles; accurate occupancy prediction supports the efficient operation of urban charging networks. Due to the diversity of functional districts and the high mobility of electric cars, the charging demand of one zone may be strongly correlated with that of neighboring zones. For instance, a workplace area may have high charging demand during daytime, while residential areas become dominant during the evening and night.

To solve this problem, a three-module forecasting architecture is proposed: the graph embedding module, the multi-decode module, and the pre-training module. The model takes as input a series of node features, including the historical occupancy rate of charging piles for multiple electric cars, energy prices, node IDs and geographic positions. The topology of the charging network is given by an adjacency matrix \(\mathbf{A}\). The charging stations or traffic zones are represented as graph nodes. The graph embedding module aims to learn node embeddings that simultaneously contain temporal context and spatial dependency; the multi-decode module is then applied to generate future predictions over multiple time horizons; the pre-training module uses customized sampling and meta-learning strategies to improve the model parameter initialization and to avoid overfitting.

4.2 Graph Embedding Module

The graph embedding module starts with a convolution operation on the input tensors. Suppose the temporal input has shape \((b, n, seq, 2)\) for a batch size \(b\), number of nodes \(n\), sequence length \(seq\), and two feature channels, namely occupancy rate and charging price. A 2D convolutional layer extracts short-term patterns from the time series. The output \(\mathbf{O}_C\) is then reshaped and transformed into a feature tensor:

\[
\mathbf{O}_C’ = \mathrm{Reshape}(\mathbf{O}_C)
\]

The reshaped tensor is then fed into the modified GAT. Through multi-head attention, each head independently projects the node features into a new representation. For each head \(m\), the linear projection is:

\[
\mathbf{h}_i^m = \mathbf{W}^m \mathbf{x}_i + \mathbf{b}^m
\]

where \(\mathbf{x}_i\) denotes the node input feature for region \(i\), while \(\mathbf{W}^m\) and \(\\mathbf{b}^m\) are the transformation matrix and bias of the \(m\)-th head. The attention coefficient from region \(i\) to region \(j\) is described as:

\[
e_{ij}^m = \mathrm{LeakyReLU}\left( \mathbf{a}_m^T [ \mathbf{h}_i^m \| \mathbf{h}_j^m ] \right)
\]

Then a softmax normalization step is applied:

\[
\alpha_{ij}^m = \frac{\exp(e_{ij}^m)}{\sum_{k \in N(i)} \exp(e_{ik}^m)}
\]

The aggregated multi-head output is not obtained by simple averaging. Instead, the model uses a learnable linear layer to fuse multiple heads:

\[
\mathbf{h}_i’ = \mathrm{Linear}\left( \alpha_{ij}^0 \mathbf{h}_j^0 \| \alpha_{ij}^1 \mathbf{h}_j^1 \| \cdots \| \alpha_{ij}^{M-1} \mathbf{h}_j^{M-1} \right)
\]

This design lets different attention heads contribute differently to the final representation, increasing the flexibility of the model. A second GAT layer is stacked to capture deeper topological relationships. Finally, the original features and the outputs from the two consequent GAT layers are fused through a weighted residual connection:

\[
\mathbf{F}_1^{fusion} = \zeta \cdot \mathbf{O}_1 + (1-\zeta)\cdot \mathbf{O}_C’
\]

\[
\mathbf{F}_2^{fusion} = \zeta \cdot \mathbf{O}_2 + (1-\zeta)\cdot \mathbf{F}_1^{fusion}
\]

where \(\zeta\) is a predefined hyperparameter controlling the fusion strength.

4.3 Multi-Decode Module

The multi-decode module is developed to map the node embedding sequence \(\mathbf{F}_2^{fusion}\) to the charging demand values of electric cars over the forthcoming time periods. It contains a BiGRU layer and a temporal attention mechanism. Specifically, the BiGRU generates forward hidden states and backward hidden states, which are concatenated at each time step:

\[
H_t = [\overrightarrow{h}_t \| \overleftarrow{h}_t]
\]

After processing the entire sequence, the last hidden state \(\mathbf{h}_{final}\) is retained. In the meantime, the attention scores are produced by feeding the hidden feature to two dense layers and applying a sigmoid activation:

\[
\mathbf{s}_{att} = \sigma\left( \mathbf{W}_2 \tanh(\mathbf{W}_1 H^T) + \mathbf{b}_2 \right)
\]

The context vector combining global and local temporal information is computed as:

\[
\mathbf{C}_{att}^T = \mathbf{s}_{att} \cdot H
\]

\[
\mathbf{H}_{con} = [\mathbf{C}_{att} \| \mathbf{h}_{final}]
\]

After a linear transformation, the final output is obtained as the predicted occupancy ratio of the charging piles in the given traffic region. This allows the model to output useful charging demand signals for electric cars over 15-minute, 30-minute, 45-minute, or 60-minute horizons.

4.4 Pre-Training Module

The pre-training module adopts a meta-learning framework. It first generates tuning samples by randomly perturbing the charging price of certain nodes; this strategy enables the model to simulate different price-demand relationships and prepare electric car charging behavior changes under different tariff environments. A small set of synthetic tasks is used to update the model parameters for a few steps. The loss function for meta-learning is:

\[
\mathcal{L}(\Theta) = \sum_{k=1}^{N} \mathcal{L}_k(\Theta)
\]

where \(\Theta\) denotes the network parameters and \(\mathcal{L}_k(\cdot)\) is the loss of the \(k\)-th subtask. The gradient of the overall loss with respect to the parameters is computed by approximation, such that the model starts from parameters that can quickly adapt to new prediction tasks. In the later micro-training stage, the real dataset is used to fine-tune the parameters. This pre-training procedure improves the model generalization ability and speeds up convergence when data are limited.

4.5 Experimental Validation of Charging Demand Forecasting

The experiment uses an urban charging dataset from a Chinese city that includes charge occupancy from 8640 consecutive 5-min time intervals, 247 traffic zones, and auxiliary information such as charging pile type and node location. Eight baseline models were compared: LSTM, GCN, GAT, STGCN, DCRNN, and AST-GAT. The evaluation was carried out at all four prediction windows: 15 minutes, 30 minutes, 45 minutes, and 60 minutes. The model hyperparameters are recorded in the following table.

Hyperparameter Value Description
batch size 512 Number of samples used per update
pre-training epochs 200 Epochs for meta pre-training
fine-tuning epochs 1000 Training epochs on the real dataset
optimizer Adam Optimization algorithm
weight decay 0.00001 Regularization coefficient
learning rate 0.001 Step size for optimizer

The experimental results for the four prediction horizons are listed in the following tables. The first table reports the results at the 15-minute horizon.

Model RMSE (10⁻²) MAPE (%) RAE (10⁻²) MAE (10⁻²)
LSTM 3.59 8.91 10.66 1.90
GCN 4.20 40.28 35.70 6.35
GAT 3.39 10.24 11.30 2.01
STGCN 3.55 31.41 28.06 4.99
DCRNN 3.72 11.32 12.80 2.28
AST-GAT 3.41 9.93 11.39 2.03
Proposed method 2.92 8.12 9.74 1.36

The next table shows the performance comparison for the 30-minute horizon.

Model RMSE (10⁻²) MAPE (%) RAE (10⁻²) MAE (10⁻²)
LSTM 5.65 14.94 18.14 3.23
GCN 6.64 46.15 41.38 7.36
GAT 5.74 16.74 18.90 3.36
STGCN 5.58 32.58 31.87 5.67
DCRNN 5.40 16.04 18.97 3.37
AST-GAT 5.38 18.00 18.70 3.33
Proposed method 4.39 13.21 16.33 2.27

The 45-minute prediction results are listed below.

Model RMSE (10⁻²) MAPE (%) RAE (10⁻²) MAE (10⁻²)
LSTM 8.54 21.00 26.78 4.76
GCN 8.13 49.35 45.54 8.10
GAT 7.41 23.62 24.54 4.36
STGCN 6.91 43.07 36.81 6.54
DCRNN 6.79 19.94 23.81 4.23
AST-GAT 6.58 17.72 22.30 3.96
Proposed method 5.37 17.65 20.95 2.92

For the 60-minute horizon, the results are listed below.

Model RMSE (10⁻²) MAPE (%) RAE (10⁻²) MAE (10⁻²)
LSTM 9.01 24.15 29.07 6.36
GCN 8.06 52.03 45.69 9.05
GAT 8.89 29.38 29.57 5.35
STGCN 8.74 49.62 40.45 7.34
DCRNN 7.82 24.68 28.94 5.13
AST-GAT 7.54 27.69 28.74 4.62
Proposed method 6.27 22.20 25.42 3.54

The average values across the four horizons are also summarized.

Model RMSE avg (10⁻²) MAPE avg (%) RAE avg (10⁻²) MAE avg (10⁻²)
LSTM 6.70 17.25 21.16 4.06
GCN 6.76 46.95 42.08 7.72
GAT 6.36 20.00 21.08 3.77
STGCN 6.20 39.17 34.30 6.14
DCRNN 5.93 18.00 21.13 3.75
AST-GAT 5.73 18.34 20.28 3.49
Proposed method 4.74 15.30 18.11 2.52

The experimental results demonstrate that the proposed spatiotemporal framework achieves the lowest errors at every prediction horizon. The integration of the graph embedding module and the multi-decode module enables the model to take advantage of the mutual reinforcement between spatial and temporal information. Moreover, the ablation study of the charging demand model confirms the contribution of each component. Specifically, the model without the graph embedding module, the model without the multi-decode module, and the model without the pre-training module all produce larger errors on the 15-minute and 60-minute horizons. The pre-training module significantly stabilizes the training process and improves the model generalization capability for predicting the future charging demand of electric cars across different urban zones.

5. Multi-Objective Charging-Discharging Strategy for Electric Cars

5.1 Problem Formulation

While load forecasting and demand prediction aim at understanding the future state of electric car charging infrastructure, the charging-discharging strategy concentrates on active control. When a large number of electric cars begin charging simultaneously during peak hours, the grid can suffer serious stability challenges. The idea of the proposed strategy is to transfer part of the charging load of electric cars from peak periods to valley periods and to encourage electric car users to discharge during peak periods through V2G mechanisms.

For this purpose, a multi-objective optimization model is established. From the user side, the objective function is designed to minimize the total integrated cost \(F_1\), which consists of the charging cost, battery degradation cost, discharging revenue, and discharging time reward. The formula is given as:

\[
F_1 = \sum_{i=1}^{N_{ev}} \sum_{t=1}^{T} \left( C_{i,t}^{charge} + C_{i,t}^{battery} – C_{i,t}^{discharge} – C_{i}^{wait} \right)
\]

where \(C_{i,t}^{charge}\) represents the charging cost of the \(i\)-th electric car at time step \(t\). It is written as:

\[
C_{i,t}^{charge} = P_{i,t} \cdot \pi_{i,t}^{charge}
\]

where \(P_{i,t}\) represents the charging power of the \(i\)-th electric car at time \(t\), and \(\pi_{i,t}^{charge}\) denotes the charging price at the same interval. Similarly, the discharging income \(C_{i,t}^{discharge}\) is determined by the product of discharging power and discharging price:

\[
C_{i,t}^{discharge} = P_{i,t} \cdot \pi_{i,t}^{discharge}
\]

The battery degradation cost is assumed to be linearly related to the throughput of battery energy during charging and discharging. If \(c\) is the battery degradation rate per unit energy throughput, \(E_i^{cap}\) is the battery capacity of the \(i\)-th electric car, and \(C^{change}\) is the replacement price of the battery, then:

\[
C_{i,t}^{battery} = c \cdot \frac{\left| E_{i,t}^{throughput} \right|}{E_i^{cap}} \cdot C^{change}
\]

To further reward the time spent by electric car users during V2G discharging, the discharging time reward is modeled as:

\[
C_i^{wait} = \pi^{wait} \cdot t_i^{wait}
\]

where \(t_i^{wait}\) denotes the discharging duration of the \(i\)-th electric car and \(\pi^{wait}\) is the unit time compensation price.

From the grid side, the first objective is to minimize the peak-to-valley difference of the total load curve:

\[
F_2 = \min \left[ \max(P_t^{M}) – \min(P_t^{M}) \right]
\]

where \(P_t^{M}\) includes the base load and the net load of electric cars after scheduling:

\[
P_t^{M} = P_t^{base} + \sum_{i=1}^{N_{ev}} P_{i,t}
\]

The second grid-side objective is to flatten the load curve as much as possible, which is measured by minimizing the variance in the total load:

\[
F_3 = \min \sum_{t=1}^{T} \left( P_t^{M} – P_{av} \right)^2
\]

where \(P_{av}\) represents the mean load over the scheduling period. All objectives have different units, therefore normalization is applied before combining them into a single optimization objective:

\[
\min F = \omega_1 \frac{F_1}{F_1^{std}} + \omega_2 \frac{F_2}{F_2^{std}} + \omega_3 \frac{F_3}{F_3^{std}}
\]

where \(\omega_1\), \(\omega_2\), and \(\omega_3\) are weighting coefficients expressing the relative importance of user-side and grid-side objectives; \(F_1^{std}\), \(F_2^{std}\), and \(F_3^{std}\) are the normalization factors. In the simulation, \(\omega_1 = 0.5\), \(\omega_2 = 0.25\), and \(\omega_3 = 0.25\).

5.2 Constraints

The optimization is subject to a set of constraints. First, the total power drawn by all electric cars at time step \(t\) should not exceed the physical capacity of the local charging infrastructure, multiplied by the predicted charging demand of electric cars in that period:

\[
\sum_{i=1}^{N_{ev}} P_{i,t} \leq N_{station} \cdot P_{max}^{char} \cdot Ch_t
\]

where \(N_{station}\) denotes the number of charging piles, \(P_{max}^{char}\) denotes the maximum power of a single pile, and \(Ch_t\) is the hourly charging demand of electric cars obtained from the demand prediction module. This ensures that the charging schedule matches both the grid infrastructure and the actual service demand.

Second, the charging and discharging power of each electric car must be bounded:

\[
0 \leq P_{i,t} \leq W_{i,t} \cdot P_{max}^{char}
\]

\[
P_{max}^{dischar} \cdot W_{i,t} \leq P_{i,t} \leq P_{max}^{char} \cdot W_{i,t}
\]

where \(W_{i,t}=1\) means the \(i\)-th electric car is connected to the grid at time step \(t\), and \(W_{i,t}=0\) otherwise.

Third, the state-of-charge must satisfy its lower and upper limits:

\[
SOC_{min} \leq SOC_{i,t} \leq SOC_{max}
\]

where \(SOC_{min}=0.1\) and \(SOC_{max}=0.9\) in the experiments. The state-of-charge at the next time step is updated as:

\[
SOC_{i,t+1} = SOC_{i,t} + \frac{\eta \cdot P_{i,t} \cdot \Delta t}{E_i^{cap}}
\]

Finally, to ensure the predicted travel demand of each user is fulfilled, the energy at the user expected departure time should be no less than the expected energy:

\[
E_i^{ori} + \sum_{\tau=1}^{t_i^{exp}} \eta \cdot P_{i,\tau} \cdot \Delta t \geq E_i^{exp}
\]

where \(E_i^{ori}\) is the initial energy, \(E_i^{exp}\) is the expected energy when the user departs, and \(t_i^{exp}\) is the available charging duration.

5.3 Solution Based on Mixed-Integer Linear Programming

Because the binary variables \(W_{i,t}\) are present in the formulation, the optimization is essentially a mixed integer programming problem. In the solution procedure, the binary variables are first relaxed to continuous values inside the interval \([0,1]\). The resulting linear program is then solved through the simplex method. The canonical linear program is written as:

\[
\min c^T x
\]

subject to:

\[
Ax \leq b, \quad A_{eq} x = b_{eq}, \quad x_{lb} \leq x \leq x_{ub}
\]

where \(c\) is the coefficient vector of the objective, \(x\) is the vector of decision variables, \(A\) and \(b\) are the inequality constraint matrix and vector, \(A_{eq}\) and \(b_{eq}\) are the equality constraint matrix and vector, while \(x_{lb}\) and \(x_{ub}\) are the lower and upper bounds. In the simplex process, the entering variable \(x_j^*\) is chosen as the one with the most negative reduced cost:

\[
x_j^* = \arg\min_{j: c_j < 0} \, c_j
\]

The leaving variable is decided by the minimum ratio test:

\[
v_i^* = \arg\min_{i: a_{ij}>0} \frac{b_i}{a_{ij}}
\]

After obtaining the relaxed optimum, a branch-and-bound algorithm is applied. For a non-integer variable \(x_j^{rel}\), one branch imposes \(x_j \leq \lfloor x_j^{rel} \rfloor\), and the other imposes \(x_j \geq \lceil x_j^{rel} \rceil\). The subproblems are solved iteratively, and the lower and upper bounds are updated until the optimality gap is acceptable.

5.4 Experimental Analysis of the Charging-Discharging Strategy

The simulation setup is conducted on the Matlab platform. The dispatch horizon is one day, divided into 24 hourly time slots. The time-of-use charging and discharging tariffs are summarized in the table below.

Period Charging price (RMB/kWh) Discharging price (RMB/kWh)
Peak hours 1.20 1.60
Off-peak hours 0.80 0.40
Valley hours 0.34 0.30

The other important simulation parameters are listed below.

Parameter Value Description
SOC_min 0.1 Minimum allowable state of charge
SOC_max 0.9 Maximum allowable state of charge
\(\eta\) 0.95 Charging/discharging efficiency
\(E^{cap}\) 64 kWh Battery capacity of electric cars
\(\omega_1\) 0.5 Weight for user cost
\(\omega_2\) 0.25 Weight for peak-valley difference
\(\omega_3\) 0.25 Weight for load variance

Four charging strategies are evaluated and compared: Strategy 1 is uncoordinated charging in which electric cars are charged at random times without discharging; Strategy 2 is uncoordinated charging/discharging in which electric cars randomly choose to charge or discharge; Strategy 3 applies a tiered price mechanism; and the proposed strategy optimizes both user cost and grid-side metrics under constraints. The load curve profile is described below.

Strategy User cost / RMB Peak-valley difference / kW Load fluctuation / kW²
Strategy 1 (Uncoordinated charging) 207.5 95 20529.33
Strategy 2 (Uncoordinated charging/discharging) 25.7 117 24609.96
Strategy 3 (Time-of-use price scheduling) 42.63 57 6835.64
Proposed strategy 1.57 57 4414.76

The results of the table clearly show that the proposed strategy has the lowest cost among all strategies, significantly reducing the user cost compared to uncoordinated charging and even compared to the conventional pricing strategy. Although the peak-valley difference achieved by the proposed method is similar to that of Strategy 3, the proposed strategy produces the smallest load fluctuation, indicating that the load curve is considerably smoother. This is important for reducing the frequent regulation burden on conventional generators and for enhancing the reliability of the power system when high penetrations of electric cars are present.

The proposed strategy is also more attractive for electric car owners because it provides explicit discharging income and discharging time rewards. The economic incentive means that users are more likely to connect their electric cars to the grid and participate in V2G applications. In addition, the battery degradation cost is carefully accounted for, avoiding excessive battery wear caused by frequent discharging of electric cars. At the same time, the grid-side objectives improve the compatibility between electric car charging and the existing distribution network.

6. Conclusion

This thesis systematically investigated the charging load forecasting, charging demand prediction, and charging-discharging optimization of electric cars. The contributions and conclusions are summarized as follows.

First, a charging load forecasting method combining attention mechanisms and multi-scale feature extraction was proposed. The method uses WOA-based VMD to decompose the original high-complexity load series of electric cars, and a multi-scale network with gating, temporal attention, and channel attention is constructed to improve feature extraction. Experiments show that the method attains better performance than a number of conventional and recent load-forecasting baselines for electric cars, which confirms its capability to identify meaningful hidden patterns from hourly charging load data.

Second, a spatiotemporal charging demand prediction method was established. By using CNN for initial time feature extraction, a modified graph attention network for spatial dependency modeling, and a hybrid BiGRU with temporal attention for prediction, the proposed model fully integrates both the temporal and topological features that influence the charging demand of electric cars. It also introduces a meta-learning pre-training strategy to enhance generalization. Experimental results at four prediction horizons demonstrate that the model outperforms GCN- and GAT-based baselines for charging demand prediction of electric cars, providing a reliable basis for charging infrastructure investment and operation decisions.

Third, a multi-objective charging-discharging scheduling strategy was constructed. It explicitly formulates user-side integrated cost with battery degradation cost, discharging revenue, and discharging time rewards. Grid-side objectives including peak-valley difference and load fluctuation are simultaneously embedded in the optimization, and the mixed integer programming technique is used to solve the scheduling problem. The experimental simulation confirms that the proposed strategy delivers a substantially smaller user-side cost and a smoother load profile than uncontrolled or pricing-only charging-discharging schedules. The strategy also satisfies the charging demand of electric cars and the operational constraints of charging piles, producing satisfactory peak shaving and valley filling effects for the grid.

In the future, additional research directions can be explored. First, the load and demand forecasting models could be evaluated on more diverse data from different cities, regions, seasons, and electric car types to improve their transferability. Second, the charging-discharging strategy can be extended to include renewable energy sources, such as photovoltaic generation and wind power, in the co-optimization framework, allowing electric cars to absorb renewable energy more flexibly. Third, battery aging models based on more accurate nonlinear characteristics can be used instead of a linear degradation assumption. Finally, real-world pilot projects could be designed to test the feasibility of the strategy and to adjust model parameters based on actual charging behaviors of electric cars. These extensions will contribute to establishing a more intelligent and sustainable ecosystem for electric cars and power grids.

Scroll to Top