Electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism

Through the ACK-CCI, PARA and LMA modules in the MSMA-Net model, the problem of insufficient accuracy of electric vehicle charging status detection in the prior art is solved, and the accuracy of efficient capture of multi-scale features is achieved.

CN120234653APending Publication Date: 2025-07-01CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510401224.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-01
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

When facing complex data structures and multi-scale features, the existing electric vehicle charging status detection methods have problems such as missed or missed detection, and it is difficult to take into account the fusion of time series features and spatial features at the same time, resulting in insufficient detection accuracy.

Method used

The MSMA-Net model is designed, including ACK-CCI module, PARA module and LMA module. Through the adaptive channel convolution kernel, position-aware residual attention and linear multiplication attention mechanism, the efficiency of feature extraction and attention mechanism is improved, multi-scale features are captured and outliers are identified.

Benefits of technology

It significantly improves the accuracy and robustness of electric vehicle charging status detection, improves the model's F1 score and accuracy on multiple data sets, and is better than the existing baseline model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234653A_ABST
    Figure CN120234653A_ABST
Patent Text Reader

Abstract

The invention discloses an electric vehicle charging state detection method based on multi-scale feature extraction and a multi-attention mechanism. The multi-scale feature extraction and the multi-attention mechanism are fused. Firstly, a data set containing normal charging and simulated attack behaviors is constructed, and an enhanced sample is generated through preprocessing. The core innovation lies in designing an MSMA-Net model and integrating three key modules: an ACK-CCI module strengthens the multi-scale feature extraction capability through an adaptive channel convolution kernel; the PARA module introduces a position perception residual attention mechanism, and accurately captures data internal structure and channel-space information; the LMA module uses linear transformation to reduce calculation complexity and enhance global information perception at the same time. Experiments show that the model significantly improves the anomaly detection precision in a complex charging scene through the synergistic effect of multi-scale spatio-temporal feature learning and an attention mechanism, and provides efficient technical guarantee for the charging safety of the electric vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric vehicle charging state detection, and particularly to a method for detecting the charging state of electric vehicles based on multi-scale feature extraction and attention mechanism. Background Art

[0002] In recent years, with the increasing prominence of energy crisis and global warming problems, countries have accelerated energy transformation and promoted the development of clean energy. Electric vehicles (EVs) are regarded as one of the key solutions to reduce the carbon footprint due to their low-emission advantages. Currently, the electric vehicle industry has made remarkable progress in terms of technological breakthroughs, market acceptance, and policy support. The widespread deployment of charging infrastructure and the development of smart grid technology have greatly improved the convenience of using electric vehicles. However, with the increase in the ownership of electric vehicles, the rapid growth of their charging demand has also brought new security challenges.

[0003] The charging characteristics of electric vehicles determine their demand for fast charging, which makes the charging network potentially vulnerable to malicious attacks. Attackers can launch denial-of-service (DoS) or distributed denial-of-service (DDoS) attacks using malware to disrupt the charging process and thus affect the stability of the power grid. In addition, due to the high complexity of electric vehicle charging behavior data, including diverse charging patterns, charging times, and charging amounts, these characteristics vary depending on user behavior, geographical location, and time. Malicious charging behavior may be hidden in normal charging patterns, making it extremely difficult to detect abnormal activities.

[0004] Most of the existing methods for detecting the charging state of electric vehicles are based on traditional machine learning or simple deep learning models, and these methods have limitations when dealing with complex data structures and multi-scale features. For example, traditional detection models are prone to missed detections or false detections when dealing with highly concealed malicious attacks, resulting in insufficient detection accuracy. In addition, existing detection technologies often rely on a single feature extraction method and are difficult to simultaneously consider the fusion of time series features and spatial features, further limiting the detection performance of the model.

[0005] Therefore, there is an urgent need for a detection method that can efficiently extract multi-scale features and combine attention mechanism to improve the accuracy and robustness of electric vehicle charging state detection while meeting the real-time requirements.

[0006] The information disclosed in this background art section is only intended to enhance the overall understanding of the present invention and should not be regarded as an admission or any form of implication that this information constitutes prior art already known to those of ordinary skill in the art. Summary of the Invention

[0007] The object of the present invention is to provide a method for detecting the charging state of an electric vehicle based on deep learning, so as to improve the detection accuracy and robustness against malicious charging behaviors.

[0008] To achieve the above object, the present invention provides a method for detecting the charging state of an electric vehicle, including the following steps:

[0009] Step 1, obtain an electric vehicle charging behavior dataset, including normal charging data and simulated attack data, as well as their spatio-temporal distribution characteristics;

[0010] Step 2, preprocess the data, generate malicious data samples and perform data augmentation;

[0011] Step 3, design the MSMA-Net model, and propose an Adaptive Channel Convolution Kernel and Channel (ACK-CCI) module, a Position-Aware Residual Attention (PARA) module, and a Linear Multiplication Attention (LMA) module;

[0012] Step 4, train the MSMA-Net model to obtain an optimized electric vehicle charging state detection model;

[0013] Step 5, test the trained MSMA-Net model on the validation set to verify the model performance.

[0014] Preferably, in the above technical solution, the electric vehicle charging behavior dataset obtained in Step 1 includes the positions (latitude and longitude) of 536 plug-in hybrid electric vehicles (such as taxis) and the charging data within 24 days.

[0015] Preferably, in the above technical solution, the data preprocessing in Step 2 includes statistically calculating the charging rate and battery capacity information of the vehicle, estimating the State of Charge (SoC) value of the battery per minute according to the driving trajectory. And use a reinforcement learning agent to perturb the actual SoC value of each data sample in the charging simulation environment to generate intelligent and concealed malicious attack samples. At the same time, in order to balance the ratio of benign samples to malicious samples, the ADASYN method is used as a data augmentation technique to ensure a more balanced sample distribution in the training dataset.

[0016] Preferably, in the above technical solution, the ACK-CCI module proposed in Step 3 is used to retain as much feature information of the real dataset as possible, and the calculation formula of its core part is as follows:

[0017]

[0018] Where C is the number of channels, K is the convolution kernel size. By using one-dimensional convolution to capture the dependencies between channels and avoiding dimensionality increase and decrease, ACK-CCI ensures the integrity of the original channel information and significantly improves the detection accuracy and robustness against malicious charging behaviors.

[0019] Preferably, for the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1, the PARA module proposed in step 3 is used to capture multi-scale features and identify outliers at different time scales, and the calculation formula of its core part is as follows:

[0020]

[0021] where E is the weighted coefficient of each element, X is the original feature information, is the enhanced feature information. The PARA module calculates weights through the input feature information, can efficiently process the input data, and dynamically adjusts the attention weights.

[0022] Preferably, for the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1, the LMA module proposed in step 3 encodes the interaction between the query and the key by combining a linear projection layer, and can effectively solve the problem of better capturing and learning global information when processing long sequence datasets. The formula summary is as follows:

[0023]

[0024] where q is a one-dimensional vector obtained by projecting the query matrix through a linear layer, K is the key matrix, and V is the value matrix. The LMA module deletes the key-value interaction, adopts an element-wise multiplication operation, and dynamically enhances the key features through an efficient linear multiplication attention mechanism, improving the model detection ability.

[0025] Preferably, for the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1, the model training in step 4 includes:

[0026] (1) Set the initial learning rate to, the batch size to, and the training process is,

[0027] (2) Two evaluation metrics are adopted: accuracy and F1-score, and their definitions are as follows:

[0028]

[0029] where

[0030] Preferably, in the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1, it is characterized in that in step 5, ablation experiments are carried out by eliminating the ACK-CCI module, PARA module and LMA module of the MSMANet model respectively, and the role of each module in the whole model and the robustness of the MSMANet model are verified.

[0031] Compared with the prior art, the present invention has the following beneficial effects:

[0032] In the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism of the present invention, the ACK-CCI module is innovatively introduced into the MSMA-Net model. After the improvement, the model can adjust the behavior of the convolution kernel according to the dynamic characteristics of the input features, capture and integrate the information of different channels more effectively, and retain the feature information in the time series at the same time.

[0033] In the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism of the present invention, the PARA module is innovatively introduced into the MSMA-Net model. After the improvement, the model automatically adjusts the attention weights by learning the internal structure and importance of the input data, enhances the feature information, and enables the model to focus more on the information that is most critical for task completion.

[0034] In the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism of the present invention, the LMA module is innovatively introduced into the MSMA-Net model. After the improvement, the model replaces the traditional matrix multiplication with linear element multiplication, significantly reduces the computational complexity, and enhances the model's ability to extract multi-scale information from the input features at the same time. Description of the Drawings

[0035] Figure 1 is the overall flowchart of the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism according to the present invention;

[0036] Figure 2 is the framework diagram of the MSMANet model of the electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism;

