Next Article in Journal
Design and Optimization of a High-Efficiency Lightweight Permanent Magnet In-Wheel Motor with Torque Performance Improvement
Next Article in Special Issue
Advances in Energy Storage, AI Optimisation, and Cybersecurity for Electric Vehicle Grid Integration
Previous Article in Journal
Evaluation of the Combustion Process of Pellets from Herbaceous Biomass with the Addition of Kaolin and Urea Solution in Low-Power Boilers
Previous Article in Special Issue
Flexible Demand Side Management in Smart Cities: Integrating Diverse User Profiles and Multiple Objectives
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Enhancing Smart Grid Reliability Through Data-Driven Optimisation and Cyber-Resilient EV Integration

1
Department of Engineering, Durham University, Durham DH1 3LE, UK
2
Department of Mathematics, Physics and Electrical Engineering, Northumbria University, Newcastle Upon Tyne NE1 8SA, UK
3
School of Engineering, Newcastle University, Newcastle Upon Tyne NE1 7RU, UK
4
School of Engineering, Istanbul University-Cerrahpaşa, Istanbul 34320, Türkiye
5
Department of Construction, Kırsehir Ahi Evran University, Kırsehir 40100, Türkiye
6
Department of Computer Engineering, Faculty of Engineering, Duzce University, Duzce 81620, Türkiye
7
School of Geography, Earth and Environmental Sciences, University of Birmingham, Birmingham B15 2TT, UK
*
Authors to whom correspondence should be addressed.
Energies 2025, 18(17), 4510; https://doi.org/10.3390/en18174510
Submission received: 31 July 2025 / Revised: 18 August 2025 / Accepted: 23 August 2025 / Published: 25 August 2025

Abstract

This study presents a novel cyber-resilient, data-driven optimisation framework for real-time energy management in electric vehicle (EV)-integrated smart grids. The proposed framework integrates a hybrid optimisation engine—combining genetic algorithms and reinforcement learning—with a real-time analytics module to enable adaptive scheduling under uncertainty. It accounts for dynamic electricity pricing, EV mobility patterns, and grid load fluctuations, dynamically reallocating charging demand in response to evolving grid conditions. Unlike existing GA/RL schedulers, this framework uniquely integrates adaptive optimisation with resilient forecasting under incomplete data and lightweight blockchain-inspired cyber-defence, thereby addressing efficiency, accuracy, and security simultaneously. To ensure secure and trustworthy EV–grid communication, a lightweight blockchain-inspired protocol is incorporated, supported by an intrusion detection system (IDS) for cyber-attack mitigation. Empirical evaluation using European smart grid datasets demonstrates a daily peak demand reduction of 9.6% (from 33 kWh to 29.8 kWh), with a 27% decrease in energy delivered at the original peak hour and a redistribution of demand that increases delivery at 19:00 h by nearly 25%. Station utilisation became more balanced, with weekly peak normalised utilisation falling from 1.0 to 0.7. The forecasting module achieved a mean absolute error (MAE) of 0.25 kWh and a mean absolute percentage error (MAPE) below 20% even with up to 25% missing data. Among tested models, CatBoost outperformed LightGBM and XGBoost with an RMSE of 0.853 kWh and R 2 of 0.416. The IDS achieved 94.1% accuracy, an AUC of 0.97, and detected attacks within 50–300 ms, maintaining over 74% detection accuracy under 50% novel attack scenarios. The optimisation runtime remained below 0.4 s even at five times the nominal dataset scale. Additionally, the study outlines a conceptual extension to support location-based planning of charging infrastructure. This proposes the alignment of infrastructure roll-out with forecasted demand to enhance spatial deployment efficiency. While not implemented in the current framework, this forward-looking integration highlights opportunities for synchronising infrastructure development with dynamic usage patterns. Collectively, the findings confirm that the proposed approach is technically robust, operationally feasible, and adaptable to the evolving demands of intelligent EV–smart grid systems.

1. Introduction

The accelerated deployment of electric vehicles (EVs) has introduced both opportunities and challenges for modern smart grids (SGs). EVs can support sustainable urban mobility and enable demand-side flexibility [1], yet their stochastic charging patterns and spatial clustering risk overload local distribution networks and increase peak demand [2,3]. Such challenges are compounded by dynamic pricing schemes, the proliferation of distributed energy resources, and growing cyber-physical vulnerabilities [4]. For example, during the intense June–July 2025 heatwaves, EU-wide electricity demand surged by around 7.5% year-on-year over just two weeks, with Spain facing spikes of up to 16%, prompting blackouts in cities such as Florence and Bergamo and underscoring the fragility of current infrastructure under climate-driven stress [5].
Recent studies have introduced advanced metaheuristics for microgrid optimisation. For example, the Generalized Normal Distribution Optimizer (GNDO) has been applied to optimise the economic and operational performance of AC microgrids with battery energy storage systems (BESS), demonstrating significant improvements in cost reduction and grid stability [6]. In parallel, the issue of data quality in energy datasets has gained attention, with self-supervised and imputation-aware models emerging as powerful tools for learning robust representations under missing or corrupted data scenarios [7]. Such developments highlight complementary research trends in optimisation and data handling that support resilient and efficient energy management systems.
Ensuring smooth and uninterrupted operation of smart grids is critical, particularly under conditions of fluctuating renewable energy penetration. Recent studies have proposed advanced control frameworks to address this, such as the intelligent Lyapunov-based adaptive fuzzy controller for standalone DC microgrids presented by Hussan et al. [8], which demonstrated stable operation and enhanced reliability under both high and low penetration of renewable energy sources. Such works highlight the growing importance of resilient control strategies in guaranteeing uninterrupted power delivery, which aligns with the objectives of our proposed GA/RL-based optimisation framework.
Conventional EV charging strategies—based on static scheduling or deterministic heuristics—fail to adapt to uncertainties in user behaviour and grid fluctuations, resulting in inefficiencies [9]. Similarly, standard forecasting models assume high-quality and complete data; however, real-world datasets are often incomplete or noisy, which limits prediction accuracy [10]. Moreover, the bi-directional communication required in EV–grid interactions enlarges the attack surface, making them susceptible to cyber-attacks that threaten system integrity and stability [11].
To overcome these limitations, this study proposes a novel cyber-resilient, data-driven optimisation framework. The framework integrates hybrid optimisation—combining genetic algorithms (GA) and reinforcement learning (RL)—with robust real-time forecasting and a lightweight blockchain-inspired security mechanism coupled with an intrusion detection system (IDS). This approach aims to achieve secure, scalable, and adaptive energy management in EV-integrated SGs.

1.1. Research Gaps and Questions

Although the integration of EVs into SGs is advancing rapidly, existing energy management approaches still exhibit notable limitations. First, most current methods rely on static scheduling or deterministic optimisation, which cannot adequately address the uncertainties inherent in EV mobility patterns and grid conditions. Second, the forecasting models employed often fail to maintain acceptable accuracy when confronted with incomplete or noisy data, which is a common challenge in real-world systems. Third, there has been insufficient emphasis on ensuring the cybersecurity and trustworthiness of decentralised EV–grid communications, particularly using lightweight solutions suitable for real-time operation.
These shortcomings motivate the following research questions:
  • How can peak demand and station utilisation be optimised dynamically under uncertain and variable conditions without compromising service quality?
  • What forecasting techniques can deliver accurate short-term EV demand predictions even in the presence of incomplete or degraded data?
  • How can secure and resilient EV–grid communication be achieved in a decentralised and resource-constrained environment?

1.2. Aim of the Study

The aim of this study is to design, implement, and evaluate a novel, cyber-resilient, data-driven optimisation framework for real-time energy management in EV-integrated SGs. The framework is intended to optimise load distribution dynamically, improve the accuracy and robustness of demand forecasting, and ensure the integrity and security of decentralised EV–grid interactions, even under challenging operational conditions.

1.3. Contributions of the Study

This work makes the following key contributions:
  • A hybrid optimisation algorithm that integrates GAs and RL to achieve adaptive and real-time scheduling of EV charging demand under uncertainty.
  • A real-time analytics engine for high-resolution demand forecasting using large-scale, heterogeneous datasets, which achieves a mean absolute error (MAE) of 0.25 kWh and maintains acceptable performance with up to 25% missing data.
  • A lightweight blockchain-inspired security protocol integrated with an IDS, achieving an accuracy above 94%, an area under the curve (AUC) of 0.97, and detection latencies under 300 ms.
  • Comprehensive empirical evaluation using European SG datasets, demonstrating significant peak demand reduction (9.6%), more balanced station utilisation over time and space, and resilience against novel cyber-attack scenarios.
  • Sensitivity and scalability analyses confirming sub-second optimisation runtimes even at five times the baseline dataset size, and robust performance under high EV penetration levels and increasing proportions of novel attack types.
The remainder of this paper is organised as follows. Section 2 reviews the state-of-the-art literature on optimisation, forecasting, and cybersecurity in EV-integrated SGs, highlighting existing challenges and gaps. Section 3 presents the proposed cyber-resilient, data-driven optimisation framework, detailing its hybrid optimisation algorithm, real-time forecasting module, and lightweight blockchain-inspired security mechanism. Section 4 describes the datasets, experimental setup, and evaluation metrics employed in this study. Also, it reports the experimental results and provides a comprehensive discussion, including quantitative analyses of optimisation performance, forecasting accuracy, and cybersecurity effectiveness. Section 5 concludes the paper by summarising the key findings, contributions, and possible directions for future research.

