Smart grid data injection attack method and device for improving robustness of detection model
By constructing a spatiotemporal correlation generation module and an attack selection matrix using the WGAN-GP model, highly concealed fake data attack vectors are generated, solving the detection challenge of smart grids with high penetration of renewable energy and improving the robustness and security of the detection model.
Patent Information
- Application Number
- CN202511261835.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-09-05
AI Technical Summary
Existing detection methods are insufficient to effectively detect spoofed data injection attacks in smart grid environments with high penetration of renewable energy, thus threatening grid security.
A spatiotemporal covert attack generation method based on the WGAN-GP model is adopted. By constructing a spatiotemporal correlation generation module and an attack selection matrix, a covert fake data attack vector is generated, and the detection model is jointly optimized with the normal operation data of renewable energy grid connection scenarios.
It enhances the detection model's perception and resilience in environments with a high proportion of renewable energy access, significantly improves the accuracy of identifying unknown or dynamic risks and the effectiveness of system protection, and provides more comprehensive technical support.
Smart Images

Figure CN120750672B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of smart grid data security, specifically relating to a method and apparatus for improving the robustness of detection models against smart grid data injection attacks. Background Technology
[0002] In recent years, with the development of the Industrial Internet of Things (IIoT) and smart sensors, power systems are undergoing tremendous changes. The integration of information and communication technologies (ICT) enables Supervisory Control and Data Acquisition (SCADA) systems to remotely monitor and control the operation of power systems. However, vulnerabilities in network components have also emerged. This poses a challenge to the secure and stable operation of power systems—they are vulnerable to cyberattacks. Attackers exploit these vulnerabilities to manipulate system parameters, damage underlying infrastructure, and cause various physical and economic losses. As a critical infrastructure, the network and data security of power systems is directly related to the continuity of energy supply and the stable development of the socio-economic system.
[0003] During power system operation, SCADA systems collect massive amounts of measurement data through RTUs, heterogeneous communication networks, and the control center's local area network. This data serves as the core basis for the control center's state estimation and decision-making, making its integrity and accuracy crucial. Security vulnerabilities in data transmission or storage can distort state estimation results, thereby affecting the energy management system's (EMS) operational control functions and posing a potential threat to the safe and stable operation of the power system. Power grid security remains a core issue in the energy sector. Among various cybersecurity risks, False Data Injection (FDIA) attacks, due to their high degree of concealment and ability to circumvent traditional Bad Data Detection (BDD) mechanisms, have become a key risk type requiring focused prevention. This type of risk, through malicious interference with physical quantity measurement data, can mislead system decisions; therefore, establishing a comprehensive defense mechanism is of great significance for ensuring power system data security. In typical cyberattacks, FDIA attacks have attracted greater attention because they easily bypass BDD to alter system measurements. They collaboratively manipulate measuring instruments for various physical quantities, misleading the results of state estimations.
[0004] The research field of False Data Injection (FDIAs) exhibits a dynamic development trend of offensive and defensive confrontation. In this process, many researchers are constantly innovating, proposing various new FDIAs based on existing attack methods, aiming to construct more destructive attack vectors at a lower cost. Meanwhile, defenders are focusing on in-depth research into the prevention, detection, proliferation patterns, and interception methods of FDIAs, striving to identify attacks more accurately and effectively block their propagation paths.
[0005] Meanwhile, with the rapid development and excellent performance of neural networks and deep learning, integrating deep learning into other fields has become increasingly popular. Many studies have used machine learning and deep learning methods to design neural network detectors (NADs) to resist network attacks, achieving good results. For example, the K-nearest neighbor method is used to build classifiers to distinguish between fake and real data for detection purposes.
[0006] Referring to Chinese patent document CN114091661A, an oversampling method based on generative adversarial networks (GANs) and the k-nearest neighbor algorithm is disclosed to improve intrusion detection performance. Specifically, this method includes: numericalizing and normalizing the original data; constructing a generative model based on WGAN-GP and training it using minority class attack samples and random noise to model the attack distribution and generate attack samples; using the k-nearest neighbor algorithm to filter noise in the generated attack samples; finally, using analysis of variance to rank the importance of the data's field attributes, performing feature selection based on the ranking results, removing unnecessary features, and ultimately obtaining an oversampled training set. Using the generated oversampled training set can effectively improve the performance of the intrusion detection model.
[0007] However, these defense methods are all based on the premise that the smart grid operates stably and that power transmission fluctuations are minimal. With the development of smart grids, a large amount of renewable energy will inevitably be connected to the grid in the future, and due to the uncertainty and high volatility of renewable energy, these defense measures will inevitably be affected. Attackers can exploit the strong uncertainty of renewable energy to design new attack methods, making current detection methods ineffective in detecting such attacks. Therefore, designing effective attack methods to address the shortcomings of existing defense methods, thereby exposing the grid's vulnerability to attacks under time-varying conditions at the detection boundary, is a problem that urgently needs to be solved by those skilled in the art.
[0008] Chinese patent document CN118364500A discloses a data privacy protection method for conditional WGAN-GP with differential privacy. First, the source data is cleaned and transformed. A conditional vector is constructed based on the transformed real data. The conditional vector and a combination of random noise conforming to a multivariate normal distribution are used as data samples for the generator. The transformed real data and the synthesized data output by the generator are used as data samples for the discriminator. Then, a WGAN-GP model for data synthesis is constructed. The discriminator in the WGAN-GP model uses the Wasserstein distance with gradient penalty as the objective function. The WGAN-GP model is trained using the constructed data samples. During training, statistical noise is first injected into the gradient of the Wasserstein distance, and then differential privacy technology is used to protect the source data. Finally, the trained WGAN-GP model is used to generate highly usable synthesized data.
[0009] In view of this, the present invention designs a spatiotemporal covert attack generation method based on the WGAN model. By analyzing the time-varying boundary of the power grid state distribution in high-penetration renewable energy access scenarios, a spatiotemporal correlation generation module and an attack selection matrix are designed to enhance the covertness of the attack, thereby enabling detection or defense models to improve their perception and resistance capabilities to unknown or dynamic risks in high-proportion renewable energy access environments. Summary of the Invention
[0010] The present invention aims to overcome at least one of the defects of the prior art and provide a method for improving the robustness of smart grid data injection attacks.
[0011] The present invention also discloses an apparatus loaded with a smart grid data injection attack method for improving the robustness of the detection model.
[0012] The detailed technical solution of this invention is as follows:
[0013] A data injection attack method for smart grids to improve the robustness of detection models, applied to a power grid system containing multiple nodes; the method includes:
[0014] S1. Based on the historical fluctuations of each node in the power grid system, iteratively select the current target attack area;
[0015] S2. Construct a fake data generation framework based on WGAN-GP, and integrate a spatiotemporal correlation module into the generator and discriminator of the fake data generation framework respectively, forming a spatiotemporal correlation generation module and a spatiotemporal correlation discrimination module.
[0016] S3. Use the state vectors of nodes within the target attack area as training samples to train the spatiotemporal correlation generation module and the spatiotemporal correlation discrimination module, so as to enable the spatiotemporal correlation generation module to generate the target attack vector.
[0017] S4. Optimize the detection model by combining the generated target attack vector with normal operation data under renewable energy grid connection scenarios to improve the robustness of the detection model.
[0018] According to a preferred embodiment of the present invention, in S1, the iteration mechanism of the target attack region is described as follows:
[0019] (3);
[0020] In formula (3): Indicates the first The attack area for the next iteration; This represents the set of nodes within the attack range selected by the attacker. Let represent the set of newly added nodes in the (k+1)th iteration, which is a set. subsets, sets By the The neighborhood nodes of the next iteration result; Represents the set of nodes in a protected state.
[0021] According to a preferred embodiment of the present invention, in step S1, an attack selection matrix is designed based on the selected target attack region. The matrix elements consist of 0s and 1s. Represents the number of nodes; defined as follows:
[0022] =0, indicating the first Each node is protected from attack;
[0023] , indicating the first Each node is an attackable node.
[0024] According to a preferred embodiment of the present invention, the training loss function of the spatiotemporal correlation generation module is:
[0025] (6);
[0026] In formula (6): This represents the loss function of the spatiotemporal correlation generation module, which is also the loss function of the generator in WGAN-GP; Represents the generated spurious state vector The score given by the discriminator; Indicates the probability distribution The following is about the generated spurious state vector Score Seeking expectations.
[0027] According to a preferred embodiment of the present invention, the training loss function of the spatiotemporal correlation discrimination module is:
[0028] (7);
[0029] (8);
[0030] In equations (7)-(8): This represents the loss function of the discriminator in WGAN-GP; Indicates the probability distribution The true state vector of the next pair of nodes Score Seeking expectations; This is a gradient penalty term. The gradient penalty coefficient is... For gradient operators; This represents the loss function of the spatiotemporal correlation discrimination module; This represents the true state vector of the i-th node within the target attack area. and the generated spurious state vector distance, Represents norm distance; is a hyperparameter for the regularization strength.
[0031] According to a preferred embodiment of the present invention, the spatiotemporal correlation generation module uses low-dimensional Gaussian noise. As input, use transposed convolution on the Gaussian noise input. Upsampling is performed to obtain the transposed convolutional data. Based on data after transpose convolution Generate spurious state vectors : ; Applied to Dimensional data reshaping ,in It is the number of time steps. It represents the number of nodes.
[0032] According to a preferred embodiment of the present invention, the input data of the spatiotemporal correlation discrimination module includes the state vector x of the target attack region node and the generated false state vector. The input data is initially processed using a lightweight CNN to extract spatial dimensional features, and the corresponding initial feature map is output. ;
[0033] By analyzing the initial feature map application Activation generates the corresponding spatial attention matrix And the spatial attention matrix Each element is located in the range [0,1], which represents the weight assigned to the corresponding spatial location;
[0034] The corresponding weighted feature map is calculated through element-wise multiplication. :
[0035] (9);
[0036] Applying standard convolution operations to weighted feature maps Generate the final output features :
[0037] (10);
[0038] In formula (10): It is a non-linear activation function; This represents the standard convolution operation; Indicates deviation;
[0039] Weighted feature maps are captured using an LSTM network. The spatiotemporal dependencies in the data are preserved by maintaining the LSTM cell states. Historical information and its hidden state are dynamically updated. LSTM networks integrate information from the current and previous time steps:
[0040] (11);
[0041] (12);
[0042] In equations (11)-(12): , , , These represent the weight matrices for the forget gate, input gate, candidate state, and output gate, respectively. , , , These are the corresponding bias terms; Represents the Hadamard product; This indicates the hidden state of the previous time step; Indicates the cell state at the previous time step; This represents the Sigmoid function.
[0043] In another aspect of the invention, an apparatus is provided for implementing a smart grid data injection attack method for improving the robustness of detection models, the apparatus comprising:
[0044] The attack area selection module is used to iteratively select the current target attack area based on the volatility of the historical state of each node in the power grid system.
[0045] The attack model construction module is used to build a fake data generation framework based on WGAN-GP, and integrates a spatiotemporal correlation module which is embedded in the generator and discriminator of the fake data generation framework to form a spatiotemporal correlation generation module and a spatiotemporal correlation discrimination module.
[0046] The attack model training module is used to train the spatiotemporal correlation generation module and the spatiotemporal correlation discrimination module using the state vectors of nodes within the target attack area as training samples, so as to prompt the spatiotemporal correlation generation module to generate the target attack vector.
[0047] The detection model optimization module is used to jointly optimize the detection model with the generated target attack vector and normal operation data under renewable energy grid connection scenarios, so as to improve the robustness of the detection model.
[0048] In another aspect of the invention, an electronic device is also provided, comprising:
[0049] At least one processor; and
[0050] A memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the smart grid data injection attack method described above for improving the robustness of the detection model.
[0051] In another aspect of the invention, a machine-readable storage medium is also provided, which stores executable instructions that, when executed, cause the machine to perform the smart grid data injection attack method described above for improving the robustness of detection models.
[0052] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0053] (1) This invention proposes a fake data generation framework based on the WGAN-GP model. Based on the WGAN model, by integrating the spatiotemporal correlation adversarial module, it can generate attacks that are concealed in spatiotemporal space. At the same time, an attack region selection matrix is constructed to simulate the attack optimization methods that attackers may make when they lack prior knowledge, thereby simulating more realistic attack scenarios and methods in the real world to verify the availability and robustness of the detection / defense model.
[0054] (2) The target attack vector generated by the method of the present invention is used together with the normal operation data under the renewable energy grid connection scenario to optimize the detection / defense model, thereby improving the detection / defense model’s ability to perceive and resist unknown or dynamic risks in the high proportion of renewable energy access environment. In the grid environment with strong renewable energy volatility and complex operation scenarios, it significantly enhances the accuracy of its identification of various new data security risks and the overall protection effectiveness of the system, and provides more comprehensive technical support for the safe and stable operation of the high proportion of renewable energy grid. Attached Figure Description
[0055] Figure 1 A comparison chart showing the changes in node voltage of a power system under conditions of no renewable energy and the injection of 60% renewable energy;
[0056] Figure 2 This is a flowchart of the smart grid data injection attack method for improving the robustness of detection models as described in this invention;
[0057] Figure 3 This is a framework diagram of the WGAN-GP model constructed in Embodiment 1 of the present invention. Detailed Implementation
[0058] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0059] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0060] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0061] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0062] Example 1
[0063] This invention aims to design a spatiotemporal covert attack generation method based on the WGAN model. By analyzing the time-varying boundary of the power grid state distribution in high-penetration renewable energy access scenarios, a spatiotemporal correlation generation module and an attack selection matrix are designed to enhance the covertness of the attack.
[0064] Specifically, we first analyze the detection methods of BDD (Bad Data Detection) and NAD (Neural Network Detector) in the power grid, and then further determine the impact of high-penetration renewable energy access on power grid state estimation and model detection capabilities.
[0065] Specifically, when performing state estimation in a power system based on a SCADA (Supervisory and Data Acquisition) system, it is necessary to collect real-time measurement values from the SCADA system, such as bus voltage amplitude and phase angle. The relationship between the measurement vector and the state vector can be represented as follows:
[0066] (1);
[0067] In formula (1): This represents a measurement vector, which typically includes active power and reactive power; This is a nonlinear measurement function used to map the system's state variables to measurement vectors: , where n represents the number of nodes in the power system and m represents the dimension of the measurement vector; represents the state vector of a node in a power system, including the voltage magnitude and phase angle of the node; e represents the measurement noise.
[0068] In an AC power system, the estimated value of the node state vector. This can be solved by optimizing the following issues:
[0069] (2);
[0070] In formula (2): This represents the estimated value of the node state vector in the power system; Indicates matrix transpose; Let represent the diagonal covariance matrix, and the measurement noise. .
[0071] Bad Data Detection (BDD) is used in AC system node state estimation to detect bad data that may cause deviations between the estimated and actual node states. This includes detecting measurement residuals. satisfy If this happens, BDD will issue an alarm, in which... It is the detection threshold, based on the measured noise. The distribution and confidence level of bad data detection are used to determine this.
[0072] Since BDD was originally designed to detect malicious data, such as abnormal measurements caused by meter malfunctions, it is difficult to detect well-designed FDI attacks. To detect covert FDI attacks, various neural network models have been proposed, taking into account the characteristics of power systems. This paper introduces six typical NAD models, which will be used to evaluate the performance of the proposed spatiotemporal stealth attack model in simulations. Details are as follows:
[0073] 1) The k-Nearest Neighbor (KNN) classification algorithm is used to build a classifier to detect covert FDI attacks. Specifically, for the KNN classifier, a valid measurement vector... Or the measured value under attack Classify based on the labels of its K nearest neighbors in the feature space.
[0074] 2) The AdaBoost algorithm is also used to build classifiers to detect covert FDI attacks. The AdaBoost algorithm is an ensemble learning technique that uses combination rules to generate and combine multiple classifiers to build a more powerful classifier.
[0075] 3) Multilayer perceptron (MLP) is the most basic model in deep learning. It uses multiple hidden layers to extract data features and is commonly used for regression and classification tasks.
[0076] Here, the three detection methods described above are used to evaluate the performance of the proposed attack models, which represent the failure to fully utilize the temporal or spatial characteristics of power system time series measurements.
[0077] 4) The DLLD (deeo-learning-based location detector) algorithm was first proposed to detect covert FDI attacks. It integrates a convolutional neural network (CNN) with a standard bad data detector (BDD). In the DLLD algorithm architecture, BDD is used to remove low-quality data, while CNN is used to extract high-dimensional temporal features of covert FDI attacks.
[0078] 5) For LSTM detectors, the temporal correlation between measurements at different time points is used to learn data patterns, which can then be used to detect anomalies.
[0079] 6) The RP-CNN method is an image-based two-stage deep learning approach. In the RP-CNN framework, a recursive graph is used to encode the spatiotemporal correlations of power system time-series measurements into a 2D image to obtain latent data features. Based on the constructed 2D image, a CNN-based classifier is used to detect the presence of covert FDI attacks.
[0080] Here, the three detection methods mentioned above are considered representative of deep learning-based detectors, which can make full use of the spatial and temporal correlations of power system measurements.
[0081] Because attackers in cyberattacks aim to severely impact the normal operation of power systems, the state of the compromised system may differ significantly from the normal system state. Both BDD (Browser-Driven Distributed) and NAD (Network-Agent Distributed) detectors can easily detect injected false data if it deviates significantly from the legitimate state; therefore, the distribution boundaries of legitimate states can be used to detect cyberattacks.
[0082] However, with the increasing penetration of renewable energy sources such as wind and solar power, the uncertainty of the power system has increased significantly. For example, when the output power of highly penetrated renewable energy sources fluctuates, voltage fluctuations at some critical nodes in the grid may be significant, even exceeding limits. Figure 1 In other words, compared to power systems without renewable energy sources (RES), the boundaries of legitimate system states expand and become significantly time-varying in power systems with high RES penetration. Therefore, with high RES penetration, attackers can further exploit the expanded boundaries of legitimate data to enhance the stealth and destructive impact of their attacks.
[0083] To remain undetectable under time-varying detection boundaries, the injected spoofing data must be designed with spatial and temporal correlations in mind. Based on the above analysis, the hazard states and metrics in stealth attacks should meet the following conditions:
[0084] (1) Consistency: The measured value under attack It should be based on physical laws and the state values of the attacked system nodes. To maintain consistency and bypass bad data detection (BDD) in power system node state estimation.
[0085] (2) Approximation: The state values of the attacked system nodes It should be close to normal to avoid being identified as an outlier.
[0086] (3) Spatiotemporal nature: the state values of the attacked system nodes It should be consistent with the spatiotemporal correlation of the system to avoid being distinguished by the boundaries of the normal state changing over time.
[0087] Based on this, this embodiment provides a smart grid data injection attack method to improve the robustness of the detection model, applicable to a power grid system containing multiple nodes. Specific details are provided below. Figure 2 The method includes:
[0088] S1. Based on the historical fluctuations of each node in the power grid system, iteratively select the current target attack area;
[0089] S2. Construct a fake data generation framework based on WGAN-GP, and integrate a spatiotemporal correlation module into the generator and discriminator of the fake data generation framework respectively, forming a spatiotemporal correlation generation module and a spatiotemporal correlation discrimination module.
[0090] S3. Use the state vectors of nodes within the target attack area as training samples to train the spatiotemporal correlation generation module and the spatiotemporal correlation discrimination module, so as to enable the spatiotemporal correlation generation module to generate the target attack vector.
[0091] S4. Optimize the detection model by combining the generated target attack vector with normal operation data under renewable energy grid connection scenarios to improve the robustness of the detection model.
[0092] Specifically, in S1, attackers typically find it difficult to directly attack all nodes. Instead, they select a region to attack, avoiding unattackable nodes such as reference nodes and actively protected nodes. Based on this, this embodiment designs an iterative method to select the current attack region according to the historical volatility of each node in the power grid system, thereby improving its applicability in real-world systems.
[0093] This embodiment designs an attack selection matrix. The matrix elements consist only of 0s and 1s. Represents the number of nodes; defined as follows:
[0094] =0, indicating the first Each node is protected from attack;
[0095] , indicating the first Each node is an attackable node.
[0096] Furthermore, regarding the determination of the attack area, in this embodiment, the power grid topology is represented as a weighted connected undirected graph. ,in It is the set of all nodes in the power grid topology. It is a set of edges, and The uncertainty intensity of nodes is quantified by standard deviation.
[0097] The attacker first selects the node with the highest strength of uncertainty from all nodes. The node is taken as the central node. The set of nodes in the protected state is represented as... ,in This includes the status on actively protected nodes and intrinsically safe nodes, such as the reference bus. Attack area. As from the set Constructed Subgraph, here This represents the set of nodes selected from all nodes in the power grid topology, i.e., the set of nodes within the attacker's attack range, excluding the set of nodes in the grid. The protected state within.
[0098] To obtain the defined attack area, an iterative mechanism is employed, which can be described as follows:
[0099] (3);
[0100] In formula (3): Indicates the first The attack area for the next iteration; This represents the set of nodes selected from all nodes in the power grid topology, i.e., the set of nodes within the attack range selected by the attacker. Let represent the set of newly added nodes in the (k+1)th iteration, which is A subset of; Indicates the first The neighborhood of the result of the next iteration is recursively in End at time; Represents the set of nodes in a protected state.
[0101] Based on the above iterative mechanism, the method proposed in this embodiment can ensure that the final target attack region simultaneously satisfies topological reachability and security constraints.
[0102] In S2, this embodiment constructs a fake data generation framework based on the WGAN-GP model. Specifically, the WGAN model is a variant of the GAN network. Due to its powerful generative capabilities, GAN networks are widely used in image generation, style transfer, data augmentation, and other fields. However, because its training process involves two networks (generator and discriminator) optimizing through an adversarial process, this game-like training mechanism can easily lead to instability during training. Furthermore, due to its relatively complex model, it is prone to gradient vanishing and gradient exploding, making convergence difficult.
[0103] Based on this, in this embodiment, gradient penalty is introduced instead of gradient clipping on the WGAN network, a variant of the GAN network, thereby enforcing 1-Lipschitz continuity. The loss function of the generator in the WGAN network is:
[0104] (4);
[0105] In equation (4): This represents the loss function of the generator in the WGAN model, with the objective of minimizing the loss of the discriminator on the generated spurious state vectors. The score makes the generated spurious state vector As close as possible to the true state vector of the node ; Represents the generated spurious state vector The score given by the discriminator in the WGAN model; This represents the generated spurious state vector. According to probability distribution Perform expectation calculation, that is, in the probability distribution The following is about the generated spurious state vector Score Seeking expectations.
[0106] In the WGAN model, the discriminator aims to distinguish between real and generated samples by maximizing the Wasserstein distance, while simultaneously satisfying 1-Lipschitz continuity. Therefore, the loss function of the discriminator in the WGAN network is:
[0107] (5);
[0108] In equation (5): This represents the loss function of the discriminator in the WGAN model; Indicates the probability distribution The true state vector of the next pair of nodes Score Seeking expectations.
[0109] Using the two loss functions mentioned above , Alternately optimize the generator and discriminator of the WGAN model to drive the adversarial training process of the WGAN model.
[0110] In the WGAN model, when the gradient norm exceeds a preset threshold, the excess portion is crudely truncated, which may interfere with policy updates and the balance between the generator and discriminator. To address this issue, this embodiment introduces gradient penalty, that is, by adding an extra penalty term to the discriminator loss function of the WGAN model to penalize excessively high gradient values, instead of crudely truncating them.
[0111] Therefore, the loss function of WGAN-GP can be expressed as follows:
[0112] (6);
[0113] (7);
[0114] In equations (6)-(7): This represents the loss function of the generator in WGAN-GP; Represents the generated spurious state vector The score given by the discriminator in WGAN-GP; This represents the loss function of the discriminator in WGAN-GP; This is a gradient penalty term used to ensure that the discriminator satisfies the 1-Lipschitz condition, where... This represents the gradient operator, used to find the partial derivatives of a multivariate function and form the gradient vector.
[0115] Based on the above, a fake data generation framework based on WGAN-GP is constructed.
[0116] Thus, in scenarios involving highly volatile renewable energy injections, the uncertainty and volatility of wind and solar power make the power system more vulnerable, and the rate and magnitude of change in the power system's state variables and active and reactive power also increase accordingly. This provides an opportunity for fake data injection attacks. Based on this scenario, this embodiment designs a fake data generation framework based on WGAN-GP, which can easily bypass BDD detection and remain undetected by currently popular machine learning detection methods.
[0117] Furthermore, this embodiment integrates a spatiotemporal correlation module and embeds it into the generator and discriminator of the constructed WGAN-GP-based fake data generation framework, forming a spatiotemporal correlation generation module and a spatiotemporal correlation discrimination module. The spatiotemporal correlation generation module upsamples the incoming noise using transposed convolution, generating a larger space by inserting gaps or padding between pixels. The spatiotemporal correlation discrimination module extracts the temporal features of the sequence, captures the temporal correlation of the sequence, and feeds it back to the generator, prompting the generator to generate pseudo-states with temporal correlation.
[0118] In S3, this embodiment uses the state vectors of nodes within the target attack area as training samples to train the spatiotemporal correlation generation module and the spatiotemporal correlation discrimination module, so as to prompt the spatiotemporal correlation generation module to generate the target attack vector.
[0119] Specifically, to ensure that the generated spurious state vectors can only modify the state within the selected target attack region, the attack selection matrix constructed in S1 is used as a basis. In this embodiment, a regularization term is added to the loss function of the WGAN-GP discriminator in formula (7). Therefore, the final loss function of the WGAN-GP discriminator, which is also the loss function of the spatiotemporal correlation discrimination module, is:
[0120] (8);
[0121] In equation (8): The final loss function of the discriminator in WGAN-GP is represented; This represents the number of nodes; i represents the i-th node; This represents the true state vector of the i-th node within the target attack area. and the generated spurious state vector distance, Representing norm distance, such as Represents the 1-norm distance. Represents the 2-norm distance; is a hyperparameter for the regularization strength.
[0122] The loss function of the spatiotemporal correlation generation module remains unchanged, as in formula (6).
[0123] During the model training phase, parameters Figure 3 The spatiotemporal correlation generation module aims to generate data that maximizes the likelihood of passing through the discriminator. In power systems, node voltage amplitudes typically range from 0.94 to 1.06 per unit, and in the image domain, the input to GAN models is generally random noise. Therefore, in this embodiment, the input data is Gaussian noise with a mean of 1 and a standard deviation of 1. Its distribution can provide a good starting point for the model when generating data. Typically, the generator uses low-dimensional Gaussian noise. As input, high-resolution state data is generated through a series of network modules. To achieve the mapping from low-dimensional to high-dimensional states, an upsampling operation is added to the generator framework.
[0124] Specifically, transposed convolution is used to handle low-dimensional Gaussian noise in the input. Upsampling is performed. By strategically inserting gaps between pixels or applying zero-padding, the spatial dimension of the generated data can be synthesized and expanded. The data after transpose-convolution is denoted as... To match the dimension of the input data in the discriminator, the transposed convolutional data... go through The processing yields the generated spurious state vector. The data includes... This represents the upsampled data after transpose convolution. Applied to Dimensional data reshaping ,in It is the number of time steps. It represents the number of nodes.
[0125] The aforementioned spatiotemporal correlation discrimination module integrates convolutional layers with a spatial attention matrix to extract multidimensional spatial features. Specifically, the attention mechanism can adaptively weight key regions in the input sequence by adjusting the convolutional kernel weights or the distribution of input features to improve feature discriminability. In power systems, measurement vectors themselves exhibit strong spatiotemporal correlation.
[0126] To enhance the model's ability to focus on key regions, this embodiment introduces a spatial attention matrix into the architecture of the spatiotemporal correlation discrimination module. This matrix Dynamically adjust the convolutional kernel weights or the distribution of input features. Specifically, the input data includes the state vector x of the target attack region nodes and the generated spurious state vectors. The input data is initially processed by a lightweight CNN to extract spatial dimensional features, thereby outputting the corresponding initial feature map. Then, by applying to the initial feature map... Activation to generate the corresponding spatial attention matrix .matrix Each element in the algorithm lies within the range [0,1], which represents the weight assigned to the corresponding spatial location; then, the corresponding weighted feature map is calculated through element-wise multiplication. :
[0127] (9);
[0128] Subsequently, standard convolution operations are applied to the weighted feature maps. This generates the final output features. :
[0129] (10);
[0130] In formula (10): It is a non-linear activation function; This represents the standard convolution operation; Indicates deviation.
[0131] Subsequently, an LSTM network is used to capture the spatiotemporal dependencies in the weighted features. This is achieved by preserving the LSTM unit states. Historical information and its hidden state are dynamically updated. LSTM networks can integrate information from the current and previous time steps. Time information extraction can be represented as:
[0132] (11);
[0133] (12);
[0134] In equations (11)-(12): , , , These represent the weight matrices for the forget gate, input gate, candidate state, and output gate, respectively. , , , These are the corresponding bias terms; Represents the Hadamard product; This indicates the hidden state of the previous time step; Indicates the cell state at the previous time step; This represents the Sigmoid function.
[0135] Since the discriminator scores the output directly instead of using a sigmoid mapping, the hidden state contains both current-time information and long-term information. It is passed to the MLP layer for scoring without the use of any activation function.
[0136] Then, the extracted hidden state ( After scoring by the MLP, the data is fed back to the spatiotemporal correlation generation module through adversarial training. This promotes the generation of states that satisfy the spatial consistency and temporal continuity of real data, thus prompting the spatiotemporal correlation generation module to generate the target attack vector. It should be understood that this feedback is achieved through gradient updates. When the spatiotemporal correlation generation module generates data, it is fed to the spatiotemporal correlation discrimination module for scoring. The discrimination module extracts the spatiotemporal patterns of real and fake data and scores them separately. If the two are similar, their scores are also similar, and the difference between their scores decreases, indicating that the model is converging and the data generated by the generation module is sufficiently realistic, making it impossible for the discrimination module to distinguish between real and fake data. Similarly, if the two are not similar enough, their scores will also be similar, and the difference between their scores will increase, indicating that the model is still training, the data generated by the generation module is not yet realistic enough, and further training is needed, while the discrimination module can distinguish between real and fake data.
[0137] S4. Optimize the detection model by combining the generated target attack vector with normal operation data under renewable energy grid connection scenarios to improve the robustness of the detection model.
[0138] Considering the challenges of future renewable energy scenarios, and with the increasing integration of renewable energy into the grid, this method reveals the potential risks to grid security that this trend may bring. By combining the target attack vector obtained through this method with normal operation data under renewable energy grid integration scenarios, the detection / defense model is optimized. This enhances the model's ability to perceive and resist unknown or dynamic risks in environments with high renewable energy integration. Consequently, in grid environments characterized by high renewable energy volatility and complex operating scenarios, this significantly improves the accuracy of identifying various new data security risks and the overall system protection effectiveness, providing more comprehensive technical support for the safe and stable operation of grids with high renewable energy ratios.
[0139] In summary, this invention, by constructing potential risk scenarios and generating diverse simulated risk data, enables power systems to cover more anomalies during testing and verification. This type of simulated risk data can effectively expose blind spots in existing detection mechanisms, thereby helping to identify problems that are difficult to identify using traditional methods. The data generated by this invention can provide targeted guidance for optimizing and upgrading defense strategies, contributing to improving the scientific rigor and effectiveness of strategy adjustments.
[0140] By generating diverse risk data in a controlled environment, the problem of insufficient single real-world attack samples is avoided. This allows for a comprehensive examination and improvement of existing protection mechanisms without increasing the actual operational risks of the system. Consequently, the power system can construct a more adaptable and robust security protection system, significantly enhancing its ability to withstand complex risks and the overall operational security.
[0141] To verify the attack capability of the spatiotemporal concealment attack method proposed in this invention, the attack performance was compared under different attack methods, power systems of different sizes, and different defense measures. Specifically, the attack was differentiated based on whether a high proportion (60%) of renewable energy was used in the system. The attack effects generated by this method were compared on IEEE-14 bus systems, IEEE-57 bus systems, and IEEE-118 bus systems, as shown in Table 1 below:
[0142] Table 1. Attack effects of the attack generated by this method on IEEE-14, IEEE-57, and IEEE-118 bus systems, respectively.
[0143]
[0144] As shown in Table 1, both spatiotemporal stealth attacks and typical stealth FDI attacks can pass the bad data detection BDD with a 100% success rate. This is because BDD can only detect outliers that violate the consistency between the corrupted state and the measurement, while all the aforementioned attacks satisfy the consistency constraint. In other words, the simulation results are consistent with the analysis in Section 3. However, in power systems with well-trained neural network detectors (NADs), the success rates of random attacks and scaling attacks are significantly reduced. Furthermore, although optimization-based and replay-based methods generally outperform scaling-based and random attacks in terms of NAD performance, the overall attack success rate is still low. This is because optimization-based and replay-based attacks do not utilize the spatiotemporal correlation of the power system, which can be easily detected by NADs that utilize the spatiotemporal correlation of the power system. Compared to typical stealth FDI attacks, spatiotemporal stealth attacks achieve a significantly higher success rate across all six NADs, both in the absence of RES and in the case of high-penetration RES. In other words, the proposed spatiotemporal stealth attacks are more effective than typical stealth FDI attacks (such as random attacks, scaling attacks, replay attacks, and optimization-based attacks). Furthermore, compared to systems without renewable energy, those with a high proportion of renewable energy access significantly improved the success rate of spatiotemporal covert attacks.
[0145] Example 2
[0146] This embodiment provides an apparatus for implementing a smart grid data injection attack method to improve the robustness of detection models. The apparatus includes:
[0147] The attack area selection module is used to iteratively select the current target attack area based on the volatility of the historical state of each node in the power grid system.
[0148] The attack model construction module is used to build a fake data generation framework based on WGAN-GP, and integrates a spatiotemporal correlation module which is embedded in the generator and discriminator of the fake data generation framework to form a spatiotemporal correlation generation module and a spatiotemporal correlation discrimination module.
[0149] The attack model training module is used to train the spatiotemporal correlation generation module and the spatiotemporal correlation discrimination module using the state vectors of nodes within the target attack area as training samples, so as to prompt the spatiotemporal correlation generation module to generate the target attack vector.
[0150] The detection model optimization module is used to jointly optimize the detection model with the generated target attack vector and normal operation data under renewable energy grid connection scenarios, so as to improve the robustness of the detection model.
[0151] Example 3
[0152] This embodiment also provides an electronic device, including:
[0153] At least one processor; and
[0154] A memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform the smart grid data injection attack method described above for improving the robustness of the detection model.
[0155] In this embodiment, the electronic device may include, but is not limited to: personal computer, server computer, workstation, desktop computer, laptop computer, notebook computer, mobile computing device, smartphone, tablet computer, cellular phone, personal digital assistant (PDA), handheld device, messaging device, wearable computing device, consumer electronic device, etc.
[0156] Example 4
[0157] This embodiment also provides a machine-readable storage medium storing executable instructions that, when executed, cause the machine to perform the smart grid data injection attack method described above for improving the robustness of the detection model.
[0158] Specifically, a system or apparatus equipped with a readable storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer or processor of the system or apparatus can read and execute the instructions stored in the readable storage medium.
[0159] In this case, the program code read from the readable medium itself can perform the functions of any of the above embodiments, and therefore the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of this specification.
[0160] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer or the cloud via a communication network.
[0161] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0163] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0164] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0165] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific implementation of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention should be included within the protection scope of the claims of the present invention.
Claims
1. A method for improving the robustness of smart grid data injection attacks, characterized in that, The method includes: S1. Based on the historical fluctuations of each node in the power grid system, iteratively select the current target attack area; S2. Construct a fake data generation framework based on WGAN-GP, and integrate a spatiotemporal correlation module into the generator and discriminator of the fake data generation framework respectively, forming a spatiotemporal correlation generation module and a spatiotemporal correlation discrimination module. The spatiotemporal correlation generation module uses low-dimensional Gaussian noise. As input, use transposed convolution on the Gaussian noise input. Upsampling is performed to obtain the transposed convolutional data. Based on data after transpose convolution Generate spurious state vectors ; The input data of the spatiotemporal correlation discrimination module includes the state vector x of the target attack area node and the generated false state vector. The input data is initially processed using a lightweight CNN to extract spatial dimensional features, and the corresponding initial feature map is output. ; By analyzing the initial feature map application Activation generates the corresponding spatial attention matrix And the spatial attention matrix Each element is located in the range [0,1], which represents the weight assigned to the corresponding spatial location; The corresponding weighted feature map is calculated through element-wise multiplication. : (9); Applying standard convolution operations to weighted feature maps Generate the final output features : (10); In formula (10): It is a non-linear activation function; This represents the standard convolution operation; Indicates deviation; Weighted feature maps are captured using an LSTM network. The spatiotemporal dependencies in the data are preserved by maintaining the LSTM cell states. Historical information and its hidden state are dynamically updated. LSTM networks integrate information from the current and previous time steps: (11); (12); In equations (11)-(12): , , , These represent the weight matrices for the forget gate, input gate, candidate state, and output gate, respectively. , , , These are the corresponding bias terms; Represents the Hadamard product; This indicates the hidden state of the previous time step; Indicates the cell state at the previous time step; Represents the Sigmoid function; S3. Use the state vectors of nodes within the target attack area as training samples to train the spatiotemporal correlation generation module and the spatiotemporal correlation discrimination module, so as to enable the spatiotemporal correlation generation module to generate the target attack vector. S4. Optimize the detection model by combining the generated target attack vector with normal operation data under renewable energy grid connection scenarios to improve the robustness of the detection model.
2. The smart grid data injection attack method for improving the robustness of detection models according to claim 1, characterized in that, In S1, the iteration mechanism of the target attack area is described as follows: (3); In formula (3): Indicates the first The attack area for the next iteration; This represents the set of nodes within the attack range selected by the attacker. Let represent the set of newly added nodes in the (k+1)th iteration, which is a set. subsets, sets By the The neighborhood nodes of the next iteration result; Represents the set of nodes in a protected state.
3. The smart grid data injection attack method for improving the robustness of detection models according to claim 2, characterized in that, In step S1, an attack selection matrix is designed based on the selected target attack area. The matrix elements consist of 0s and 1s. Represents the number of nodes; defined as follows: =0, indicating the first Each node is protected from attack; , indicating the first Each node is an attackable node.
4. The smart grid data injection attack method for improving the robustness of detection models according to claim 3, characterized in that, The training loss function for the spatiotemporal correlation generation module is: (6); In formula (6): This represents the loss function of the spatiotemporal correlation generation module, which is also the loss function of the generator in WGAN-GP; Represents the generated spurious state vector The score given by the discriminator; Indicates the probability distribution The following is about the generated spurious state vector Score Seeking expectations.
5. The smart grid data injection attack method for improving the robustness of detection models according to claim 4, characterized in that, The training loss function of the spatiotemporal correlation discrimination module is: (7); (8); In equations (7)-(8): This represents the loss function of the discriminator in WGAN-GP; Indicates the probability distribution The true state vector of the next pair of nodes Score Seeking expectations; This is a gradient penalty term. The gradient penalty coefficient is... For gradient operators; This represents the loss function of the spatiotemporal correlation discrimination module; This represents the true state vector of the i-th node within the target attack area. and the generated spurious state vector distance, Represents norm distance; is a hyperparameter for the regularization strength.
6. The smart grid data injection attack method for improving the robustness of detection models according to claim 1, characterized in that, The false state vector for: ; Applied to Dimensional data reshaping ,in It is the number of time steps. It represents the number of nodes.
7. An apparatus for implementing a smart grid data injection attack method to improve the robustness of detection models, characterized in that, The device includes: The attack area selection module is used to iteratively select the current target attack area based on the volatility of the historical state of each node in the power grid system. The attack model construction module is used to build a fake data generation framework based on WGAN-GP, and integrates a spatiotemporal correlation module which is embedded in the generator and discriminator of the fake data generation framework to form a spatiotemporal correlation generation module and a spatiotemporal correlation discrimination module. The spatiotemporal correlation generation module uses low-dimensional Gaussian noise. As input, use transposed convolution on the Gaussian noise input. Upsampling is performed to obtain the transposed convolutional data. Based on data after transpose convolution Generate spurious state vectors ; The input data of the spatiotemporal correlation discrimination module includes the state vector x of the target attack area node and the generated false state vector. The input data is initially processed using a lightweight CNN to extract spatial dimensional features, and the corresponding initial feature map is output. ; By analyzing the initial feature map application Activation generates the corresponding spatial attention matrix And the spatial attention matrix Each element is located in the range [0,1], which represents the weight assigned to the corresponding spatial location; The corresponding weighted feature map is calculated through element-wise multiplication. : (9); Applying standard convolution operations to weighted feature maps Generate the final output features : (10); In formula (10): It is a non-linear activation function; This represents the standard convolution operation; Indicates deviation; Weighted feature maps are captured using an LSTM network. The spatiotemporal dependencies in the data are preserved by maintaining the LSTM cell states. Historical information and its hidden state are dynamically updated. LSTM networks integrate information from the current and previous time steps: (11); (12); In equations (11)-(12): , , , These represent the weight matrices for the forget gate, input gate, candidate state, and output gate, respectively. , , , These are the corresponding bias terms; Represents the Hadamard product; This indicates the hidden state of the previous time step; Indicates the cell state at the previous time step; Represents the Sigmoid function; The attack model training module is used to train the spatiotemporal correlation generation module and the spatiotemporal correlation discrimination module using the state vectors of nodes within the target attack area as training samples, so as to prompt the spatiotemporal correlation generation module to generate the target attack vector. The detection model optimization module is used to jointly optimize the detection model with the generated target attack vector and normal operation data under renewable energy grid connection scenarios, so as to improve the robustness of the detection model.
8. An electronic device, characterized in that, The electronic device includes: at least one processor; and a memory storing instructions that, when executed by the at least one processor, cause the at least one processor to perform a smart grid data injection attack method for improving the robustness of a detection model as described in any one of claims 1 to 6.
9. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores executable instructions that, when executed, cause the machine to perform the smart grid data injection attack method for improving the robustness of the detection model as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Oversampling method for improving intrusion detection performance based on generative adversarial network and k-nearest neighbor algorithm
CN114091661A
Data privacy protection method for conditional WGAN-GP with differential privacy
CN118364500A
Encrypted traffic intrusion detection and system based on BiLSTM and gated multi-head attention fusion
CN120378167A
Attack and defense method of mechanical equipment fault diagnosis model based on conditional generative adversarial network
CN120469834A