Electric vehicle grid-connected frequency modulation network attack detection method and device

CN121508913APending Publication Date: 2026-02-10CHONGQING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511514167.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In existing technologies, network attack detection results are inaccurate when electric vehicles communicate with the power grid, and malicious data tampering may lead to instability in power grid frequency regulation.

Method used

By acquiring the grid frequency offset, the number of electric vehicles in the charging station, and the remaining battery power percentage, a network attack detection model is used to determine the trust score of the charging station, screen available sites, and perform attack detection.

Benefits of technology

This improves the accuracy and reliability of charging station attack detection, ensuring the stability of power grid frequency regulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121508913A_ABST
    Figure CN121508913A_ABST
Patent Text Reader

Abstract

The invention provides an electric vehicle grid-connected frequency modulation network attack detection method and device, and the method comprises the steps: obtaining the current frequency offset of a power grid, the current number of electric vehicles in a charging station, and the current remaining power percentage of electric vehicle batteries, and obtaining the current frequency offset, the current number, and the current remaining power percentage of the electric vehicle batteries according to the current frequency offset, the current number, and the current remaining power percentage of the electric vehicle batteries; determining the current residual electric quantity percentage of the charging station and the current up-and-down adjustment power capacity of the terminal aggregator, and inputting the current quantity, the current residual electric quantity percentage of the charging station and the current up-and-down adjustment power capacity of the terminal aggregator as detection input data into a network attack detection model to obtain detection output data, determining a trust score of the charging station according to the detection input data and the detection output data, and determining a detection result of attack detection on the charging station according to the trust score; according to the invention, the accuracy and credibility of the trust score of the charging station are improved, and then the detection result of attack detection on the charging station is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power system network security, and particularly relates to a method and device for detecting network attacks on grid-connected frequency regulation of electric vehicles. BACKGROUND

[0002] V2G-Cyber Physical Systems (V2G-CPS) refers to an intelligent system that deeply integrates Vehicle-to-Grid (V2G) technology and Cyber Physical Systems (CPS), and realizes efficient and safe two-way interaction between electric vehicles and power grids through real-time data interaction, dynamic control and collaborative optimization. However, when the terminal aggregator in the electric vehicle and the power grid communicates, the real-time data transmitted by the network is easy to be stolen or even maliciously tampered with by an adversary, and these attacks may worsen or even destabilize the frequency regulation of the power grid.

[0003] In the related art, a Supervisory Control and Data Acquisition (SCADA) uses a bad data detection model to detect malicious tampering, however, a False Data Injection Attack (FDIA) that is carefully designed can bypass the current Bad Data Detection (BDD) model by jointly tampering with key data of sensors, smart devices or other measurement units in the system, leading to the operating state of the system being incorrectly estimated, thereby misleading the real-time operation of the control center and even disrupting the stability of the system. Therefore, it is necessary to improve the method for detecting network attacks on grid-connected frequency regulation of electric vehicles in the related art. SUMMARY

[0004] In view of the above-mentioned shortcomings of the prior art, the present application provides a method and device for detecting network attacks on grid-connected frequency regulation of electric vehicles to solve the technical problem of inaccurate attack detection results.

[0005] According to an aspect of the embodiments of the present application, a method for detecting network attack of grid-connected frequency modulation of electric vehicles is provided. The method comprises: obtaining a current frequency offset of a power grid, a current number of electric vehicles in a charging station, and a current remaining percentage of battery capacity of the electric vehicles; the current frequency offset is determined based on a current charging frequency of the power grid and a preset reference frequency; the power grid is configured to supply power to the charging station; the charging station is configured to charge the electric vehicles; determining a current remaining percentage of battery capacity of the charging station and a current up-down adjustment power capacity of a terminal aggregator based on the current frequency offset, the current number, and the current remaining percentage of battery capacity of the electric vehicles; the terminal aggregator is located in the power grid and is configured to manage the charging station; inputting the current number, the current remaining percentage of battery capacity of the charging station, and the current up-down adjustment power capacity of the terminal aggregator as detection input data into a network attack detection model to obtain detection output data; the network attack detection model is obtained by training a preset attack detection model based on sample data; the sample data comprises: historical number of electric vehicles in the charging station, historical remaining percentage of battery capacity of the charging station, and historical up-down adjustment power capacity of the terminal aggregator; determining a trust score of the charging station based on the detection input data and the detection output data; and determining a detection result of attack detection on the charging station based on the trust score.

[0006] In an embodiment of the present application, the process of determining the current remaining percentage of battery capacity of the charging station and the current up-down adjustment power capacity of the terminal aggregator based on the current frequency offset, the current number, and the current remaining percentage of battery capacity of the electric vehicles comprises: determining a total power of the charging station based on the current frequency offset; obtaining a rated charging power of the electric vehicles, calculating a current up-down adjustment power maximum value of the electric vehicles based on the current remaining percentage of battery capacity of the electric vehicles and the rated charging power of the electric vehicles; calculating the current up-down adjustment power capacity of the charging station based on the current up-down adjustment power maximum value and the current number; and predicting the current remaining percentage of battery capacity of the charging station based on the current up-down adjustment power capacity of the charging station, the current up-down adjustment power maximum value of the electric vehicles, the total power of the charging station, and the rated charging power of the electric vehicles; and determining the current up-down adjustment power capacity of the terminal aggregator based on the current up-down adjustment power capacity of the charging station, a connection relationship between the terminal aggregator and the charging station, and a number of charging stations managed by the terminal aggregator.

[0007] In an embodiment of the present application, after obtaining the trust score of the charging station, the method further comprises: if the number of charging stations is less than or equal to a first preset number threshold, determining the charging power of the electric vehicle in the charging station according to the trust score of the charging station; if the number of charging stations is greater than the first preset number threshold, screening available sites from the charging stations based on the trust score of the charging station and the current up and down adjustment power capacity of the charging station, obtaining a target charging station, and determining the charging power of the electric vehicle in the target charging station according to the trust score of the target charging station.

[0008] In an embodiment of the present application, the process of determining the charging power of the electric vehicle in the charging station according to the trust score of the charging station comprises: if the trust score is greater than or equal to the second preset score threshold, calculating the charging power of the electric vehicle in the charging station according to the total power of the charging station, the current up and down adjustment power capacity of the charging station and the current up and down adjustment power maximum value of the electric vehicle; if the trust score is less than the second preset score threshold and greater than or equal to a first preset score threshold, multiplying a first preset capacity ratio with the current up and down adjustment power capacity of the charging station to obtain a first changed capacity of the charging station, and calculating the charging power of the electric vehicle in the charging station according to the total power of the charging station, the first changed capacity of the charging station and the current up and down adjustment power maximum value of the electric vehicle; if the trust score is less than the first preset score threshold and greater than or equal to a third preset score threshold, performing real-time attack detection on the charging station, multiplying a second preset capacity ratio with the current up and down adjustment power capacity of the charging station to obtain a second changed capacity of the charging station, and calculating the charging power of the electric vehicle in the charging station according to the total power of the charging station, the second changed capacity of the charging station and the current up and down adjustment power maximum value of the electric vehicle; if the trust score is less than the third preset score threshold, prohibiting the charging station from providing charging service for the electric vehicle.

[0009] In an embodiment of the present application, the process of determining the charging power of the electric vehicle in the target charging station according to the trust score of the target charging station comprises: calculating a capacity weighting value of the target charging station based on the trust score of the target charging station and the current up and down adjustment power capacity of the target charging station; adjusting the total power of the target charging station according to the capacity weighting value of the target charging station to obtain the changed power of the target charging station; adjusting the current up and down adjustment power capacity of the target charging station according to the trust score of the target charging station to obtain the changed capacity of the target charging station; and calculating the charging power of the electric vehicle in the target charging station according to the changed power of the target charging station, the changed capacity of the target charging station and the current up and down adjustment power maximum value of the electric vehicle in the target charging station.