2. Literature Review

Several strands of research underpin the present work, spanning optimisation techniques, demand forecasting models, and cybersecurity mechanisms in EV-integrated SGs.
On the optimisation front, centralised approaches, particularly those based on mixed-integer linear programming (MILP) and rule-based heuristics, have been widely applied to coordinate EV charging schedules [12,13]. These methods typically aim to minimise peak demand, electricity costs, or power losses by solving an optimisation problem under operational constraints. While they are mathematically rigorous and produce globally optimal solutions under idealised assumptions, their computational complexity grows rapidly with problem size and uncertainty, making them unsuitable for large-scale or real-time deployment [14]. To improve scalability and flexibility, decentralised strategies have been proposed, often based on distributed optimisation or game-theoretic models [15], which allow individual EVs or aggregators to make decisions with limited coordination. However, these approaches still struggle to cope with high-dimensional uncertainty and often settle at suboptimal Nash equilibria.
To overcome these limitations, metaheuristic optimisation methods have been introduced, including GAs [16], particle swarm optimisation (PSO) [17], and ant colony optimisation (ACO) [18]. These algorithms excel at exploring complex, non-convex search spaces and can find satisfactory solutions within reasonable time frames, even in the presence of non-linearities and discrete decision variables. Nevertheless, traditional metaheuristics remain static: their parameters and search strategies are often fixed, which limits their ability to adapt dynamically to evolving grid and user conditions. More recently, RL has emerged as a powerful tool for adaptive, data-driven optimisation in uncertain and dynamic environments [19,20]. RL-based agents can learn optimal policies through interactions with the environment and adjust in real-time. Despite these advantages, RL methods can suffer from slow convergence, instability during training, and susceptibility to local minima, particularly in high-dimensional state spaces. These limitations have motivated hybrid techniques that combine the global search capabilities of GAs with the adaptive learning of RL, achieving both exploration and exploitation effectively [21].
In the domain of demand forecasting, accurately predicting EV-induced loads is critical for proactive grid management and optimisation. Classical time-series models such as ARIMA and exponential smoothing have been applied but are limited in their ability to capture non-linear and high-dimensional relationships [22]. Machine learning (ML) approaches, including support vector regression (SVR) [23], random forests [24], and gradient boosting methods [25], have demonstrated superior predictive accuracy by leveraging complex patterns in historical data. Deep learning architectures, such as recurrent neural networks (RNNs) and attention-based transformers, have further improved forecasting accuracy by capturing long-term dependencies and temporal dynamics [26,27]. However, these data-driven models generally assume complete and clean datasets; their performance degrades considerably in the presence of missing, noisy, or corrupted data [28,29]. Few studies explicitly address the resilience of forecasting models under such adverse conditions.
Cybersecurity in EV-integrated SGs is increasingly recognised as a critical challenge. Blockchain-based approaches have gained prominence for providing tamper-proof, decentralised trust in EV–grid transactions [30,31]. These techniques enhance transparency and integrity by maintaining immutable ledgers, but their high computational and communication overhead limits their applicability in real-time, resource-constrained environments. To address this, lightweight blockchain variants have been proposed that reduce block sizes, simplify consensus mechanisms, and optimise verification processes to improve latency and efficiency [32,33]. Concurrently, IDSs have been developed to detect cyber-attacks on SG communications. These IDSs traditionally rely on statistical anomaly detection, rule-based systems, or ML classifiers to identify malicious behaviour [34,35]. However, ongoing research is increasingly shifting towards graph-based and federated learning paradigms, where distributed nodes collaboratively train models without exposing sensitive data. Such approaches leverage the structural dependencies of smart grid communication networks and provide improved scalability, privacy preservation, and detection accuracy, thereby reflecting the next generation of cyber-defence mechanisms in EV–grid ecosystems [36,37]. Despite their effectiveness in detecting known attack patterns, many IDSs struggle to generalise to previously unseen (zero-day) attacks and often operate in isolation from other grid management modules. Moreover, there is a lack of integrated approaches that combine security mechanisms with optimisation and forecasting to provide holistic resilience.
Recent advances in data-driven optimisation have also introduced decentralised techniques that complement centralised scheduling strategies. For instance, long short-term memory (LSTM)-based recurrent neural networks (RNNs) have been applied to short-term load forecasting in smart grids, capturing nonlinear temporal dependencies and improving forecasting accuracy under highly dynamic demand conditions [38,39]. Similarly, decentralised stochastic recursive gradient methods have been proposed for distributed energy optimisation, where local nodes iteratively update their strategies using limited communication, thereby reducing centralised bottlenecks and improving scalability [40,41,42]. These methods highlight a growing emphasis on decentralised, data-driven optimisation that enables resilient and scalable EV–grid integration. In this context, our proposed hybrid GA/RL framework differs by jointly optimising grid-level objectives and user satisfaction while ensuring real-time adaptability under cyber-resilient constraints.
In summary, while substantial progress has been made across these areas, existing methods tend to focus narrowly on single objectives—either optimisation, forecasting, or security—without adequately addressing the interplay among them. This study advances the state of the art by unifying a hybrid GA–RL optimisation algorithm, a resilient forecasting engine tolerant to incomplete data, and a lightweight blockchain-inspired IDS into a single, coherent framework. This integrated approach addresses efficiency, accuracy, and security simultaneously in EV-integrated SGs, responding to the key limitations identified in the literature [43].

3. Methodology

In our framework, the GA generates diverse candidate schedules through population evolution, while the RL agent refines and re-ranks the top offspring after each generation using policy-gradient updates. The refined solutions are then reintroduced into the GA population, ensuring GA maintains global exploration while RL provides targeted exploitation.
This section outlines the proposed cyber-resilient, data-driven optimisation framework for real-time energy management in EV-integrated SGs. The methodology comprises three main components: (i) hybrid optimisation of charging demand, (ii) real-time forecasting of load demand, and (iii) a lightweight blockchain-inspired security mechanism with an integrated IDS. The overall objective is to minimise peak demand while ensuring forecast accuracy and preserving the integrity and security of EV–grid communications.
Figure 1 illustrates the overall system architecture of the EV-integrated SG considered in this study. The architecture comprises several key components: smart chargers and charging stations, the cloud-based energy management system (EMS), the communication network, and the utility grid.
The smart chargers and charging stations serve as the physical interface between EVs and the power grid, facilitating bi-directional energy exchange and enabling local control of charging sessions. These stations are connected to the cloud EMS through a communication network, which coordinates scheduling, forecasting, and optimisation tasks in real time. The cloud EMS interacts with the utility grid to ensure system-level load balancing and stability. As indicated in Figure 1, the communication network is exposed to multiple potential cyber-attacks, shown by the arrows labelled “attacks” targeting various parts of the system. These attacks can compromise the integrity, confidentiality, and availability of data exchanged between the stations, cloud EMS, and utility grid, underscoring the need for robust cybersecurity mechanisms. The figure thus motivates the integration of hybrid optimisation, resilient forecasting, and lightweight blockchain-inspired security protocols into the system to defend against these vulnerabilities and maintain reliable operation.

3.1. Datasets

This study employs two publicly available datasets to evaluate the proposed cyber-resilient, data-driven optimisation framework. Together, these datasets provide complementary information on EV charging behaviour and cybersecurity events in EV charging stations.
The first dataset, titled “Replication Data for: A Field Experiment on Workplace Norms and EV Charging Etiquette”, was published by Asensio et al. [44] in the Harvard Dataverse repository. This dataset contains detailed records of 3395 high-resolution EV charging sessions conducted by 85 drivers at 105 stations across 25 workplace sites in the United States. The data, collected as part of the U.S. Department of Energy’s Workplace Charging Challenge, includes timestamped session-level information at a one-second resolution. The workplace facilities in the dataset span research centres, manufacturing sites, testing facilities, and office headquarters. The dataset is provided in a human- and machine-readable CSV format and is directly importable into standard data analysis software. Although this dataset originates from U.S. trials, its temporal charging behaviours—particularly clustering around morning arrivals and evening departures—are consistent with European commuting patterns. Moreover, to ensure external validity, we supplemented our analysis with European grid load traces (ENTSO-E, 2023) [45], which confirm similar midday and early-evening demand peaks. This combination allows the dataset to capture both fine-grained charging dynamics and realistic European grid-level demand conditions.
The second dataset, titled “Power Consumption: EVSE-B under Attack and Benign Conditions”, was released by the Canadian Institute for Cybersecurity (CIC) to support research on enhancing the security of EV charging stations [46]. This dataset contains power consumption measurements of an EVSE-B unit operating under both benign and simulated attack scenarios. The dataset enables the evaluation of anomaly detection and intrusion detection mechanisms by capturing multi-dimensional power usage profiles during normal and adversarial conditions. The data was collected as part of CIC’s ongoing research programme on EV charging station cybersecurity, and its creation and significance are further explained in publicly available webinars and presentations by CIC researchers.
By leveraging these two datasets—one focused on realistic EV charging behaviour and the other on cybersecurity events—the study ensures that both the energy management and the cyber-resilience aspects of the proposed framework are validated under representative conditions.
Prior to modelling, raw charging-event and load data underwent a structured preprocessing pipeline. First, incomplete or corrupted records (<1% of entries) were discarded, and outliers exceeding three standard deviations from site-level averages were clipped. Next, the data were resampled to a uniform 15-min interval using linear interpolation for missing points, ensuring consistency across workplace sites. Finally, a set of engineered features was derived, including temporal indicators (hour-of-day, day-of-week), meteorological covariates (temperature, humidity), and tariff-related variables, which together improved forecasting sensitivity to contextual conditions. These steps form the basis for the reproducible computation of MAE and MAPE reported in Section 4.

