Power false data injection attack detection method and system based on deep learning

By introducing the long-short-term memory neural network of the multi-head self-attention mechanism into the detection model, combined with the virtual power grid simulation power flow calculation, the problem that the existing model cannot capture the serial correlation and structural complexity is solved, and the power false data injection attack detection accuracy is improved. Accuracy and efficiency.

CN118779787APending Publication Date: 2024-10-15SHANGHAI UNIVERSITY OF ELECTRIC POWER +1
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410794530.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

Existing detection models cannot fully capture sequence correlation, and the neural network structure is complex, resulting in low detection efficiency and large errors.

Method used

A long-short-term memory neural network using a multi-head self-attention mechanism is used to optimize the structure of the neural network by introducing an attention module. It uses virtual power grids to simulate power flow calculations and preprocess power data to build a false data injection attack detection model.

Benefits of technology

It reduces computational complexity, improves detection accuracy and prediction performance, effectively identifies false data injection, and avoids the problem of serial correlation not being captured in traditional models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779787A_ABST
    Figure CN118779787A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power false data injection attack detection method based on deep learning, and relates to the technical field of electric power false data injection attack detection, and the method comprises the steps: collecting an electric power data set of a power station as an original data set, and carrying out the preprocessing of the original data set; the method comprises the following steps: simulating a load flow calculation process through a virtual power grid to obtain load flow data, constructing a false data injection attack, and obtaining an attacked bad data set; and establishing a detection model by adopting a long-short-term memory neural network introduced with a multi-head self-attention mechanism, and performing attack detection on the bad data set by utilizing the detection model. According to the method, optimization is carried out for the situation that the sequence correlation cannot be noticed in a traditional LSTM, a multi-head attention mechanism is adopted, the calculation complexity is reduced, meanwhile, errors in the training process are reduced, and the prediction performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of false power data injection attack detection, and specifically to a method and system for false power data injection attack detection based on deep learning. Background Art

[0002] In the early days, the field of false data injection attack detection in the power industry mainly applied some relatively simple detection algorithms, such as K nearest neighbor classification, support vector machine, sparse logistic regression, perceptron, adaptive boosting algorithm, multi-core learning, and Bayesian reasoning. With the increase in computing power and the amount of system operation data, attack detection solutions based on deep neural networks have begun to emerge. For example, algorithms such as deep belief networks, deep feedforward neural networks, recurrent neural networks, convolutional neural networks, and long short-term memory neural networks have been applied to this field. However, the long short-term memory neural network model cannot fully capture the correlation between different parts of the sequence. In order to solve this problem, the Attention-LSTM model is used to introduce an attention module before the neural network module. Summary of the invention

[0003] In view of the above-mentioned problems, the present invention is proposed.

[0004] Therefore, the technical problem solved by the present invention is to solve the problem that the existing detection model cannot consider the sequence correlation and the neural network structure is relatively complex.

[0005] To solve the above technical problems, the present invention provides the following technical solutions: a method for detecting false data injection attacks on electric power based on deep learning, comprising: collecting the electric power data set of the power station as the original data set, and preprocessing the original data set; simulating the flow calculation process through a virtual power grid to obtain flow data, constructing a false data injection attack, and obtaining a bad data set after the attack; using a long short-term memory neural network to establish a detection model, and using the detection model to perform attack detection on the bad data set.

[0006] As a preferred solution of the deep learning-based power false data injection attack detection method described in the present invention, the preprocessing is to delete useless data segments and symbols in the original data set, retain only active power and reactive power, and group the retained data; the grouping is to group according to the periodic characteristics of the power system load, and specifically includes the following steps: according to the total amount of data, the power load type is divided into three types: residential load, commercial load, and industrial load, with a daily or weekly period, and the data of each load type is divided into different groups, and according to the impact of abnormal weather on the power system, the data during abnormal weather is marked, and the normal data changes and abnormal patterns caused by false data injection are distinguished by identifying the data characteristics under different conditions.

[0007] As a preferred solution of the power false data injection attack detection method based on deep learning described in the present invention, wherein: the flow calculation process of simulating the virtual power grid to obtain the flow data includes the following steps: the pre-processed original data set is placed in the virtual power grid for simulation, and the relationship between the measured data and the state data in the simulation process is expressed by the following formula:

[0008] z=Hx+e;

[0009] Where z is the measurement vector, z=(z1,z2,…,z m ), m is the spatial dimension of the measurement vector z; x is the state vector, x=(x1,x2,…,x n ), n is the spatial dimension of the state vector x, H is the Jacobian matrix associated with the network topology, and e is the measurement error;

[0010] Let θ ij is the phase angle difference between node i and node j, Y ij is the admittance between node i and node j, the nonlinear power flow equation is expressed by the following formula:

[0011]

[0012] Among them, P i and Q i is the active power and reactive power at a certain node; V i and V j is the voltage amplitude at different nodes;

[0013] The nonlinear power flow equation of the power system is used to minimize the difference between the measured value and the predicted value. At this time, the weighted least squares method is used to calculate the minimum error between the state vector and the measurement vector. The objective function is defined as:

[0014]

[0015] in, is the state estimate; is the minimum error between the state vector and the measurement vector; W is a diagonal matrix consisting of the inverse of the variance of each measurement error.

[0016] Obtain the state estimate based on the objective function for:

[0017]

[0018] As a preferred solution of the power false data injection attack detection method based on deep learning described in the present invention, wherein: the construction of the false data injection attack to obtain the bad data set after the attack includes the following steps: in the bad data detection link, according to the state estimation value The deviation of , select the threshold τ, and compare the measured data with the estimated residual to detect whether there is an abnormality in the current measured data. The specific formula is as follows:

[0019]

[0020] Among them, T(x) is the final check whether there is data anomaly.

[0021] The measurement data after the system receives the false data injected by the attacker is expressed as:

[0022] Z a = Z + a;

[0023] Among them, a is the false data calculated by the attacker, and Z a Substitute it in and get the estimated value of the state after injection. The specific formula is as follows:

[0024]

[0025] Define c=(H T WH) -1 H T W -1 a, then Substituting it in, we get the following result:

[0026]

[0027] Among them, T(x a ) is the data after being attacked and is used to detect whether there is data anomaly after passing through BDD; c is the measurement noise vector.

[0028] If a=Hc, the residual does not change, and BDD will not detect anomalies that should not occur in the part of the measurement data where the attacker injects false data. Unless the data in this section is abnormal before the injection, this attack will perfectly avoid BDD detection.

[0029] As a preferred solution of the deep learning-based power false data injection attack detection method described in the present invention, the long short-term memory neural network that introduces a multi-head self-attention mechanism refers to optimizing the structural composition of the traditional LSTM model, and introducing an attention module before the neural network module; the attention module uses a multi-head self-attention mechanism.

[0030] The multi-head self-attention mechanism projects the representation of each position in the input sequence into multiple subspaces, namely heads, and then calculates the attention weight in each subspace. Finally, the outputs of multiple heads are concatenated and projected into the final output space. In the multi-head self-attention mechanism, three linear transformations are required to map the input to different subspaces to form Q, K, and V. The calculation formula is as follows:

[0031] Q i =XW Qi

[0032] K i =XW Ki ;

[0033] V i =XW Vi

[0034] Where W Qi , W Ki , W VI is the learned weight matrix, and the subscript i represents the i-th attention head. Then we need to calculate the attention score:

[0035]

[0036] Among them, d k is the dimension of the attention head. Softmax normalize the attention score to get the attention weight:

[0037] Attention_weights i =Softmax(Attention(Q i ,K i )).

[0038] As a preferred solution of the power false data injection attack detection method based on deep learning described in the present invention, wherein: V is weighted summed using the attention weight to obtain the output of each position:

[0039] head i =Attention_weights i ·V i ;

[0040] Among them, the outputs of all attention heads are concatenated and then projected through a linear transformation:

[0041] MultiHead(X)=Concat(head1,head2,…,head h )W O ;

[0042] Among them, head i represents the output of the i-th attention head, W O is the final projection weight matrix, and Concat(·) is the concatenation operation.

[0043] As a preferred solution of the deep learning-based power false data injection attack detection method described in the present invention, the long short-term memory neural network includes a forget gate, an input gate and an output gate; the forget gate generates an output between 0 and 1 through a sigmoid activation function, indicating the degree of information retention at the corresponding position, 0 means complete forgetting, and 1 means complete retention; the input gate is used to determine what new information should be remembered in the current time step; the output gate determines how much information to output.

[0044] To further solve the above technical problems, the present invention provides the following technical solutions: A system suitable for determining the specific heat ratio of gas at the outlet of a gas turbine combustion chamber, comprising: an acquisition module, which uses the power data set collected daily by the power station as the original data set and preprocesses the original data set; a calculation module, which puts the preprocessed original data set into a pre-built power grid system, simulates the power flow calculation process in the smart grid, obtains power flow data, and then constructs a false data injection attack to obtain a bad data set after the attack; a detection module, which uses a long short-term memory neural network with a multi-head self-attention mechanism to establish a detection model, uses the original data set to train the detection model, and uses the swapped data set of the trained detection model to perform attack detection.

[0045] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the method for detecting false power data injection attacks based on deep learning as described above are implemented.

[0046] 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 for detecting false power data injection attacks based on deep learning as described above are implemented.

[0047] The beneficial effects of the present invention are as follows: the present invention optimizes the inability to notice sequence correlation in traditional LSTM, adopts a multi-head attention mechanism, reduces computational complexity, and at the same time reduces errors in the training process and improves prediction performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0049] Figure 1 An overall flow chart of a method for detecting false power data injection attacks based on deep learning provided in the first embodiment of the present invention.

[0050] Figure 2 A schematic diagram of a power CPS of a power false data injection attack detection method based on deep learning provided in the second embodiment of the present invention.

[0051] Figure 3 A detection model structure diagram of a method for detecting false power data injection attacks based on deep learning provided in the second embodiment of the present invention.

[0052] Figure 4 A graph showing the changing trend of the time spent on model detection of various power false data injection attack detection methods based on deep learning provided in the second embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0054] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0055] Example 1

[0056] Reference Figure 1 , is an embodiment of the present invention, and provides a method for detecting false data injection attacks in electric power based on deep learning, comprising:

[0057] S1: Collect the power data set of the power station as the original data set, and preprocess the original data set.

[0058] Specifically, the power data set collected daily by the power station is used as the original data set, and the original data set is preprocessed to delete useless data segments and symbols in the data set, only retaining active power and reactive power, and the retained data is divided into 11 groups.

[0059] Furthermore, the periodic characteristics of the power system load are used for grouping. According to the total amount of data, daily or weekly cycles can be considered. At the same time, the power load types are divided into three types: residential load, commercial load, and industrial load. The data of each load type is divided into different groups. Considering the impact of abnormal weather on the power system, the data during abnormal weather is marked. By identifying the data characteristics under different conditions, it is possible to more accurately distinguish between normal data changes and abnormal patterns caused by false data injection.

[0060] Preferably, grouping helps the model capture the differences between normal and abnormal data in different time periods, thereby improving the accuracy of FDIA detection. For example, the power usage pattern may be different on weekdays and weekends or holidays, and the power load in summer and winter may also be significantly different. By grouping based on these characteristic cycles, the model can better understand the normal fluctuation range of power data in different time periods.

[0061] S2: The flow calculation process is simulated through a virtual power grid to obtain flow data, construct a false data injection attack, and obtain a bad data set after the attack.

[0062] Furthermore, before attack detection, the processed data set needs to be placed in a pre-built power grid system to simulate the key power flow calculation process in the smart grid, obtain power flow data, and then construct a false data injection attack to obtain a bad data set after the attack. The processed data is placed in a virtual power grid for simulation, and the relationship between the measurement data and the status data can be expressed by the following formula:

[0063] z=Hx+e;

[0064] Among them, the measurement vector z=(z1,z2,…,z m ), whose spatial dimension is m, where z i It contains various power data at the same time node, such as active and reactive injection power P, Q, active and reactive power flow measurement, where P = (P1, P2, ..., K), Q = (Q1, Q2, ..., Q K ), K is the number of nodes, the state vector x=(x1,x2,…,x n ), whose spatial dimension is n, which contains the voltage phase angle θ and the voltage amplitude V, H is the Jacobian matrix related to the network topology, and e is the measurement error.

[0065] It should be noted that, assuming θ ij is the phase angle difference between node i and node j, Y ij is the admittance between node i and node j, the nonlinear power flow equation can be expressed as follows:

[0066]

[0067] Among them, P i and Q i is the active power and reactive power at a certain node; V i and V j is the voltage amplitude at different nodes.

[0068] It should be noted that the basic idea of ​​state estimation is to use the power flow equation of the power system to minimize the difference between the measured value and the predicted value. In this link, the weighted least squares method can be used to calculate the minimum error between the state vector and the measurement vector. The objective function can be defined as follows:

[0069]

[0070] in, is the state estimate; is the minimum error between the state vector and the measurement vector; W is a diagonal matrix composed of the inverse of the variance of each measurement error. According to this function, the estimated value that can be obtained is expressed as follows:

[0071]

[0072] It should be noted that in the bad data detection phase, the final state estimate is Usually some deviations will occur, so a threshold τ is selected in advance, and the measured data and the estimated residual are compared with it to detect whether there are abnormalities in the current measured data. The result expression can be expressed as follows:

[0073]

[0074] Among them, T(x) is the final check whether there is data anomaly.

[0075] It should be noted that BDD can detect whether there are abnormal parts in the measurement data. However, this has also become a loophole that attackers can cleverly exploit. Attackers can inject false data into part of the measurement data, making it bad data in the eyes of the attacker, but this part of the data is disguised as normal data during the BDD process, thus perfectly avoiding its detection algorithm. Here, the measurement data after the system receives the false data injected by the attacker is represented as Z a =Z+a, where a is the false data calculated by the attacker. a Substituting in, we can get the estimated value of the state after injection, which is expressed as follows:

[0076]

[0077] Define c=(H T WH) -1 HT W -1 a, then Substituting it in, we get the following result:

[0078]

[0079] Among them, T(x a ) is the data after being attacked and is used to detect whether there is data anomaly after passing through BDD; c is the measurement noise vector.

[0080] It should be noted that if a=Hc, the residual does not change, which will not cause BDD to detect anomalies that should not occur in part of the measurement data where the attacker injects false data. Unless the data in this section is abnormal before the injection, this attack will perfectly avoid BDD detection.

[0081] S3: A detection model is established by introducing a long short-term memory neural network with a multi-head self-attention mechanism, and the detection model is used to detect attacks on bad data sets.

[0082] Furthermore, since the traditional LSTM cannot notice the problem of sequence correlation, a multi-head self-attention mechanism is adopted and the model structure is optimized to improve the detection efficiency.

[0083] The structural composition of the traditional LSTM model is optimized. Before the neural network module, the model with the attention module is introduced. By introducing the attention mechanism into the LSTM, the model can better handle long-term dependencies and complex relationships between different parts of the sequence, thereby improving the performance of the model in processing sequence data tasks.

[0084] In the Attention-LSTM model, the attention module uses a multi-head self-attention mechanism. The basic idea of ​​the multi-head self-attention mechanism is to project the representation of each position in the input sequence into multiple subspaces (called heads), then calculate the attention weight in each subspace, and finally concatenate the outputs of multiple heads and project them into the final output space. By introducing multiple heads, the model can learn different features and relationships in different representation subspaces, thereby improving the generalization and expression capabilities of the model. In this mechanism, three linear transformations are required to map the input to different subspaces to form Q (Query), K (Key), and V (Value). The calculation formula is as follows:

[0085] Q i =XW Qi

[0086] K i =XW Ki ;

[0087] V i =XW Vi

[0088] Where W Qi , W Ki , W Vi is the learned weight matrix, and the subscript i represents the i-th attention head. Then we need to calculate the attention score:

[0089]

[0090] Among them, d k is the dimension of the attention head. Softmax normalize the attention score to get the attention weight:

[0091] Attention_weights i =Softmax(Attention(Q i ,K i ));

[0092] It is worth noting that the attention weights need to be used to perform a weighted summation on V to obtain the output at each position:

[0093] head i =Attention_weights i ·V i ;

[0094] The outputs of all attention heads are concatenated and then projected through a linear transformation:

[0095] MultiHead(X)=Concat(head1,head2,…,head h )W O ;

[0096] Among them, head i represents the output of the i-th attention head, W O is the final projection weight matrix, and Concat(·) is the concatenation operation.

[0097] In the neural network module, LSTM introduces a new component called "memory unit", which is responsible for storing and outputting information. Through a series of gating structures, LSTM can effectively control the flow of information, thereby alleviating the problems of gradient vanishing and gradient exploding in traditional RNN. Specifically, LSTM contains three main gating mechanisms: forget gate, input gate, and output gate.

[0098] It is worth noting that the forget gate determines which information in the previous memory state should be retained and which should be forgotten. It generates an output between 0 and 1 through a sigmoid activation function, indicating the degree of information retention at the corresponding position. 0 means complete forgetting and 1 means complete retention. The input gate is responsible for deciding what new information should be remembered at the current time step. Similar to the forget gate, the input gate also generates an output between 0 and 1 through a sigmoid activation function to determine which information should be added to the memory unit. The output gate determines how much information is output from the memory unit. An output between 0 and 1 is generated through a sigmoid activation function, and this output is multiplied by the memory state after tanh activation of the memory unit to finally generate the output of the LSTM unit. The operation rules within each memory unit can be expressed as follows:

[0099] f t =σ(W f ·[h t-1 ,x t ]+b f ) (Forget Gate)

[0100] i t =σ(W i ·[h t-1 ,x t ]+b i ) (Input Gate)

[0101]

[0102] o t =σ(W o ·[h t-1 ,x t ]+b o ) (left out of the door)

[0103] h t =o t ⊙tanh(C t )(Update hidden state)

[0104] where f t is the output of the forget gate, i t is the output of the input gate, is the output of the candidate memory cell, C t is the final memory unit, o t is the output of the output gate, h t is the final hidden state, σ represents the sigmoid function, and ⊙ represents vector element multiplication.

[0105] In summary, the present invention optimizes the inability to notice sequence correlation in traditional LSTM and adopts a multi-head attention mechanism to reduce computational complexity, while reducing errors in the training process and improving prediction performance.

[0106] Example 2

[0107] Reference Figure 2-Figure 3 , is an embodiment of the present invention, and provides a power false data injection attack detection system based on deep learning, including: an acquisition module, which uses the power data set collected daily by the power station as the original data set and preprocesses the original data set; a calculation module, which puts the preprocessed original data set into a pre-built power grid system, simulates the power flow calculation process in the smart grid, obtains power flow data, and then constructs a false data injection attack to obtain a bad data set after the attack; a detection module, which uses a long short-term memory neural network with a multi-head self-attention mechanism to establish a detection model, uses the original data set to train the detection model, and uses the swapped data set of the trained detection model to perform attack detection.

[0108] Example 3

[0109] It is an embodiment of the present invention, which is different from the previous embodiment in that:

[0110] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.

[0111] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0112] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0113] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0114] Example 4

[0115] As an embodiment of the present invention, a method for detecting false data injection attacks on electric power based on deep learning is provided. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0116] Reference Figure 2 to Figure 4 , which is an embodiment of the present invention, provides a method for detecting false data injection attacks on electric power based on deep learning. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.

[0117] like Figure 4 As shown in the figure, the time cost of the five detection methods increases with the length of the input sequence. The time cost of the simpler CNN, RNN and LSTM is basically proportional to the complexity of the neural network construction because they do not use a composite structure of multiple modules. The time cost curve of the CNN-LSTM and Attention-LSTM that use multiple modules is relatively stable in the first half, and gradually shows a slow exponential rise in the second half.

[0118] Taking into account the reason for the introduction of the attention module, Attention-LSTM sacrifices a small time overhead in exchange for a more obvious detection accuracy, which shows the feasibility and effectiveness of the model in the field of FDIA detection.

[0119] The experiment was conducted on a dataset of more than 60,000 continuous time period data from Germany's IHEPCDS. The experimental steps were divided into dataset preprocessing, environment construction, detection model training and experimental result evaluation. The final experimental results showed that there was a significant improvement on this dataset compared with other traditional deep learning methods.

[0120] A variety of deep learning methods are selected for comparison with the method of the present invention. Among them, CNN, RNN, LSTM and CNN-LSTM are four common architectures, each of which is suitable for different types of sequence data processing tasks. The test data are shown in Table 1.

[0121] Table 1 Test data table

[0122] method Accuracy Accuracy Recall F-number CNN 0.862 0.859 0.865 0.851 RNN 0.897 0.906 0.903 0.893 LSTM 0.913 0.911 0.921 0.906 CNN-LSTM 0.918 0.926 0.922 0.911 Attention-LSTM 0.931 0.935 0.923 0.927

[0123] After comparing various detection methods, it can be clearly found that the prediction accuracy of the method model of the present invention is generally better than other deep learning methods. To a certain extent, it solves the problem of serial correlation of false data in smart grids.

[0124] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A power false data injection attack detection method based on deep learning, characterized in that: include: Collecting a power data set of a power station as an original data set, and preprocessing the original data set; Through the virtual power grid simulation flow calculation process, the flow data is obtained, and a false data injection attack is constructed to obtain a bad data set after the attack; A detection model is established by introducing a long short-term memory neural network with a multi-head self-attention mechanism, and the detection model is used to perform attack detection on bad data sets.

2. The method for detecting false power data injection attacks based on deep learning according to claim 1, characterized in that: The preprocessing is to delete useless data segments and symbols in the original data set, retain only active power and reactive power, and group the retained data; The grouping is performed by utilizing the periodic characteristics of the power system load, and specifically includes the following steps: According to the total amount of data, the power load types are divided into three types: residential load, commercial load, and industrial load, with daily or weekly cycles. The data of each load type is divided into different groups. According to the impact of abnormal weather on the power system, the data during abnormal weather is marked. By identifying the data characteristics under different conditions, normal data changes and abnormal patterns caused by false data injection can be distinguished.

3. The method for detecting false data injection attacks on electric power based on deep learning as claimed in claim 2, characterized in that: The process of simulating the flow calculation through the virtual power grid to obtain the flow data includes the following steps: The pre-processed raw data set is put into the virtual power grid for simulation. The relationship between the measured data and the state data in the simulation process is expressed by the following formula: z=Hx+e; Where z is the measurement vector, z=(z1,z2,…,z m ), m is the spatial dimension of the measurement vector z; x is the state vector, x=(x1,x2,…,x n ), n is the spatial dimension of the state vector x, H is the Jacobian matrix associated with the network topology, and e is the measurement error; Let θ ij is the phase angle difference between node i and node j, Y ij is the admittance between node i and node j, the nonlinear power flow equation is expressed by the following formula: Among them, P i and Q i is the active power and reactive power at a certain node; V i and V j is the voltage amplitude at different nodes; The nonlinear power flow equation of the power system is used to minimize the difference between the measured value and the predicted value. At this time, the weighted least squares method is used to calculate the minimum error between the state vector and the measurement vector. The objective function is defined as: in, is the state estimate; is the minimum error between the state vector and the measurement vector; W is a diagonal matrix consisting of the inverse of the variance of each measurement error; Obtain the state estimate based on the objective function for:

4. The method for detecting false power data injection attacks based on deep learning as claimed in claim 3, characterized in that: The construction of the false data injection attack to obtain the bad data set after the attack includes the following steps: In the bad data detection phase, according to the state estimation value The deviation of , select the threshold τ, and compare the measured data with the estimated residual to detect whether there is an abnormality in the current measured data. The specific formula is as follows: Among them, T(x) is the final check whether there is data anomaly; The measurement data after the system receives the false data injected by the attacker is expressed as: From a =Z+a; Among them, a is the false data calculated by the attacker, and Z a Substitute it in and get the estimated value of the state after injection. The specific formula is as follows: Define c=(H T WH) -1 H T W -1 a, then Substituting it in, we get the following result: Among them, T(x a ) is the data after the attack to detect whether there is data anomaly after BDD; c is the measurement noise vector; If a=Hc, the residual does not change, and BDD will not detect anomalies that should not occur in the part of the measurement data where the attacker injects false data. Unless the data in this section is abnormal before the injection, this attack will perfectly avoid BDD detection.

5. The method for detecting false power data injection attacks based on deep learning according to claim 4, characterized in that: The long short-term memory neural network that introduces a multi-head self-attention mechanism refers to optimizing the structural composition of the traditional LSTM model, introducing an attention module before the neural network module; the attention module uses a multi-head self-attention mechanism; The multi-head self-attention mechanism projects the representation of each position in the input sequence into multiple subspaces, namely heads, and then calculates the attention weight in each subspace. Finally, the outputs of multiple heads are concatenated and projected into the final output space. In the multi-head self-attention mechanism, three linear transformations are required to map the input to different subspaces to form Q, K, and V. The calculation formula is as follows: Where W Qi , W Ki , W Vi is the learned weight matrix, and the subscript i represents the i-th attention head. Then we need to calculate the attention score: Among them, d k is the dimension of the attention head. Softmax normalize the attention score to get the attention weight: Attention_weights i =Softmax(Attention(Q i ,K i ))。 6. The method for detecting false power data injection attacks based on deep learning according to claim 5, characterized in that: Use the attention weight to perform a weighted summation on V to get the output for each position: head i =Attention_weights i ·V i ; Among them, the outputs of all attention heads are concatenated and then projected through a linear transformation: MultiHead(X)=Concat(head1,head2,…,head h )W O ; Among them, head i represents the output of the i-th attention head, W O is the final projection weight matrix, and Concat(·) is the concatenation operation.

7. The method for detecting false data injection attacks on electric power based on deep learning as claimed in claim 6, characterized in that: The LSTM neural network includes a forget gate, an input gate, and an output gate; The forget gate generates an output between 0 and 1 through a sigmoid activation function, indicating the degree of information retention at the corresponding position, 0 means complete forgetting, and 1 means complete retention; The input gate is used to decide what new information should be remembered at the current time step; The output gate determines how much information is output.

8. A system using the power false data injection attack detection method based on deep learning as described in any one of claims 1 to 7, characterized in that: include: The acquisition module takes the power data set collected daily by the power station as the original data set and pre-processes the original data set; The calculation module puts the pre-processed raw data set into the pre-built power grid system, simulates the power flow calculation process in the smart grid, obtains the power flow data, and then constructs a false data injection attack to obtain a bad data set after the attack; The detection module uses a long short-term memory neural network with a multi-head self-attention mechanism to establish a detection model, uses the original data set to train the detection model, and uses the swapped data set of the trained detection model to perform attack detection.

9. 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 power false data injection attack detection method based on deep learning described in any one of claims 1 to 7 are implemented.

10. 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 power false data injection attack detection method based on deep learning described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • False data injection attack detection and positioning method based on TGRU model

    CN119272205A

  • False Data Injection Attack Detection and Location Method Based on TGRU Model

    CN119272205B

  • FDI attack detection method for wind power plant power prediction

    CN120045892A

  • A fdi attack detection method for wind farm power prediction

    CN120045892B

  • Black box adversarial false data injection attack modeling method and device for improving robustness of detection model

    CN120524483A