[0010] In an embodiment of the present application, the process of screening the available station from the charging stations to obtain the target charging station based on the trust score of the charging station and the current up and down adjustment power capacity of the charging station comprises: comparing the trust score of the charging station with a first preset score threshold; and comparing the current up and down adjustment power capacity of the charging station with the power average value of the charging station; the power average value of the charging station is determined by the total power of the charging station and the number of charging stations; if the trust score of the charging station is greater than the first preset score threshold and the current up and down adjustment power capacity of the charging station is greater than the power average value of the charging station, the charging station is taken as the target charging station.

[0011] In an embodiment of the present application, if the preset attack detection model comprises an encoder and a decoder, the process of training the preset attack detection model based on the sample data to obtain the network attack detection model comprises: inputting the sample data into the encoder to obtain encoded data; and inputting the encoded data into the decoder to obtain decoded data; adjusting the weight parameters and bias parameters in the encoder and the weight parameters and bias parameters in the decoder to minimize the difference between the sample data and the decoded data, to obtain the network attack detection model.

[0012] In an embodiment of the present application, the process of determining the trust score of the charging station according to the detection input data and the detection output data comprises: calculating the residual error between the detection input data and the detection output data to obtain the detection error of the detection input data; calculating the attack index of the charging station according to the detection error of the detection input data; and calculating the trust score of the charging station according to the attack index of the charging station.

[0013] In an embodiment of the present application, the process of determining the detection result of attack detection on the charging station according to the trust score includes: if the trust score is greater than or equal to a first preset score threshold, determining that the detection result is that the charging station is not attacked; and if the trust score is less than the first preset score threshold, determining that the detection result is that the charging station is attacked.

[0014] According to an aspect of an embodiment of the present application, there is provided a device for detecting network attack of grid-connected frequency modulation of electric vehicles, comprising: a data acquisition module configured to acquire a current frequency offset of a power grid, a current number of electric vehicles in a charging station, and a current remaining percentage of battery capacity of the electric vehicles; the current frequency offset is determined based on a current charging frequency of the power grid and a preset reference frequency; the power grid is configured to supply power to the charging station; the charging station is configured to charge the electric vehicles; a data processing module configured to determine a current remaining percentage of battery capacity of the charging station and a current up and down adjustment power capacity of a terminal aggregator according to the current frequency offset, the current number, and the current remaining percentage of battery capacity of the electric vehicles; the terminal aggregator is located in the power grid and is configured to manage the charging station; a data output module configured to input the current number, the current remaining percentage of battery capacity of the charging station, and the current up and down adjustment power capacity of the terminal aggregator as detection input data into a network attack detection model to obtain detection output data; the network attack detection model is obtained by training a preset attack detection model based on sample data; the sample data includes historical number of electric vehicles in the charging station, historical remaining percentage of battery capacity of the charging station, and historical up and down adjustment power capacity of the terminal aggregator; and a result determination module configured to determine a trust score of the charging station according to the detection input data and the detection output data, and determine a detection result of attack detection on the charging station according to the trust score.

[0015] Beneficial effects of the present application: the present application obtains the current frequency offset of the power grid, the current number of electric vehicles in the charging station, the current remaining percentage of the electric vehicle battery, determines the current remaining percentage of the charging station, the current up and down adjustment power capacity of the terminal aggregator according to the current frequency offset, the current number, the current remaining percentage of the electric vehicle battery, takes the current number, the current remaining percentage of the charging station and the current up and down adjustment power capacity of the terminal aggregator as detection input data, inputs the network attack detection model, obtains detection output data, determines the trust score of the charging station according to the detection input data and the detection output data, determines the detection result of the attack detection on the charging station according to the trust score, the above process, through the attack detection model, outputs the detection output data, determines the trust score of the charging station according to the detection input data and the detection output data, improves the accuracy and credibility of the trust score of the charging station, and further improves the detection result of the attack detection on the charging station.

[0016] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0017] The drawings incorporated into the specification and forming part of the specification, show embodiments consistent with the present application, and together with the specification, serve to explain the principles of the present application. It is obvious that the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings from these drawings without creative labor. In the drawings: Figure 1 is a schematic diagram of an adaptive aggregation architecture shown by an exemplary embodiment of the present application; Figure 2 is a flowchart of an electric vehicle grid-connected frequency modulation network attack detection method shown by an exemplary embodiment of the present application; Figure 3 is a flowchart of an electric vehicle grid-connected frequency modulation network attack detection method shown by another exemplary embodiment of the present application; Figure 4 is a service framework diagram of a physical information system between an electric vehicle and a power grid shown by an exemplary embodiment of the present application; Figure 5 is a structural schematic diagram of an attack detection module shown by an exemplary embodiment of the present application; Figure 6 is a block diagram of an electric vehicle grid-connected frequency modulation network attack detection device shown by an exemplary embodiment of the present application; Figure 7 is a structural schematic diagram of a computer system of an electronic device shown by an exemplary embodiment of the present application. Detailed Implementation

[0018] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0019] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0020] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.

[0021] Figure 1 This is a schematic diagram illustrating an adaptive aggregation architecture in an exemplary embodiment of this application. Figure 1 This includes electric vehicles (EVs), charging stations, and terminal aggregators. During communication and data stream transmission between EVs and charging stations, between charging stations and EV aggregators, and between EV aggregators and terminal aggregators, malicious data injection attacks may occur.

[0022] In an example embodiment of the present application, the terminal aggregator obtains the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining percentage of the electric vehicle battery, determines the current remaining percentage of the charging station, the current up and down adjustment power capacity of the terminal aggregator according to the current frequency offset, the current number, and the current remaining percentage of the electric vehicle battery, inputs the current number, the current remaining percentage of the charging station, and the current up and down adjustment power capacity of the terminal aggregator as detection input data into the network attack detection model to obtain detection output data, determines the trust score of the charging station according to the detection input data and the detection output data, and determines the detection result of the attack detection on the charging station according to the trust score. The current frequency offset of the power grid is obtained through the communication process between the terminal aggregator and the power grid, the current number of electric vehicles in the charging station is obtained through the communication process between the terminal aggregator and the electric vehicle aggregator, the communication process between the electric vehicle aggregator and the charging station, and the current remaining percentage of the electric vehicle battery is obtained through the communication process between the terminal aggregator and the electric vehicle aggregator, the communication process between the electric vehicle aggregator and the charging station, and the communication process between the charging station and the electric vehicle.

[0023] Illustratively, after the terminal aggregator obtains the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining percentage of the electric vehicle battery, the terminal aggregator determines the current remaining percentage of the charging station, the current up and down adjustment power capacity of the terminal aggregator according to the current frequency offset, the current number, and the current remaining percentage of the electric vehicle battery, inputs the current number, the current remaining percentage of the charging station, and the current up and down adjustment power capacity of the terminal aggregator as detection input data into the network attack detection model to obtain detection output data, determines the trust score of the charging station according to the detection input data and the detection output data, and determines the detection result of the attack detection on the charging station according to the trust score. The above process outputs the detection output data through the attack detection model, determines the trust score of the charging station according to the detection input data and the detection output data, improves the accuracy and reliability of the trust score of the charging station, and further improves the detection result of the attack detection on the charging station.

[0024] It should be noted that the electric vehicle grid-connected frequency modulation network attack detection method provided in the embodiments of the present application is generally executed by the terminal aggregator, and accordingly, the electric vehicle grid-connected frequency modulation network attack detection device is generally arranged in the terminal aggregator.