3.2. Hybrid Optimisation of Charging Demand

The hybrid optimisation module combines a GA with RL to schedule EV charging dynamically. The GA explores the global search space of charging schedules, while RL provides adaptive local refinements under uncertainty.
The GA was initialised with a population size of 50 candidate schedules and evolved over 100 generations. A single-point crossover operator was applied with a probability of 0.8, while mutation was used with a rate of 0.05 to encourage solution diversity. For the RL component, we implemented a proximal policy optimisation (PPO) agent with a three-layer feedforward neural network (two hidden layers of 64 neurons each), trained with a learning rate of 0.001. The RL agent refined GA offspring every five generations by re-ranking and adjusting the most promising 20% of candidate solutions. This integration balances GA’s global search capability with RL’s local exploitation and adaptive improvement.
The optimisation objective is formulated as a weighted multi-objective function that balances peak-load minimisation, grid stability, and user satisfaction:
min x L ( x ) = α P max + β V grid + γ 1 U ( t ) ,
where P max is the maximum aggregate load, V grid is a penalty term reflecting voltage deviation and grid stability, and U ( t ) is the user satisfaction score at time t. The coefficients α , β , and γ are weighting parameters that allow flexible prioritisation of different objectives. In our experiments, we adopted α = 0.5 , β = 0.2 , and γ = 0.3 , determined through empirical sensitivity analysis (see Section 4.3).
Formally, the GA generates a set of offspring solutions { x G A } via crossover and mutation. Each offspring is subsequently refined by the RL agent through a local adjustment operator R , such that x = R ( x G A ) . Here, R represents one or more RL update episodes, where actions are selected according to the policy π ( a | s ) optimised under the reward function balancing grid stability and user satisfaction. Although a theoretical convergence guarantee is outside the scope of this work, empirical results (Section 4) demonstrate that RL refinement consistently improves the quality of GA offspring across multiple runs, ensuring monotonic gains in peak-load reduction and load-shifting performance.
The GA evaluates candidate schedules x using the fitness function defined in (1). New schedules are generated through selection, crossover, and mutation operators:
x ( k + 1 ) = mutate crossover select ( x ( k ) ) ,
where k denotes the generation index.
To enhance adaptivity, an RL agent adjusts x ( k + 1 ) by learning a policy π ( x | s ) , which maximises a cumulative reward R given by:
R = t γ t P max ( t ) + λ U ( t ) ,
where U ( t ) denotes user satisfaction at time t, λ is a weighting factor, and γ is the discount rate.
The choice of the user-satisfaction weight λ = 0.3 was based on a sensitivity analysis in which λ was varied between 0.1 and 0.5 in increments of 0.1. Results indicated that λ = 0.3 yielded the best trade-off: peak-load reduction remained above 9% while user dissatisfaction penalties stayed below 5%. Smaller λ values overly favoured user preferences at the expense of grid stability, while larger values led to significant user inconvenience. Hence, λ = 0.3 was selected as the optimal balance.
The user-satisfaction metric U ( t ) is defined as follows:
U ( t ) = min E delivered ( t ) E requested ( t ) , 1.0
where E delivered ( t ) is the cumulative energy supplied to a vehicle by time t, and E requested ( t ) is the total energy demand at plug-in. This ratio is normalised to a maximum of 1.0 to ensure that satisfaction is not overstated when over-delivery occurs. The weight α determines the relative importance of user satisfaction versus grid objectives in the optimisation, while the temporal discount factor γ accounts for the diminishing marginal utility of energy delivered later in the session. Empirical tuning through grid-vehicle simulation experiments determined α = 0.6 and γ = 0.85 , which achieved a balance between peak-load reduction and maintaining a minimum 90% satisfaction rate across all sessions.
By combining (2) and (3), an adaptive schedule update rule can be derived:
x ( k + 1 ) = π mutate ( crossover ( select ( x ( k ) ) ) ) | s ,
where x ( k + 1 ) is guided both by evolutionary operators and by the RL policy, as formulated in (2) and (3).

3.3. Real-Time Demand Forecasting

To support proactive optimisation, the framework includes a forecasting module trained on historical and real-time data. The goal is to predict the total load demand P ^ ( t + Δ ) at future time t + Δ , based on the input feature vector f ( t ) :
P ^ ( t + Δ ) = F ( f ( t ) ; θ ) ,
where F represents the forecasting model, parameterised by θ .
The model minimises the mean squared error (MSE) between predictions and actual demand:
MSE = 1 T t = 1 T P ( t ) P ^ ( t ) 2 ,
where T is the number of time points.
Incorporating the hybrid schedule x from (5) into (6) enables forecasting of optimised future demand profiles:
P ^ opt ( t + Δ ) = F f ( t ) , x ; θ .
In addition to handling up to 25% missing values, the model also accounts for corrupted or noisy data points. Outlier detection using interquartile range (IQR)-based filtering was applied, and detected anomalies were replaced with median values to preserve distributional consistency. Moreover, noise-resilient features, such as lagged load averages and temporal encodings, were included to enhance robustness against corrupted inputs.
Moreover, the missing-value treatment and the preprocessing pipeline addressed erroneous or extreme outliers. Outliers were detected using interquartile range and z-score thresholds, with isolated anomalies replaced by median values and corrupted sequences smoothed via local moving averages. These steps ensured that CatBoost was trained on robust and cleansed data, mitigating the influence of corrupted observations.

3.4. Lightweight Blockchain-Inspired Security and IDS

To protect EV–grid communications, a lightweight blockchain-inspired protocol ensures data integrity and trust. Each transaction block B j contains a cryptographic hash H j computed as follows:
H j = hash ( B j 1 T j ) ,
where T j represents the transaction data and ‖ denotes concatenation.
An IDS monitors the system for anomalies by classifying feature vectors z ( t ) as either benign or attack:
y ( t ) = 0 , if benign 1 , if attack = C z ( t ) ; ϕ ,
where C is the classifier with parameters ϕ .
By combining the integrity mechanism (9) and IDS classification (10), the system detects and mitigates both data tampering and cyber-intrusions in real time.
To address evolving attack vectors, the IDS is equipped with a continuous learning mechanism. Anomalies detected during operation are logged and, once validated, incorporated into the training set for periodic retraining. Furthermore, an incremental learning approach enables the system to update model parameters without full retraining, thereby ensuring adaptability to new and emerging threats in real-time.

3.5. Overall Framework

To ensure stability in the hybrid process, the transition from GA to RL is managed by passing only the top-ranked GA offspring as initial states to the RL agent. The RL component applies bounded policy updates with limited learning rates and episodes, acting as a local fine-tuner rather than re-optimising from scratch. Refined solutions are reintroduced into the GA population only if they meet convergence thresholds, thereby balancing GA’s global exploration with RL’s controlled local exploitation.
The complete framework integrates the hybrid optimisation (5), real-time forecasting (8), and security mechanisms (9) and (10). The resulting operational load profile P * ( t ) is therefore defined as follows:
P * ( t ) = P ^ opt ( t ) , if H j valid and y ( t ) = 0 , halt , if integrity violation or attack detected .
Equation (11) is derived by combining (8)–(10), encapsulating the joint contribution of all three modules: optimal scheduling, forecasting, and security. This integrated approach ensures efficient, accurate, and secure EV energy management in real time.
Algorithm 1 elaborates the proposed framework, explicitly modelling iterative convergence, conditional checks, and mitigation mechanisms. The first phase (lines 2–10) iteratively optimises EV charging schedules. The hybrid optimisation proceeds while the convergence criterion is not met (not converged) and the generation count k remains below the maximum K max . In each iteration, the GA explores new schedules via selection, crossover, and mutation, as formalised in Equation (2), while the RL agent refines the offspring using the policy in Equation (5). If the fitness improvement falls below a small threshold ϵ , the algorithm sets the convergence flag to true and exits the loop.
Energies 18 04510 i001
In the second phase (lines 12–24), the system operates in real time at each time step t. The forecasted optimal demand P ^ opt ( t + Δ ) is predicted according to Equation (8). Blockchain-inspired integrity checks are conducted by computing the hash H j for each transaction block, and the IDS simultaneously classifies the communication features z ( t ) as benign or attack based on Equation (10). If either the integrity check fails ( H j invalid) or the IDS detects an attack ( y ( t ) = 1 ), a mitigation protocol is triggered: the system halts charging, isolates compromised nodes, and raises an alarm. If the attack persists for longer than τ seconds, the system rolls back the ledger to its last secure state and reinitialises the IDS. Otherwise, if no threat is detected, the system commits the optimised load profile P * ( t ) as defined in Equation (11). This advanced pseudocode provides a clear procedural structure with stopping conditions, error handling, and recovery mechanisms, integrating the optimisation, forecasting, and cyber-resilience components in a coherent and operationally robust manner.

