Defense Strategy Against False Data Injection Attacks on Cyber–Physical System for Vehicle–Grid Based on KNN-GAE
Abstract
1. Introduction
- (1)
- Proposing an FDIA defense framework tailored for CPSVG, aligning system characteristics with attack defense requirements. By addressing the core features of the vehicle–grid interactive cyber–physical system—”deep coupling of information and physics,” “dynamic heterogeneity of data,” and “topology changes with charging cluster access”—as well as the characteristics of FDIA, such as strong concealment and ease of disguising within data fluctuations, a two-stage defense framework of “attack localization–data reconstruction” is constructed. This framework overcomes the limitations of traditional single defense strategies with poor adaptability and achieves end-to-end precise defense against FDIAs.
- (2)
- Designing a KNN-based attack localization mechanism leveraging spatiotemporal features to enhance attack detection accuracy. Based on the spatiotemporal correlation of CPSVG measurement data, a feature vector integrating “node historical time-series data + grid topological neighborhood data” is constructed. The non-parametric advantage of the KNN algorithm is utilized to adapt to the multi-modal distribution characteristics of the data. This mechanism effectively distinguishes normal load fluctuations from malicious attack signals, addressing the high missed detection rate of traditional BDD methods for concealed attacks and achieving precise localization of attacked nodes.
- (3)
- Constructing a topology-aware GAE data reconstruction model to ensure high-fidelity data recovery. The CPSVG measurement system is modeled as a “node–edge feature” attribute graph, leveraging the inherent advantage of Graph Autoencoders (GAEs) in integrating node features with grid topology. The model is trained on normal operational data to learn the inherent physical constraints of the system. For the contaminated nodes localized by KNN, a mask-based reconstruction strategy is employed to achieve high-fidelity data repair, avoiding the information loss problem caused by “mere removal without reconstruction” and providing complete and reliable data input for state estimation.
2. Problem Statement
2.1. Modeling of the CPSVG
2.2. State Estimation of the CPSVG
2.3. Modeling of FDIA in the CPSVG
3. Defense Strategy Based on K-Nearest Neighbor-Graph Autoencoder
3.1. Overall Design of the Defense Framework
3.2. Rapid Localization of Attacked Data via KNN
3.2.1. Principle of the KNN Algorithm and Its Applicability in CPSVG
3.2.2. Feature Construction and Training for Attack Localization
3.2.3. Online Attack Localization Process
3.3. Topology Aware Data Reconstruction Based on Graph Autoencoder
3.3.1. Graph Modeling of CPSVG Measurement System
- (1)
- Nodes. Nodes () are defined as the set of all key measurement entities in the CPSVG system. Each node uniquely corresponds to a physical location, such as a grid bus, the grid connection point of a V2G charging station, or the data aggregation point of a vehicle aggregator.
- (2)
- Edges. Edges () are defined as the set of physical and electrical connections between nodes. If there is a direct power line between nodes and , then edge . These connection relationships are encoded into a static adjacency matrix , which serves as the structured input of the graph, where if nodes and are connected, , otherwise 0.
- (3)
- Node Features. Node Features () are defined as the set of measurement values of all nodes at a specific time . It is a dynamic feature matrix mapped from the system measurement vector at that time, where the values in the -th row are the real-time measurement values of node .
3.3.2. Principle and Training of Graph Autoencoder (GAE)
- (1)
- Graph Encoder
- (2)
- Graph Decoder
- (3)
- Unsupervised Training of GAE
3.3.3. Online Topology-Aware Reconstruction Process
- (1)
- Graph Signal Construction: First, map the real-time measurement vector to the graph node feature matrix at the current moment.
- (2)
- Node Masking: According to the abnormal index set , locate all nodes determined to be abnormal in the feature matrix . The system sets the feature values of these nodes to 0, forming a feature matrix containing unknown information.
- (3)
- Topology-Aware Reconstruction: Input the graph signal containing unknown information into GAE. Although the features of some nodes are missing, the encoder can still infer the macroscopic operating state of the power grid from a large number of healthy nodes and their neighbor relationships and generate a reasonable latent representation . Subsequently, the decoder uses this latent representation to simulate values that conform to global physical laws and neighborhood states for those masked nodes, outputting a complete, reconstructed feature matrix .
- (4)
- Data Output: Finally, the system replaces the values at the positions corresponding to the index set in the reconstructed matrix with the corresponding values in the original contaminated vector , while keeping the remaining healthy data unchanged.
4. Case Study Analysis
4.1. Case Setup
4.1.1. Simulation Test System
4.1.2. Dataset Generation
- (1)
- The Monte Carlo method [26] is used to simulate the random behavior of individual EVs according to statistical rules (such as travel chains, charging habits, etc.). The power demands of all EVs within the same aggregator and belonging to the same sub-node are arithmetically summed to obtain the total active power and reactive power demands of each sub-node at the current time interval (5 min interval).
- (2)
- Based on the active power (P) and reactive power (Q) values of all sub-nodes generated in step (1), AC power flow calculation [27,28] is conducted for the internal networks of the four aggregators to solve for the states of the sub-nodes (such as voltage and phase angle) and the exchange power between each aggregator and the distribution network at the grid-connection point.
- (3)
- Based on the exchange power at the grid-connection point between aggregators and the distribution network solved in step (2), power flow calculation is performed for the IEEE 33-bus distribution network to solve for the global state of the entire CPSVG system at the current time. This includes the voltage and phase angle of all main network nodes and the power flow of all lines.
4.1.3. Evaluation Metrics
- (1)
- Detection Rate (DR)
- (2)
- Root Mean Square Error (RMSE)
- (3)
- F1-Score
4.1.4. Scenario Design
- (1)
- Scenario 1: No Defense
- (2)
- Scenario 2: BDD Detection Mechanism
- (3)
- Scenario 3: Localization and Elimination Only, No Reconstruction
- (4)
- Scenario 4: KNN-GAE Method
4.2. Analysis of Simulation Results
4.2.1. Simulation Results and Comparison
4.2.2. Robustness Analysis of the Model
- (1)
- Performance Analysis Under Different Attack Intensities
- (2)
- Performance Analysis Under Different Attack Coverages
4.2.3. Comparison with Other Methods
5. Conclusions and Outlook
5.1. Conclusions
- (1)
- This paper first analyzes the structural characteristics of the CPSVG system and its vulnerability to cyberattacks, and points out that FDIA, due to its high concealment and strong destructiveness, has become a key factor threatening system security.
- (2)
- To effectively defend against FDIA, this paper proposes a two-stage defense strategy. The strategy first uses the KNN algorithm to analyze the system measurement data, realizing accurate localization of the attack data source. Subsequently, for the located contaminated data, a Graph Autoencoder (GAE) model is used for data reconstruction to restore the key information distorted by the attack.
- (3)
- Through simulation experiments, this paper compares the proposed method with three scenarios: no defense, traditional Bad Data Detection (BDD), and only localization and elimination of abnormal data. The experimental results show that the proposed KNN-GAE method exhibits advantages in both the accuracy of attack localization and the fidelity of data reconstruction. In the voltage state estimation of key nodes, the data processed by this method makes the state estimation results highly consistent with the real values, effectively resisting the interference of FDIA on the system and ensuring the safe and stable operation of the power grid.
5.2. Outlook
- (1)
- Optimization of the algorithm and improvement of generalization ability: In the future, more advanced machine learning or deep learning algorithms can be explored, for example, combining the Attention Mechanism with GAE to further improve the accuracy of data reconstruction.
- (2)
- Defense strategies for hybrid attack scenarios: The current research mainly focuses on FDIA. However, in practical applications, the system may face multiple types of cyberattacks simultaneously, such as Denial of Service (DoS) attacks and replay attacks. Future research can focus on designing a comprehensive defense framework that can defend against multiple hybrid attacks at the same time.
- (3)
- Lightweight deployment and engineering practice: Considering the limitations of computing resources in actual systems, future research can explore lightweight methods for the model. On the premise of ensuring defense performance, reduce the computational complexity and time cost of the algorithm, so as to facilitate deployment and application on edge computing nodes and promote the transformation of research results into engineering practice.
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Sovacool, B.K.; Noel, L.; Axsen, J.; Kempton, W. The neglected social dimensions to a vehicle-to-grid (V2G) transition: A critical and systematic review. Environ. Res. Lett. 2018, 13, 013001. [Google Scholar] [CrossRef]
- Dibaji, S.M.; Pirani, M.; Flamholz, D.B.; Annaswamy, A.M.; Johansson, K.H.; Chakrabortty, A. A systems and control perspective of CPS security. Annu. Rev. Control 2019, 47, 394–411. [Google Scholar] [CrossRef]
- Guille, C.; Gross, G. A conceptual framework for the vehicle-to-grid (V2G) implementation. Energy Policy 2009, 37, 4379–4390. [Google Scholar] [CrossRef]
- Tehrani, K. A smart cyber physical multi-source energy system for an electric vehicle prototype. J. Syst. Archit. 2020, 111, 101804. [Google Scholar] [CrossRef]
- Han, W.; Xiao, Y. Privacy preservation for V2G networks in smart grid: A survey. Comput. Commun. 2016, 91, 17–28. [Google Scholar] [CrossRef]
- Ahmed, M.; Pathan, A.S.K. False data injection attack (FDIA): An overview and new metrics for fair evaluation of its countermeasure. Complex Adapt. Syst. Model. 2020, 8, 4. [Google Scholar] [CrossRef]
- Xydas, E.S.; Marmaras, C.E.; Cipcigan, L.M.; Hassan, A.S.; Jenkins, N. Electric vehicle load forecasting using data mining methods. In Proceedings of the IET Hybrid and Electric Vehicles Conference 2013 (HEVC 2013), London, UK, 6–7 November 2013; IET: Stevenage, UK, 2013; pp. 1–6. [Google Scholar]
- Liu, H.; Qi, J.; Wang, J.; Li, P.; Li, C.; Wei, H. EV dispatch control for supplementary frequency regulation considering the expectation of EV owners. IEEE Trans. Smart Grid 2016, 9, 3763–3772. [Google Scholar] [CrossRef]
- Alnowibet, K.; Annuk, A.; Dampage, U.; Mohamed, M.A. Effective energy management via false data detection scheme for the interconnected smart energy hub–microgrid system under stochastic framework. Sustainability 2021, 13, 11836. [Google Scholar] [CrossRef]
- Liang, G.; Zhao, J.; Luo, F.; Weller, S.R.; Dong, Z.Y. A review of false data injection attacks against modern power systems. IEEE Trans. Smart Grid 2016, 8, 1630–1638. [Google Scholar] [CrossRef]
- Hu, Z.; Wang, Y.; Tian, X.; Yang, X.; Meng, D.; Fan, R. False data injection attacks identification for smart grids. In Proceedings of the 2015 Third International Conference on Technological Advances in Electrical, Electronics and Computer Engineering (TAEECE), Beirut, Lebanon, 29 April–1 May 2015; IEEE: New York, NY, USA, 2015; pp. 139–143. [Google Scholar]
- Manandhar, K.; Cao, X.; Hu, F.; Liu, Y. Detection of faults and attacks including false data injection attack in smart grid using Kalman filter. IEEE Trans. Control. Netw. Syst. 2014, 1, 370–379. [Google Scholar] [CrossRef]
- Zhao, J.; Zhang, G.; La Scala, M.; Dong, Z.Y.; Chen, C.; Wang, J. Short-term state forecasting-aided method for detection of smart grid general false data injection attacks. IEEE Trans. Smart Grid 2015, 8, 1580–1590. [Google Scholar] [CrossRef]
- Shi, W.; Wang, Y.; Jin, Q.; Ma, J. PDL: An efficient prediction-based false data injection attack detection and location in smart grid. In Proceedings of the 2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC), Tokyo, Japan, 23–27 July 2018; IEEE: New York, NY, USA, 2018; Volume 2, pp. 676–681. [Google Scholar]
- Li, S.; Yılmaz, Y.; Wang, X. Quickest detection of false data injection attack in wide-area smart grids. IEEE Trans. Smart Grid 2014, 6, 2725–2735. [Google Scholar] [CrossRef]
- Zhao, J.; Mili, L.; Wang, M. A generalized false data injection attacks against power system nonlinear state estimator and countermeasures. IEEE Trans. Power Syst. 2018, 33, 4868–4877. [Google Scholar] [CrossRef]
- Huang, D.; He, L.; Sun, J.; Hu, A. Distributed Detection Method for Power Grid False Data Attacks Based on Edge Computing. Power Syst. Prot. Control 2021, 49, 1–9. [Google Scholar] [CrossRef]
- He, Y.; Mendis, G.J.; Wei, J. Real-time detection of false data injection attacks in smart grid: A deep learning-based intelligent mechanism. IEEE Trans. Smart Grid 2017, 8, 2505–2516. [Google Scholar] [CrossRef]
- Yang, S.; Tan, B.; Guo, J. Detection of false data injection attacks in a novel energy Internet based on dual Markov chains. Electr. Power Autom. Equip. 2021, 41, 131–137. [Google Scholar] [CrossRef]
- Xie, J.; Rahman, A.; Sun, W. Bayesian GAN-based false data injection attack detection in active distribution grids with DERs. IEEE Trans. Smart Grid 2023, 15, 3223–3234. [Google Scholar] [CrossRef]
- Wang, Y.; Han, X.; Zhang, G.; Jia, K. Mitigation of false data injection attack in DC microgrid based on conditional GAN. In Proceedings of the 2024 3rd International Conference on Energy and Electrical Power Systems (ICEEPS), Guangzhou, China, 14–16 July 2024; IEEE: New York, NY, USA, 2024; pp. 744–748. [Google Scholar]
- Liu, Z.; Li, Y.; Wang, Q.; Li, J. TSCW-GAN based FDIAs defense for state-of-charge estimation of battery energy storage systems in smart distribution networks. IEEE Trans. Ind. Inform. 2023, 20, 5048–5059. [Google Scholar] [CrossRef]
- Yan, X. scADGH: scRNA-seq clustering utilizing on attention-based DAE and hybrid similarity GAE. In Proceedings of the 2024 IEEE 4th International Conference on Electronic Technology, Communication and Information (ICETCI), Changchun, China, 24–26 May 2024; IEEE: New York, NY, USA, 2024; pp. 1448–1453. [Google Scholar]
- Hamilton, A.; Khan, M.S.; Silvestri, S.; Scott, C. Big-Data Driven Anomaly Detection in Vehicular Social Networks Using Graph Autoencoders. In Proceedings of the 2024 27th International Symposium on Wireless Personal Multimedia Communications (WPMC), Greater Noida, India, 17–20 November 2024; IEEE: New York, NY, USA, 2024. [Google Scholar]
- Crawford, K.; Baran, M.E. Topology Error Monitoring Using Bad Data Detection Methods. IEEE Trans. Ind. Appl. 2023, 60, 1476–1483. [Google Scholar] [CrossRef]
- Nogueira, T.; Magano, J.; Sousa, E.; Alves, G.R. The impacts of battery electric vehicles on the power grid: A Monte Carlo method approach. Energies 2021, 14, 8102. [Google Scholar] [CrossRef]
- Liu, C.; Zhang, B.; Hou, Y.; Wu, F.F.; Liu, Y. An improved approach for AC-DC power flow calculation with multi-infeed DC systems. IEEE Trans. Power Syst. 2010, 26, 862–869. [Google Scholar] [CrossRef]
- Baradar, M.; Ghandhari, M.; Van Hertem, D.; Kargarian, A. Power flow calculation of hybrid AC/DC power systems. In Proceedings of the 2012 IEEE Power and Energy Society General Meeting, San Diego, CA, USA, 22–26 July 2012; IEEE: New York, NY, USA, 2012; pp. 1–6. [Google Scholar]
Aggregator | Type | Connected Distribution Network Bus | Number of Sub-Nodes | Managed EV Scale | Maximum Aggregated Power |
---|---|---|---|---|---|
A1 | Large public charging station operator | 30 | 5 | 200 units | 2.0 MW |
A2 | Community charging pile operator | 32 | 12 | 350 units | 1.5 MW |
A3 | Large public charging station operator | 21 | 8 | 250 units | 2.5 MW |
A4 | Community charging pile operator | 17 | 9 | 300 units | 1.2 MW |
Vector Type | Composition | Data Source (Source Node) | Dimension |
---|---|---|---|
State Vector | Node voltage magnitude | 33 nodes of the distribution network (obtained via power flow calculation) | 33 |
Node voltage phase angle | 32 non-reference nodes of the distribution network (obtained via power flow calculation) | 32 | |
Measurement Vector | Node injected power (P, Q) | 33 nodes of the distribution network (obtained from known data + power flow calculation) | 66 |
Sub-node interactive power (P, Q) | 34 internal nodes of 4 EV aggregators (directly obtained via Monte Carlo simulation) | 68 |
Target Node | Actual State | Localization Result of Scenario 2 (BDD) | Localization Result of Scenarios 3 & 4 (KNN) |
---|---|---|---|
Injected Power at Node 21 | Attacked | Abnormal | Abnormal |
Aggregated Power at A3-2 | Attacked | Normal | Abnormal |
Aggregated Power at A3-5 | Attacked | Normal | Abnormal |
... (Other Nodes) | Normal | Normal | Normal |
DR | / | 33.33% | 100% |
F1-Score | / | 0.5 | 1 |
Measurement Node | Actual Value | Processing Result of Scenario 1 | Processing Result of Scenario 2 | Processing Result of Scenario 3 | Processing Result of Scenario 4 |
---|---|---|---|---|---|
Injected Power at Node 21 | 1.85 | 2.5 | Eliminated | Eliminated | 1.86 |
Aggregated Power at A3-2 | 0.92 | 1.6 | 1.60 (Undetected) | Eliminated | 0.94 |
Aggregated Power at A3-5 | 0.76 | 1.4 | 1.40 (Undetected) | Eliminated | 0.77 |
RMSE | / | 0.657 | 0.360 | / | 0.014 |
Number of Simultaneously Attacked Nodes | DR | RMSE | F1-Score |
---|---|---|---|
1 | 100% | 0.011 | 1 |
3 (Typical Scenario) | 100% | 0.014 | 1 |
5 | 100% | 0.018 | 0.83 |
10 | 90% | 0.023 | 0.82 |
Method | Attacked Nodes | TP | FP | FN | DR | RMSE | F1-Score |
---|---|---|---|---|---|---|---|
CNN-LSTM | 5 | 4 | 3 | 1 | 80.0% | 0.135 | 0.667 |
10 | 7 | 4 | 3 | 70.0% | 0.228 | 0.667 | |
15 | 10 | 5 | 5 | 66.7% | 0.315 | 0.667 | |
20 | 12 | 6 | 8 | 60.0% | 0.410 | 0.632 | |
GAN | 5 | 5 | 2 | 0 | 100.0% | / | 0.833 |
10 | 9 | 3 | 1 | 90.0% | / | 0.818 | |
15 | 13 | 4 | 2 | 86.7% | / | 0.812 | |
20 | 16 | 5 | 4 | 80.0% | / | 0.781 | |
KNN-GAE | 5 | 5 | 1 | 0 | 100.0% | 0.018 | 0.909 |
10 | 10 | 1 | 0 | 100.0% | 0.023 | 0.952 | |
15 | 14 | 2 | 1 | 93.3% | 0.035 | 0.903 | |
20 | 18 | 2 | 2 | 90.0% | 0.048 | 0.900 |
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. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, Q.; Song, D.; Wang, Y.; Wang, D.; Tao, W.; Ai, Q. Defense Strategy Against False Data Injection Attacks on Cyber–Physical System for Vehicle–Grid Based on KNN-GAE. Energies 2025, 18, 5215. https://doi.org/10.3390/en18195215
Li Q, Song D, Wang Y, Wang D, Tao W, Ai Q. Defense Strategy Against False Data Injection Attacks on Cyber–Physical System for Vehicle–Grid Based on KNN-GAE. Energies. 2025; 18(19):5215. https://doi.org/10.3390/en18195215
Chicago/Turabian StyleLi, Qiuyan, Dawei Song, Yuanyuan Wang, Di Wang, Weijian Tao, and Qian Ai. 2025. "Defense Strategy Against False Data Injection Attacks on Cyber–Physical System for Vehicle–Grid Based on KNN-GAE" Energies 18, no. 19: 5215. https://doi.org/10.3390/en18195215
APA StyleLi, Q., Song, D., Wang, Y., Wang, D., Tao, W., & Ai, Q. (2025). Defense Strategy Against False Data Injection Attacks on Cyber–Physical System for Vehicle–Grid Based on KNN-GAE. Energies, 18(19), 5215. https://doi.org/10.3390/en18195215