[0025] The implementation details of the technical solutions of the embodiments of the present application are described below: Figure 2This is a flowchart illustrating an exemplary embodiment of the present application of a method for detecting network attacks on electric vehicles connected to the grid and frequency regulation network. This method can be executed by a computing processing device, which can be configured to... Figure 1 In the terminal aggregator shown. (Refer to...) Figure 2 As shown, the electric vehicle grid-connected frequency modulation network attack detection method includes at least steps S210 to S240, which are described in detail below: In step S210, the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining battery percentage of the electric vehicles are obtained. In one embodiment of this application, the current frequency offset is determined based on the current charging frequency of the power grid and a preset reference frequency, and the current frequency offset is the difference between the current charging frequency and the preset reference frequency; the power grid is used to supply power to the charging station; the charging station is used to charge the electric vehicles. The frequency at which the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining battery percentage of the electric vehicles are obtained is consistent with the frequency of attack detection on the charging station, that is, within one attack detection cycle, the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining battery percentage of the electric vehicles are obtained once.

[0026] In step S220, the current remaining battery percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator are determined based on the current frequency offset, the current quantity, and the current remaining battery percentage of the electric vehicle battery. In one embodiment of this application, the terminal aggregator is located in the power grid and is used to manage the charging station. The process of determining the current remaining battery percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator based on the current frequency offset, the current quantity, and the current remaining battery percentage of the electric vehicle battery includes: determining the total power of the charging station based on the current frequency offset; obtaining the rated charging power of the electric vehicle; calculating the current maximum up / down adjustment power of the electric vehicle based on the current remaining battery percentage of the electric vehicle battery and the rated charging power of the electric vehicle; calculating the current up / down adjustment power capacity of the charging station based on the current maximum up / down adjustment power and the current quantity; predicting the current remaining battery percentage of the charging station based on the current up / down adjustment power capacity of the charging station, the current maximum up / down adjustment power of the electric vehicle, the total power of the charging station, and the rated charging power of the electric vehicle; and determining the current up / down adjustment power capacity of the terminal aggregator based on the current up / down adjustment power capacity of the charging station, the connection relationship between the terminal aggregator and the charging station, and the number of charging stations managed by the terminal aggregator.

[0027] In step S230, the current number of electric vehicles, the current remaining battery percentage of the charging station, and the current up / down adjustment power capacity of the terminal aggregator are used as input data for detection and input into the network attack detection model to obtain detection output data. In one embodiment of this application, the network attack detection model is trained on a preset attack detection model based on sample data; the sample data includes: the historical number of electric vehicles in the charging station, the historical remaining battery percentage of the charging station, and the historical up / down adjustment power capacity of the terminal aggregator. The historical number of electric vehicles in the charging station includes: the number of electric vehicles in the charging station obtained before the current attack detection period; the historical remaining battery percentage of the charging station includes: the remaining battery percentage data of the charging station obtained before the current attack detection period; the historical up / down adjustment power capacity of the terminal aggregator includes: the up / down adjustment power capacity data of the terminal aggregator obtained before the current attack detection period. The data on the number of electric vehicles in the charging station, the remaining battery percentage data of the charging station, and the up / down adjustment power capacity data of the terminal aggregator all originate from the same attack detection period, which can be one or more.

[0028] In step S340, the trust score of the charging station is determined based on the detection input data and detection output data; based on the trust score, the detection result of attack detection on the charging station is determined. In one embodiment of this application, the attack detection model outputs detection output data, and the trust score of the charging station is determined based on the detection input data and detection output data, thereby improving the accuracy and reliability of the trust score of the charging station, and thus improving the detection result of attack detection on the charging station.

[0029] In one embodiment of this application, the process of determining the current remaining power percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator based on the current frequency offset, the current quantity, and the current remaining power percentage of the electric vehicle battery includes: The total power of the charging station is determined based on the current frequency offset. In one embodiment of this application, the formula for calculating the total power of the charging station based on the current frequency offset is as follows: Equation (1) in, This indicates the total power of the charging station. This represents the adjustment coefficient. Indicates the current frequency offset. This indicates the preset linear bias power. Indicates the maximum droop power. This represents the lower limit of the frequency offset (a positive value). This represents the upper limit of the frequency offset (which is a positive value).

[0030] In one embodiment of this application, when the current frequency offset At this time, the V2G (Vehicle-to-Grid) system will intervene in the power system response frequency offset signal. Typically, the total power of the charging station... This can be represented as the total power managed by a terminal aggregator corresponding to one or more large charging stations. EVs connected to the power grid share the load in response to commands issued by the control center, and assist in grid frequency regulation by shifting the charging and discharging frequency. Due to differences in charging interface protocols and current remaining battery percentage limitations, all electric vehicles connected to the power system share the load equally. That's impractical. Therefore, an EV response control center is needed to allocate power to each of its electric vehicles.

[0031] The rated charging power of the electric vehicle is obtained. Based on the current remaining battery charge percentage and the rated charging power of the electric vehicle, the maximum current upward and downward adjustment power of the electric vehicle is calculated. In one embodiment of this application, the maximum current upward and downward adjustment power of the electric vehicle includes: the maximum current upward adjustment power and the maximum current downward adjustment power. The formula for calculating the maximum current upward adjustment power is as follows: Equation (2) in, This indicates the current maximum upward adjustment power. This indicates the maximum interface power between the vehicle and the power grid. This indicates the rated charging power of the electric vehicle. Represents the normal cumulative distribution function. Indicates the tolerance coefficient. This indicates the minimum remaining charge percentage for an electric vehicle to be removed from service. This indicates the current remaining percentage of battery power in the electric vehicle.

[0032] The formula for calculating the maximum downward adjustment power is as follows: Equation (3) in, This indicates the current maximum downward adjustment power. This indicates the maximum interface power between the vehicle and the power grid. This indicates the rated charging power of the electric vehicle. Represents the normal cumulative distribution function. Indicates the tolerance coefficient. This indicates the minimum remaining charge percentage for an electric vehicle to be removed from service. This indicates the current remaining percentage of battery power in the electric vehicle.

[0033] In one embodiment of this application, formulas (2) and (3) are used to characterize how an electric vehicle will adjust its current remaining battery percentage. Selectively submit frequency adjustment control signals to the terminal aggregator. The smaller the value, the lower the percentage of remaining charge that electric vehicle users are willing to accept before leaving the vehicle. It simultaneously provides bidirectional frequency adjustment control signals over a larger surrounding area.

[0034] The current upward and downward adjustable power capacity of the charging station is calculated based on the current maximum upward and downward adjustable power values ​​and the current quantity. In one embodiment of this application, the current upward and downward adjustable power capacity of the charging station includes the current upward adjustable power capacity and the current downward adjustable power capacity. The formula for calculating the current upward adjustable power capacity is as follows: Equation (4) in, This indicates that the power capacity is currently being adjusted upwards. Let i represent the set of electric vehicles in the i-th charging station. Indicates power error. This represents the current number of electric vehicles in the i-th charging station. This represents the maximum current upward adjustment power of electric vehicles in the i-th charging station. The expectation.

[0035] The current maximum upward adjustment power of electric vehicles in the i-th charging station The formula for calculating the expectation is as follows: Equation (5) in, This represents the maximum current upward adjustment power of electric vehicles in the i-th charging station. Expectations This represents the average value of the maximum interface power between the vehicle and the power grid at the i-th charging station. This represents the average rated charging power of electric vehicles in the i-th charging station. This indicates an upward adjustment of the power estimation coefficient. This represents the average remaining battery percentage reported by the attacker when launching a tampering attack on the i-th charging station. This represents the average percentage of remaining battery power after electric vehicles leave the i-th charging station. This represents the upward adjustment power error coefficient. Both the upward adjustment power estimation coefficient and the upward adjustment power error coefficient need to be obtained by maximum likelihood estimation of historical capacity data.

[0036] The formula for calculating the current downward adjustment of power capacity is as follows: Equation (6) in, This indicates that the power capacity is currently being adjusted downwards. Let i represent the set of electric vehicles in the i-th charging station. Indicates power error. This represents the current number of electric vehicles in the i-th charging station. This represents the maximum current downward adjustment power of electric vehicles in the i-th charging station. The expectation.