4. Results and Discussion

Table 1 summarises the key parameters employed in the analysis of the proposed framework. The number of EVs N was set to 500, with a daily time horizon of T = 24 h. For the hybrid optimisation module, the GA was run for a maximum of K max = 100 generations with a convergence threshold of ϵ = 10 3 . The RL agent used a discount factor γ of 0.95 and a user satisfaction weight λ of 0.3 to balance grid and user objectives. The mitigation protocol was configured to trigger if an attack persisted beyond τ = 60 s. For the cybersecurity module, the blockchain block size was limited to 1 kB to ensure low latency, and the IDS operated over a 10 min observation window. The forecasting module predicted load demand 30 min ahead ( Δ ), providing sufficient foresight for scheduling decisions. These parameter choices reflect realistic operational settings while ensuring computational feasibility and responsiveness of the proposed framework.
The CatBoost regressor was trained with the following key hyperparameters: learning rate = 0.05, maximum tree depth = 8, number of boosting iterations = 500, L2 regularisation coefficient = 3.0, and early stopping after 50 rounds without improvement. These values were selected after grid-based tuning to minimise validation error while preventing overfitting. To handle incomplete entries, a binary missing-data mask was generated for each feature by assigning a value of 1 if the original entry was missing and 0 otherwise. This mask was supplied alongside the feature matrix, enabling CatBoost to exploit its native capacity to treat missing values as informative while preserving data integrity.
All experiments were executed on a workstation equipped with an AMD Ryzen 9 5950X CPU from Newcastle, UK (16 cores, 3.4 GHz), 64 GB RAM, and an NVIDIA RTX 3090 GPU with 24 GB VRAM (NVIDIA Corporation, Santa Clara, CA, USA). Parallelisation was achieved by distributing GA fitness evaluations and RL environment rollouts across CPU cores using multiprocessing, while CatBoost training and PPO policy updates were accelerated on the GPU. This hybrid strategy ensured that optimisation of 5× scaled datasets could be completed in under 0.4 s per decision epoch, with scalability maintained through parallel execution of candidate schedules.

4.1. Convergence and Stability

Let f ( x ) denote the optimisation objective (lower is better) and let b ( g ) be the best schedule in generation g. The GA employs elitist selection and bounded mutation, and the RL module refines only the top-k GA offspring using clipped policy updates with an accept-if-better rule; that is, a refined schedule x ˜ replaces x only if f ( x ˜ ) f ( x ) . It follows that
f b ( g + 1 ) min f b ( g ) , min x Top - k f R ( x ) ,
so { f ( b ( g ) ) } g 0 is a monotonically non-increasing sequence bounded below by inf x f ( x ) , hence it converges. When the feasible schedule space is finite, elitism implies that { b ( g ) } reaches a fixed point x in finite iterations such that no GA offspring combined with a single RL refinement can further decrease f; i.e., x is a local optimum with respect to the combined neighbourhood induced by crossover/mutation and the RL step. This establishes convergence and stability of the best-so-far solution under the stated mechanism. Global optimality is not guaranteed in general; to mitigate suboptimal trapping, we employ (i) diversity maintenance via bounded mutation, (ii) optional annealing of mutation rates, and (iii) a patience-based stopping rule (terminate when improvement < ε for W consecutive generations or upon reaching K max ). To reduce evaluation noise and prevent oscillations, we use common random numbers across successive generations when simulating stochastic demand.

4.2. Peak Demand Reduction

The effectiveness of the proposed hybrid optimisation framework in mitigating peak demand is clearly demonstrated by the experimental results. Figure 2 illustrates the daily load profiles of the EV charging demand before and after optimisation. Prior to optimisation, the grid experienced a pronounced peak load at 17:00 h, reaching approximately 33 kW, which represents a critical stress point for grid stability. Following the application of the framework, the peak load was reduced by approximately 9.6%, with the new maximum observed at 19:00 h at around 29.8 kWh. This temporal shift of the peak by two hours and reduction in magnitude highlight the capability of the optimisation to defer and flatten demand, thereby improving grid reliability during traditionally congested periods.
A closer inspection of the hourly charging activity, as presented in Figure 3, provides further insights. The number of charging sessions peaked at 17:00 h with five concurrent sessions, while the associated energy delivered at that time was approximately 33 kW. Post-optimisation, although the number of sessions during the peak remained at five, the energy consumed at 17:00 h reduced markedly to approximately 24 kWh, representing a reduction of about 27% at that hour. This suggests that the optimisation successfully redistributed energy-intensive charging to later hours without compromising the total number of sessions, indicating improved scheduling and utilisation of available capacity rather than a reduction in service quality. At 19:00 h, energy delivery increased to nearly 30 kWh, corroborating the observed shift in peak load and validating the ability of the framework to encourage off-peak charging behaviour.
In addition to the temporal redistribution of demand within a single day, Figure 4 presents a weekly heatmap of station utilisation to evaluate the spatial and temporal impact of the framework across the week. Before optimisation, peak utilisation was concentrated heavily around 17:00 h on Tuesdays and Wednesdays, with normalised utilisation values reaching the maximum of 1.0, indicating full station capacity at those times. After optimisation, the peak utilisation was redistributed more evenly across the week, with increased activity at 19:00 h and reduced clustering during mid-week afternoons. Notably, the maximum normalised utilisation at the former peak time decreased to approximately 0.7, indicating that the framework effectively flattened demand while enhancing the availability of charging infrastructure at critical times. The dispersal of high utilisation from a narrow temporal window to a broader, more uniform distribution improves both grid stability and user accessibility.
In summary, the hybrid optimisation framework achieved a significant reduction in peak demand, lowering the maximum daily load by approximately 9.6% and shifting the peak from 17:00 h to 19:00 h. Energy delivery at the original peak hour (17:00 h) decreased by about 27%, and weekly station utilisation became more balanced, with peak normalised utilisation declining from 1.0 to around 0.7. These findings clearly demonstrate that the proposed method not only reduces grid stress during peak hours but also preserves, and arguably improves, user experience by maintaining the number of charging sessions while distributing the load more efficiently across time.

4.3. Energy Demand Forecasting Performance

The proposed demand forecasting model, which integrates a novel hybrid ensemble approach, demonstrated promising predictive accuracy and robustness. Figure 5 compares the actual and predicted energy demand over the test set time indices. Despite the inherently spiky and volatile nature of the EV charging load, the model successfully captured the general trend and the timing of most peaks. The highest observed peak in the test set was approximately 8.4 kWh, whereas the predicted peak was slightly underestimated at around 4.5 kWh. Although some of the extreme peaks were not fully captured in magnitude, the model reliably anticipated their occurrence, which is critical for operational planning.
Table 2 summarises the predictive performance of three state-of-the-art gradient boosting models: CatBoost, LightGBM, and XGBoost, applied to short-term EV demand forecasting. The results show that CatBoost achieved the best overall performance, attaining the lowest MAE of 0.251 kWh and the lowest root mean square error (RMSE) of 0.853 kWh. Its coefficient of determination ( R 2 ) was 0.416, indicating a moderate degree of variance explained by the model. LightGBM produced higher errors, with an MAE of 0.328 kWh and an RMSE of 0.988 kWh, and a lower R 2 of 0.216. Notably, XGBoost performed worst in terms of R 2 , which was slightly negative at −0.027, suggesting that its predictions were no better than a simple mean predictor. Although XGBoost achieved a slightly lower MAE (0.243 kWh) than CatBoost, its much higher RMSE (1.130 kWh) and poor R 2 indicate a tendency to underestimate extreme peaks and fail to capture variability in the data. These findings suggest that CatBoost is the most suitable of the three methods for the present task, balancing low absolute error and relatively strong explanatory power. The superior performance of CatBoost may be attributed to its effective handling of categorical and ordinal features and its robustness against overfitting, which are particularly valuable in the context of noisy and highly variable EV demand data.
The overall error distribution, presented in Figure 6, provides further insight into the model’s performance. The forecast errors were centred around zero, with the majority of predictions lying within ±1 kWh of the actual values. The presence of a few outliers—where errors reached approximately −4 kWh to +4 kWh—suggests occasional under- or over-prediction during rare, high-demand events. Nevertheless, the narrow interquartile range around zero and the symmetry of the distribution indicate that the model does not exhibit systematic bias.
Figure 7 illustrates the relative importance of different input features in the forecasting model. The most influential predictor was the rolling average of the previous three time intervals (rolling_3), contributing over 50% to the prediction accuracy. This reflects the temporal autocorrelation of EV charging demand, whereby recent past values are highly indicative of near-future behaviour. Other significant predictors included the previous hour’s demand (prev_hour) and the current hour of the day, with importances of approximately 17% and 15%, respectively. Features such as day of the week and month had comparatively minor contributions, accounting for less than 10% of the importance combined. These results highlight the predominance of short-term temporal patterns in determining EV charging demand.
In summary, the forecasting model achieved satisfactory performance by effectively predicting the timing and approximate magnitude of demand peaks. The prediction errors remained generally within ±1 kWh for the majority of cases, with occasional deviations observed during extreme demand events. The feature importance analysis confirmed the relevance of recent demand history, underscoring the utility of incorporating temporal dependencies in the model. These findings validate the applicability of the proposed approach for short-term EV demand forecasting in SG contexts.

