A space-time detection method for false data injection attack of power grid
By combining spatial and temporal Transformer modules, a spatiotemporal Transformer network is constructed, which solves the spatiotemporal dependency problem in detecting fake data injection attacks in power grids and improves detection accuracy and performance.
Patent Information
- Application Number
- CN202310544568.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-05-15
AI Technical Summary
Existing technologies struggle to simultaneously capture the complex spatiotemporal dependencies in the power grid, resulting in low accuracy in detecting false data injection attacks in power systems. Furthermore, methods based on LSTM and GRU are limited by sequentiality, making it difficult to learn long-term sequences.
The spatial Transformer module is used to explore the local and global spatial dependencies of the power grid, and the temporal Transformer module is combined to capture the nonlinear and long-term temporal dependencies of the power grid data, and a spatiotemporal Transformer network is constructed for detection.
It improves the detection performance of fake data injection attacks in power systems, dynamically captures the hidden spatial patterns and long-term time dependencies of the power grid, and achieves more accurate detection.
Smart Images

Figure CN116578903B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of power grid false data injection attack detection, and particularly relates to a space-time detection method for power grid false data injection attack. BACKGROUND
[0002] Since false data injection attack (FDIA) can bypass traditional residual-based detection techniques, a successful FDIA can have adverse effects on the physical or economic operation of the power system. In order to ensure the protection of the power system, a large number of studies on resisting FDIA have been carried out at home and abroad.
[0003] The research on FDIA detection can be basically divided into model-based detection methods and data-driven detection methods. The model-based method does not need to observe historical data, but the detection accuracy also depends on the accuracy of the model, and the delay problem is also difficult to satisfy. The data-driven detection method does not involve the parameters and specific structure of the system in the application process, and this kind of method can detect FDIA only by using historical data. In recent years, graph neural network (GNN) has become a powerful tool for processing graph data, and a FDIA detection model based on GNN is developed in the prior art. However, most of the GNN-based models can only capture local spatial dependencies. In terms of time correlation, the methods based on LSTM and GRU are affected by their inherent sequentiality, which hinders the learning ability of long time series. In addition, most of the existing methods only consider time correlation or spatial correlation for FDIA detection. How to capture complex spatio-temporal dependency features and provide accurate FDIA detection for the entire power system is a problem worthy of study. SUMMARY
[0004] The technical problem to be solved by the present application is to provide a space-time detection method for power grid false data injection attack. The space Transformer module proposed in the present application dynamically captures hidden spatial patterns on the basis of the topology connection of the power system, so as to comprehensively consider the local and global dependency relationships of the power grid. The time Transformer module captures the nonlinear and long-term time dependency of the power grid data, so as to achieve the purpose of improving the detection performance of FDIA in the power system.
[0005] To solve the above technical problems, the technical scheme adopted by the present application is as follows: a space-time detection method for power grid false data injection attack, comprising the following steps:
[0006] Step S1, determining the input features of the false data injection attack detection model, the input features including an adjacency matrix A representing the connection relationship between the busbars of the power system and the power of each busbar node;
[0007] Step S2, establishing a space Transformer model: a fixed graph convolution layer and a space self-attention layer are applied to explore local space dependence and global space dependence respectively, and the learned local space features and global space features are fused using a gate mechanism;
[0008] Step S3, establishing a time Transformer model, capturing the time correlation features of the power grid data by assigning different time correlation weights to the input data;
[0009] Step S4, modeling the false data detection problem as a classification problem, and constructing a whole FDIA detection model based on the spatio-temporal Transformer network.
[0010] The further improvement of the technical scheme of the application is that the specific process of determining the input features of the false data injection attack detection model in step S1 is as follows:
[0011] The power grid is represented as a graph G=(V,E,A), wherein V represents a set of N buses, E is a set of branches between buses, an adjacency matrix A is obtained according to the connection relationship between the buses of the power system, if the bus nodes are directly connected, the corresponding element in A is 1; if the bus nodes are not directly connected, the corresponding element in A is 0, and the node power data of the N buses in the power grid with a time sequence length of M is regarded as a three-dimensional space-time matrix That is, a feature vector with a length of d is collected at each sampling time point of each bus, and after the three-dimensional space-time matrix Z is normalized, the input features of the model are composed in combination with the adjacency matrix of the power grid.
[0012] The further improvement of the technical scheme of the application is that the specific process of applying a fixed graph convolution layer to explore local space dependence in step S2 is as follows:
[0013] The calculation of the graph convolution is based on the Chebyshev polynomial approximation, D represents the diagonal matrix of the adjacency matrix A, I n is a unit matrix, and the symmetric normalized Laplacian matrix L is defined as L=I n -D -1 / 2 AD 1 / 2 , so as to obtain a scaled Laplacian matrix Where λ max is the maximum eigenvalue of L, the approximate output of the graph convolution based on the Chebyshev polynomial T k is written as:
[0014]
[0015] Wherein, K is the kernel size of the graph convolution, and θ is a vector of polynomial coefficients.
[0016] The further improvement of the technical solution of the present application is that the specific process of applying a spatial self-attention layer to explore global spatial dependencies in step S2 is as follows:
[0017] Firstly, the embedding features of each time step are converted, and the query vector key vector and value vector are calculated by applying a trainable linear transformation.
[0018]
[0019]
[0020]
[0021] wherein, and are the weight matrices of and respectively.
[0022] The weight of the correlation strength between the query and key matrices in the high-dimensional latent subspace is calculated The calculation method is:
[0023]
[0024] wherein, is the self-attention score between all nodes of the graph G with embedding features , that is, the global spatial dependency between the busbars of the power grid, and the obtained score is used to weight , and the weighted sum is calculated to obtain the new embedding of the node
[0025]
[0026] In addition, a three-layer feedforward network is used to further learn the nonlinear features of the nodes, which includes three hidden layers and two correction linear unit (ReLu) activation functions, and explores the interaction between feature channels to update
[0027]
[0028] A residual connection is established between the input embedding features and the features extracted by spatial self-attention and The weight matrix is for three layers; connected by another residual. The input and output of the feedforward network are summed, and the feature fusion is performed using an AND gate mechanism.
[0029] A further improvement to the technical solution of the present invention lies in the following: the process of fusing the local spatial features and global spatial features learned in step S2 using a gating mechanism is as follows:
[0030] Gate g is a graph convolutional layer and spatial self-attention layer Conclusion:
[0031]
[0032] in, and They are respectively to and Transform it into a linear projection of a one-dimensional vector by using a gate g. and Weighted output
[0033]
[0034] Output of Spatial Transformer To collect M time steps in parallel and through Input the subsequent time Transformer.
[0035] A further improvement to the technical solution of the present invention is that the specific process of establishing the time Transformer model in step S3 is as follows:
[0036] From input features and time embedding Cascade Among them G t It is a 1×1 convolutional layer that generates a d-dimensional vector for each node at each time step;
[0037] First, the time series with lengths M and d channels are... The learning process of these three subspaces, namely the query subspace, involves projecting the data onto a potential high-dimensional subspace with learnable mappings. key subspace and value subspace Represented as
[0038]
[0039]
[0040]
[0041] in, and It is a linear mapping learned. After obtaining these three potential high-dimensional subspaces, a scaling dot product function is introduced to consider z. t-M+1 ,…,z t Bidirectional time dependence in
[0042]
[0043] By weighting by time correlation Aggregation is performed to obtain temporal features;
[0044]
[0045] for Develop a shared three-layer feedforward neural network;
[0046]
[0047] Using residual connection To better learn deep networks, for each node, its output is... Therefore, by collecting all nodes The output of the time-transformer is
[0048] A further improvement to the technical solution of this invention lies in the following: In step S4, the problem of fake data detection is modeled as a classification problem, and the specific process of constructing the overall FDIA detection model based on the spatiotemporal Transformer network is as follows:
[0049] The features of each bus in the power grid at historical moments are put into a spatial Transformer layer, and then the temporal Transformer extracts the temporal features of the power grid data. The intermediate result of fusing the spatiotemporal features of the power grid is unfolded into a one-dimensional vector, which is then passed through a fully connected layer and a softmax layer to output the probability of anomalies at each node. The node with the highest probability is taken as the final detection result of the model. After the model is built, supervised training with the cross-entropy loss function is applied to calculate all the unknown parameters defined in the model.
[0050]
[0051] Where P is the number of samples, Q is the number of categories, and y iq For the sample label category, p iq Let be the probability that sample i belongs to category q.
[0052] Thanks to the adoption of the above technical solutions, the present application has achieved the following technical progress:
[0053] In order to improve the detection performance of FDIA in the power system, the present application proposes a new space-time graph neural network to dynamically model the spatial and long-term time dependence, introduces a spatial Transformer module to learn the time-varying spatial correlation of the power grid. On the basis of the topological connection of the power system, the hidden spatial mode is also dynamically captured to comprehensively consider the local and global dependence relationship of the power grid. In the time dimension, a time Transformer module is introduced to capture the nonlinear and long-term time dependence relationship of the power grid data, so as to improve the detection performance of FDIA in the power system. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1 is an illustrative architecture diagram of the space-time Transformer network of the method of the present application;
[0055] Figure 2 is a schematic diagram of the spatial Transformer structure and the spatial self-attention layer of the method of the present application;
[0056] Figure 3 is a schematic diagram of the time Transformer structure and the time self-attention layer of the method of the present application. DETAILED DESCRIPTION
[0057] The present application will be further described in detail below in combination with embodiments:
[0058] As shown in Figure 1 , the space-time detection method for false data injection attacks of the power grid proposed by the present application has the following steps:
[0059] Step S1, determine the input features of the false data injection attack detection model:
[0060] The power grid can be naturally represented as a graph G=(V,E,A), where V represents the set of N buses, and E is the set of branches between buses. The adjacency matrix A is obtained according to the connection relationship between the buses of the power system. If the bus nodes are directly connected, the corresponding element in A is 1; otherwise, it is 0. The time series length of M node power of N buses in the power grid is regarded as a three-dimensional space-time matrix , i.e. each bus at each sampling time point will collect a feature vector with a length of d. After the three-dimensional space-time matrix Z is normalized, the input features of the model are composed in combination with the adjacency matrix of the power grid.
[0061] Step S2, establish a spatial Transformer model:
[0062] As shown in Figure 2As shown, a fixed graph convolution layer and a spatial self-attention layer are applied to explore local and global components of spatial dependencies, respectively. The learned local and global spatial features are fused using a gating mechanism.
[0063] 1) Graph convolution layer
[0064] Graph convolution generalizes the classical grid-based convolution to the graph domain. Node features are aggregated from neighboring nodes according to learned weights and pre-defined graph information. The computation of graph convolution is generally based on Chebyshev polynomial approximation to reduce computational complexity. is the diagonal matrix representing the adjacency matrix A, I n is the identity matrix. The symmetrically normalized Laplacian matrix L is defined as L = I n - D -1 / 2 AD 1 / 2 , resulting in a scaled Laplacian matrix where λ max is the largest eigenvalue of L. The approximate output of graph convolution based on Chebyshev polynomial T k can be written as:
[0065]
[0066] where K is the kernel size of graph convolution and θ is the vector of polynomial coefficients. Since G is constructed based on the physical connectivity of the power grid, local spatial dependencies determined by the topology can be explicitly explored through the fixed graph convolution layer.
[0067] 2) Spatial self-attention layer
[0068] GCN-based models only model local spatial dependencies. To capture global hidden spatial dependencies, a spatial self-attention layer is proposed. This is achieved by independently computing the correlation between each pair of buses at each time step, effectively modeling global spatial dependencies between nodes.
[0069] First, the embedding features of each time step are converted into higher-level features to obtain sufficient expressive power. By applying a trainable linear transformation, the query vector key vector and value vector
[0070]
[0071]
[0072]
[0073] Here, and are the weight matrices of and respectively.
[0074] In a similar way as the encoder of Transformer, the weight is calculated as
[0075]
[0076] where is the self-attention score between all nodes of graph G with embedding features , i.e., the global spatial dependency between buses of power grid. Dot product method is adopted to reduce the computational and storage cost in calculation. Softmax is used to normalize the spatial dependency, and the scale factor prevents saturation caused by the softmax function. The resulting score is used to weight and calculate the weighted sum to get the new embedding of node
[0077]
[0078] In addition, a three-layer feedforward network is used to further learn the nonlinear features of nodes, which contains three hidden layers and two rectified linear unit (ReLu) activation functions. The explores the interaction between feature channels to update
[0079]
[0080] To prevent the degradation of neural networks, a residual connection is established between the input embedding features and the features extracted by spatial self-attention and are the weight matrices of three layers. Here, another residual connection is used to sum the input and output of the feedforward network, and the gate mechanism is used to fuse the features.
[0081] 3) Gate mechanism for feature fusion
[0082] The gate mechanism effectively fuses the learned local and global features. The gate g is derived from of the graph convolution layer and of the spatial self-attention layer.
[0083]
[0084] in, and They are respectively to and Transform it into a linear projection of a one-dimensional vector. This is done by using a gate g. and Weighted output
[0085]
[0086] Output of Spatial Transformer To collect M time steps in parallel and through Input the subsequent time Transformer.
[0087] Step S3, establish the time-based Transformer model:
[0088] like Figure 3 As shown, a temporal Transformer network entirely based on an attention mechanism was developed. Similar to the spatial Transformer, From input features and time embedding The cascade obtained, where G t It is a 1×1 convolutional layer that generates a d-dimensional vector for each node at each time step.
[0089] First, the time series with lengths M and d channels are... Projected onto a latent high-dimensional subspace with learnable mappings. The learning process for these three subspaces, namely the query subspace... key subspace and value subspace It can be represented as
[0090]
[0091]
[0092]
[0093] in and It is a linear mapping learned. After obtaining these three potential high-dimensional subspaces, we introduce a scaling dot product function to consider z. t-M+1 ,…,z t The bidirectional time dependency in [the context].
[0094]
[0095] RNN-based models are limited to considering temporal dependencies based on previous time steps, and this left-to-right architecture is suboptimal for modeling contextual dependencies. By aggregating features weighted by temporal correlations to obtain temporal features.
[0096]
[0097] To explore the interactions between latent features, a shared three-layer feedforward neural network is developed for each time step.
[0098]
[0099] Here, residual connections are adopted to better learn deep networks. For each node, its output is Therefore, by collecting the output of all nodes, the output of the temporal Transformer is
[0100] Step S4, the false data detection problem is modeled as a classification problem, and the overall model of FDIA detection based on the space-time Transformer network is constructed accordingly.
[0101] The features of each bus in the historical time grid are put into the space Transformer layer, effectively integrating the local and global spatial dependencies of the grid data. Then the time Transformer is used to extract the features of the grid data in time sequence. The intermediate results of the fusion of the grid space-time features are unfolded into a one-dimensional vector, and the probabilities of each node anomaly are output through a fully connected layer and a softmax layer. The node with the highest probability is the final detection result of the model. After the model is constructed, supervised training is applied using the cross-entropy loss function to calculate all unknown parameters defined in the model:
[0102]
[0103] where P is the number of samples, Q is the number of classes, y iq is the sample label class, and p iq is the probability that sample i belongs to class q.
Claims
1. A method for spatiotemporal detection of false data injection attacks on power grid, characterized in that: Comprising the following steps: Step S1, determining input features of the false data injection attack detection model, the input features including an adjacency matrix A representing connection relationships between busbars of the power system and power of each busbar node, and regarding time series length M node power data of N busbars in the power grid as a time-space-feature three-dimensional space-time matrix That is, a feature vector with a length of d is collected at each sampling time point of each busbar, and after the three-dimensional space-time matrix Z is normalized, the input features of the model are composed in combination with the adjacency matrix of the power grid; Step S2, establishing a space Transformer model: applying a fixed graph convolution layer and a space self-attention layer to explore local spatial dependencies and global spatial dependencies respectively, and fusing the learned local spatial features and global spatial features using a gate mechanism; The specific process of applying a fixed graph convolution layer to explore local spatial dependencies is as follows: The computation of graph convolution is based on the Chebyshev polynomial approximation. I represents the diagonal matrix of the adjacency matrix A. n As the identity matrix, the symmetric normalized Laplace matrix L is defined as L = I n -D -1 / 2 AD 1 / 2 This yields a scaled Laplace matrix. Where λ max It is the largest eigenvalue of L, based on the Chebyshev polynomial T k Approximate output of graph convolution Written as: Wherein, K is the kernel size of graph convolution, and theta is the vector of polynomial coefficients. The specific process of applying a space self-attention layer to explore global spatial dependencies is as follows: The embedding features for each time step are first transformed by applying a trainable linear transformation to compute the query vector the key vector and the value vector wherein, and are weight matrices respectively and are weight matrices respectively The weight of the correlation strength between the query and key matrices in the high-dimensional latent subspace is calculated The calculation method is: wherein is the self-attention score between all nodes of the graph G with the embedding features is the global spatial dependency between the nodes of the power grid bus, the resulting score is used to weight and the weighted sum results in the new embedding of the node In addition, a three-layer feedforward network is employed to further learn the nonlinear features of the nodes, which contains three hidden layers and two rectified linear unit (ReLu) activation functions, which are utilized to Exploring the interactions between feature channels to update between the input embedding features and the spatially self-attended features a residual connection is established and is a three-layer weight matrix; another residual connection is used to sum the input and output of the feedforward network, and the feature fusion is performed with the gating mechanism; The process of fusing the learned local spatial features and global spatial features using a gate mechanism is as follows: The gate g is derived from the and spatial self-attention layer g = tanh(Wg x + bg) wherein, and are linear projections that convert and to one-dimensional vectors, the outputs and are obtained by weighting Output of the spatial Transformer To collect the M time steps obtained in parallel And by Input the subsequent temporal Transformer; Step S3, establishing a time Transformer model to capture the time correlation features of power grid data by assigning different time correlation weights to the input data; The specific process of establishing a time Transformer model is as follows: from the input features and temporal embeddings obtained from the concatenation of where G t is a 1 x 1 convolutional layer that generates a d-dimensional vector for each node at each time step; First, time series of length M and d channels are projected into latent high-dimensional subspaces with learnable mappings, and the learning process of these three subspaces, i.e., the query subspace the key subspace and the value subspace is represented as where and are linear mappings of the learning, after obtaining the three latent high-dimensional subspaces, a scaled dot product function is introduced to consider the bidirectional temporal dependencies in Z T , By weighting by time correlation Aggregation is performed to obtain temporal features; To A shared three-layer feedforward neural network is developed; Using residual connections Better learning of deep networks, for each node, its output is Thus, by collecting all the nodes' outputs The output of the temporal Transformer is Step S4, model the false data detection problem as a classification problem, and build a FDIA detection overall model based on the space-time Transformer network accordingly. 2.The method of claim 1, wherein: The specific process of determining the input features of the false data injection attack detection model in step S1 is as follows: The power grid is represented as a graph G=(V,E,A), where V represents a set of N buses, E is a set of branches between buses, and an adjacency matrix A is obtained according to the connection relationship between the buses of the power system. If the bus nodes are directly connected, the corresponding element in A is 1; if the bus nodes are not directly connected, the corresponding element in A is 0. 3.The method of claim 1, wherein: The specific process of modeling the false data detection problem as a classification problem and constructing the overall model of the FDIA detection based on the space-time Transformer network in step S4 is as follows: The features of each bus in the historical time grid are put into the space Transformer layer, and then the time Transformer is used to extract the features of the grid data in time sequence. The intermediate result of fusing the space-time features of the grid is unfolded into a one-dimensional vector, and then a fully connected layer and a softmax layer are used to output the probability of each node being abnormal. The node with the highest probability is the final detection result of the model. After the model is constructed, the cross-entropy loss function is used for supervised training to calculate all unknown parameters defined in the model: where P is the number of samples, Q is the number of classes, y iq is the sample label class, p iq is the probability that sample i belongs to class q.
Citation Information
Patent Citations
Method for evaluating network attack resistance stability of power system by using false alarm attack model
CN111898843A
Power grid state topology collaborative false data attack defense method
CN115378699A