[0037] The current maximum downward adjustment power of electric vehicles in the i-th charging station The formula for calculating the expectation is as follows: Equation (7) in, This represents the maximum current downward adjustment power of electric vehicles in the i-th charging station. Expectations This represents the average value of the maximum interface power between the vehicle and the power grid at the i-th charging station. This represents the average rated charging power of electric vehicles in the i-th charging station. This indicates a downward adjustment of the power estimation coefficient. This represents the average remaining battery percentage reported by the attacker when launching a tampering attack on the i-th charging station. This represents the average percentage of remaining battery power after electric vehicles leave the i-th charging station. This represents the downward adjustment power error coefficient. Both the downward adjustment power estimation coefficient and the downward adjustment power error coefficient need to be obtained by maximum likelihood estimation of historical capacity data.

[0038] In one embodiment of this application, formulas (5) and (7) assume that each electric vehicle connected to the power grid contains two power flows, and the charging power of bidirectional electric vehicles... and the rated charging power of electric vehicles And limited by maximum power electronic power Under the given conditions, the calculation was obtained. This represents the maximum interface power between the vehicle and the power grid.

[0039] The current remaining battery percentage of the charging station is predicted based on the current adjustable power capacity of the charging station, the current maximum adjustable power of the electric vehicle, the total power of the charging station, and the rated charging power of the electric vehicle. In one embodiment of this application, the current remaining battery percentage of the charging station is predicted using an attack detection period as the time unit, and the duration of the attack detection period is set according to actual needs.

[0040] The formula for predicting the current remaining battery percentage of a charging station is as follows: Equation (8) in, This represents the current remaining battery percentage of the i-th charging station within K+1 prediction periods. This represents the current remaining battery percentage of the i-th charging station within K prediction periods. This represents the average rated charging power of electric vehicles in the i-th charging station. This represents the total power of the charging station calculated over K prediction periods. This indicates the current maximum upward adjustment power. Let represent the maximum current upward adjustment power of electric vehicles in the i-th charging station. Expectations This indicates that the power capacity is currently being adjusted upwards. Indicates charging efficiency. Indicates the duration of the attack detection period. Indicates the battery capacity of an electric vehicle. This represents the expected value of the electric vehicle battery capacity. When the current remaining power percentage of the charging station is greater than or equal to 0, formula (8) is used to predict the current remaining power percentage of the charging station.

[0041] The formula for predicting the current remaining battery percentage of a charging station is as follows: Equation (9) in, This represents the current remaining battery percentage of the i-th charging station within K+1 prediction periods. This represents the current remaining battery percentage of the i-th charging station within K prediction periods. This represents the average rated charging power of electric vehicles in the i-th charging station. This represents the total power of the charging station calculated over K prediction periods. This indicates the current maximum downward adjustment power. Represents the maximum current downward adjustment power of electric vehicles in the i-th charging station. Expectations This indicates that the power capacity is currently being adjusted upwards. Indicates charging efficiency. Indicates the duration of the attack detection period. Indicates the battery capacity of an electric vehicle. This represents the expected value of the electric vehicle battery capacity. When the value is less than 0, the current remaining power percentage of the charging station is predicted using formula (9).

[0042] The current upward and downward adjustable power capacity of the terminal aggregator is determined based on the current upward and downward adjustable power capacity of the charging station, the connection relationship between the terminal aggregator and the charging station, and the number of charging stations managed by the terminal aggregator. In one embodiment of this application, the current upward and downward adjustable power capacity of the terminal aggregator includes: the current upward adjustable power capacity of the terminal aggregator and the current downward adjustable power capacity of the terminal aggregator. The calculation formula for the current upward adjustable power capacity of the terminal aggregator is as follows: Equation (10) in, This indicates the current upward adjustment power capacity of the terminal aggregator, and N represents the number of charging stations managed by the terminal aggregator. This indicates the connection relationship between the terminal aggregator and the i-th charging station. =1 indicates that the terminal aggregator selects to connect with the i-th charging station. = 0 indicates that the terminal aggregator chooses not to connect to the i-th charging station. This indicates whether the i-th charging station chooses to upload its current adjustable power capacity. This indicates that the power capacity is currently being adjusted upwards.

[0043] The formula for calculating the current downward adjustment power capacity of the terminal aggregator is as follows: Equation (11) in, This indicates the current downward adjustment power capacity of the terminal aggregator, and N represents the number of charging stations managed by the terminal aggregator. This indicates the connection relationship between the terminal aggregator and the i-th charging station. =1 indicates that the terminal aggregator selects to connect with the i-th charging station. =0 indicates that the terminal aggregator chooses not to connect to the i-th charging station. This indicates whether the i-th charging station accepts the adjustment signal from the terminal aggregator. This indicates that the power capacity is currently being adjusted downwards.

[0044] In one embodiment of this application, the following is employed: Figure 1The illustrated two-layer aggregator architecture uses electric vehicle aggregators as the first layer. This first-layer aggregator selectively connects or disconnects the power lines between vehicles and the grid based on system status (or the adjustment capacity of different charging stations). Furthermore, to ensure the homogeneity of aggregation parameters across different charging stations and work areas during the statistical process, the electric vehicle group needs to be stratified according to large charging stations or specific work areas. In the second layer, a terminal aggregator manages the first-layer aggregator. Assuming multiple charging stations are potentially vulnerable to spoofed data injection attacks, the terminal aggregator can selectively connect vehicles to the grid based on the attack. Managing N charging stations simultaneously, the current up and down adjustment power capacity of the terminal aggregator is obtained.

[0045] In one embodiment of this application, after obtaining the trust score of the charging station, the electric vehicle grid-connected frequency modulation network attack detection method further includes: If the number of charging stations is less than or equal to a first preset threshold, the charging power of the electric vehicles within the charging station is determined based on the trust score of the charging station. In one embodiment of this application, the first preset threshold can be set according to actual conditions, and the first preset threshold can be set to 1. The process of determining the charging power of electric vehicles within a charging station based on its trust score includes: if the trust score is greater than or equal to a second preset threshold, the charging power of the electric vehicles within the charging station is calculated based on the total power of the charging station, the current vertical adjustment capacity of the charging station, and the current maximum vertical adjustment power of the electric vehicles; if the trust score is less than the second preset threshold but greater than or equal to a first preset threshold, the first preset capacity ratio is multiplied by the current vertical adjustment capacity of the charging station to obtain the first modified capacity of the charging station, and the charging power of the electric vehicles within the charging station is calculated based on the total power of the charging station, the first modified capacity of the charging station, and the current maximum vertical adjustment power of the electric vehicles; if the trust score is less than the first preset threshold but greater than or equal to a third preset threshold, real-time attack detection is performed on the charging station, and the second preset capacity ratio is multiplied by the current vertical adjustment capacity of the charging station to obtain the second modified capacity of the charging station, and the charging power of the electric vehicles within the charging station is calculated based on the total power of the charging station, the second modified capacity of the charging station, and the current maximum vertical adjustment power of the electric vehicles; if the trust score is less than the third preset threshold, the charging station is prohibited from providing charging services to electric vehicles.

[0046] If the number of charging stations exceeds a first preset threshold, available stations are selected from the charging stations based on their trust scores and current adjustable power capacities to obtain target charging stations. The charging power of electric vehicles within the target charging station is then determined based on its trust score. In one embodiment of this application, the process of determining the charging power of electric vehicles within the target charging station based on its trust score includes: calculating a capacity weighting value for the target charging station based on its trust score and current adjustable power capacity; adjusting the total power of the target charging station based on its capacity weighting value to obtain a changed power; adjusting the current adjustable power capacity of the target charging station based on its trust score to obtain a changed capacity; and calculating the charging power of the electric vehicles within the target charging station based on its changed power, changed capacity, and the maximum current adjustable power of electric vehicles within the target charging station.