4.4. Cybersecurity and Intrusion Detection Performance

The performance of the proposed lightweight blockchain-inspired protocol, integrated with a random forest-based IDS, was evaluated through multiple metrics.
Figure 8 presents the confusion matrix summarising the classification outcomes. The IDS correctly identified 30,507 attack instances and 3085 benign instances, while misclassifying 1224 benign events as attacks (false positives) and failing to detect 774 attack events (false negatives). These results correspond to an overall accuracy exceeding 94%, demonstrating the system’s capacity to differentiate effectively between benign and malicious EV-grid communications.
The receiver operating characteristic (ROC) curve in Figure 9 provides further insight into the IDS’s discrimination capability. The AUC was measured at 0.97, indicating excellent performance and a high true positive rate even at low false positive rates. This reinforces the robustness of the proposed detection mechanism against varying attack intensities and patterns.
Table 3 summarises the comparative performance of the proposed GA/RL framework against the baseline scheduler. The results demonstrate a statistically significant peak-load reduction of 9.6% with a narrow 95% confidence interval (8.7–10.4%), indicating the robustness of the improvement. Similarly, the framework achieved a 27.0% load shift towards off-peak periods, with the confidence interval (25.5–28.4%) confirming consistency across resamples. In both cases, the paired t-tests yielded p < 0.01 , providing strong evidence that the observed differences are not due to random variation but reflect a genuine advantage of the hybrid optimisation approach.
Detection latency, a critical factor for real-time operation, was examined in Figure 10. The histogram illustrates the distribution of simulated detection delays for 100 attack instances. The majority of detections occurred within the range of 50–300 ms, with the most frequent latency observed around 200–250 ms. Such prompt detection is well within the operational thresholds of modern SG communication networks, ensuring timely mitigation of threats without perceptible delays to legitimate operations.
Finally, Figure 11 shows the power trace of the EV charging station during a period including both benign and attack activities. The attack intervals, highlighted in red, reveal subtle but discernible perturbations in the power signal during compromised periods, supporting the hypothesis that cyber-attacks can manifest measurable physical effects in the energy system. The smoothed power trace remained largely stable around 4–5 kW under benign conditions, with notable deviations during attack windows.
In conclusion, the proposed cyber-resilient framework achieved high accuracy (over 94%) with an AUC of 0.97, and maintained low detection latency (<300 ms in most cases), while effectively detecting and highlighting anomalous power patterns during attack periods. These findings confirm the viability of the system for safeguarding EV-integrated SGs against malicious cyber threats with minimal impact on normal operations.

4.5. Sensitivity Analysis and Scalability Evaluation

Figure 12 collectively examines the scalability, resilience, and robustness of the proposed cyber-resilient, data-driven optimisation framework under varying operational conditions. Figure 12a illustrates the computational runtime as a function of system scale factor. Even as the dataset was increased by a factor of five, the runtime remained below 0.4 s, with an average of approximately 0.25 s at baseline scale. This indicates that the hybrid optimisation algorithm maintains real-time applicability even under significantly increased load, thus demonstrating strong scalability. Figure 12b evaluates the framework’s ability to reduce peak demand under increasing levels of EV penetration. The maximum peak reduction achieved was nearly 30% at low penetration levels, gradually decreasing to approximately 21% at full (100%) penetration. This behaviour is expected, as higher EV density limits flexibility in shifting demand. Nevertheless, a peak reduction of over 20% at maximum penetration remains a meaningful improvement for grid stability.
Figure 12c examines the impact of missing data on forecasting accuracy. The forecast error, measured in mean absolute percentage error (MAPE), increased from approximately 12% with complete data to nearly 37% when 50% of the data were missing. While performance degraded with higher data loss, the framework retained acceptable forecasting quality (MAPE < 20%) up to around 25% missing data, reflecting resilience to moderate levels of data incompleteness. Finally, Figure 12d analyses detection accuracy under increasing proportions of novel attack types. Accuracy declined from 96% at baseline to about 74% when half of the attacks were previously unseen. Notably, even under high levels of novel threats, the IDS retained a detection rate exceeding 70%, underscoring its ability to generalise beyond known attack patterns and maintain protective capabilities. In summary, the proposed framework exhibits excellent scalability, maintaining sub-second runtimes even at five times the nominal scale. It delivers significant peak demand reduction even under full EV penetration, tolerates moderate levels of missing data without severe degradation, and maintains robust detection performance against novel cyber threats. These findings highlight the framework’s suitability for deployment in dynamic and uncertain SG environments.
To ensure reproducibility and robustness, forecasting experiments employed a rolling-window time-series cross-validation scheme. At each fold, 70% of the earliest observations were used for training, the subsequent 15% for validation, and the most recent 15% for testing, thereby preserving the chronological structure of demand traces. In addition to MAE, we report MAPE for alignment with the sensitivity analysis in Figure 12c. The CatBoost forecaster achieved an MAE of 0.137 kW and a MAPE of 4.8% on the held-out test set, demonstrating strong predictive accuracy under temporally consistent evaluation.

4.6. Location-Based Planning in Charging Infrastructure Deployment: Strategic Integration Proposal

The global adoption of electric vehicles (EVs) continues to accelerate. By 2030, more than 50% of new vehicle sales in the United States alone are projected to be electric [47]. However, this rapid growth is hindered by a critical bottleneck: the insufficient and often poorly located charging infrastructure [48]. Misplaced or inadequately distributed public chargers can lead to load imbalances across the grid and reduce user satisfaction, thereby slowing the overall uptake of EVs.
For example, it is estimated that by 2030, the U.S. will require an additional 2.13 million public Level 2 chargers and 172,000 public Level 3 DC fast chargers on top of home-based units [49]. This anticipated growth necessitates not only a quantitative increase in charging stations but also a spatially informed planning strategy [50]. Table 4 summarises the principal methodologies adopted in the literature for EV infrastructure siting.
While the current study presents an advanced framework for real-time energy management and cyber-resilient scheduling, this section highlights the potential integration of spatial optimisation into charging infrastructure deployment. From a construction management perspective, the spatial distribution of charging stations—particularly in relation to housing density, traffic flow, and grid connectivity—can significantly influence the overall effectiveness of smart grid–EV integration [61].
Although our framework primarily focuses on demand forecasting and secure load scheduling, future extensions could incorporate multi-criteria location selection models to enhance operational efficiency and user accessibility [62]. Furthermore, aligning infrastructure rollout with load forecasts could reduce construction disruption during peak demand periods and enable phased deployment strategies. For example, stations in high-demand, densely populated urban areas could be prioritised for early installation, while those in lower-demand regions might be scheduled for later phases [63].
Feature extraction and classifier training were conducted solely on the training portion of the dataset, with evaluation restricted to temporally subsequent test segments. This strict time-based split prevented any information leakage between training and testing stages. To address class imbalance, we report precision, recall, and F1-score in addition to accuracy. The proposed IDS attained an accuracy of 96.2%, a precision of 94.8%, a recall of 92.7%, and an F1-score of 93.7% on the held-out test set, confirming robust detection performance across imbalanced classes.
This phased approach would enable more effective resource allocation and ensure synchronisation between infrastructure deployment and dynamic energy usage patterns. Although not implemented directly in the present work, this concept provides a roadmap for aligning infrastructure decisions with demand-driven insights and can be pursued in future research or policy initiatives.
Future Potential: Spatial Data Integration. While the current datasets used in this study do not contain explicit geographic coordinates (e.g., GPS), each charging station is identified by a “site” ID. If these site locations are publicly accessible or can be geocoded through supplementary sources, spatial analysis could be further applied, as in the following instances:
  • Daily and weekly charging demand heatmaps per station could be generated.
  • Hourly demand density maps could be derived from user behaviour data.
  • Demand could be stratified by workplace types (e.g., office, manufacturing, testing).
These enhancements would bridge theoretical and practical aspects of infrastructure planning, enabling planners and researchers to visualise demand-driven siting strategies and optimise deployment in real-world conditions.

5. Conclusions

This paper proposed an integrated, cyber-resilient, data-driven optimisation framework for real-time energy management in electric vehicle (EV)-integrated smart grids. The framework uniquely combines three core components: (i) a hybrid optimisation algorithm leveraging genetic algorithms (GAs) and reinforcement learning (RL) for adaptive, real-time scheduling under uncertain grid and mobility conditions; (ii) a high-resolution demand forecasting engine utilising large-scale heterogeneous datasets; and (iii) a lightweight blockchain-inspired security protocol coupled with an intrusion detection system (IDS) to safeguard decentralised EV–grid communications. Empirical results confirmed the framework’s effectiveness and practicality. The hybrid optimisation achieved a 9.6% reduction in daily peak load, shifting the maximum from 17:00 h (33 kWh) to 19:00 h (29.8 kWh), and redistributed energy demand to off-peak hours. Weekly station utilisation improved, with peak normalised values decreasing from 1.0 to 0.7, indicating more balanced infrastructure use. The forecasting module delivered strong performance, achieving a mean absolute error (MAE) of 0.25 kWh and remaining robust (MAPE < 20%) even with up to 25% missing data. Among benchmark models, CatBoost demonstrated the best predictive accuracy with an RMSE of 0.853 kWh and R 2 of 0.416. The IDS exhibited high cyber-resilience, with 94.1% classification accuracy, an AUC of 0.97, and attack detection latencies between 50–300 ms. Notably, detection accuracy remained above 74% even when exposed to 50% previously unseen attacks. Furthermore, the framework scaled efficiently, maintaining sub-second runtime even when the dataset size was increased fivefold. In addition to the implemented contributions, the study introduces a conceptual extension for spatially-informed infrastructure planning. This future-oriented proposal advocates aligning charging station deployment with real-time demand forecasts to enhance operational efficiency, support phased roll-outs, and improve user accessibility—especially in dense urban regions. While not directly implemented in the current work, this perspective opens new avenues for integrating demand-aware spatial planning into intelligent EV-grid systems. Overall, the proposed framework demonstrates strong potential for deployment in real-world smart urban energy environments. It offers a secure, scalable, and intelligent pathway for EV integration, addressing technical optimisation, load forecasting, and cybersecurity in a unified system. Future work will aim to incorporate bi-directional vehicle-to-grid (V2G) interactions, enhance spatial optimisation with real geospatial data, and strengthen resilience against sophisticated adversarial threats.