[0037] Figure 3 is the structural diagram of the ACK-CCI module;

[0038] Figure 4 is the structural diagram of the PARA module;

[0039] Figure 5 is the structural diagram of the LMA module;

[0040] Figure 6It is a comparison chart of the verification accuracy rate of MSMANet on four datasets;

[0041] Figure 7 It is a comparison chart of the training loss of MSMANet on four data machines. Specific implementation manners

[0042] Combined with the accompanying drawings, the embodiments of the present invention will be specifically described below. It should be particularly noted that the protection scope of the present invention is not limited to these specific embodiments.

[0043] Unless otherwise specifically stated, the terms "including" and its similar expressions, such as "comprising" or "containing", used in this specification and the claims should be interpreted as covering the mentioned components or parts, and at the same time do not exclude the existence of other unlisted components or parts.

[0044] As Figures 1 to 7 shown, according to a specific implementation manner of the present invention, an electric vehicle charging state detection method based on multi-scale feature extraction and multi-attention mechanism includes the following steps:

[0045] Step 1, obtain an electric vehicle charging behavior dataset;

[0046] The datasets used in the experiments are as follows: Detection origin dataset: includes normal charging behaviors and a small number of malicious charging instances. Detection syn dataset: generated by an artificially designed attack method, simulating normal and malicious charging behaviors. Detection synonly dataset: generated by a reinforcement learning (RL) agent to simulate attacks, only containing synthetic data. Detection syncomp dataset: generated by combining artificial attacks and reinforcement learning attacks, with more complex attack strategies.

[0047] Among them, the size divisions of the training sets, test sets, and validation sets of the four datasets are 95:4:4, 43:4:4, 95:4k:4, and 145:4:4 respectively.

[0048] Step 2, preprocess the data, generate malicious data samples and perform data augmentation;

[0049] By using the ADASYN method as a data augmentation technique, ensure that the sample distribution in the training dataset is more balanced.

[0050] Step 3, design the MSMA-Net model, and propose an adaptive channel convolution kernel and channel interaction (ACK-CCI) module, a position-aware residual attention (PARA) module, and a linear multiplication attention (LMA) module;

[0051] (1) As Figure 2As shown in the figure, after the linear convolution layer, the ACK-CCI, PARA, and LMA modules are added, and the final representation is integrated into the backbone network through linear connection.

[0052] (2) As shown in Figure 3 the figure, we propose the ACK-CCI module to retain as much feature information of the real dataset as possible. The calculation formula for its core part is as follows:

[0053]

[0054] where C is the number of channels, K is the convolution kernel size. By using one-dimensional convolution to capture the dependencies between channels and avoid dimensionality increase and decrease, ACK-CCI ensures the integrity of the original channel information, significantly improving the detection accuracy and robustness of malicious charging behaviors.

[0055] (3) As shown in Figure 4 the figure, we propose the PARA module to capture multi-scale features and identify outliers at different time scales. The calculation formula for its core part is as follows:

[0056]

[0057] where E is the weighted coefficient of each element, X is the original feature information, and

[0058] (4) As shown in Figure 5 the figure, the LMA module we proposed encodes the interaction between the query and the key by incorporating a linear projection layer, effectively solving the problem of better capturing and learning global information when dealing with long-sequence datasets. The formula summary is as follows:

[0059]

[0060] where q is a one-dimensional vector obtained by projecting the query matrix through a linear layer, K is the key matrix, and V is the value matrix. The LMA module deletes the key-value interaction and uses element-wise multiplication operations. Through an efficient linear multiplication attention mechanism, it dynamically enhances the key features and improves the model's detection ability.

[0061] Step Four: Train the model;

[0062] (1) The initial learning rate is set to 0.0006811225, the batch size is 1000, and the training process is 200 epochs.

[0063] (2) The model uses two evaluation metrics: Accuracy and F1-score, and their definitions are as follows:

[0064]

[0065] Among them

[0066] Step 5, test the trained MSMA-Net model on the validation set to verify the model performance.

[0067] Through ablation experiments, the ACK-CCI module, PARA module, and LMA module of the MSMANet model were eliminated respectively, verifying the role of each module in the entire model and the robustness of the MSMANet model. Compared with the existing baseline models (DetectionDNN, SK-Net, SE-Net, SAFM, CBAM), the model of the present invention achieved the highest accuracy on multiple datasets: on the Detection syncomp dataset, the F1-score increased by 0.5%, and the Accuracy increased by 0.7%; on the Detection origin dataset, the F1-score reached 0.9944, and the Accuracy reached 0.9938; on the Detection synonly dataset, the F1-score and Accuracy reached 0.9410 and 0.9391 respectively. The experimental results show that the MSMA-Net model of the present invention performs excellently in the malicious charging detection task, effectively improving the accuracy of malicious charging attack detection, and is significantly better than the existing baseline models.