[0047] In one embodiment of this application, after obtaining the trust score of the charging station, available stations are selected from the charging stations based on the trust score and the current up and down adjustable power capacity of the charging station to obtain the target charging station, thereby isolating abnormal nodes and maintaining the normal operation of the charging function of the target charging station.

[0048] In one embodiment of this application, the process of determining the charging power of electric vehicles within a charging station based on the station's trust score includes: If the trust score is greater than or equal to the second preset score threshold, the charging power of the electric vehicle in the charging station is calculated based on the total power of the charging station, the current vertical adjustment power capacity of the charging station, and the current maximum vertical adjustment power of the electric vehicle. In one embodiment of this application, the second preset score threshold is set according to the actual situation, and the second preset score threshold is set to 0.8. The current maximum vertical adjustment power of an electric vehicle includes both its current maximum upward adjustment power and its current maximum downward adjustment power. Similarly, the current vertical adjustment power capacity of a charging station includes both its current upward and downward adjustment power capacities. The process of calculating the charging power of electric vehicles within a charging station based on its total power, current vertical adjustment power capacity, and current maximum vertical adjustment power of the electric vehicles includes: determining whether the total power of the charging station is less than 0; if so, calculating the charging power of the electric vehicles within the charging station using the total power, current downward adjustment power capacity, and current maximum downward adjustment power of the electric vehicles; and if the total power of the charging station is greater than or equal to 0, calculating the charging power of the electric vehicles within the charging station using the total power, current upward adjustment power capacity, and current maximum upward adjustment power of the electric vehicles.

[0049] The formula for calculating the charging power of electric vehicles in a charging station is as follows: Equation (12) in, This indicates the charging power of electric vehicles within the charging station. This indicates the total power of the charging station. This indicates the current maximum upward adjustment power of the electric vehicle. This indicates the current upward adjustment power capacity of the charging station. This indicates the current maximum downward adjustment power of the electric vehicle. This indicates the current downward adjustment power capacity of the charging station.

[0050] If the trust score is less than the second preset score threshold and the trust score is greater than or equal to the first preset score threshold, then the first preset capacity ratio is multiplied by the current adjustable power capacity of the charging station to obtain the first changed capacity of the charging station. Based on the total power of the charging station, the first changed capacity of the charging station, and the current maximum adjustable power of the electric vehicle, the charging power of the electric vehicle within the charging station is calculated. In one embodiment of this application, the first preset score threshold is set according to actual conditions, and is set to 0.6. The first preset capacity ratio is also set according to actual conditions, and is set to 0.8. The calculation formula for the charging power of the electric vehicle within the charging station is as follows: Equation (13) in, This indicates the charging power of electric vehicles within the charging station. This indicates the total power of the charging station. This indicates the current maximum upward adjustment power of the electric vehicle. This indicates the current upward adjustment power capacity of the charging station. This indicates the current maximum downward adjustment power of the electric vehicle. This indicates the current downward adjustment power capacity of the charging station.

[0051] If the trust score is less than the first preset threshold and greater than or equal to the third preset threshold, real-time attack detection is performed on the charging station, and the second preset capacity ratio is multiplied by the current adjustable power capacity of the charging station to obtain the second changed capacity of the charging station. Then, based on the total power of the charging station, the second changed capacity of the charging station, and the current maximum adjustable power of the electric vehicle, the charging power of the electric vehicle within the charging station is calculated. In one embodiment of this application, the third preset threshold is set according to actual conditions, and is set to 0.4. The second preset capacity ratio is also set according to actual conditions, and is set to 0.5. The calculation formula for the charging power of the electric vehicle within the charging station is as follows: Equation (14) in, This indicates the charging power of electric vehicles within the charging station. This indicates the total power of the charging station. This indicates the current maximum upward adjustment power of the electric vehicle. This indicates the current upward adjustment power capacity of the charging station. This indicates the current maximum downward adjustment power of the electric vehicle. This indicates the current downward adjustment power capacity of the charging station.

[0052] If the trust score is less than a third preset threshold, the charging station is prohibited from providing charging services to electric vehicles. In one embodiment of this application, when the trust score is less than the third preset threshold, it indicates that the charging station is highly likely to be attacked. In this case, the charging station is untrustworthy, and therefore, the charging station is prohibited from providing charging services to electric vehicles.

[0053] In one embodiment of this application, the level of attack on the charging station is detected based on the trust score, and the charging power of the charging station is dynamically adjusted according to the level of attack on the charging station. When the trust score is less than a first preset score threshold and the trust score is greater than or equal to a third preset score threshold, the attack detection process of the charging station is triggered, so as to promptly grasp the attack situation of the charging station.

[0054] In one embodiment of this application, the process of determining the charging power of electric vehicles within a target charging station based on the trust score of the target charging station includes: Based on the trust score and the current adjustable power capacity of the target charging station, a capacity-weighted value for the target charging station is calculated. In one embodiment of this application, the formula for calculating the capacity-weighted value of the target charging station is as follows: Equation (15) in, This represents the capacity-weighted value of the j-th target charging station. This represents the trust score of the j-th target charging station. This represents the current upward adjustment power capacity of the j-th target charging station. This represents the set of target charging stations. Indicates the first exponent coefficient. The value is 1.2. This represents the second exponential coefficient. The value is 0.8.

[0055] Based on the capacity weighting value of the target charging station, the total power of the target charging station is adjusted to obtain the changed power of the target charging station. In one embodiment of this application, the formula for calculating the changed power of the target charging station includes: when the total power of the target charging station is greater than or equal to 0 and the total power of the target charging station is less than or equal to the current upward adjustment power capacity of the target charging station, or when the total power of the target charging station is less than 0 and the total power of the target charging station is less than or equal to the current downward adjustment power capacity of the target charging station, the formula for calculating the changed power of the target charging station is as follows: Equation (16) in, This represents the changed power of the j-th target charging station. This represents the capacity-weighted value of the j-th target charging station. This represents the total power of the j-th target charging station.

[0056] If the total power of the target charging station is greater than or equal to 0 and the total power of the target charging station is greater than the current upward adjustment power capacity of the target charging station, the formula for calculating the changed power of the target charging station is as follows: Equation (17) in, This represents the changed power of the j-th target charging station. This represents the capacity-weighted value of the j-th target charging station. This represents the current upward adjustment power capacity of the j-th target charging station. Indicates the overload derating factor. This represents the total power of the j-th target charging station.

[0057] When the total power of the target charging station is less than 0 and the total power of the target charging station is greater than the current downward adjustment power capacity of the target charging station, the formula for calculating the changed power of the target charging station is as follows: Equation (18) in, This represents the changed power of the j-th target charging station. This represents the capacity-weighted value of the j-th target charging station. This represents the current downward adjustment power capacity of the j-th target charging station. Indicates the overload derating factor. This represents the total power of the j-th target charging station.

[0058] Based on the trust score of the target charging station, the current upward and downward adjustable power capacity of the target charging station is adjusted to obtain the changed capacity of the target charging station. In one embodiment of this application, the process of adjusting the current upward and downward adjustable power capacity of the target charging station based on the trust score to obtain the changed capacity of the target charging station includes: if the trust score of the target charging station is greater than or equal to a second preset score threshold, then the current upward adjustable power capacity or the current downward adjustable power capacity of the target charging station is used as the changed capacity of the target charging station; if the trust score of the target charging station is less than the second preset score threshold, and the trust score is greater than or equal to a first preset score threshold, then a first preset capacity ratio is multiplied by the current upward adjustable power capacity of the target charging station, or the first preset capacity ratio is multiplied by the current downward adjustable power capacity of the target charging station to obtain the changed capacity of the target charging station.

[0059] The charging power of the electric vehicles in the target charging station is calculated based on the changed power of the target charging station, the changed capacity of the target charging station, and the current maximum vertical adjustment power of the electric vehicles in the target charging station. In one embodiment of this application, the formula for calculating the charging power of the electric vehicles in the target charging station is as follows: Equation (19) in, This indicates the charging power of electric vehicles within the target charging station. This represents the changed power of the j-th target charging station. This indicates the maximum current upward adjustment power for electric vehicles within the target charging station. This indicates the maximum current downward adjustment power for electric vehicles within the target charging station. This represents the product of the first preset capacity ratio and the current upward adjustment power capacity of the target charging station. This represents the product of the first preset capacity ratio and the current downward adjustment power capacity of the target charging station, and the product of the first preset capacity ratio and the current upward adjustment power capacity of the target charging station. Alternatively, the product of the first preset capacity ratio and the current downward adjustment power capacity of the target charging station. This refers to the changed capacity of the target charging station.

[0060] In one embodiment of this application, the process of filtering available charging stations from among the charging stations to obtain a target charging station based on the charging station's trust score and its current adjustable power capacity includes: The trust score of the charging station is compared with a first preset score threshold; and the current adjustable power capacity of the charging station is compared with the average power of the charging station. In one embodiment of this application, the average power of the charging station is determined by the total power of the charging stations and the number of charging stations. The average power of the charging station is the ratio of the total power of the charging stations to the number of charging stations. The first preset score threshold is set according to the actual situation, and is set to 0.6. If a charging station's trust score is greater than a first preset score threshold and its current adjustable power capacity is greater than its average power, then the charging station is designated as a target charging station. In one embodiment of this application, if the total power of the charging station is greater than or equal to 0, the selection formula for the target charging station is as follows: Equation (20) in, This represents the set of target charging stations. This represents the trust score of the i-th charging station. This represents the current upward adjustment power capacity of the i-th target charging station. M represents the total power of the charging station, and M represents the number of target charging stations.

[0061] In one embodiment of this application, a target charging station is obtained by filtering available charging stations from among the charging stations based on the trust score and the current adjustable power capacity of the charging station. This serves to protect the target charging station and significantly improves the overall security and operational reliability of the system.

[0062] In one embodiment of this application, if the preset attack detection model includes an encoder and a decoder, then the process of training the preset attack detection model based on sample data to obtain a network attack detection model includes: Sample data is input into the encoder to obtain encoded data; the encoded data is then input into the decoder to obtain decoded data. In one embodiment of this application, the encoder's network structure is a Long Short-Term Memory (LSTM) network, and the decoder's network structure is also a LTM network. The encoder's network structure is shown below: Equation (21) in, Represents sample data, The smallest latent feature space representing the multidimensional capacity information in the sample data. This represents a nonlinear feature mapping function from sample data to the minimum latent feature space. This represents the trainable weights in the encoder's network structure. and bias parameters .

[0063] The network structure of the decoder is shown below: Equation (22) in, The smallest latent feature space representing the multidimensional capacity information in the sample data. Represents sample data, This represents a nonlinear feature mapping function from the minimum latent feature space to the sample data. The trainable weights in the decoder's network structure and bias parameters .

[0064] With the goal of minimizing the difference between sample data and decoded data, the weight and bias parameters in the encoder and decoder are adjusted to obtain the network attack detection model. In one embodiment of this application, the expressions for the adjusted weights and parameters in the network attack detection model are as follows: Equation (23) in, This represents the adjusted weights and parameters in the network attack detection model. This represents the unadjusted weights and bias parameters of all layers in the encoder and decoder, i.e., the trainable weights in the network structure including the encoder. and bias parameters and the trainable weights in the decoder's network structure. and bias parameters T represents the total number of attack detection cycles. This represents the sample data input during the z-th attack detection cycle. This represents the decoded data output during the z-th attack detection cycle.

[0065] In one embodiment of this application, a multi-dimensional temporal analysis mechanism based on LSTM-AE (Long Short-Term Memory Autoencoder) effectively identifies bad data injection attacks within a physical rule framework, thereby improving the accuracy of attack detection.

[0066] In one embodiment of this application, the process of determining the trust score of a charging station based on detection input data and detection output data includes: The detection error of the detection input data is obtained by calculating the residual between the detection input data and the detection output data. In one embodiment of this application, the formula for calculating the residual between the detection input data and the detection output data is as follows: Equation (24) in, This represents the residual between the detection input data and the detection output data. This indicates the detection input data. This represents the adjusted weights and parameters in the network attack detection model. This indicates the detection output data. This represents the nonlinear feature mapping function from the sample data to the minimum latent feature space, and the reconstruction function between the nonlinear feature mapping function from the minimum latent feature space to the sample data.

[0067] Based on the detection error of the input data, the attack index of the charging station is calculated; and based on the attack index, the trust score of the charging station is calculated. In one embodiment of this application, the formula for calculating the attack index of the charging station is as follows: Equation (25) in, Indicates the first i Attack index of a charging station T Indicates the number of attack detection cycles. Indicates the first The detection error of each feature Indicates the first The detection output data for each feature.

[0068] In one embodiment of this application, the detection input data includes the current quantity, the current remaining battery percentage of the charging station, and the current upward and downward adjustment power capacities of the terminal aggregator, each of which is used as a feature. The detection output data also has four corresponding features.

[0069] The formula for calculating the trust score of a charging station is as follows: Equation (26) in, This represents the trust score of the i-th charging station in the k-th prediction period. This represents the trust score of the (i-1)th charging station in the (K-1)th prediction period. This represents the attack index of the i-th charging station.

[0070] In one embodiment of this application, the attack index of the charging station is calculated in real time by detecting the detection error of the input data, and after obtaining the trust score of the charging station, the trust level of the charging station is determined in real time by the trust score.

[0071] In one embodiment of this application, the process of determining the detection result of attack detection on the charging station based on the trust score includes: If the trust score is greater than or equal to a first preset score threshold, the detection result is determined to be that the charging station has not been attacked. In one embodiment of this application, the first preset score threshold is set according to the actual situation, and the first preset score threshold is set to 0.6.

[0072] If the trust score is less than a first preset score threshold, the detection result is determined to be that the charging station has been attacked. In one embodiment of this application, the first preset score threshold is set according to the actual situation, and the first preset score threshold is set to 0.6.

[0073] Figure 3 This is a flowchart illustrating another exemplary embodiment of the present application of a method for detecting network attacks on electric vehicles connected to the grid and using frequency modulation. Figure 3 The electric vehicle grid-connected frequency regulation network attack detection method includes: (1) Physical model construction stage: constructing the grid frequency dynamic equation containing electric vehicle clusters; calculating the total power of the charging station according to the droop control strategy of electric vehicle response frequency deviation, as shown in formula (1); calculating the current maximum value of electric vehicle up and down adjustment power, as shown in formula (2); (2) Detection input data calculation stage: calculating the current up and down adjustment power capacity of the charging station; predicting the current remaining power percentage of the charging station; calculating the current up and down adjustment power capacity of the terminal aggregator; (3) Attack detection stage: using the current quantity, the current remaining power percentage of the charging station and the current up and down adjustment power capacity of the terminal aggregator as detection input data, inputting them into the network attack detection model to obtain detection output data; determining the trust score of the charging station according to the detection input data and detection output data; (4) Dynamic protection stage: determining the detection result of attack detection on the charging station according to the trust score; adjusting the charging power of electric vehicles in the charging station according to the trust score.

[0074] Figure 4 This is another exemplary embodiment of the present application illustrating a service framework diagram of the physical information system between an electric vehicle and the power grid. Figure 4 In this context, the service framework of the physical information system between electric vehicles and the power grid includes: a PI controller (proportional-integral controller), an AGC (Automatic Generation Controller), generators, a droop controller, a Terminal Aggregator, a V2G Controller (vehicle-to-grid interaction controller), EV aggregators, and a Digital Twin of FRC (frequency regulation control digital twin system). The Terminal Aggregator manages multiple EV aggregators and indirectly manages charging stations, while the EV aggregators directly manage the charging stations.

[0075] In one embodiment of this application, the PI controller (proportional-integral controller) is based on a preset reference frequency of the power grid. and current charging frequency The current frequency offset between them controls the AGC to allocate and regulate power to the Generators, and the Generators output the power injected into the power plant turbine. ; offset the current frequency Input formula (1) to obtain the total power of the charging station, and use the total power of the charging station as the input of the Drop controller and send it to the V2G Controller; collect data on electric vehicle groups (current number of electric vehicles in the charging station, current remaining battery percentage of electric vehicles, etc.) and send it to the Digital Twin of FRC. The Digital Twin of FRC calculates the current remaining battery percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator according to formulas (9), (10) and (11), and sends the current remaining battery percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator to the V2G Controller; V2G The controller uses the current number of electric vehicles (EVs) in the charging station, the current remaining battery percentage, and the current up / down adjustment power capacity of the terminal aggregator as input data for network attack detection, and inputs this data into the model to obtain detection output data. Based on the input and output data, it determines the trust score of the charging station. Based on the trust score, it determines the detection result for attack detection on the charging station. Based on the trust score, it determines the charging power of the EVs in the charging station and performs V2G power dispatch based on their charging power. EV Groups charge according to the charging power of the EVs. EV aggregators calculate the total charging power of the EVs in the charging station. EV aggregators send the total charging power of the EVs in the charging station (i.e., the total power of the charging station) to the Terminal Aggregator. The Terminal Aggregator then calculates the total charging power based on the power injected by the power plant turbine. Electrical loads Total power of the charging station Disturbance power (introduced by renewable resources) A grid frequency dynamic equation incorporating electric vehicle clusters is constructed to characterize the current frequency offset of the grid and the power injected by the power plant turbines. Electrical loads Total power of the charging station (Power Grids in Area i, the power grid in area i), disturbance power (introduced by renewable resources) The relationship between them.

[0076] The power grid frequency dynamic equations involving electric vehicle clusters are shown below: Equation (27) Where H represents the inertia of the power grid operation, This represents the current frequency offset, where t represents time and D represents the damping coefficient. This indicates the power injected into the steam turbine of the power plant. Indicates electrical load. This indicates the total power of the charging station. This indicates the disturbance power.

[0077] Figure 5 This is a schematic diagram illustrating the structure of an attack detection module according to an exemplary embodiment of this application. Figure 5 The attack detection module includes a normalization module, an encoder, a decoder, and a denormalization module. The encoder and decoder both use a Long Short-Term Memory (LSTM) network. The normalization module normalizes the input data; the encoder encodes the normalized input data to obtain encoded data; the decoder decodes the encoded data to obtain decoded data; and the denormalization module performs denormalization on the decoded data to obtain the output data.

[0078] The following describes an embodiment of the apparatus described in this application, which can be used to execute the electric vehicle grid-connected frequency modulation network attack detection method described in the above embodiments of this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the electric vehicle grid-connected frequency modulation network attack detection method described above in this application.

[0079] Figure 6 This is a block diagram illustrating an exemplary embodiment of an electric vehicle grid-connected frequency modulation network attack detection device. The device can be applied to... Figure 1 The implementation environment shown is specifically configured in a terminal aggregator. This device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which this device is applicable.

[0080] like Figure 6 As shown, the exemplary electric vehicle grid-connected frequency modulation network attack detection device 600 includes: The data acquisition module 601 is used to obtain the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining percentage of the electric vehicle battery capacity.

[0081] The data processing module 602 is used to determine the current remaining power percentage of the charging station and the current up and down adjustment power capacity of the terminal aggregator based on the current frequency offset, the current quantity, and the current remaining power percentage of the electric vehicle battery. The data output module 603 is used to input the current quantity, the current remaining power percentage of the charging station, and the current up and down adjustable power capacity of the terminal aggregator as detection input data into the network attack detection model to obtain detection output data.

[0082] The result determination module 604 is used to determine the trust score of the charging station based on the detection input data and detection output data; and to determine the detection result of attack detection on the charging station based on the trust score.

[0083] In one embodiment of this application, the current frequency offset is determined based on the current charging frequency of the power grid and a preset reference frequency. The current frequency offset is the difference between the current charging frequency and the preset reference frequency. The power grid is used to supply power to the charging station, and the charging station is used to charge electric vehicles. The frequency at which the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining battery percentage of the electric vehicles are obtained are consistent with the frequency of attack detection on the charging station. That is, within one attack detection cycle, the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining battery percentage of the electric vehicles are obtained once.

[0084] In one embodiment of this application, a terminal aggregator is located in the power grid and is used to manage charging stations. The process of determining the current remaining power percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator based on the current frequency offset, the current number of charging stations, and the current remaining power percentage of the electric vehicle battery includes: determining the total power of the charging station based on the current frequency offset; obtaining the rated charging power of the electric vehicle; calculating the current maximum up / down adjustment power of the electric vehicle based on the current remaining power percentage of the electric vehicle battery and the rated charging power of the electric vehicle; calculating the current up / down adjustment power capacity of the charging station based on the current maximum up / down adjustment power and the current number of charging stations; predicting the current remaining power percentage of the charging station based on the current up / down adjustment power capacity of the charging station, the current maximum up / down adjustment power of the electric vehicle, the total power of the charging station, and the rated charging power of the electric vehicle; and determining the current up / down adjustment power capacity of the terminal aggregator based on the current up / down adjustment power capacity of the charging station, the connection relationship between the terminal aggregator and the charging station, and the number of charging stations managed by the terminal aggregator.

[0085] In one embodiment of this application, the network attack detection model is trained on a preset attack detection model based on sample data. The sample data includes: the historical number of electric vehicles in the charging station, the historical remaining battery percentage of the charging station, and the historical power adjustment capacity of the terminal aggregator. The historical number of electric vehicles in the charging station includes: the number of electric vehicles in the charging station obtained before the current attack detection period; the historical remaining battery percentage of the charging station includes: the remaining battery percentage of the charging station obtained before the current attack detection period; and the historical power adjustment capacity of the terminal aggregator includes: the power adjustment capacity data of the terminal aggregator obtained before the current attack detection period. The data on the number of electric vehicles in the charging station, the remaining battery percentage of the charging station, and the power adjustment capacity data of the terminal aggregator all originate from the same attack detection period, which can be one or more.

[0086] In one embodiment of this application, the attack detection model outputs detection output data, and the trust score of the charging station is determined based on the detection input data and the detection output data. This improves the accuracy and reliability of the trust score of the charging station, thereby improving the detection results of attack detection on the charging station.

[0087] It should be noted that the electric vehicle grid-connected frequency modulation network attack detection device and the electric vehicle grid-connected frequency modulation network attack detection method provided in the above embodiments belong to the same concept. The specific operation methods of each module and unit have been described in detail in the method embodiments and will not be repeated here. In practical applications, the electric vehicle grid-connected frequency modulation network attack detection device provided in the above embodiments can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. This is not a limitation here.

[0088] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, enable the electronic device to implement the electric vehicle grid-connected frequency modulation network attack detection method provided in the above embodiments.

[0089] Figure 7 This is a schematic diagram illustrating the structure of a computer system for an electronic device, as shown in an exemplary embodiment of this application. It should be noted that... Figure 7 The computer system 700 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0090] like Figure 7As shown, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, based on programs stored in Read-Only Memory (ROM) 702 or programs loaded from storage portion 708 into Random Access Memory (RAM) 703. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An Input / Output (I / O) interface 705 is also connected to the bus 704.

[0091] The following components are connected to I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 710 as needed so that computer programs read from it can be installed into storage section 708 as needed.

[0092] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs various functions defined in the system of this application.