Author Contributions

Conceptualisation, M.C., H.A., and M.S.; methodology, M.C., H.A., M.S., and O.A.; software, M.C.; validation, M.C., H.A., M.S., and O.A.; investigation, M.C.; resources, H.A. and M.S.; writing—original draft preparation, M.C.; writing—review and editing, M.C., H.A., M.S., O.A., D.D., and M.B.; visualisation, M.C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data and code are publicly available at https://github.com/cavusmuhammed68/Cyber_EV (accessed on 3 July 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Sabzi, S.; Vajta, L. Optimizing Electric Vehicle Charging Considering Driver Satisfaction Through Machine Learning. IEEE Access 2024, 12, 102167–102177. [Google Scholar] [CrossRef]
  2. van den Berg, M.A.; Lampropoulos, I.; AlSkaif, T.A. Impact of electric vehicles charging demand on distribution transformers in an office area and determination of flexibility potential. Sustain. Energy Grids Netw. 2021, 26, 100452. [Google Scholar] [CrossRef]
  3. Vishnu, G.; Kaliyaperumal, D.; Jayaprakash, R.; Karthick, A.; Chinnaiyan, V.K.; Ghosh, A. Review of Challenges and Opportunities in the Integration of Electric Vehicles to the Grid. World Electr. Veh. J. 2023, 14, 259. [Google Scholar] [CrossRef]
  4. Kavousighahfarokhi, A.; Hannan, M.A.; Abu, S.M.; Ker, P.J.; Wong, R.T.K.; Jang, G. Grid-integrated electric vehicle charging station technologies and data dissemination through internet of energy use. Renew. Sustain. Energy Rev. 2025, 220, 115904. [Google Scholar] [CrossRef]
  5. Brännlund, R.; Vesterberg, M. Peak and off-peak demand for electricity: Is there a potential for load shifting? Energy Econ. 2021, 102, 105466. [Google Scholar] [CrossRef]
  6. Llanos-Pino, M.A.; Grisales-Noreña, L.F.; Sanin-Villa, D.; Montoya, O.D.; Hernández, J.C. Optimizing economic and operational performance in AC microgrids: An intelligent energy management strategy for BESS using the Generalized Normal Distribution Optimizer. Results Eng. 2025, 27, 106005. [Google Scholar] [CrossRef]
  7. Dai, Y.; Yang, C.; Liu, K.; Liu, Y.; Yao, Y. Quality-aware industrial data imputation with self-supervised recovery for process soft sensor development. Comput. Chem. Eng. 2025, 203, 109328. [Google Scholar] [CrossRef]
  8. Hussan, U.; Hassan, M.; Ayub, M.A.; Peng, J. Smooth and uninterrupted operation of standalone DC microgrid under high and low penetration of RESs. IEEE Access 2024, 12, 48620–48629. Available online: https://ieeexplore.ieee.org/abstract/document/10460546/ (accessed on 18 August 2025). [CrossRef]
  9. Motlagh, S.G.; Oladigbolu, J.; Li, L. A review on electric vehicle charging station operation considering market dynamics and grid interaction. Appl. Energy 2025, 392, 126058. [Google Scholar] [CrossRef]
  10. Ibrahim, B.; Rabelo, L.; Gutierrez-Franco, E.; Clavijo-Buritica, N. Machine Learning for Short-Term Load Forecasting in Smart Grids. Energies 2022, 15, 8079. [Google Scholar] [CrossRef]
  11. Ramul, A.R.; Shahraki, A.S.; Bachache, N.K.; Sadeghi, R. Cyberspace enhancement of electric vehicle charging stations in smart grids based on detection and resilience measures against hybrid cyberattacks: A multi-agent deep reinforcement learning approach. Energy 2025, 325, 136038. [Google Scholar] [CrossRef]
  12. An, Y.; Gao, Y.; Wu, N.; Zhu, J.; Li, H.; Yang, J. Optimal scheduling of electric vehicle charging operations considering real-time traffic condition and travel distance. Expert Syst. Appl. 2023, 213 Pt B, 118941. [Google Scholar] [CrossRef]
  13. Chen, Y.; Bao, Z.; Tan, Y.; Wang, J.; Liu, Y.; Sang, H.; Yuan, X. Hierarchical Charging Scheduling Strategy for Electric Vehicles Based on NSGA-II. Energies 2025, 18, 3269. [Google Scholar] [CrossRef]
  14. Zhang, W.; Zhang, D.; Mu, B.; Wang, L.Y.; Bao, Y.; Jiang, J.; Morais, H. Decentralized Electric Vehicle Charging Strategies for Reduced Load Variation and Guaranteed Charge Completion in Regional Distribution Grids. Energies 2017, 10, 147. [Google Scholar] [CrossRef]
  15. Raju, B.A.; Mohan Reddy, P.K.; Vuddanti, S. Decentralized Coordination of Electric Vehicle Charging in Microgrids Using Game Theory. In Proceedings of the 2024 IEEE 3rd International Conference on Electrical Power and Energy Systems (ICEPES), Bhopal, India, 21–22 June 2024; pp. 1–5. [Google Scholar] [CrossRef]
  16. Elkholy, A.M.; Nikolaevich, R.A.; Vasilievich, B.A.; Aleksandrovich, C.I. Genetic Algorithm-Based Optimization of EV Charging Station Placement on Long-Distance Routes. In Proceedings of the 2025 7th International Youth Conference on Radio Electronics, Electrical and Power Engineering (REEPE), Moscow, Russia, 8–10 April 2025; pp. 1–7. [Google Scholar] [CrossRef]
  17. Boubaker, S.; Kraiem, H.; Ghazouani, N.; Kamel, S.; Mellit, A.; Alsubaei, F.S.; Bourennani, F.; Meskine, W.; Alqubaysi, T. Multi-objective optimization framework for electric vehicle charging and discharging scheduling in distribution networks using the red deer algorithm. Sci. Rep. 2025, 15, 13343. [Google Scholar] [CrossRef]
  18. Qi, Z. Application of Improved Ant Colony Algorithm in Optimizing the Charging Path of Electric Vehicles. World Electr. Veh. J. 2024, 15, 230. [Google Scholar] [CrossRef]
  19. Abdullah, H.M.; Gastli, A.; Ben-Brahim, L. Reinforcement Learning Based EV Charging Management Systems—A Review. IEEE Access 2021, 9, 41506–41531. [Google Scholar] [CrossRef]
  20. Shi, D.; Xu, H.; Wang, S.; Hu, J.; Chen, L.; Yin, C. Deep reinforcement learning based adaptive energy management for plug-in hybrid electric vehicle with double deep Q-network. Energy 2024, 305, 132402. [Google Scholar] [CrossRef]
  21. Ameer, H.; Wang, Y.; Fan, X.; Chen, Z. Hybrid optimization of EV charging station placement and pricing using Bender’s decomposition and NSGA-II algorithm. Appl. Energy 2025, 397, 126385. [Google Scholar] [CrossRef]
  22. He, W. Load Forecasting via Deep Neural Networks. Procedia Comput. Sci. 2017, 122, 308–314. [Google Scholar] [CrossRef]
  23. Chen, Y.; Xu, P.; Chu, Y.; Li, W.; Wu, Y.; Ni, L.; Bao, Y.; Wang, K. Short-term electrical load forecasting using the Support Vector Regression (SVR) model to calculate the demand response baseline for office buildings. Appl. Energy 2017, 195, 659–670. [Google Scholar] [CrossRef]
  24. Amezquita, H.; Guzman, C.P.; Morais, H. Forecasting Electric Vehicles’ Charging Behavior at Charging Stations: A Data Science-Based Approach. Energies 2024, 17, 3396. [Google Scholar] [CrossRef]
  25. Saini, P.; Parida, S.K. A novel probabilistic gradient boosting model with multi-approach feature selection and iterative seasonal trend decomposition for short-term load forecasting. Energy 2024, 294, 130975. [Google Scholar] [CrossRef]
  26. Chen, Y.; Tang, Z.; Cui, Y.; Rao, W.; Li, Y. Electric Vehicle Charging Demand Prediction Model Based on Spatiotemporal Attention Mechanism. Energies 2025, 18, 687. [Google Scholar] [CrossRef]
  27. Chan, J.W.; Yeo, C.K. A Transformer based approach to electricity load forecasting. Electr. J. 2024, 37, 107370. [Google Scholar] [CrossRef]
  28. Hussain, A.; Giangrande, P.; Franchini, G.; Fenili, L.; Messi, S. Analyzing the Effect of Error Estimation on Random Missing Data Patterns in Mid-Term Electrical Forecasting. Electronics 2025, 14, 1383. [Google Scholar] [CrossRef]
  29. Sreekumar, A.V.; Lekshmi, R.R. Electric vehicle charging station demand prediction model deploying data slotting. Results Eng. 2024, 24, 103095. [Google Scholar] [CrossRef]
  30. Appasani, B.; Mishra, S.K.; Jha, A.V.; Mishra, S.K.; Enescu, F.M.; Sorlei, I.S.; Bîrleanu, F.G.; Takorabet, N.; Thounthong, P.; Bizon, N. Blockchain-Enabled Smart Grid Applications: Architecture, Challenges, and Solutions. Sustainability 2022, 14, 8801. [Google Scholar] [CrossRef]
  31. Aderibole, A.; Aljarwan, A.; Rehman, M.H.U.; Zeineldin, H.H.; Mezher, T.; Salah, K.; Damiani, E.; Svetinovic, D. Blockchain Technology for Smart Grids: Decentralized NIST Conceptual Model. IEEE Access 2020, 8, 43177–43190. [Google Scholar] [CrossRef]
  32. Faheem, M.; Kuusniemi, H.; Eltahawy, B.; Bhutta, M.S.; Raza, B. A lightweight smart contracts framework for blockchain-based secure communication in smart grid applications. IET Gener. Transm. Distrib. 2024, 18, 625–638. [Google Scholar] [CrossRef]
  33. Husain, Z.; El-Fouly, T.H.M.; Singh, S.; Mizouni, R.; Otrok, H.; El-Saadany, E. BlockCharge: A blockchain-based auction framework for EV charging via mobile stations. Appl. Energy 2025, 377 Pt C, 124638. [Google Scholar] [CrossRef]
  34. Panthi, M.; Das, T.K. Intelligent Intrusion Detection Scheme for Smart Power-Grid Using Optimized Ensemble Learning on Selected Features. Int. J. Crit. Infrastruct. Prot. 2022, 39, 100567. [Google Scholar] [CrossRef]
  35. Danilczyk, W.; Sun, Y.L.; He, H. Smart Grid Anomaly Detection using a Deep Learning Digital Twin. In Proceedings of the 2020 52nd North American Power Symposium (NAPS), Tempe, AZ, USA, 11–13 April 2021; pp. 1–6. [Google Scholar] [CrossRef]
  36. Perdigão, D.; Cruz, T.; Simões, P. Data-centric federated learning for anomaly detection in smart grids and other industrial control systems. In Proceedings of the NOMS 2024—2024 IEEE Network Operations and Management Symposium, Seoul, Republic of Korea, 6–10 May 2024. [Google Scholar] [CrossRef]
  37. Keçeci, C.; Davis, K.R.; Serpedin, E. Federated learning-based distributed localization of false data injection attacks on smart grids. IEEE Syst. J. 2025. [Google Scholar] [CrossRef]
  38. Umunnawuike, C.; Mahat, S.Q.A.; Aziz, M. Predictive energy: Harnessing artificial intelligence for sustainable energy forecasting and management. In Proceedings of the SPE Nigeria Annual International Conference and Exhibition, Lagos, Nigeria, 4–6 August 2025; Available online: https://onepetro.org/SPENAIC/proceedings-abstract/25NAIC/25NAIC/787239 (accessed on 18 August 2025).
  39. Cavus, M.; Allahham, A. Spatio-temporal attention-based deep learning for smart grid demand prediction. Electronics 2025, 14, 2514. [Google Scholar] [CrossRef]
  40. Rojek, I.; Mikołajewski, D.; Galas, K.; Piszcz, A. Advanced deep learning algorithms for energy optimization of smart cities. Energies 2025, 18, 407. [Google Scholar] [CrossRef]
  41. Koshkin, D.; Sadovoy, O.; Rudenko, A.; Sokolik, V. Optimising energy distribution and detecting vulnerabilities in networks using artificial intelligence. Mach. Energetics 2025, 2, 36–48. [Google Scholar] [CrossRef]
  42. Olayiwola, D.E.; Smart, E.E. Advances in AI-powered energy management systems for renewable-integrated smart grids. World J. Adv. Eng. Technol. Sci. 2025, 15, 685. [Google Scholar] [CrossRef]
  43. Wang, W.; Lu, Z. Cyber security in the Smart Grid: Survey and challenges. Comput. Netw. 2013, 57, 1344–1371. [Google Scholar] [CrossRef]
  44. Asensio, O.I.; Apablaza, C.Z.; Lawson, M.C.; Walsh, S.E. Replication Data for: A Field Experiment on Workplace Norms and Electric Vehicle Charging Etiquette; Georgia Institute of Technology: Atlanta, GA, USA, 2020. [Google Scholar] [CrossRef]
  45. Sahnovskis, A.; Zicmane, I.; Kovalenko, S. Enhancing grid reliability in the Baltic region: Integrating renewable energy and ENTSO-E synchronization. In Proceedings of the 2024 IEEE International Conference and Exposition on Electric and Power Engineering (EPEi), Iasi, Romania, 17–19 October 2024; pp. 543–546. [Google Scholar] [CrossRef]
  46. Buedi, E.D.; Ghorbani, A.A.; Dadkhah, S.; Ferreira, R. Enhancing EV Charging Station Security Using A Multi-dimensional Dataset: CICEVSE2024. In Proceedings of the IFIP Annual Conference on Data and Applications Security and Privacy, San Jose, CA, USA, 15–17 July 2024. [Google Scholar]
  47. Mills, M.; Obi, M.; Cody, K.; Garton, K.; Wisser, A.M.; Nabahani, S. Utility Planning for Distribution-Optimized Electric Vehicle Charging: A Case Study in the United States Pacific Northwest. IEEE Power Energy Mag. 2023, 21, 48–55. [Google Scholar] [CrossRef]
  48. Ullah, I.; Zheng, J.; Jamal, A.; Zahid, M.; Almoshageh, M.; Safdar, M. Electric vehicles charging infrastructure planning: A review. Int. J. Green Energy 2024, 21, 1710–1728. [Google Scholar] [CrossRef]
  49. S&P Global Mobility. EV Chargers: How Many Do We Need? Available online: https://press.spglobal.com/2023-01-09-EV-Chargers-How-many-do-we-need (accessed on 28 July 2025).
  50. He, S.Y.; Kuo, Y.-H.; Sun, K.K. The spatial planning of public electric vehicle charging infrastructure in a high-density city using a contextualised location-allocation model. Transp. Res. Part A Policy Pract. 2022, 160, 21–44. [Google Scholar] [CrossRef]
  51. Banegas, J.; Mamkhezri, J. A systematic review of geographic information systems based methods and criteria used for electric vehicle charging station site selection. Environ. Sci. Pollut. Res. 2023, 30, 68054–68083. [Google Scholar] [CrossRef] [PubMed]
  52. Fadranski, D.; Syré, A.M.; Grahle, A.; Göhlich, D. Analysis of Charging Infrastructure for Private, Battery Electric Passenger Cars: Optimizing Spatial Distribution Using a Genetic Algorithm. World Electr. Veh. J. 2023, 14, 26. [Google Scholar] [CrossRef]
  53. Hisoglu, S.; Comert, R. GIS-Based Optimum Site Selection for Solar Electric Vehicle Charging Station: Ankara–Istanbul Highway Case. Int. Arch. Photogramm. Remote Sens. Spat. Inf. Sci. 2021, 46, 267–272. [Google Scholar] [CrossRef]
  54. Xie, R.; Wei, W.; Khodayar, M.E.; Wang, J.; Mei, S. Planning Fully Renewable Powered Charging Stations on Highways: A Data-Driven Robust Optimization Approach. IEEE Trans. Transp. Electr. 2018, 4, 817–830. [Google Scholar] [CrossRef]
  55. Abdullah, H.M.; Gastli, A.; Ben-Brahim, L.; Mohammed, S.O. Integrated Multi-Criteria Model for Long-Term Placement of Electric Vehicle Chargers. IEEE Access 2022, 10, 123452–123473. [Google Scholar] [CrossRef]
  56. Guo, S.; Zhao, H. Optimal site selection of electric vehicle charging station by using fuzzy TOPSIS based on sustainability perspective. Appl. Energy 2015, 158, 390–402. [Google Scholar] [CrossRef]
  57. Wu, Y.; Yang, M.; Zhang, H.; Chen, K.; Wang, Y. Optimal Site Selection of Electric Vehicle Charging Stations Based on a Cloud Model and the PROMETHEE Method. Energies 2016, 9, 157. [Google Scholar] [CrossRef]
  58. Wu, H.; Lan, X.; He, Y.; Wu, A.Y.; Ding, M. Orderly charging of electric vehicles: A two-stage spatial-temporal scheduling method based on user-personalized navigation. Appl. Energy 2025, 378, 124800. [Google Scholar] [CrossRef]
  59. Gopalakrishnan, R.; Biswas, A.; Lightwala, A.; Vasudevan, S.; Dutta, P.; Tripathi, A. Demand prediction and placement optimization for electric vehicle charging stations. arXiv 2016, arXiv:1604.05472. [Google Scholar] [CrossRef]
  60. Junker, J.S.; Hu, R.; Li, Z.; Ketter, W. Data-Driven Optimization of EV Charging Station Placement Using Causal Discovery. arXiv 2025, arXiv:2503.17055. [Google Scholar] [CrossRef]
  61. Pagany, R.; Ramirez Camargo, L.; Dorner, W. A review of spatial localization methodologies for the electric vehicle charging infrastructure. Int. J. Sustain. Transp. 2019, 13, 433–449. [Google Scholar] [CrossRef]
  62. Cavus, M.; Ayan, H.; Dissanayake, D.; Sharma, A.; Deb, S.; Bell, M. Forecasting Electric Vehicle Charging Demand in Smart Cities Using Hybrid Deep Learning of Regional Spatial Behaviours. Energies 2025, 18, 3425. [Google Scholar] [CrossRef]
  63. Wolbertus, R.; van den Hoed, R.; Kroesen, M.; Chorus, C. Charging infrastructure roll-out strategies for large scale introduction of electric vehicles in urban areas: An agent-based simulation study. Transp. Res. Part A Policy Pract. 2021, 148, 262–285. [Google Scholar] [CrossRef]