[0068] The above description of the specific exemplary embodiments of the present invention is mainly for illustration and demonstration, rather than limiting the present invention to the disclosed specific forms. On this basis, it is obvious that those skilled in the art can make various adjustments or improvements according to these revelations. The purpose of selecting and elaborating these specific embodiments is to clearly show the core idea and practical application of the present invention, so that technicians can implement various different exemplary solutions based on the present invention and make various adjustments and optimizations. The protection scope of the present invention shall be subject to the appended claims and their equivalent variants.

Claims

1. A method for detecting the charging status of an electric vehicle based on multi-scale feature extraction and multi-attention mechanism, characterized in that: include: Step 1: Collect charging behavior data of electric vehicles and mark normal charging behavior and simulated attack behavior; Step 2: Use the enhanced model to preprocess the real data set and obtain four data sets under different attack modes; Step 3, design the MSMA-Net model, propose the adaptive channel convolution kernel and channel interaction (ACK-CCI) module, the position-aware residual attention (PARA) module and the linear multiplication attention (LMA) module; Step 4: Train the model on a Linux server to obtain a robust electric vehicle charging status detection model. Test the trained MSMANet model on the validation set by evaluating the F1 score and accuracy to verify the robustness of the model. Step 5: Conduct ablation experiments to evaluate the impact of each module on model performance.

2. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: The charging behavior data obtained in step 1 contains the locations and charging data of 536 plug-in hybrid electric vehicles within 24 days.

3. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: The data preprocessing process in step 2 includes counting the vehicle's charging rate and battery capacity information, estimating the battery state of charge (SoC) value per minute based on the driving trajectory, and using a reinforcement learning agent to perturb the actual SoC value of each data sample in a charging simulation environment to generate intelligent and covert malicious attack samples. At the same time, in order to balance the ratio of benign samples to malicious samples, the ADASYN method is used as a data enhancement technology to ensure that the sample distribution in the training data set is more balanced.

4. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: The four different attack methods in step 2 are described by the following formulas: where S(d,t,i) is EV i The actual Soc value at time t on day d, λ is a constant less than 1, and μ(d,t,i) is used to simulate malicious behavior to report low Soc to obtain a faster charging rate, which is a time-dependent function that varies between 0.

5. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: The ACK-CCI module proposed in step 3 is used to retain as much feature information of the real data set as possible. The calculation formula of its core part is as follows: Where C is the number of channels and K is the size of the convolution kernel. By using one-dimensional convolution to capture the dependencies between channels and avoid dimensionality increase and decrease, ACK-CCI ensures the integrity of the original channel information and significantly improves the detection accuracy and robustness of malicious charging behavior.

6. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: The PARA module proposed in step 3 is used to capture multi-scale features and identify outliers at different time scales. The calculation formula of its core part is as follows: Where E is the weight coefficient of each element, X is the original feature information, It is the enhanced feature information. The PARA module calculates the weight by inputting feature information. It can efficiently process the input data and dynamically adjust the attention weight.

7. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: The LMA module proposed in step 3 encodes the interaction between queries and keys by incorporating a linear projection layer, effectively solving the problem of better capturing learning global information when processing long sequence data sets. The formula is summarized as follows: Where q is the one-dimensional vector obtained by projecting the query matrix through the linear layer, K is the key matrix, and V is the value matrix. The LMA module deletes the key-value interaction and adopts element-by-element multiplication operation. Through the efficient linear multiplication attention mechanism, it dynamically enhances the key features and improves the model detection capability.

8. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: Step 4: Training the model includes: (1) The initial learning rate is set to 0.0006811225, the batch size is 1000, and the training process is 200 cycles; (2) Two evaluation indicators are used: Accuracy and F1-score, which are defined as follows: in 9. The electric vehicle charging status detection method based on multi-scale feature extraction and multi-attention mechanism according to claim 1 is characterized in that: In step 5, the ablation experiment eliminated the ACK-CCI module, PARA module, and LMA module of the MSMANet model respectively, verifying the role of each module in the entire model and the robustness of the MSMANet model.