Power grid false data injection attack detection method and device
By building an attack detection model focusing on topological connection relationships and electrical characteristics, and using adversarial samples for training, the robustness and adaptability of grid false data injection detection in complex attack scenarios are solved, and efficient detection of grid false data injection attacks is achieved.
Patent Information
- Application Number
- CN202510930173.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-08-08
AI Technical Summary
The prior art is difficult to effectively detect false data injection attacks in power grids in complex attack scenarios, resulting in insufficient robustness and adaptability.
By constructing an attack detection model, using grid topological information and electrical measurement data, we generate adversarial samples for training, pay attention to topological connection relationships and electrical characteristics, and use self-supervised learning to identify abnormal data.
It improves detection robustness and adaptability in complex attack scenarios, and can quickly identify target nodes of the power grid's false data injection attack.
Smart Images

Figure CN120455165A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for detecting false data injection attacks in power grids. Background Art
[0002] In recent years, with the increasing digitalization and intelligence of power systems, false data injection attacks (FDIA) in power grids have become an important risk factor threatening the safe operation of power grids.
[0003] Traditional residual detection methods struggle to cope with carefully crafted attacks. While machine learning-based detection methods have made some breakthroughs, they typically focus solely on the topological connectivity of the power grid, limiting their anomaly detection capabilities in complex attack scenarios. Therefore, improving the robustness and adaptability of false data injection detection in power grids under complex attack scenarios is an urgent issue. Summary of the Invention
[0004] Based on this, it is necessary to provide a power grid false data injection attack detection method and device that can improve the robustness and adaptability of power grid false data injection detection in complex attack scenarios in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for detecting false data injection attacks in a power grid, comprising:
[0006] Acquire first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected;
[0007] Inputting first power grid topology information and first electrical measurement data of at least one node into a trained attack detection model to obtain first electrical prediction data of at least one node;
[0008] determining a target node that is attacked by false data injection into a power grid based on first electrical measurement data and corresponding first electrical prediction data of at least one node;
[0009] Among them, the attack detection model is trained according to the following steps: obtaining the second grid topology information of the target grid and the second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes the connection relationship information of each sample node of the target grid; for each sample node, based on the system state disturbance data under the preset attack type, generating the third electrical measurement data corresponding to the sample node after the attack; based on the adversarial sample corresponding to at least one sample node and the second grid topology information, training the pre-constructed attack detection model; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
[0010] In one embodiment, based on the system state disturbance data under the preset attack type, the third electrical measurement data corresponding to the sample node after the attack is generated, including: when the preset attack type includes the standard attack type and the system state disturbance data includes the optimal system state offset direction, the third electrical measurement data corresponding to the sample node after the attack is generated according to the optimal system state offset direction and the second electrical measurement data; when the preset attack type includes the replay attack type and the system state disturbance data includes the attacked electrical measurement data at the historical moment, the third electrical measurement data corresponding to the sample node after the attack is generated according to the attacked electrical measurement data at the historical moment and the preset noise. three electrical measurement data; when the preset attack type includes a progressive attack type, and the system state disturbance data includes attack intensity data that increases with time and the system state offset direction, generate attack load data injected into the sample node according to the attack intensity data that increases with time and the system state offset direction; generate third electrical measurement data corresponding to the sample node after the attack according to the second electrical measurement data and the attack load data; when the preset attack type includes an intermittent attack type, and the system state disturbance data includes the probability of executing the attack at the target time, generate the third electrical measurement data of the sample node after the attack at the target time according to the probability of executing the attack at the target time.
[0011] In one embodiment, a pre-constructed attack detection model is trained based on an adversarial sample and second power grid topology information corresponding to at least one sample node, including: generating a fusion feature corresponding to at least one sample node based on the adversarial sample and second power grid topology information corresponding to at least one sample node; the fusion feature is obtained by fusing electrical measurement data of the sample node and connection relationship information between each sample node; obtaining second electrical prediction data corresponding to the second electrical measurement data and third electrical prediction data corresponding to the third electrical measurement data based on the fusion feature corresponding to at least one sample node; determining a first prediction loss based on the second electrical measurement data and the second electrical prediction data; determining a second prediction loss based on the third electrical measurement data and the third electrical prediction data; determining an adversarial training loss based on the second electrical prediction data and the third electrical prediction data; and training the pre-constructed attack detection model based on the first prediction loss, the second prediction loss, and the adversarial training loss.
[0012] In one embodiment, a fusion feature corresponding to at least one sample node is generated based on an adversarial sample corresponding to at least one sample node and second power grid topology information, including: determining connection relationship information between each sample node in a target power grid based on the second power grid topology information; for any sample node, determining an electrical feature corresponding to the sample node based on second electrical measurement data included in the adversarial sample of the sample node; and fusing the electrical feature corresponding to the sample node and the connection relationship information between the sample node and other sample nodes to obtain a fusion feature corresponding to the sample node.
[0013] In one embodiment, the method further includes: transforming the grid topology of the target grid according to a preset transformation method to obtain transformed second grid topology information; after obtaining the second electrical measurement data of at least one sample node in the target grid after the second grid topology information is transformed, continuing to execute the step of generating third electrical measurement data.
[0014] In one embodiment, a target node attacked by a false data injection attack on a power grid is determined based on first electrical measurement data and corresponding first electrical prediction data of at least one node, including: for any node, determining the electrical measurement data similarity based on the first electrical measurement data and corresponding first electrical prediction data of the node; and when the electrical measurement data similarity is greater than a set threshold, determining the node as a target node attacked by a false data injection attack on a power grid.
[0015] In a second aspect, the present application further provides a power grid false data injection attack detection device, comprising:
[0016] An acquisition module, configured to acquire first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected;
[0017] an input module, configured to input first power grid topology information and first electrical measurement data of at least one node into a trained attack detection model to obtain first electrical prediction data of at least one node;
[0018] a determination module, configured to determine a target node attacked by a false data injection attack on a power grid based on first electrical measurement data and corresponding first electrical prediction data of at least one node;
[0019] Among them, the attack detection model is trained according to the following steps: obtaining the second grid topology information of the target grid and the second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes the connection relationship information of each sample node of the target grid; for each sample node, based on the system state disturbance data under the preset attack type, generating the third electrical measurement data corresponding to the sample node after the attack; based on the adversarial sample corresponding to at least one sample node and the second grid topology information, training the pre-constructed attack detection model; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
[0020] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0021] Acquire first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected;
[0022] Inputting first power grid topology information and first electrical measurement data of at least one node into a trained attack detection model to obtain first electrical prediction data of at least one node;
[0023] determining a target node that is attacked by false data injection into a power grid based on first electrical measurement data and corresponding first electrical prediction data of at least one node;
[0024] Among them, the attack detection model is trained according to the following steps: obtaining the second grid topology information of the target grid and the second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes the connection relationship information of each sample node of the target grid; for each sample node, based on the system state disturbance data under the preset attack type, generating the third electrical measurement data corresponding to the sample node after the attack; based on the adversarial sample corresponding to at least one sample node and the second grid topology information, training the pre-constructed attack detection model; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
[0025] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0026] Acquire first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected;
[0027] Inputting first power grid topology information and first electrical measurement data of at least one node into a trained attack detection model to obtain first electrical prediction data of at least one node;
[0028] determining a target node that is attacked by false data injection into a power grid based on first electrical measurement data and corresponding first electrical prediction data of at least one node;
[0029] Among them, the attack detection model is trained according to the following steps: obtaining the second grid topology information of the target grid and the second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes the connection relationship information of each sample node of the target grid; for each sample node, based on the system state disturbance data under the preset attack type, generating the third electrical measurement data corresponding to the sample node after the attack; based on the adversarial sample corresponding to at least one sample node and the second grid topology information, training the pre-constructed attack detection model; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
[0030] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:
[0031] Acquire first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected;
[0032] Inputting first power grid topology information and first electrical measurement data of at least one node into a trained attack detection model to obtain first electrical prediction data of at least one node;
[0033] determining a target node that is attacked by false data injection into a power grid based on first electrical measurement data and corresponding first electrical prediction data of at least one node;
[0034] Among them, the attack detection model is trained according to the following steps: obtaining the second grid topology information of the target grid and the second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes the connection relationship information of each sample node of the target grid; for each sample node, based on the system state disturbance data under the preset attack type, generating the third electrical measurement data corresponding to the sample node after the attack; based on the adversarial sample corresponding to at least one sample node and the second grid topology information, training the pre-constructed attack detection model; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
[0035] The above-mentioned power grid false data injection attack detection method and device are used for an attack detection model for detecting power grid false data injection attacks on the power grid to be detected. The attack detection model is obtained by training based on the second power grid topology information of the target power grid and the adversarial samples generated based on the second electrical measurement data of the sample node and the corresponding third electrical measurement data after the attack. In the process of training the attack detection model, not only the topological connection relationship of the power grid is paid attention to, but also the electrical characteristics of the power grid are paid attention to, so that the attack detection model can fully explore the intrinsic correlation between the topological connection relationship of the power grid and the electrical characteristics, thereby having better robustness and adaptability when facing complex attack scenarios; and, the adversarial samples used in the process of training the attack detection model enable the attack detection model to quickly identify abnormal data through self-supervised learning, thereby further improving the robustness and adaptability when facing complex attack scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 This is a diagram of an application environment of a method for detecting false data injection attacks in a power grid according to an embodiment;
[0038] Figure 2 A schematic diagram of a flow chart of a method for detecting false data injection attacks in a power grid according to an embodiment;
[0039] Figure 3 1 is a flow chart of the steps of determining a target node in one embodiment;
[0040] Figure 4 A schematic flow chart of a method for detecting false data injection attacks in a power grid according to another embodiment;
[0041] Figure 5 A schematic flow chart of a method for detecting false data injection attacks in a power grid according to another embodiment;
[0042] Figure 6 Schematic diagram of power grid topology structures of various target power grids obtained through transformation in one embodiment;
[0043] Figure 7 A performance comparison chart of different detectors in response to standard attacks in one embodiment;
[0044] Figure 8 A scatter plot showing the performance comparison of different detectors in response to power grid data replay attacks in one embodiment;
[0045] Figure 9 A bar chart comparing the detection rates of various detectors in power systems of different sizes in one embodiment;
[0046] Figure 10 A bar chart comparing the performance of various detectors in an attack-prone power system according to an embodiment;
[0047] Figure 11 This is a structural block diagram of a power grid false data injection attack detection device according to one embodiment;
[0048] Figure 12 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0050] The power grid false data injection attack detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The terminal 102 communicates with the server 104 via a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.
[0051] In an exemplary embodiment, Figure 2 As shown, a method for detecting false data injection attacks in power grids is provided. Figure 1 The following example describes the servers in Figure 2, including S210 to S230.
[0052] S210 , obtaining first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected.
[0053] The first power grid topology information may be understood as topology structure information of the power grid to be detected.
[0054] The nodes can be understood as the busbars in the power grid to be detected, and the connection relationship information of each node can be understood as the branch connection information in the power grid to be detected.
[0055] Optionally, the first power grid topology information may include bus number information and branch connection information.
[0056] The first electrical measurement data may be understood as measurement data corresponding to at least one electrical parameter of the voltage amplitude, phase angle, line active power, and line reactive power of each node.
[0057] Among them, the voltage amplitude can be understood as the maximum value of the positive and negative half-cycle of the AC voltage; the phase angle can be understood as the phase difference between two or more signals in the circuit; the line active power can be understood as the AC power actually emitted or consumed per unit time in the line; the line reactive power can be understood as the power required to establish and maintain the electromagnetic field in the line.
[0058] In an optional embodiment, the collected original electrical measurement data may be preprocessed to obtain first electrical measurement data.
[0059] For non-periodic data, such as voltage amplitude and line active power, the standard score (Z-score) method can be used to normalize the non-periodic data. For periodic data, such as phase angle, the sine-cosine transform can be used to preserve the periodic information.
[0060] For abnormal data, you can use The law and the density-based spatial clustering of applications with noise (DBSCAN) clustering algorithm are used to identify abnormal data, and then corrections are made by eliminating or interpolating data according to the abnormal proportion.
[0061] In the specific implementation, it is also possible to check for missing data and constraints between physical variables to obtain cleaned and standardized measurement data. In the specific implementation, it is also possible to obtain the actual state X of the system, and then estimate the system state variables using the least squares method to obtain the estimated value. ;in, represents the optimal estimated system state; Represents the input raw electrical measurement data; Represents the measurement matrix, which characterizes the linear mapping relationship between the original electrical measurement data and the actual state of the system; represents the Euclidean distance; It means finding a solution that minimizes the objective function value among all possible X.
[0062] Output standardized and cleaned data set ,in is the normalized feature of the first electrical measurement data corresponding to the jth node; is the total number of first electrical measurement data. Specifically, , dimension ; is the voltage amplitude The Z-score standardized value; 、 is the voltage phase angle The transformed sine and cosine values; 、 It is the Z-score normalized value of the line active power P and line reactive power Q.
[0063] S220, inputting the first power grid topology information and the first electrical measurement data of at least one node into the trained attack detection model to obtain the first electrical prediction data of at least one node; wherein, the attack detection model is trained according to the following steps: obtaining the second power grid topology information of the target power grid, and the second electrical measurement data of at least one sample node in the target power grid; the second power grid topology information includes the connection relationship information of each sample node of the target power grid; for each sample node, generating the third electrical measurement data corresponding to the sample node after the attack according to the system state disturbance data under the preset attack type; training the pre-constructed attack detection model according to the adversarial sample corresponding to at least one sample node and the second power grid topology information; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
[0064] In an optional embodiment, before inputting the first power grid topology information into the trained attack detection model, an undirected graph of the power grid to be detected can be constructed based on the first power grid topology information. ;in, , n is a positive integer, Indicates a branch connection information collection.
[0065] Then the adjacency matrix of the power grid to be detected can be constructed based on the undirected graph .in, Indicates that there is a branch between the two buses, that is, the two nodes are connected by an edge, that is, there is a connection relationship between the two nodes; It means that there is no branch between the two buses, that is, the two nodes are not connected by an edge, that is, there is no connection relationship between the two nodes.
[0066] And, a node admittance matrix Y is constructed according to the first power grid topology information. The elements in the node admittance matrix Y can be defined as:
[0067]
[0068] in, represents the complex admittance of the branch between nodes ij; represents the shunt susceptance of node i; Indicates that the node admittance matrix is a complex matrix.
[0069] And, constructing an admittance matrix based on the first grid topology information , admittance matrix The elements in can be defined as:
[0070]
[0071] in, Represents the admittance of the i-th node, which is used to measure the total strength of the admittance between the node and its adjacent nodes; represents the node admittance matrix The element in row i and column j; represents the modulus length of the complex admittance; It means summing the modulus of the complex admittances of other nodes connected to node i.
[0072] Then, the node admittance matrix Y and the admittance matrix Constructing the electrical Laplace matrix and the normalized electrical Laplace moment :
[0073]
[0074] in, is the n-th order identity matrix.
[0075] Then, the adjacency matrix can be , admittance matrix , electrical Laplace matrix , normalized electrical Laplace moment The first electrical measurement data of at least one node is input into a trained attack detection model to obtain the first electrical prediction data of at least one node.
[0076] The training steps of the attack detection model will be described in detail later.
[0077] S230 , determining a target node attacked by false data injection into a power grid based on first electrical measurement data and corresponding first electrical prediction data of at least one node.
[0078] In an optional embodiment, for any node, the electrical data difference can be determined based on the first electrical measurement data of the node and the corresponding first electrical prediction data; and the target node attacked by false data injection into the power grid can be determined based on the electrical data difference and a preset difference threshold.
[0079] For example, nodes whose electrical data difference is greater than a preset difference threshold may be regarded as target nodes attacked by false power grid data injection.
[0080] The above-mentioned power grid false data injection attack detection method and device are used for an attack detection model for detecting power grid false data injection attacks on the power grid to be detected. The attack detection model is obtained by training based on the second power grid topology information of the target power grid and the adversarial samples generated based on the second electrical measurement data of the sample node and the corresponding third electrical measurement data after the attack. In the process of training the attack detection model, not only the topological connection relationship of the power grid is paid attention to, but also the electrical characteristics of the power grid are paid attention to, so that the attack detection model can fully explore the intrinsic correlation between the topological connection relationship of the power grid and the electrical characteristics, thereby having better robustness and adaptability when facing complex attack scenarios; and, the adversarial samples used in the process of training the attack detection model enable the attack detection model to quickly identify abnormal data through self-supervised learning, thereby further improving the robustness and adaptability when facing complex attack scenarios.
[0081] Based on the technical solutions of the above embodiments, the present application also provides another optional embodiment. In this optional embodiment, the step of determining the target node in S230 is refined.
[0082] See also Figure 3 The steps for determining the target node in include:
[0083] S310 , for any node, determining electrical measurement data similarity based on first electrical measurement data of the node and corresponding first electrical prediction data.
[0084] In an optional embodiment, the electrical measurement data similarity may be calculated based on a matrix corresponding to the first electrical measurement data of any node and a matrix corresponding to the first electrical prediction data.
[0085] S320 , when the electrical measurement data similarity is greater than a set threshold, the any node is regarded as a target node for a power grid false data injection attack.
[0086] In this embodiment, by determining the electrical measurement data similarity between the first electrical measurement data of any node and the corresponding first electrical prediction data, a target node whose electrical measurement data similarity is greater than a set threshold can be accurately determined.
[0087] The following details the training steps of the attack detection model. The training steps of the attack detection model include:
[0088] Obtain second grid topology information of the target grid and second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes connection relationship information of each sample node in the target grid. For each sample node, generate third electrical measurement data corresponding to the sample node after the attack based on system state disturbance data under a preset attack type. Train a pre-built attack detection model based on adversarial examples corresponding to the at least one sample node and the second grid topology information. For each sample node, the positive sample in the adversarial example corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial example is the third electrical measurement data of the sample node.
[0089] Among them, the process of obtaining the second grid topology information of the target grid and the second electrical measurement data of at least one sample node in the target grid is similar to the process of obtaining the first grid topology information of the grid to be detected and the first electrical measurement data of at least one node in the grid to be detected in S210 above, and will not be repeated here.
[0090] The preset attack type may include at least one of a standard attack type, a replay attack type, a progressive attack type, and an intermittent attack type.
[0091] Among them, the standard attack type can be understood as the type of attack implemented by the attacker by changing the direction of the system state deviation; the replay attack type can be understood as the type of attack implemented by the attacker by intercepting historical normal measurement data and repeatedly sending it; the progressive attack type can be understood as the type of attack implemented by the attacker by slowly injecting false data in stages, gradually pushing the system away from the normal operating state; the intermittent attack type can be understood as the type of attack implemented by the attacker by periodically or randomly starting and stopping the attack.
[0092] The system state disturbance data may be understood as disturbance data that affects the system state.
[0093] For each sample node, the second electrical measurement data of the sample node can be used as a positive sample, and the third electrical measurement data of the sample node can be used as a negative sample. The positive and negative samples corresponding to the sample node can be used as adversarial samples to train the pre-built attack detection model.
[0094] Based on the technical solutions of the above embodiments, the present application also provides another optional embodiment. In this optional embodiment, the step of generating the third electrical measurement data is refined.
[0095] Among them, according to the system state disturbance data under the preset attack type, the third electrical measurement data corresponding to the sample node after the attack is generated, including: when the preset attack type includes the standard attack type and the system state disturbance data includes the optimal system state offset direction, the third electrical measurement data corresponding to the sample node after the attack is generated according to the optimal system state offset direction and the second electrical measurement data; when the preset attack type includes the replay attack type and the system state disturbance data includes the attacked electrical measurement data at a historical moment, the third electrical measurement data corresponding to the sample node after the attack is generated according to the attacked electrical measurement data at the historical moment and the preset noise. quantity data; when the preset attack type includes a progressive attack type and the system state disturbance data includes attack intensity data that increases with time and a system state offset direction, generate attack load data injected into the sample node according to the attack intensity data that increases with time and the system state offset direction; generate third electrical measurement data corresponding to the sample node after the attack according to the second electrical measurement data and the attack load data; when the preset attack type includes an intermittent attack type and the system state disturbance data includes a probability of executing the attack at a target moment, generate the third electrical measurement data of the sample node after the attack at the target moment according to the probability of executing the attack at the target moment.
[0096] In an optional embodiment, when the preset attack type includes a standard attack type, the optimal system state offset direction can be obtained according to the following process:
[0097] In the power system, the original electrical measurement vector z and the system true state vector x satisfy the following relationship: ; Where H is the measurement matrix; e is the measurement noise.
[0098] The electrical measurement vector after the attack can be expressed as: ;in, The state offset vector introduced for the attack; The injected attack payload.
[0099] Then Minimize, and make , we can get the optimal system state deviation direction: ; Among them, the optimal system state deviation direction is the unit direction vector, and the upper limit of attack strength is .
[0100] In an optional embodiment, the direction can be shifted according to the optimal system state Can generate system state offset vector : .in, is the scaling factor, which controls the actual intensity of the attack disturbance and satisfies ; is a sparse mask vector that satisfies , the i-th element in the sparse mask vector is 1, indicating that bus i is an attack node, and 0 indicates that the node is not attacked; Represents element-wise multiplication.
[0101] Then the system state offset vector and the second electrical measurement data is substituted into In the example, the third electrical measurement data after the attack corresponding to the sample node can be obtained.
[0102] In an optional embodiment, when the preset attack type includes a replay attack type and the system state disturbance data includes attacked electrical measurement data at a historical moment, the third electrical measurement data corresponding to the sample node after the attack can be obtained according to the following formula:
[0103]
[0104] in, is the attacked electrical measurement data at the current time t, For historical moments The attacked electrical measurement data below; It is the time delay window. If it is set to 2, it means that the electrical measurement data from 2 time intervals ago will be used. is random noise.
[0105] In an optional embodiment, when the preset attack type includes a progressive attack type and the system state disturbance data includes attack intensity data increasing over time and the system state deviation direction, the third electrical measurement data corresponding to the sample node after the attack can be obtained according to the following formula:
[0106]
[0107] in, is the second electrical measurement data; This is the attack strength data that increases over time; is the system state deviation direction vector, which represents the disturbance direction of the attack in the state space; Can be used to offset the direction of the optimal system state or vectors from other feature analyses; is a vector The Euclidean norm of .
[0108] In an optional embodiment, when the preset attack type includes an intermittent attack type and the system state disturbance data includes the probability of executing the attack at the target time, the third electrical measurement data corresponding to the sample node after the attack can be obtained according to the following formula:
[0109]
[0110] in, is the decision variable for whether to execute the attack at time t; is the probability of executing the attack at time t; It is a Bernoulli distribution function that randomly returns 1 or 0, where 1 indicates "attack triggered" and 0 indicates "remain normal".
[0111] In an optional embodiment, the generated negative sample set can be output ,in Represents the generated negative sample set; is the sampling time corresponding to the i-th negative sample; For the moment The dimension of the injected attacked measurement data vector is consistent with the original electrical measurement data; N is the upper limit of the number of constructed negative samples; the negative sample set contains negative samples of at least one preset attack type.
[0112] In an optional embodiment, the adversarial samples can also be verified and labeled. Specifically, it can include: applying the measurement matrix H to perform the power system state estimation process, and obtaining the corresponding state variable estimation value. . The state estimation process must ensure that the results meet the basic physical constraints of the power system, including that the node voltage amplitude should be within a reasonable range and that the change amplitude of the voltage phase angle of each node should be controlled within the specified threshold; if the result of an attack sample after state estimation does not meet the above constraints, the sample is deemed invalid and removed from subsequent analysis. For each sample that meets the constraints, it is labeled according to its attributes. Positive samples under normal operating conditions are assigned labels , while negative samples that successfully bypass state estimation verification are given labels In addition, to enhance the interpretability and applicability of the dataset, all samples are annotated with detailed metadata, denoted as , which includes key parameters such as attack type, target bus number, and the intensity of the applied disturbance. The final form of the complete sample set is: ,in is the sampling time corresponding to the i-th sample; Represents the observation vector, no longer distinguishing between attack and normal; Indicates the label type (0 for normal, 1 for attack), used for classification learning; Indicates additional meta information, including attack type / intensity / bus number, etc.
[0113] In this embodiment, by generating the third electrical measurement data corresponding to the sample node after the attack based on the system state disturbance data under the preset attack type, negative samples under different preset attack types can be obtained, thereby enhancing the adaptability of the attack detection model to diverse attack types and enhancing the detection robustness of the attack detection model to unknown attack types.
[0114] Based on the technical solutions of the above embodiments, the present application also provides another optional embodiment, in which the training steps of the attack detection model are refined.
[0115] Among them, a pre-constructed attack detection model is trained according to the adversarial sample and the second power grid topology information corresponding to at least one sample node, including: generating a fusion feature corresponding to at least one sample node according to the adversarial sample and the second power grid topology information corresponding to at least one sample node; the fusion feature is obtained based on the fusion of the electrical measurement data of the sample node and the connection relationship information between each sample node; according to the fusion feature corresponding to at least one sample node, second electrical prediction data corresponding to the second electrical measurement data and third electrical prediction data corresponding to the third electrical measurement data are obtained; according to the second electrical measurement data and the second electrical prediction data, a first prediction loss is determined; according to the third electrical measurement data and the third electrical prediction data, a second prediction loss is determined; according to the adversarial training loss is determined according to the second electrical prediction data and the third electrical prediction data; according to the first prediction loss, the second prediction loss and the adversarial training loss, the pre-constructed attack detection model is trained.
[0116] In an optional embodiment, a feature extraction unit in the attack detection model can be used to extract features from the adversarial sample and the second power grid topology information corresponding to at least one sample node to obtain a high-dimensional representation feature vector. The attention enhancement unit in the attack detection model can then be used to enhance the features of the high-dimensional representation feature vector to obtain a fused feature corresponding to the at least one sample node. The high-dimensional representation fused feature is then reduced in dimension using the latent representation space in the attack detection model to obtain a reduced fused feature. The reduced fused feature is then decoded using a graph decoder to obtain second electrical prediction data corresponding to the second electrical measurement data and third electrical prediction data corresponding to the third electrical measurement data.
[0117] According to the first prediction loss, the second prediction loss and the adversarial training loss, the attack detection model parameters can be adjusted to obtain a trained attack detection model.
[0118] In this embodiment, based on the first prediction loss between the second electrical measurement data and the second electrical prediction data, the second prediction loss between the third electrical measurement data and the third electrical prediction data, and the adversarial training loss between the second electrical prediction data and the third electrical prediction data, the attack detection model can be trained quickly, so that the detection accuracy of the trained attack detection model is higher.
[0119] Based on the technical solutions of the above embodiments, the present application also provides another optional embodiment, in which the steps of generating fusion features are refined.
[0120] Among them, based on the adversarial sample corresponding to at least one sample node and the second power grid topology information, a fusion feature corresponding to at least one sample node is generated, including: determining the connection relationship information between each sample node in the target power grid according to the second power grid topology information; for any sample node, determining the electrical feature corresponding to the sample node according to the second electrical measurement data contained in the adversarial sample of the sample node; and fusing the electrical feature corresponding to the sample node and the connection relationship information between the sample node and other sample nodes to obtain the fusion feature corresponding to the sample node.
[0121] In this embodiment, by fusing the electrical characteristics corresponding to the sample nodes and the connection relationship information between the sample nodes and other sample nodes, the attack detection model can fully explore the intrinsic correlation between the power grid topology connection relationship and the electrical characteristics, thereby having better robustness and adaptability when facing complex attack scenarios.
[0122] Based on the technical solutions of the above-mentioned embodiments, the present application also provides another optional embodiment. In this optional embodiment, the above-mentioned power grid false data injection attack detection method also includes: transforming the power grid topology of the target power grid according to a preset transformation method to obtain the transformed second power grid topology information; after obtaining the second electrical measurement data of at least one sample node in the target power grid after the second power grid topology information is transformed, continuing to execute the step of generating the third electrical measurement data.
[0123] In an optional embodiment, the grid topology of the target grid may be transformed according to the random perturbation matrix.
[0124] In an optional embodiment, the transformed second power grid topology information may be obtained according to the following formula: ;in, , M is the random perturbation matrix, p is the perturbation probability; It is a bitwise exclusive OR operation.
[0125] After obtaining the transformed second grid topology information, the second electrical measurement data of at least one sample node in the target grid after the second grid topology information is transformed can be re-obtained according to the transformed second grid topology information, and the step of generating the third electrical measurement data can be continued.
[0126] In this embodiment, by transforming the grid topology of the target grid, the cross-topology generalization capability of the attack detection model can be improved, and attacks under different topologies can be quickly responded to and accurately detected.
[0127] Based on the technical solutions of the above embodiments, the present application also provides another optional embodiment, in which a method for detecting false data injection attacks on a power grid is described in detail.
[0128] See also Figure 4 The steps of the power grid false data injection attack detection method include:
[0129] S401, obtaining second grid topology information of a target grid and second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes connection relationship information of each sample node in the target grid.
[0130] S402 : For each sample node, generate third electrical measurement data corresponding to the sample node after being attacked according to system state disturbance data under a preset attack type.
[0131] S403: Determine, based on the second power grid topology information, connection relationship information between sample nodes in the target power grid.
[0132] S404 : For any sample node, determine the electrical feature corresponding to the sample node according to the second electrical measurement data included in the adversarial sample of the sample node.
[0133] S405 , fusing the electrical features corresponding to the sample node and the connection relationship information between the sample node and other sample nodes to obtain a fused feature corresponding to the sample node.
[0134] S406 , obtaining second electrical prediction data corresponding to the second electrical measurement data and third electrical prediction data corresponding to the third electrical measurement data according to the fusion feature corresponding to the at least one sample node.
[0135] S407, determining a first prediction loss based on the second electrical measurement data and the second electrical prediction data; determining a second prediction loss based on the third electrical measurement data and the third electrical prediction data; and determining an adversarial training loss based on the second electrical prediction data and the third electrical prediction data.
[0136] S408: Training a pre-built attack detection model according to the first prediction loss, the second prediction loss, and the adversarial training loss.
[0137] S409 , obtaining first grid topology information of the grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected.
[0138] S410 , inputting first power grid topology information and first electrical measurement data of at least one node into a trained attack detection model to obtain first electrical prediction data of at least one node.
[0139] S411 , for any node, determining electrical measurement data similarity based on first electrical measurement data of the node and corresponding first electrical prediction data.
[0140] S412 , when the electrical measurement data similarity is greater than a set threshold, the node is regarded as a target node for a power grid false data injection attack.
[0141] Based on the technical solutions of the above embodiments, the present application also provides another optional embodiment, in which a method for detecting false data injection attacks on a power grid is described in detail. Figure 5 A flow chart of a method for detecting false data injection attacks in a power grid is shown. Figure 5 The proposed method consists of four main parts: a graph encoder, a latent representation space, a graph decoder, and anomaly detection modules. The graph encoder includes an input processing unit (processing raw topological data) and a feature extraction unit (extracting features through graph convolutional layers I and II, regularized dropout layers, and batch normalization layers); the attention enhancement unit enhances the learning of important features through a self-attention mechanism; the latent representation space performs feature compression through a dimension compression layer, a joint representation layer, and an information bottleneck; the graph decoder reconstructs data through a transposed graph convolutional layer I, a graph convolutional layer II, and a residual connection layer; and finally, the anomaly detection module calculates the reconstruction error and feature error, combining an anomaly scoring function and an adaptive threshold to determine whether there is a false data injection attack.
[0142] The graph encoder is responsible for converting the input raw power grid topology data and measurement values into a compact graph representation feature, and extracting local and global structure information through a deep neural network. Among them, the input processing unit in the graph encoder preprocesses the input raw topology data and electrical measurement data of nodes (such as voltage, current, power) and constructs the adjacency matrix of the graph, outputting the feature matrix X and the adjacency matrix A. The graph convolutional layer I and graph convolutional layer II in the feature extraction unit can extract the local structure features of nodes according to the input feature matrix X and adjacency matrix A. The Dropout layer is used to prevent overfitting by randomly discarding some neurons. The batch normalization layer is used to stabilize the learning process and improve the training efficiency. Finally, the feature extraction unit can output the high-order representation of the extracted node connection relationship , where h is the output dimension of the feature layer. The attention enhancement unit in the graph encoder can extract the influence of key nodes or edges according to the high-order representation of the input node connection relationship , enhancing the important connection features. The feature fusion layer integrates the original graph structure and attention information. Finally, the attention enhancement unit can output the fused feature matrix . The latent representation space is used to compress the high-dimensional features into latent representations. The dimensionality reduction layer in the latent representation space is used to perform dimensionality reduction on using a dimensionality reduction convolution to generate the compressed feature Z. The embedding representation layer is used to generate the final latent representation , z < h. The information bottleneck mechanism is used to retain the information important for reconstruction and discard irrelevant features. Finally, the latent representation space outputs the latent feature embedding Z. The graph decoder is used to restore the original input structure and attributes as much as possible using the latent representation Z, and calculates the reconstruction error through the reconstruction result to detect anomalies. After the latent representation Z is input to the decoder input layer, the graph reconstruction unit in the graph decoder can decode the decoded latent feature embedding Z from the low-dimensional space to the original dimension according to the transposed graph convolutional layer I and transposed graph convolutional layer II. The residual connection layer is used to retain the key skip information and prevent feature loss. Finally, the graph reconstruction unit outputs the decoded feature . The output processing unit in the graph decoder is used to reverse-infer the adjacency relationship and features according to the decoded feature and the original adjacency matrix A. The detail refinement layer is used to refine the details in the decoded feature . The adjacency matrix reconstruction layer is used to obtain the reconstructed adjacency matrix . The node feature reconstruction layer is used to obtain the reconstructed node features . The output integration layer outputs the reconstructed adjacency matrix and the reconstructed node features .
[0143] The anomaly detection module is used to compare the differences between the original input and the decoded output to identify false data injection. Among them, the reconstruction error calculation layer is used to calculate according to the input original X and the reconstructed node features , calculate the reconstruction error of each node The anomaly scoring function layer is used to output the anomaly score of the target node based on the input error value E. The adaptive threshold layer can output a list of abnormal nodes. , that is, to determine which nodes are attacked by FDIA.
[0144] In an optional embodiment, the graph convolution layer in the attack detection model may include: standard graph convolution, admittance-based graph convolution, and Chebyshev graph convolution.
[0145] Among them, standard graph convolution: ; Admittance-based graph convolution: ; Chebyshev graph convolution: ,in .
[0146] Graph attention mechanisms can include: inter-node attention, multi-head attention, and feature-level attention.
[0147] Among them, the attention between nodes: ; Multi-head attention: ; Feature-level attention: .
[0148] The encoder in the attack detection model is: ; The variational encoder is: ; The decoder is: ;Define the reconstruction loss as: ; KL divergence regularization is: ; The topology-aware loss is: ; The total loss function is: .
[0149] In an optional embodiment, during the model training process, data preparation is first performed, dividing the data into training sets, validation sets, and test sets; model initialization is performed, using He to initialize weights and configuring the Adaptive Moment Estimation (Adam) optimizer; a training loop is executed, using mini-batch training, forward propagation to calculate losses, and then backpropagation to update parameters; an early stopping strategy is implemented, monitoring the validation set reconstruction error, and stopping training when the decrease is less than 0.1% for 10 consecutive rounds. In the anomaly detection process, the validation set reconstruction error statistics are calculated: and ; Set the detection threshold: ; Implement adaptive threshold mechanism: ; Use multi-scale time window analysis to comprehensively judge the reconstruction errors of short-term, medium-term and long-term time scales. In terms of anomaly location and model evaluation, calculate the node anomaly score Perform node-level anomaly location and identify abnormal nodes; analyze the anomaly propagation path and find the affected nodes connected to the abnormal node; perform performance evaluation and calculate indicators such as accuracy, precision, recall rate, F1 score, and cross-topology generalization capability.
[0150] In an optional embodiment, during the training phase, a cross-topology migration strategy may also be implemented: assuming that a set of multiple trained power grid topology graphs is , the corresponding trained model parameter set is ,in Represented in the topology diagram The parameter set obtained by training above. For the target power grid topology , calculate its difference with each training graph Structural similarity , defined as ,in is the graph edit distance, which is used to measure the difference between the structures of two graphs. is the attenuation coefficient, which is used to control the influence of distance on similarity. Then, the existing model parameters are fused by weighted average to construct the initial model parameters of the target power grid. , and its calculation formula is .in, for The structural similarity with the i-th reference image, is the model parameter corresponding to the i-th topology graph. The final It can be used as the model initialization parameter of the target power grid, and can also be directly used for migration deployment to reduce retraining overhead and improve the cross-topology adaptability of the model.
[0151] In this example, simulation tests validated the effectiveness of a method for detecting false data injection attacks in power grids. The test cases were based on IEEE 14-node, IEEE 39-node, and IEEE 118-node systems, configured with varying attack intensities and targets. By leveraging a graph autoencoder network and a generalized training strategy, the method achieved high-precision detection of FDIA and data replay attacks.
[0152] The specific configuration of the embodiment is as follows: 1. Test environment configuration: Hardware environment: Intel Core i7-9700K processor, 32GB RAM, NVIDIA GeForce RTX 2080Ti GPU. Software environment: Python 3.8, PyTorch 1.8.0, NetworkX 2.5, Matpower 7.0. Power system simulation platform: Matpower toolbox running in MATLAB R2020a environment. 2. Power grid test system configuration: IEEE 14-bus system: including 14 buses, 20 transmission lines, 5 generators, and 54 measurement points; IEEE 39-bus system: including 39 buses, 46 transmission lines, 10 generators, and 118 measurement points; IEEE 118-bus system: including 118 buses, 186 transmission lines, 54 generators, and 490 measurement points. Measurement configuration: Power injection measurement and voltage amplitude measurement are configured at each bus node, and power flow measurement is configured at both ends of each line. 3. Attack scenario configuration: (1) FDIA attack: Attack intensity: Set the state estimation deviation at four levels: 5%, 10%, 15%, and 20%. Attack target: Randomly select 10%-25% of the measurement points in the entire network as attack points. Attack vector construction: Construct an attack vector c that satisfies H·c=0 based on the DC power flow model to ensure that the residual remains unchanged after the attack. (2) Data replay attack: Time window: Set The measurement data at time t is used as the measurement data at time t. : Set to 5 minutes, 15 minutes, and 30 minutes. Attack range: Acts on the status data of all measurement points. 4. Graph Autoencoder (GAE) model configuration: (1) Graph construction: Based on the physical topology of the power grid, the undirected graph of the power grid, the initial feature vector dimension of each node is 8, including measurement values such as voltage, phase angle, active power, and reactive power. (2) Encoder structure: Input layer: number of nodes × feature dimension (8). Graph convolution layer 1: 64 hidden units, using Chebyshev polynomial approximation, order K=2. Graph convolution layer 2: 32 hidden units, activation function is ReLU. Potential representation layer: 16-dimensional potential vector. (3) Decoder structure: Fully connected layer 1: 32 hidden units, activation function is ReLU. Fully connected layer 2: 64 hidden units, activation function is ReLU. Output layer: The same dimension as the input layer, used to reconstruct the original features. 5. Training parameter configuration: Batch size: 64. Learning rate: initial value 0.001, using Adam optimizer, weight decay coefficient . Training cycle: 100 rounds for IEEE14-node system, 150 rounds for IEEE39-node system, and 200 rounds for IEEE118-node system. Loss function: Mean square error (MSE) loss, which calculates the difference between the reconstructed output and the original input. Training data split: 70% for training, 15% for validation, and 15% for testing. 6. Generalization training strategy configuration: Data enhancement: For each benchmark system, 10 different topology change configurations are generated. Topology change method: Randomly disconnect 1-3 transmission lines and adjust the generator output. Hybrid training: Mix normal operating data under different topologies for training to improve the model's adaptability to topology changes. Verification strategy: After each training cycle, use the validation set to evaluate model performance and select the best model. 7. Anomaly detection threshold configuration: Reconstruction error threshold: Reconstruct the error distribution based on the validation set and set it to. .in is the mean reconstruction error of normal samples, is the standard deviation. IEEE 14-node system threshold: 0.085. IEEE 39-node system threshold: 0.072. IEEE 118-node system threshold: 0.058. 8. Comparison method parameter configuration: FNN: 3-layer fully connected network, the number of hidden layer units is 128, 64, and 32 respectively, and the dropout rate is 0.3. CGNN: 2-layer graph convolution, the number of hidden layer units is 64 and 32 respectively, and residual connection. ARIMA: parameters , , , the time window size is 24. PCA: retains 95% of the variance information, corresponding to the number of principal components of about 12-18. OC-SVM: RBF is used as the kernel function, , IsolationForest: Number of trees: 100, subsample size: 256. 9. Evaluation metric calculation method: Detection rate = TP / (TP + FN) × 100%. False alarm rate = FP / (FP + TN) × 100%. F1-score = 2 × precision × recall / (precision + recall). Where TP is true positive, FP is false positive, TN is true negative, and FN is false negative.
[0153] Figure 6 Schematic diagrams of the grid topologies for various target grids obtained through transformation. The figure shows six different topological configurations for a 14-node power system, modeled as undirected graphs. The circles in each subgraph represent nodes (busbars) in the grid, and the lines represent the connections between nodes. Figure 7This figure compares the performance of different detectors against standard attacks. The figure shows the detection performance of five different detection methods, including Detector 1 (a feedforward neural network (FNN)), Detector 2 (a long short-term memory network (LSTM)), Detector 3 (a convolutional neural network (CNN)), Detector 4 (a graph convolutional neural network (CGNN)), and Detector 5 (the proposed graph autoencoder (GAE)), for three different IEEE power system sizes: 14-node, 39-node, and 118-node. The horizontal axis of each sub-graph represents the detection rate (DR) percentage, and the vertical axis represents the 1-false alarm rate (1-FAR) percentage. Different colored dots represent different detection methods, and the size and color of the dots also reflect the accuracy (ACC). The figure clearly shows that the proposed GAE method (black dots) performs best in all three scales. In particular, in the 118-node system, the detection rate approaches 100%, with an extremely low false alarm rate (approximately 0.4%), significantly outperforming other methods overall. The performance advantage of the GAE method becomes more pronounced as the system scale increases, demonstrating its greater adaptability and robustness in complex, large-scale power grids. This figure suggests that the detection method based on graph structure modeling and adversarial sample generation has significant advantages in detecting false data injection attacks in power grids, and is particularly suitable for large-scale power systems. Figure 8 A scatter plot comparing the performance of different detectors against power grid data replay attacks. The figure shows the performance comparison of five different detectors against data replay attacks in three different IEEE power grid systems: 14-node, 39-node, and 118-node systems. Detector 1 (FNN); Detector 2 (LSTM); Detector 3 (CNN); Detector 4 (CGNN); and Detector 5 (GAE), the proposed GAE, against data replay attacks. Each scatter plot plots the detection rate (DR) on the horizontal axis and (1-false alarm rate) (1-FAR) on the vertical axis, with a color gradient representing detection performance. The figure clearly shows that the proposed GAE method (black circles) performs best in all tested systems, achieving a 99.4% detection rate and 99.8% (1-false alarm rate) in the IEEE 118-node system. In comparison, other methods, such as CGNN (blue), perform second best, while FNN (cyan) performs the worst. This result proves that the detection method based on graph structure modeling and adversarial sample generation has significant advantages in capturing the complex spatial correlation of power grid topology, can more effectively identify data replay attacks, and provide more reliable protection for power grid security. Figure 9 The following bar chart compares the detection rates of various detectors for power systems of different sizes. The figure shows the comparison of the detection rates (DR%) of various detection methods for three different IEEE power systems of 14 nodes, 39 nodes, and 118 nodes. As can be seen from the chart, as the grid size increases from 14 to 118 nodes, the detection rates of all detection methods show an upward trend. In all test scenarios, the GAE-based method and the CGNN+AE method performed best, especially in the 118-node system, where the GAE method achieved a detection rate of nearly 100%. In contrast, traditional statistical methods such as ARIMA performed poorly across all scales, achieving the lowest detection rates. This result demonstrates that graph-based modeling methods can more effectively utilize grid topology feature information, and their performance advantages become more pronounced as the system size increases, providing a more reliable solution for detecting false data injection attacks on power grids. Figure 10 This bar chart compares the performance of various detectors in power systems under attack. The figure shows the performance comparison of seven different detectors in an attacked environment for three different IEEE power system sizes: 14 nodes, 39 nodes, and 118 nodes. The following table compares the performance of seven different detectors: Detector 1 (the ARIMA model); Detector 2 (the FNN); Detector 3 (the LSTM); Detector 4 (the CNN); Detector 5 (the Aspen Energy Analyzer (AEA)); Detector 6 (the CGNN); and Detector 7 (the RGAE model). The chart is divided into three groups: the left side shows the detection rate (DR); the middle side shows the 1-false alarm rate (1-FAR); and the right side shows the accuracy (ACC). The figure clearly shows that the performance of various detection methods generally improves as the system size increases (from 14 to 118 nodes). The RGAE-based method performs best across all system sizes, achieving a 91.3% detection rate and an 8.3% false alarm rate in the 118-node system. In contrast, traditional statistical methods such as ARIMA were most significantly affected by the attack, while deep learning methods such as CGNN performed better but still fell short of RGAE. This result demonstrates that the graph-based RGAE method has greater robustness and detection capabilities against false data injection attacks in power grids, making it particularly suitable for the security monitoring of large-scale power grid systems.
[0154] Based on the above comparison results, this application achieved a 92.2% detection rate and a 5.4% false alarm rate on a 14-node IEEE system; a 95.6% detection rate and a 2.8% false alarm rate on a 39-node IEEE system; and a 98.8% detection rate and a 0.4% false alarm rate on a 118-node IEEE system, representing an overall improvement of 10%-36% over other methods. In particular, against data replay attacks, this application achieved a 99.4% detection rate and a false alarm rate of only 0.2% in a 118-node IEEE system, significantly outperforming traditional methods.
[0155] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0156] Based on the same inventive concept, embodiments of the present application further provide a power grid false data injection attack detection device for implementing the aforementioned power grid false data injection attack detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more power grid false data injection attack detection device embodiments provided below can be found in the aforementioned limitations of the power grid false data injection attack detection method, and will not be further elaborated here.
[0157] In an exemplary embodiment, Figure 11 As shown, a power grid false data injection attack detection device is provided, comprising: an acquisition module 1101, an input module 1102, and a determination module 1103, wherein: the acquisition module 1101 is used to obtain first power grid topology information of a power grid to be detected, and first electrical measurement data of at least one node in the power grid to be detected; the first power grid topology information includes connection relationship information of each node of the power grid to be detected; the input module 1102 is used to input the first power grid topology information and the first electrical measurement data of at least one node into a trained attack detection model to obtain first electrical prediction data of at least one node; the determination module 1103 is used to determine a target node that is attacked by the power grid false data injection attack based on the first electrical measurement data of at least one node and the corresponding first electrical prediction data;
[0158] Among them, the attack detection model is trained according to the following steps: obtaining the second grid topology information of the target grid and the second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes the connection relationship information of each sample node of the target grid; for each sample node, based on the system state disturbance data under the preset attack type, generating the third electrical measurement data corresponding to the sample node after the attack; based on the adversarial sample corresponding to at least one sample node and the second grid topology information, training the pre-constructed attack detection model; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
[0159] In one embodiment, based on the system state disturbance data under the preset attack type, the third electrical measurement data corresponding to the sample node after the attack is generated, including: when the preset attack type includes the standard attack type and the system state disturbance data includes the optimal system state offset direction, the third electrical measurement data corresponding to the sample node after the attack is generated according to the optimal system state offset direction and the second electrical measurement data; when the preset attack type includes the replay attack type and the system state disturbance data includes the attacked electrical measurement data at the historical moment, the third electrical measurement data corresponding to the sample node after the attack is generated according to the attacked electrical measurement data at the historical moment and the preset noise. three electrical measurement data; when the preset attack type includes a progressive attack type, and the system state disturbance data includes attack intensity data that increases with time and the system state offset direction, generate attack load data injected into the sample node according to the attack intensity data that increases with time and the system state offset direction; generate third electrical measurement data corresponding to the sample node after the attack according to the second electrical measurement data and the attack load data; when the preset attack type includes an intermittent attack type, and the system state disturbance data includes the probability of executing the attack at the target time, generate the third electrical measurement data of the sample node after the attack at the target time according to the probability of executing the attack at the target time.
[0160] In one embodiment, a pre-constructed attack detection model is trained based on an adversarial sample and second power grid topology information corresponding to at least one sample node, including: generating a fusion feature corresponding to at least one sample node based on the adversarial sample and second power grid topology information corresponding to at least one sample node; the fusion feature is obtained by fusing electrical measurement data of the sample node and connection relationship information between each sample node; obtaining second electrical prediction data corresponding to the second electrical measurement data and third electrical prediction data corresponding to the third electrical measurement data based on the fusion feature corresponding to at least one sample node; determining a first prediction loss based on the second electrical measurement data and the second electrical prediction data; determining a second prediction loss based on the third electrical measurement data and the third electrical prediction data; determining an adversarial training loss based on the second electrical prediction data and the third electrical prediction data; and training the pre-constructed attack detection model based on the first prediction loss, the second prediction loss, and the adversarial training loss.
[0161] In one embodiment, a fusion feature corresponding to at least one sample node is generated based on an adversarial sample corresponding to at least one sample node and second power grid topology information, including: determining connection relationship information between each sample node in a target power grid based on the second power grid topology information; for any sample node, determining an electrical feature corresponding to the sample node based on second electrical measurement data included in the adversarial sample of the sample node; and fusing the electrical feature corresponding to the sample node and the connection relationship information between the sample node and other sample nodes to obtain a fusion feature corresponding to the sample node.
[0162] In one embodiment, the device further includes: transforming the grid topology of the target grid according to a preset transformation method to obtain a transformed second grid topology information; after obtaining the second electrical measurement data of at least one sample node in the target grid after the second grid topology information is transformed, continuing to execute the step of generating the third electrical measurement data.
[0163] In one embodiment, the determination module 1103 is specifically used to: for any node, determine the electrical measurement data similarity based on the node's first electrical measurement data and the corresponding first electrical prediction data; when the electrical measurement data similarity is greater than a set threshold, the node is regarded as a target node subject to a false data injection attack on the power grid.
[0164] Each module in the aforementioned power grid false data injection attack detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0165] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 12 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the first grid topology information of the power grid to be detected, the first electrical measurement data of at least one node in the power grid to be detected, the second grid topology information of the target power grid, the second electrical measurement data of at least one sample node in the target power grid, etc. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it realizes a method for detecting false data injection attacks on a power grid. Those skilled in the art will understand that Figure 12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0166] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0167] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0168] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0169] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0170] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application. The above-mentioned embodiments only express several implementation methods of the present application. The description is relatively specific and detailed, but it cannot be understood as a limitation on the scope of the patent of this application. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the attached claims.
Claims
1. A method for detecting false data injection attacks in power grids, characterized in that: The method comprises: Acquire first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected; Inputting the first power grid topology information and the first electrical measurement data of the at least one node into a trained attack detection model to obtain first electrical prediction data of the at least one node; determining a target node attacked by a false data injection attack on a power grid based on the first electrical measurement data and the corresponding first electrical prediction data of the at least one node; The attack detection model is trained according to the following steps: Acquire second grid topology information of a target grid and second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes connection relationship information of each sample node in the target grid; For each sample node, generating third electrical measurement data corresponding to the sample node after being attacked according to the system state disturbance data under the preset attack type; A pre-constructed attack detection model is trained based on the adversarial sample corresponding to the at least one sample node and the second power grid topology information; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
2. The method according to claim 1, characterized in that The step of generating the attacked third electrical measurement data corresponding to the sample node according to the system state disturbance data under the preset attack type includes: When the preset attack type includes a standard attack type and the system state disturbance data includes an optimal system state deviation direction, generating third electrical measurement data corresponding to the sample node after the attack based on the optimal system state deviation direction and the second electrical measurement data; When the preset attack type includes a replay attack type and the system state disturbance data includes attacked electrical measurement data at a historical moment, generating third electrical measurement data corresponding to the sample node after the attack based on the attacked electrical measurement data at the historical moment and preset noise; In a case where the preset attack type includes a progressive attack type, and the system state disturbance data includes attack intensity data that increases over time and a system state deviation direction, generating attack payload data injected into the sample node based on the attack intensity data that increases over time and the system state deviation direction; and generating third electrical measurement data corresponding to the sample node after the attack based on the second electrical measurement data and the attack payload data; When the preset attack type includes an intermittent attack type and the system state disturbance data includes a probability of executing the attack at a target time, third electrical measurement data of the sample node after being attacked at the target time is generated according to the probability of executing the attack at the target time.
3. The method according to claim 1, characterized in that The training of a pre-built attack detection model according to the adversarial sample corresponding to the at least one sample node and the second power grid topology information includes: generating a fusion feature corresponding to the at least one sample node based on the adversarial sample corresponding to the at least one sample node and the second power grid topology information; wherein the fusion feature is obtained by fusing electrical measurement data of the sample node and connection relationship information between each sample node; obtaining, according to the fusion feature corresponding to the at least one sample node, second electrical prediction data corresponding to the second electrical measurement data and third electrical prediction data corresponding to the third electrical measurement data; determining a first predicted loss based on the second electrical measurement data and the second electrical prediction data; determining a second predicted loss based on the third electrical measurement data and the third electrical prediction data; determining an adversarial training loss based on the second electrical prediction data and the third electrical prediction data; A pre-built attack detection model is trained according to the first prediction loss, the second prediction loss, and the adversarial training loss.
4. The method according to claim 3, characterized in that Generating a fusion feature corresponding to the at least one sample node according to the adversarial sample corresponding to the at least one sample node and the second power grid topology information includes: Determine and construct connection relationship information between each sample node in the target power grid according to the second power grid topology information; For any sample node, determine the electrical feature corresponding to the sample node based on the second electrical measurement data included in the adversarial sample of the sample node; The electrical characteristics corresponding to the sample node and the connection relationship information between the sample node and other sample nodes are fused to obtain the fusion characteristics corresponding to the sample node.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: transforming the grid topology of the target grid according to a preset transformation method to obtain transformed second grid topology information; After obtaining the second electrical measurement data of at least one sample node in the target power grid after the second power grid topology information is transformed, the step of generating the third electrical measurement data is continued.
6. The method according to any one of claims 1 to 4, characterized in that The determining, based on the first electrical measurement data and the corresponding first electrical prediction data of the at least one node, a target node attacked by a false data injection attack on a power grid includes: For any node, determining electrical measurement data similarity based on first electrical measurement data of the node and corresponding first electrical prediction data; When the similarity of the electrical measurement data is greater than a set threshold, the node is regarded as a target node for a false power grid data injection attack.
7. A power grid false data injection attack detection device, characterized in that: The device comprises: an acquisition module, configured to acquire first grid topology information of a grid to be detected and first electrical measurement data of at least one node in the grid to be detected; the first grid topology information includes connection relationship information of each node in the grid to be detected; an input module, configured to input the first power grid topology information and the first electrical measurement data of the at least one node into a trained attack detection model to obtain the first electrical prediction data of the at least one node; a determination module, configured to determine a target node attacked by a false data injection attack on a power grid based on the first electrical measurement data and the corresponding first electrical prediction data of the at least one node; The attack detection model is trained according to the following steps: Acquire second grid topology information of a target grid and second electrical measurement data of at least one sample node in the target grid; the second grid topology information includes connection relationship information of each sample node in the target grid; For each sample node, generating third electrical measurement data corresponding to the sample node after being attacked according to the system state disturbance data under the preset attack type; A pre-constructed attack detection model is trained based on the adversarial sample corresponding to the at least one sample node and the second power grid topology information; wherein, for each sample node, the positive sample in the adversarial sample corresponding to the sample node is the second electrical measurement data of the sample node, and the negative sample in the adversarial sample is the third electrical measurement data of the sample node.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Smart power grid false data injection attack detection method, terminal and storage medium
CN121887528A