Figure 1. System architecture of the EV-integrated SG, showing smart chargers, charging stations, cloud EMS, communication network, utility grid, and potential attack vectors.
Figure 1. System architecture of the EV-integrated SG, showing smart chargers, charging stations, cloud EMS, communication network, utility grid, and potential attack vectors.
Energies 18 04510 g001
Figure 2. Daily load profiles before and after optimisation, showing a reduction in peak demand by approximately 9.6% and a shift of the peak from 17:00 h to 19:00 h.
Figure 2. Daily load profiles before and after optimisation, showing a reduction in peak demand by approximately 9.6% and a shift of the peak from 17:00 h to 19:00 h.
Energies 18 04510 g002
Figure 3. Hourly EV charging sessions and corresponding energy demand before and after optimisation, illustrating load shifting while maintaining the number of sessions.
Figure 3. Hourly EV charging sessions and corresponding energy demand before and after optimisation, illustrating load shifting while maintaining the number of sessions.
Energies 18 04510 g003
Figure 4. Weekly heatmap of station utilisation before and after optimisation, indicating more uniform temporal and spatial distribution of charging demand across the week.
Figure 4. Weekly heatmap of station utilisation before and after optimisation, indicating more uniform temporal and spatial distribution of charging demand across the week.
Energies 18 04510 g004
Figure 5. Comparison of actual and predicted energy demand over the test set, demonstrating the forecasting model’s ability to capture the temporal patterns of EV load.
Figure 5. Comparison of actual and predicted energy demand over the test set, demonstrating the forecasting model’s ability to capture the temporal patterns of EV load.
Energies 18 04510 g005
Figure 6. Distribution of forecasting errors showing the majority of predictions within ±1 kWh of actual values, with a few outliers.
Figure 6. Distribution of forecasting errors showing the majority of predictions within ±1 kWh of actual values, with a few outliers.
Energies 18 04510 g006
Figure 7. Feature importance analysis of the forecasting model, highlighting the dominant contribution of short-term historical demand features (rolling_3 and prev_hour).
Figure 7. Feature importance analysis of the forecasting model, highlighting the dominant contribution of short-term historical demand features (rolling_3 and prev_hour).
Energies 18 04510 g007
Figure 8. Confusion matrix of the IDS, showing correct classification of benign and attack instances, with an overall accuracy exceeding 94%.
Figure 8. Confusion matrix of the IDS, showing correct classification of benign and attack instances, with an overall accuracy exceeding 94%.
Energies 18 04510 g008
Figure 9. ROC curve of the IDS, achieving an AUC of 0.97, indicating excellent discriminatory power.
Figure 9. ROC curve of the IDS, achieving an AUC of 0.97, indicating excellent discriminatory power.
Energies 18 04510 g009
Figure 10. Histogram of detection latency for detected attack instances, with most detections occurring within 50–300 ms, peaking around 200–250 ms.
Figure 10. Histogram of detection latency for detected attack instances, with most detections occurring within 50–300 ms, peaking around 200–250 ms.
Energies 18 04510 g010
Figure 11. Smoothed power trace of the EV charging station, with attack periods highlighted, showing deviations in power during compromised intervals.
Figure 11. Smoothed power trace of the EV charging station, with attack periods highlighted, showing deviations in power during compromised intervals.
Energies 18 04510 g011
Figure 12. Scalability, resilience, and robustness analysis of the proposed framework under varying conditions. (a) Computational runtime as a function of system scale factor, showing runtimes below 0.4 s even at five times nominal scale. (b) Peak demand reduction versus EV penetration, decreasing from approximately 30% at low penetration to about 21% at full penetration. (c) Forecast error (MAPE) versus missing data percentage, remaining below 20% up to around 25% missing data and rising to 37% at 50% missing data. (d) Detection accuracy versus proportion of novel attack types, declining from 96% to approximately 74% as novel attack proportion increases to 50%.
Figure 12. Scalability, resilience, and robustness analysis of the proposed framework under varying conditions. (a) Computational runtime as a function of system scale factor, showing runtimes below 0.4 s even at five times nominal scale. (b) Peak demand reduction versus EV penetration, decreasing from approximately 30% at low penetration to about 21% at full penetration. (c) Forecast error (MAPE) versus missing data percentage, remaining below 20% up to around 25% missing data and rising to 37% at 50% missing data. (d) Detection accuracy versus proportion of novel attack types, declining from 96% to approximately 74% as novel attack proportion increases to 50%.
Energies 18 04510 g012
Table 1. Key parameters used in the proposed framework analysis.
Table 1. Key parameters used in the proposed framework analysis.
ParameterDescriptionValue
NNumber of EVs considered500
TTime horizon (hours)24
γ RL discount factor0.95
λ Weight for user satisfaction0.3
K max Maximum GA generations100
ϵ Convergence threshold 10 3
τ Mitigation response time (seconds)60
Block sizeBlockchain block size (kB)1
IDS window sizeObservation window for IDS (minutes)10
Forecast horizon Δ Forecasting lead time (minutes)30
Table 2. Performance comparison of ML models on EV demand forecasting.
Table 2. Performance comparison of ML models on EV demand forecasting.
ModelMAE (kWh)RMSE (kWh) R 2
CatBoost0.2510.8530.416
LightGBM0.3280.9880.216
XGBoost0.2431.130−0.027
Table 3. Performance comparison between baseline scheduler and proposed GA/RL framework. Reported values are mean improvements with 95% confidence intervals (CI) over 1000 bootstrap resamples.
Table 3. Performance comparison between baseline scheduler and proposed GA/RL framework. Reported values are mean improvements with 95% confidence intervals (CI) over 1000 bootstrap resamples.
MetricBaselineGA/RL Frameworkp-Value
Peak-load reduction0.0%9.6% [8.7%, 10.4%]<0.01
Load-shift (to off-peak)0.0%27.0% [25.5%, 28.4%]<0.01
Table 4. Overview of EV charging infrastructure planning methods.
Table 4. Overview of EV charging infrastructure planning methods.
Method/ModelKey StudiesCriteriaDescription
Spatial and Geographic Models (e.g., GIS, map-based, equations)[51,52,53,54]Cost, distance, road network, traffic density, population, geographical accessibilityMapping and infrastructure analysis using GIS or field-based data
Multi-Criteria Decision Making (MCDM, AHP, TOPSIS, etc.)[55,56,57]Accessibility, cost, user preferences, environmental impactDecision-making structures integrating multiple spatial and social metrics
User and Behavioural Analysis[58]Frequency, time of use, accessibility, user segmentationModels based on user preferences and charging habits
Data-Driven Discovery and Prediction (ML, Data Mining)[59,60]Demand forecasting, user clustering, location suitabilityPredictive modelling using historical data and machine learning
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Cavus, M.; Ayan, H.; Sari, M.; Akbulut, O.; Dissanayake, D.; Bell, M. Enhancing Smart Grid Reliability Through Data-Driven Optimisation and Cyber-Resilient EV Integration. Energies 2025, 18, 4510. https://doi.org/10.3390/en18174510

AMA Style

Cavus M, Ayan H, Sari M, Akbulut O, Dissanayake D, Bell M. Enhancing Smart Grid Reliability Through Data-Driven Optimisation and Cyber-Resilient EV Integration. Energies. 2025; 18(17):4510. https://doi.org/10.3390/en18174510

Chicago/Turabian Style

Cavus, Muhammed, Huseyin Ayan, Mahmut Sari, Osman Akbulut, Dilum Dissanayake, and Margaret Bell. 2025. "Enhancing Smart Grid Reliability Through Data-Driven Optimisation and Cyber-Resilient EV Integration" Energies 18, no. 17: 4510. https://doi.org/10.3390/en18174510

APA Style

Cavus, M., Ayan, H., Sari, M., Akbulut, O., Dissanayake, D., & Bell, M. (2025). Enhancing Smart Grid Reliability Through Data-Driven Optimisation and Cyber-Resilient EV Integration. Energies, 18(17), 4510. https://doi.org/10.3390/en18174510

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop