Power system false data positioning and recovering system based on deep learning

Through the deep learning power system fake data positioning and recovery system, the traditional method has solved the problem of slow response and low accuracy when facing new fake data injection attacks, and achieved efficient fake data positioning and recovery, which improved the security and reliability of the smart grid.

CN120508996AActive Publication Date: 2025-08-19NANJING UNIV OF POSTS & TELECOMM

Patent Information

Application Number
CN202510999425.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-08-19
Estimated Expiration
2045-07-21

AI Technical Summary

Technical Problem

When traditional power systems face new and complex false data injection attacks, they respond slowly and have low accuracy, which affects the safety and reliability of the power system.

Method used

The power system false data positioning and recovery system is adopted based on deep learning, including data acquisition and standard processing modules, position detection modules and data recovery modules. The data acquisition module cleans and normalizes the operating parameters. The position detection module locates false data through the spatial and temporal feature fusion detection model. The data recovery module uses the TVAE-WGANGP model to generate recovery data.

Benefits of technology

It significantly improves positioning sensitivity and data reconstruction accuracy in complex attack scenarios, providing reliable active defense technology for smart grids.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508996A_ABST
    Figure CN120508996A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of data mining, and provides a deep learning-based false data positioning and recovery system for a power system, which comprises a data acquisition and standard processing module, a position detection module and a data recovery module, the data acquisition and standard processing module is used for acquiring operation parameters of the electric power system and performing cleaning and normalization processing on the operation parameters to generate standardized operation parameters; the position detection module is used for inputting the standardized operation parameters into a preset spatial-temporal feature fusion detection model and outputting a predicted position index of the false data; and the data recovery module is used for generating recovery data according to the predicted position index and the TVAE-WGANGP recovery model. According to the method, the positioning sensitivity and the data reconstruction precision in a complex attack scene can be remarkably improved, and a reliable active defense technology is provided for security protection of a smart power grid.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data mining technology, and in particular relates to a power system false data positioning and recovery system based on deep learning. Background Art

[0002] In recent years, the rapid development of industrial Internet of Things (IIoT) technologies has driven the transformation and upgrade of traditional power systems to smart grids. Through the deep integration of information and communication technologies, a highly automated and intelligent power network has been constructed. Physical measurement data is collected by remote terminal units and phasor measurement units and transmitted to the application layer for in-depth analysis and processing via the monitoring and data acquisition system, enabling intelligent monitoring and real-time control of the entire system. In the operation of smart grids, power system state estimation, as the core support module of the energy management system, not only provides the data foundation for key decisions such as load forecasting, emergency response, and economic dispatch, but also provides core algorithmic support for dynamic security assessment and adaptive control strategy generation of the power grid by dynamically verifying network topology and parameter consistency. The integrity and reliability of measurement data are directly related to the safe and stable operation of smart grids.

[0003] With the rapid development of new power systems, the threat of false data injection attacks (FDIAs) is rapidly increasing. FDIAs pose a serious threat to power systems by interfering with state estimation and endangering their safety and reliability. The complexity and ever-expanding scale of power systems provide attackers with more potential attack points. Traditional methods for detecting false measurement data in power systems suffer from slow response and low accuracy when faced with these new and complex attacks. Summary of the Invention

[0004] The embodiment of the present application provides a power system false data location and recovery system based on deep learning, which can solve the problems of slow response and low accuracy in the current traditional power system false measurement data detection method when facing new and complex attacks.

[0005] In the first aspect, an embodiment of the present application provides a deep learning-based false data positioning and recovery system for an electric power system, comprising a data acquisition and standard processing module, a position detection module, and a data recovery module; the data acquisition and standard processing module is used to collect the operating parameters of the electric power system, and clean and normalize the operating parameters to generate standardized operating parameters; the position detection module is used to input the standardized operating parameters into a preset spatiotemporal feature fusion detection model, and output the predicted location index of the false data; the data recovery module is used to generate recovery data based on the predicted location index and the TVAE-WGANGP recovery model.

[0006] In a possible implementation of the first aspect, the data acquisition and standard processing module includes a data acquisition unit and a data standard processing unit; A data acquisition unit, used to collect operating parameters of the power system; The data standard processing unit is used to remove missing values, outliers, and duplicate values of the collected operating parameters, and perform normalization processing to generate standardized operating parameters.

[0007] Optionally, in another possible implementation of the first aspect, the preset spatiotemporal feature fusion detection model includes a temporal feature extraction layer, a spatial feature extraction layer, a feature fusion layer, and a fully connected layer. The above-mentioned input of the standardized operating parameters into the preset spatiotemporal feature fusion detection model and output of the predicted location index of the false data include: Input the standardized operating parameters into the time feature extraction layer, extract the time series features of each measurement point, and output the time feature vector; Input the standardized operating parameters into the spatial feature extraction layer, extract the spatial correlation features between nodes, and output the spatial feature vector; Input the temporal feature vector and the spatial feature vector into the feature fusion layer for weighted fusion, and output the fused feature vector; The fused feature vector is input into the fully connected layer, and the predicted location index of the false data is output.

[0008] Optionally, in another possible implementation of the first aspect, the time feature extraction layer includes at least one global time series perception module, the global time series perception module includes a multi-head attention layer and a feedforward neural network layer, and the above-mentioned input of the standardized operating parameters into the time feature extraction layer, extracting the time series features of each measurement point, and outputting the time feature vector includes: Input the standardized operating parameters into the multi-head attention layer, extract the global dependencies between each time step, and output the attention representation; The attention representation is input into the feedforward neural network layer for nonlinear mapping, and the time series features of each measurement point are output; Perform residual connection and layer normalization operations on time series features to output time feature vectors Optionally, in another possible implementation of the first aspect, the spatial feature extraction layer includes a standard convolution layer, a depthwise separable convolution layer, and a compression-excitation attention layer, which inputs standardized operating parameters into the spatial feature extraction layer, extracts spatial correlation features between nodes, and outputs a spatial feature vector, including: The standardized operating parameters are channel-expanded and then input into the standard convolution layer to output the first spatial feature; The local spatial features are input into the depthwise separable convolutional layer, which performs intra-channel spatial filtering and inter-channel feature fusion respectively, and outputs the second spatial features; The second spatial feature is input into the compression-excitation attention layer for global average pooling operation to generate a channel description vector; the channel description vector is input into two layers of fully connected layers and nonlinear activation function for nonlinear transformation, and recalibrated through the channel attention weight to generate the third spatial feature; The third spatial feature is input into the fully connected layer for feature projection to generate a spatial feature vector.

[0009] Optionally, in another possible implementation of the first aspect, the step of inputting the temporal feature vector and the spatial feature vector into the feature fusion layer, performing weighted fusion, and outputting the fused feature vector includes: Map the temporal feature vector and the spatial feature vector to the common semantic space through linear projection; A weighted sum is performed based on the projected temporal feature vector, spatial feature vector, and learnable scaling coefficient to output a fused feature vector.

[0010] Optionally, in another possible implementation of the first aspect, inputting the fused feature vector to the fully connected layer and outputting the predicted position index of the false data includes: The fused feature vector is input into the dimensionality reduction layer to compress the feature dimension, and the Dropout operation and nonlinear processing based on the GELU activation function are performed to generate an intermediate feature representation; Combine the intermediate feature representation with the weight vector corresponding to the category to generate the attack position space output; The attack position space output is activated according to the sigmoid function to generate a multi-label prediction result, and the predicted position index of the false data is generated based on the multi-label prediction result.

[0011] Optionally, in another possible implementation of the first aspect, the TVAE-WGANGP recovery model includes a generative network and an adversarial network based on an autoencoder VAE, where the adversarial network includes a discriminator. The above generates recovery data based on the predicted position index and the TVAE-WGANGP recovery model, including: Based on the predicted position index, the data at the corresponding position in the original measurement data is set as missing value, and a missing mask matrix is constructed. Gaussian noise that follows a normal distribution is spliced to obtain the restored input data. The recovered input data is fed into a generative network based on an autoencoder VAE, which extracts latent variables and outputs the reconstructed data at the missing locations. The reconstructed data and real sample data are input into the adversarial network, combined with the loss function of the discriminator, the discrimination result is output, the adversarial network is optimized according to the discrimination result, and the restored data is generated.

[0012] Optionally, in another possible implementation of the first aspect, the above-mentioned inputting the restored input data into the generative network based on the autoencoder VAE, extracting the latent variables and outputting the reconstructed data of the missing position includes: The restored input data is encoded with the Transformer encoder to extract context-related high-dimensional features; Perform residual connection and layer normalization operations on high-dimensional features to obtain the mean and variance of the latent variables, and then sample them through the reparameterization method to obtain the latent space variables; The latent space variables are input into the gated MLP and fully connected layers respectively to obtain the reconstructed data; The reconstruction error between the original measurement data and the reconstructed data, as well as the KL divergence between the potential distribution and the standard normal distribution are calculated. The loss function of VAE is constructed based on the reconstruction error and KL divergence, and the encoder and decoder parameters of the generated network are optimized based on the loss function of VAE.

[0013] Optionally, in another possible implementation of the first aspect, the loss function of the above-mentioned discriminator takes the Wasserstein distance between the reconstructed data and the real sample data as the optimization target, and introduces a gradient penalty term based on the interpolated sample to constrain the discriminator to satisfy the K-Lipschitz continuity condition, thereby constraining the training objective of the adversarial network.

[0014] Beneficial effects: In the technical solution of the present application, the system includes a data acquisition and standard processing module, a position detection module, and a data recovery module; the data acquisition and standard processing module is used to collect the operating parameters of the power system, and clean and normalize the operating parameters to generate standardized operating parameters; the position detection module is used to input the standardized operating parameters into a preset spatiotemporal feature fusion detection model and output the predicted position index where the false data is located; the data recovery module is used to generate recovery data based on the predicted position index and the TVAE-WGANGP recovery model. The system provided by the present application can significantly improve the positioning sensitivity and data reconstruction accuracy in complex attack scenarios, and provide a reliable active defense technology for the security protection of smart grids. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0016] Figure 1 This is a structural diagram of a power system false data location and recovery system based on deep learning provided in one embodiment of the present application. DETAILED DESCRIPTION

[0017] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0018] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0019] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0020] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0021] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0022] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0023] The following is a detailed description of a power system false data location and recovery system based on deep learning provided by this application with reference to the accompanying drawings.

[0024] Figure 1 A structural diagram of a power system false data location and recovery system based on deep learning provided in an embodiment of the present application is shown.

[0025] like Figure 1 As shown, the power system false data positioning and recovery system 100 based on deep learning includes a data acquisition and standard processing module 110, a position detection module 120 and a data recovery module 130; The data acquisition and standard processing module 110 is used to collect the operating parameters of the power system, clean and normalize the operating parameters, and generate standardized operating parameters; The identification and recovery of false data in power systems begins with the efficient collection and processing of key measurement data. This module mainly provides the necessary data support for attack localization and data recovery, ensuring that the detection and recovery algorithms can be trained on a comprehensive and rich dataset, thereby improving the generalization ability and accuracy of the evaluation model.

[0026] Furthermore, in the embodiment of the present application, the data acquisition and standard processing module 110 includes a data acquisition unit and a data standard processing unit; A data acquisition unit, used to collect operating parameters of the power system; The data standard processing unit is used to remove missing values, outliers, and duplicate values of the collected operating parameters, and perform normalization processing to generate standardized operating parameters.

[0027] It should be noted that the data acquisition unit mainly obtains data from various sensors, smart meters, protection devices, energy management systems, etc., and is used to continuously monitor and record key operating parameters of the power system, including voltage, current, frequency, power, load and other key parameters.

[0028] The data standard processing unit is used to standardize the collected data on the operating status of various systems. As the input of the algorithm, the data samples will inevitably affect the analysis results of the algorithm output. Therefore, good data cleaning and preprocessing are crucial to improving the accuracy of the anomaly detection algorithm. After collecting the data to be detected, data cleaning and data preprocessing are required. Data cleaning mainly includes: 1) Clean records containing missing values; 2) Cleaning a small number of extreme data and negative data in the test samples; 3) Remove duplicate values to ensure that there are no redundant or duplicate records in the dataset.

[0029] After cleaning, the accuracy and consistency of the data set must be ensured, otherwise it cannot be processed and analyzed normally. After data cleaning, data preprocessing is performed, which mainly includes normalization.

[0030] In a complex power network communication environment, due to the large and complex data, it is generally necessary to perform linear normalization on the data, so that all samples are between 0 and 1. The linear normalization formula is:

[0031] Where: x(i) represents any sample value, min(x(n)) is the minimum value in the data, and max(x(n)) is the maximum value in the data.

[0032] The position detection module 120 is used to input the standardized operating parameters into a preset spatiotemporal feature fusion detection model and output the predicted position index where the false data is located; To combat false data injection attacks in power systems, this application proposes a deep learning detection model based on spatiotemporal feature fusion. This model utilizes a dual-branch architecture, consisting of an input layer, hidden layer, feature fusion layer, fully connected layer, and output layer. After the input signal is normalized, the temporal feature extraction branch captures long-term temporal dependencies, while the spatial feature extraction branch extracts local spatial features. The feature fusion layer achieves interactive enhancement of spatiotemporal features, and finally, the fully connected layer completes the multi-label classification task.

[0033] Furthermore, in an embodiment of the present application, the preset spatiotemporal feature fusion detection model includes a temporal feature extraction layer, a spatial feature extraction layer, a feature fusion layer, and a fully connected layer. The above-mentioned standardized operating parameters are input into the preset spatiotemporal feature fusion detection model, and the predicted location index of the false data is output, including: Input the standardized operating parameters into the time feature extraction layer, extract the time series features of each measurement point, and output the time feature vector; Input the standardized operating parameters into the spatial feature extraction layer, extract the spatial correlation features between nodes, and output the spatial feature vector; Input the temporal feature vector and the spatial feature vector into the feature fusion layer for weighted fusion, and output the fused feature vector; The fused feature vector is input into the fully connected layer, and the predicted location index of the false data is output.

[0034] Furthermore, in an embodiment of the present application, the time feature extraction layer includes at least one global time series perception module, which includes a multi-head attention layer and a feedforward neural network layer. The above-mentioned standardized operating parameters are input into the time feature extraction layer, the time series features of each measurement point are extracted, and the time feature vector is output, including: Input the standardized operating parameters into the multi-head attention layer, extract the global dependencies between each time step, and output the attention representation; The attention representation is input into the feedforward neural network layer for nonlinear mapping, and the time series features of each measurement point are output; Perform residual connection and layer normalization operations on the time series features and output the time feature vector.

[0035] Optionally, in one embodiment, the input standardized operating parameters are first defined as , where B is the batch size and d is the feature dimension. The temporal feature extraction process first maps the input raw data into a high-dimensional semantic space through linear projection, and defines the generation process of the query, key, and value matrices as follows:

[0036] in is the trainable parameter matrix, is the bias term, The dimension of each attention head is . The association weights between different time steps are calculated by scaling the dot-product attention:

[0037] Among them, Q, K, and V represent query, key, and value matrices respectively. k is the dimension of the key vector.

[0038] The scaling factor here It is used to alleviate the problem of excessively large dot product values in high-dimensional spaces and prevent the softmax function from entering the gradient saturation region. The multi-head attention mechanism enables the model to focus on different parts of the input sequence in parallel from different subspaces by parallelizing multiple attention heads, capturing global dependencies. Its calculation form is:

[0039] Where h is the number of attention heads, To further enhance the nonlinear expression capability, a feed-forward neural network (FFN) is used to perform nonlinear transformation on the features extracted by the attention machine, further mining high-level feature information to ensure that the model can integrate global semantic information and generate a rich set of feature vectors.

[0040] The GELU activation function introduces a random regularization effect, and its formula is expressed as:

[0041] Compared with the traditional ReLU function, GELU has a smooth gradient transition when approaching zero, which helps to alleviate the problem of gradient mutation. In addition, after each sub-layer, residual connection and layer normalization are used. The calculation process is as follows:

[0042] in represents multi-head attention or feedforward network operations, is the layer index. The residual structure ensures that gradients are effectively propagated in deep networks, while layer normalization accelerates model convergence and improves generalization performance by standardizing the feature dimensions of each sample. This design effectively alleviates the vanishing gradient problem in deep networks and promotes the fusion and transfer of features between layers.

[0043] The temporal feature extraction layer adopts a stacked design, employing two cascaded global temporal perception modules. This integrates long-range feature information to establish global dependencies across time steps. Each module sequentially performs multi-head self-attention, feedforward transformation, and feature fusion. This structure enables the model to abstract temporal features layer by layer, capturing local fluctuation patterns at the bottom layer and extracting global dependencies at higher layers. Each perception module further extracts and optimizes feature representations based on the previous layer, ensuring that the final feature vector fully reflects the global information of the input features.

[0044] Furthermore, in an embodiment of the present application, the spatial feature extraction layer includes a standard convolution layer, a depthwise separable convolution layer, and a compression-excitation attention layer. The above-mentioned standardized operating parameters are input into the spatial feature extraction layer, the spatial correlation features between each node are extracted, and the spatial feature vector is output, including: The standardized operating parameters are channel-expanded and then input into the standard convolution layer to output the first spatial feature; The local spatial features are input into the depthwise separable convolutional layer, which performs intra-channel spatial filtering and inter-channel feature fusion respectively, and outputs the second spatial features; The second spatial feature is input into the compression-excitation attention layer for global average pooling operation to generate a channel description vector; the channel description vector is input into two layers of fully connected layers and nonlinear activation function for nonlinear transformation, and recalibrated through the channel attention weight to generate the third spatial feature; The third spatial feature is input into the fully connected layer for feature projection to generate a spatial feature vector.

[0045] As a possible implementation manner, the above-mentioned fully connected layer can be a fully connected layer including 512 neuron nodes, which is not limited in this application.

[0046] Optionally, in one embodiment, the normalized operating parameters are first converted into a three-dimensional tensor by a spatial dimension reshaping operation. , where the newly added channel dimension is used to accommodate one-dimensional convolution. Subsequently, the single-channel signal is mapped to a high-dimensional feature space through a one-dimensional convolution layer (Conv1d) with a convolution kernel size of K1, and the output is , (number of output channels) and L (sequence length of the output feature map) can be derived through the analytical formula of the convolution operator, which is determined by the configuration of hyperparameters such as the dimension of the input tensor, the size of the convolution kernel (kernel / filter), the stride, and the padding strategy.

[0047] To strike a balance between enhanced feature expression and computational efficiency, the network architecture employs depthwise separable convolution, which consists of two stages: spatial filtering within a channel and fusion between channels. The first stage performs depthwise convolution, which decouples spatial feature extraction from channel mixing. Specifically, it applies position-sensitive convolution kernels independently to each channel, focusing on extracting local spatial features without introducing information interaction between channels. Its calculation formula is:

[0048] in is the depth convolution kernel weight of layer I, j represents the sample index, p is the index of a position in the input signal, is the number of input channels. Subsequently, point-by-point convolution is performed using a 1×1 convolution kernel to achieve information fusion between channels:

[0049] in is a 1×1 point-by-point convolution kernel, is a certain location The total number of parameters of the depthwise separable convolution is , which is much lower than that of standard convolution , is the number of input channels, is the number of output channels, and K represents the receptive field size when the convolution kernel is applied to each channel, which improves computational efficiency while reducing the risk of overfitting.

[0050] To further enhance the representation capability of convolutional features, the model introduces a Squeeze-and-Excitation (SE) attention layer, which adaptively emphasizes attack-sensitive feature channels through a dynamic channel weighting mechanism. Perform global average pooling to generate channel description vectors:

[0051] in, For the location and channel The output on this vector Through a two-layer fully connected network and a nonlinear activation function, the nonlinear interaction relationship between channels is learned. Finally, the original feature map is recalibrated by the channel attention weight s:

[0052] in represents the element-wise multiplication in the channel direction, is the feature map after being processed by the SE module. It is the feature map after pointwise convolution.

[0053] In terms of spatial feature extraction, the hybrid convolutional architecture adopts the following processing flow: first, the basic local pattern feature is extracted through the standard 3×1 convolution layer; then the depth-wise separable convolution is used to achieve parameter-efficient feature refinement; and finally, the SE attention layer is used to complete the channel-adaptive feature weight adjustment. After multiple stages of progressive feature abstraction processing, the feature is finally projected through a fully connected layer containing 512 neuron nodes to generate a spatial representation vector. .

[0054] Furthermore, in the embodiment of the present application, the temporal feature vector and the spatial feature vector are input into the feature fusion layer for weighted fusion, and the fused feature vector is output, including: Map the temporal feature vector and the spatial feature vector to the common semantic space through linear projection; A weighted sum is performed based on the projected temporal feature vector, spatial feature vector, and learnable scaling coefficient to output a fused feature vector.

[0055] Optionally, in one embodiment, in order to effectively integrate the heterogeneous information and complementary characteristics of spatiotemporal features, this application introduces a learnable weighted fusion method to achieve a dynamic balance of feature contribution by adaptively adjusting parameters. (B is the batch size, is the output dimension of the temporal feature extraction layer) and the spatial feature ( is the output dimension of the spatial feature extraction layer). The fusion process first maps the two to a common semantic space through linear projection:

[0056] in and is the learnable projection matrix ( is the public space dimension), is the bias term. This projection operation not only solves the problem of feature dimension mismatch, but also enhances the expression compatibility of features through nonlinear transformation.

[0057] Then, a learnable scaling factor is introduced Build a dynamic weighting mechanism to ultimately generate rich feature expressions , the specific formula is shown as follows: .

[0058] in, is the output of the temporal feature layer, is the output of the spatial feature layer.

[0059] Furthermore, in the embodiment of the present application, the above-mentioned inputting the fused feature vector into the fully connected layer and outputting the predicted position index of the false data includes: The fused feature vector is input into the dimensionality reduction layer to compress the feature dimension, and the Dropout operation and nonlinear processing based on the GELU activation function are performed to generate an intermediate feature representation; Combine the intermediate feature representation with the category-specific weight vector to generate the attack location space output; The attack position space output is activated according to the sigmoid function to generate a multi-label prediction result, and the predicted position index of the false data is generated based on the multi-label prediction result.

[0060] Optionally, in one embodiment, the high-dimensional features output by the feature fusion layer are first Mapped to the prediction space of the attack location, the feature dimension is compressed through the dimensionality reduction layer and nonlinearity is introduced:

[0061] in is the dimension reduction matrix, is the bias term, and the Dropout layer uses probability The neuron output is randomly masked to prevent overfitting, and the GELU activation function introduces nonlinear transformation capabilities to the features. Subsequently, the attack position space output is generated through the category-specific weight vector:

[0062] in is the classification weight matrix ( is the total number of attack instrument locations), is the bias term, is the element-wise sigmoid function:

[0063] in, are the raw scores (logits) input to the Sigmoid activation function, obtained through the feedforward process of the network.

[0064] Each output unit Represents the probability estimate of the presence of an attack at the corresponding location. Sigmoid is used to activate multiple output units simultaneously to adapt to the scenario of coexistence of locations caused by joint attacks.

[0065] As a possible implementation method, in order to deal with the problem of category imbalance, the classifier introduces a dynamic weight adjustment strategy, the output layer bias term Initialization is performed based on the frequency of positive samples in the training set. The formula is as follows:

[0066] in is the number of positive samples in the kth class, and N is the total number of samples. This initialization strategy causes the model to favor predicting high-frequency classes during the initial training phase, accelerating convergence. As the adaptive focus loss function is optimized, the weights of each class are automatically balanced, and the bias term is gradually adjusted to its optimal value.

[0067] Since the traditional binary cross entropy loss function treats all categories equally, it can easily lead to a bias in the model towards high-frequency categories. Therefore, as a possible implementation method, this application proposes an adaptive focal loss function (AFL), which adjusts the sample difficulty weight through learnable category weights and dynamic focal factors to solve the problem of imbalanced attack sample categories and avoid the model's bias towards conservative predictions, thereby improving the detection rate of covert attacks. Its mathematical formula is:

[0068] in is the predicted probability of sample i in the kth class, For samples In the The unnormalized prediction scores for the classes, is a learnable category balancing factor, is the category-related focusing factor. Weight Update via:

[0069] in is an optimizable parameter, is the learnable weight parameter, is the number of positive samples of the kth class in the training set, Prevent division by zero errors.

[0070] The data recovery module 130 is configured to generate recovery data according to the predicted location index and the TVAE-WGANGP recovery model.

[0071] Furthermore, in an embodiment of the present application, the TVAE-WGANGP recovery model includes a generative network and an adversarial network based on an autoencoder VAE, and the adversarial network includes a discriminator. The above generates recovery data based on the predicted position index and the TVAE-WGANGP recovery model, including: S1. Based on the predicted position index, the data at the corresponding position in the original measurement data is set to missing values, and a missing mask matrix is constructed. Gaussian noise that follows a normal distribution is spliced to obtain the restored input data. S2, input the recovered input data into the generative network based on the autoencoder VAE, extract the latent variables and output the reconstructed data of the missing position; Furthermore, in an embodiment of the present application, the above-mentioned inputting of the restored input data into the generative network based on the autoencoder VAE, extracting the latent variables and outputting the reconstructed data of the missing position also includes: The restored input data is encoded with the Transformer encoder to extract context-related high-dimensional features; Perform residual connection and layer normalization operations on high-dimensional features to obtain the mean and variance of the latent variables, and then sample them through the reparameterization method to obtain the latent space variables; The latent space variables are input into the gated MLP and fully connected layers respectively to obtain the reconstructed data; The reconstruction error between the original measurement data and the reconstructed data, as well as the KL divergence between the potential distribution and the standard normal distribution are calculated. The loss function of VAE is constructed based on the reconstruction error and KL divergence, and the encoder and decoder parameters of the generated network are optimized based on the loss function of VAE.

[0072] S3. Input the reconstructed data and real sample data into the adversarial network, combine the loss function of the discriminator, output the discrimination result, optimize the adversarial network according to the discrimination result, and generate restored data.

[0073] In an embodiment of the present application, the loss function of the above-mentioned discriminator takes the Wasserstein distance between the reconstructed data and the real sample data as the optimization target, and introduces a gradient penalty term based on the interpolated sample to constrain the discriminator to meet the K-Lipschitz continuity condition, which constitutes the training target of the adversarial network.

[0074] Optionally, an embodiment will be used below to illustrate the contents of steps S1-S3.

[0075] Standardize power system measurement data with some missing values (replaced with NaN) , Gaussian noise that obeys normal distribution The mask matrix M is input into the encoding network, the dimension is expanded to a high-dimensional space through a fully connected layer, and then spectral normalization is used to constrain the weight matrix: ,in is the maximum singular value of the weight matrix, and batch normalization is performed to adjust the data distribution to zero mean and unit variance. Learnable scaling and offset parameters are introduced to enhance model flexibility. Then, nonlinearity is introduced using the GELU activation function. This activation method maintains approximate linearity in the positive region while providing a smooth transition in the negative region, which helps to capture complex patterns in power data.

[0076] After adding the position encoding, the high-dimensional features are input to the Transformer encoding layer, and after residual connection and layer normalization, two outputs are obtained. and , which represent the mean and variance of the Gaussian distribution respectively. Then, the latent variable z is reparameterized and the data is reconstructed through the gated MLP and fully connected layers; VAE introduces KL divergence to measure the distance between the previous and next data distributions. KL divergence is used to describe and The similarity between two distributions is expressed as:

[0077] Where: Represents the maximum likelihood estimation function of X. Since the KL divergence is non-negative, minimizing the KL divergence can be transformed into maximizing the variational lower bound , after transformation derivation, the loss function of VAE is:

[0078] Where: yes The reconstruction error, Represents the variational distribution and the prior distribution To simplify the calculation process, the normal distribution is often used. As a prior distribution .

[0079] This application introduces Wasserstein distance as the objective function to solve the gradient vanishing problem of traditional networks during training. Wasserstein distance can reflect the distribution of generated data. Transform to target data distribution The minimum cost required, under ideal conditions, is the Wasserstein distance is continuously differentiable, which helps improve the training stability of GAN, and its expression is:

[0080] Where: represents the supremum of the function value, K is the Lipschitz constant, For the generated data, Representation function Satisfies K-Lipschitz continuity, represents the score of the discriminator on the target data, Represents the score of the discriminator on the generated data. In practical applications, WGAN may also experience gradient explosion and non-convergence, which is usually attributed to unreasonable constraints imposed on the adversarial network. Therefore, the gradient of the adversarial network is added as a penalty term to the adversarial network loss function, forming a generative adversarial network model WGANGP based on gradient penalty optimization. This avoids the problems of gradient vanishing and mode collapse, making the training process more stable and reliable. The adversarial network loss function of WGANGP is:

[0081] Where: represents the P norm, represents the gradient operator, is the penalty coefficient, , Obey the uniform distribution in the range [0, 1], Represents the target data distribution To generate data distribution Uniform sampling between, D(x) is the output of the discriminator, G(Z) is the generated data, is the expected value of the discriminator output D(x), is the output of the discriminator for the sample G(Z) generated by the generator, where G(Z) is the sample generated from the latent variable Z through the generator network, Generate samples for the discriminator D The gradient, Used to control the impact of this item on the total loss function, It is the distribution of real data Samples sampled in The expected value of , and similarly, the loss function of the generated network can be obtained as:

[0082] in, represents the distribution of the latent variable z, represents the expectation of sampling all latent variables z.

[0083] During the training process of WGANGP, the input of the generative network is Gaussian noise, and the normal measurement data is used as the generation target. The generative network and the adversarial network perform minimum-maximum game adversarial training based on their respective loss functions. By reconstructing the loss, the data to be recovered at the zero position of the mask matrix M is converted to and generate data Combine to get recovered data , the recovered data : .

[0084] The present application provides a deep learning-based power system false data positioning and recovery system, which includes a data acquisition and standard processing module, a location detection module, and a data recovery module; the data acquisition and standard processing module is used to collect the operating parameters of the power system, and clean and normalize the operating parameters to generate standardized operating parameters; the location detection module is used to input the standardized operating parameters into a preset spatiotemporal feature fusion detection model and output the predicted location index of the false data; the data recovery module is used to generate recovery data based on the predicted location index and the TVAE-WGANGP recovery model. The system provided by the present application can significantly improve the positioning sensitivity and data reconstruction accuracy in complex attack scenarios, and provide a reliable active defense technology for the security protection of smart grids.

[0085] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0086] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A power system false data location and recovery system based on deep learning, characterized by: It includes data acquisition and standard processing module, position detection module and data recovery module; The data acquisition and standard processing module is used to collect the operating parameters of the power system, clean and normalize the operating parameters, and generate standardized operating parameters; The position detection module is used to input the standardized operating parameters into a preset spatiotemporal feature fusion detection model and output the predicted position index where the false data is located; The data recovery module is used to generate recovery data according to the predicted position index and the TVAE-WGANGP recovery model.

2. The system according to claim 1, wherein The data acquisition and standard processing module includes a data acquisition unit and a data standard processing unit; The data acquisition unit is used to collect operating parameters of the power system; The data standard processing unit is used to remove missing values, eliminate abnormal values, and deduplicate the collected operating parameters, and perform normalization processing to generate standardized operating parameters.

3. The system according to claim 1, wherein: The preset spatiotemporal feature fusion detection model includes a time feature extraction layer, a spatial feature extraction layer, a feature fusion layer, and a fully connected layer. The standardized operating parameters are input into the preset spatiotemporal feature fusion detection model to output the predicted location index of the false data, including: Input the standardized operating parameters into the time feature extraction layer, extract the time series features of each measurement point, and output the time feature vector; Input the standardized operating parameters into the spatial feature extraction layer, extract the spatial correlation features between nodes, and output the spatial feature vector; Input the temporal feature vector and the spatial feature vector into the feature fusion layer for weighted fusion, and output the fused feature vector; The fused feature vector is input into the fully connected layer, and the predicted location index of the false data is output.

4. The system according to claim 3, wherein: The time feature extraction layer includes at least one global time series perception module, which includes a multi-head attention layer and a feedforward neural network layer. The standardized operating parameters are input into the time feature extraction layer, the time series features of each measurement point are extracted, and the time feature vector is output, including: Input the standardized operating parameters into the multi-head attention layer, extract the global dependencies between each time step, and output the attention representation; The attention representation is input into the feedforward neural network layer for nonlinear mapping, and the time series features of each measurement point are output; Perform residual connection and layer normalization operations on the time series features and output the time feature vector.

5. The system according to claim 3, wherein: The spatial feature extraction layer includes a standard convolution layer, a depth-separable convolution layer, and a compression-excitation attention layer. The standardized operating parameters are input into the spatial feature extraction layer, the spatial correlation features between each node are extracted, and the spatial feature vector is output, including: The standardized operating parameters are channel-expanded and then input into the standard convolution layer to output the first spatial feature; The local spatial features are input into the depthwise separable convolutional layer, which performs intra-channel spatial filtering and inter-channel feature fusion respectively, and outputs the second spatial features; The second spatial feature is input into the compression-excitation attention layer for global average pooling operation to generate a channel description vector; the channel description vector is input into two layers of fully connected layers and nonlinear activation function for nonlinear transformation, and recalibrated through the channel attention weight to generate the third spatial feature; The third spatial feature is input into the fully connected layer for feature projection to generate a spatial feature vector.

6. The system according to any one of claims 3 to 5, characterized in that: The step of inputting the temporal feature vector and the spatial feature vector into the feature fusion layer, performing weighted fusion, and outputting the fused feature vector includes: Map the temporal feature vector and the spatial feature vector to the common semantic space through linear projection; A weighted sum is performed based on the projected temporal feature vector, spatial feature vector, and learnable scaling coefficient to output a fused feature vector.

7. The system according to claim 6, wherein: The fusion feature vector is input to the fully connected layer, and the predicted position index of the false data is output, including: The fused feature vector is input into the dimensionality reduction layer to compress the feature dimension, and the Dropout operation and nonlinear processing based on the GELU activation function are performed to generate an intermediate feature representation; Combine the intermediate feature representation with the weight vector corresponding to the category to generate the attack position space output; The attack position space output is activated according to the sigmoid function to generate a multi-label prediction result, and the predicted position index of the false data is generated based on the multi-label prediction result.

8. The system according to claim 7, wherein: The TVAE-WGANGP recovery model includes a generative network and an adversarial network based on an autoencoder VAE, wherein the adversarial network includes a discriminator. The recovery data is generated according to the predicted position index and the TVAE-WGANGP recovery model, including: Based on the predicted position index, the data at the corresponding position in the original measurement data is set as missing value, and a missing mask matrix is constructed. Gaussian noise that follows a normal distribution is spliced to obtain the restored input data. The recovered input data is fed into a generative network based on an autoencoder VAE, which extracts latent variables and outputs the reconstructed data at the missing locations. The reconstructed data and real sample data are input into the adversarial network, combined with the loss function of the discriminator, the discrimination result is output, the adversarial network is optimized according to the discrimination result, and the restored data is generated.

9. The system according to claim 8, wherein The method of inputting the restored input data into the generative network based on the autoencoder VAE, extracting the latent variables and outputting the reconstructed data of the missing position includes: The restored input data is encoded with the Transformer encoder to extract context-related high-dimensional features; Perform residual connection and layer normalization operations on high-dimensional features to obtain the mean and variance of the latent variables, and then sample them through the reparameterization method to obtain the latent space variables; The latent space variables are input into the gated MLP and fully connected layers respectively to obtain the reconstructed data; The reconstruction error between the original measurement data and the reconstructed data, as well as the KL divergence between the potential distribution and the standard normal distribution are calculated. The loss function of VAE is constructed based on the reconstruction error and KL divergence, and the encoder and decoder parameters of the generated network are optimized based on the loss function of VAE.

10. The system according to claim 8, wherein The loss function of the discriminator takes the Wasserstein distance between the reconstructed data and the real sample data as the optimization target, and introduces a gradient penalty term based on the interpolated samples to constrain the discriminator to meet the K-Lipschitz continuity condition, which constitutes the training objective of the adversarial network.

Citation Information

Patent Citations

  • Deep learning-driven anomaly recognition and repair method and intelligent system

    CN113240011A

  • Smart power grid false data injection attack positioning method based on frequency spectrum domain data driving

    CN116304621A

  • Space-time detection method for power grid false data injection attack

    CN116578903A

  • Full-station protection constant value management method and system based on NLP

    CN118628289A

  • Power grid network attack detection method and system based on deep learning

    CN119583182A

Cited By

  • Power system data generation method based on outlier detection and depth generation model

    CN121167313A