[0093] Another aspect of this application provides a computer-readable storage medium storing computer-readable instructions that, when executed by a computer's processor, cause the computer to perform the electric vehicle grid-connected frequency modulation network attack detection method provided in the above embodiments. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0094] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0095] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A method for detecting network attacks on electric vehicles connected to the grid via frequency modulation, characterized in that, The method includes: The system acquires the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining battery percentage of the electric vehicles; the current frequency offset is determined based on the current charging frequency of the power grid and a preset reference frequency; the power grid is used to supply power to the charging station; the charging station is used to charge the electric vehicles. Based on the current frequency offset, the current quantity, and the current remaining power percentage of the electric vehicle battery, the current remaining power percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator are determined; the terminal aggregator is located in the power grid and is used to manage the charging station; The current number, the current remaining power percentage of the charging station, and the current up / down adjustment power capacity of the terminal aggregator are used as detection input data and input into the network attack detection model to obtain detection output data. The network attack detection model is trained on a preset attack detection model based on sample data. The sample data includes: the historical number of electric vehicles in the charging station, the historical remaining power percentage of the charging station, and the historical up / down adjustment power capacity of the terminal aggregator. Based on the detection input data and the detection output data, a trust score for the charging station is determined; based on the trust score, a detection result for attack detection of the charging station is determined.

2. The method for detecting network attacks on electric vehicle grid-connected frequency modulation networks according to claim 1, characterized in that, The process of determining the current remaining power percentage of the charging station and the current adjustable power capacity of the terminal aggregator based on the current frequency offset, the current quantity, and the current remaining power percentage of the electric vehicle battery includes: The total power of the charging station is determined based on the current frequency offset. Obtain the rated charging power of the electric vehicle, and calculate the maximum current up and down adjustment power of the electric vehicle based on the current remaining battery percentage of the electric vehicle battery and the rated charging power of the electric vehicle. Calculate the current vertical adjustment power capacity of the charging station based on the current maximum vertical adjustment power and the current quantity; Based on the current adjustable power capacity of the charging station, the current maximum adjustable power of the electric vehicle, the total power of the charging station, and the rated charging power of the electric vehicle, predict the current remaining power percentage of the charging station. Based on the current adjustable power capacity of the charging station, the connection relationship between the terminal aggregator and the charging station, and the number of charging stations managed by the terminal aggregator, the current adjustable power capacity of the terminal aggregator is determined.

3. The method for detecting network attacks on electric vehicle grid-connected frequency modulation networks according to claim 2, characterized in that, After obtaining the trust score of the charging station, the method further includes: If the number of charging stations is less than or equal to a first preset number threshold, the charging power of the electric vehicles in the charging station is determined based on the trust score of the charging station. If the number of charging stations is greater than the first preset number threshold, then based on the trust score of the charging station and the current adjustable power capacity of the charging station, available stations are selected from the charging stations to obtain target charging stations, and the charging power of electric vehicles in the target charging station is determined according to the trust score of the target charging station.

4. The method for detecting frequency modulation network attacks on electric vehicles according to claim 3, characterized in that, The process of determining the charging power of electric vehicles within the charging station based on the trust score of the charging station includes: If the trust score is greater than or equal to the second preset score threshold, then the charging power of the electric vehicle in the charging station is calculated based on the total power of the charging station, the current vertical adjustment power capacity of the charging station, and the current maximum vertical adjustment power of the electric vehicle. If the trust score is less than the second preset score threshold and the trust score is greater than or equal to the first preset score threshold, then the first preset capacity ratio is multiplied by the current up and down adjustable power capacity of the charging station to obtain the first changed capacity of the charging station, and the charging power of the electric vehicle in the charging station is calculated based on the total power of the charging station, the first changed capacity of the charging station and the current maximum up and down adjustable power of the electric vehicle. If the trust score is less than the first preset score threshold and the trust score is greater than or equal to the third preset score threshold, then the charging station is subjected to real-time attack detection and the second preset capacity ratio is multiplied by the current up and down adjustment power capacity of the charging station to obtain the second changed capacity of the charging station. Then, based on the total power of the charging station, the second changed capacity of the charging station and the current maximum up and down adjustment power of the electric vehicle, the charging power of the electric vehicle in the charging station is calculated. If the trust score is less than the third preset score threshold, the charging station is prohibited from providing charging services to the electric vehicle.

5. The method for detecting network attacks on electric vehicle grid-connected frequency modulation networks according to claim 3, characterized in that, The process of determining the charging power of electric vehicles within the target charging station based on the trust score of the target charging station includes: Based on the trust score of the target charging station and the current adjustable power capacity of the target charging station, calculate the capacity weighted value of the target charging station; Based on the capacity weighting value of the target charging station, the total power of the target charging station is adjusted to obtain the changed power of the target charging station; Based on the trust score of the target charging station, the current up and down adjustable power capacity of the target charging station is adjusted to obtain the changed capacity of the target charging station. The charging power of the electric vehicles in the target charging station is calculated based on the changed power of the target charging station, the changed capacity of the target charging station, and the current maximum vertical adjustment power of the electric vehicles in the target charging station.

6. The method for detecting network attacks on electric vehicle grid-connected frequency modulation networks according to claim 3, characterized in that, The process of selecting available charging stations from the charging stations based on their trust scores and current adjustable power capacities includes: The trust score of the charging station is compared with a first preset score threshold; and the current adjustable power capacity of the charging station is compared with the average power of the charging station; the average power of the charging station is determined by the total power of the charging station and the number of charging stations. If the trust score of the charging station is greater than the first preset score threshold and the current up / down adjustable power capacity of the charging station is greater than the average power of the charging station, then the charging station will be designated as the target charging station.

7. The method for detecting network attacks on electric vehicle grid-connected frequency modulation networks according to any one of claims 1-6, characterized in that, If the preset attack detection model includes an encoder and a decoder, then the process of training the preset attack detection model based on sample data to obtain the network attack detection model includes: The sample data is input into the encoder to obtain encoded data; and the encoded data is input into the decoder to obtain decoded data. With the goal of minimizing the difference between the sample data and the decoded data, the weight parameters and bias parameters in the encoder and the weight parameters and bias parameters in the decoder are adjusted to obtain the network attack detection model.

8. The method for detecting network attacks on electric vehicle grid-connected frequency modulation networks according to any one of claims 1-6, characterized in that, The process of determining the trust score of the charging station based on the detection input data and the detection output data includes: Calculate the residual between the detection input data and the detection output data to obtain the detection error of the detection input data; Based on the detection error of the input data, the attack index of the charging station is calculated; and based on the attack index of the charging station, the trust score of the charging station is calculated.

9. The method for detecting network attacks on electric vehicle grid-connected frequency modulation networks according to any one of claims 1-6, characterized in that, The process of determining the detection result of attack detection on the charging station based on the trust score includes: If the trust score is greater than or equal to the first preset score threshold, then the detection result is determined to be that the charging station has not been attacked; If the trust score is less than the first preset score threshold, the detection result is determined to be that the charging station has been attacked.

10. A network attack detection device for electric vehicle grid-connected frequency modulation, characterized in that, include: The data acquisition module is used to acquire the current frequency offset of the power grid, the current number of electric vehicles in the charging station, and the current remaining battery percentage of the electric vehicles; the current frequency offset is determined based on the current charging frequency of the power grid and a preset reference frequency; the power grid is used to supply power to the charging station; the charging station is used to charge the electric vehicles; The data processing module is used to determine the current remaining power percentage of the charging station and the current up / down adjustment power capacity of the terminal aggregator based on the current frequency offset, the current quantity, and the current remaining power percentage of the electric vehicle battery; the terminal aggregator is located in the power grid and is used to manage the charging station; The data output module is used to input the current quantity, the current remaining power percentage of the charging station, and the current up and down adjustable power capacity of the terminal aggregator as detection input data into the network attack detection model to obtain detection output data. The network attack detection model is obtained by training a preset attack detection model based on sample data; The sample data includes: the historical number of electric vehicles in the charging station, the historical remaining power percentage of the charging station, and the historical adjustable power capacity of the terminal aggregator. The result determination module is used to determine the trust score of the charging station based on the detection input data and the detection output data; and to determine the detection result of attack detection on the charging station based on the trust score.