CAEGRU-based intelligent power grid electric quantity anomaly detection method, system and device, and storage medium

By combining the CAEGRU model with data cleaning and deep learning, the problems of high noise in power data and low accuracy of anomaly detection in smart grids are solved, enabling efficient and accurate anomaly detection in power systems and ensuring the stability and security of power systems.

CN120995190APending Publication Date: 2025-11-21GUIZHOU POWER GRID CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510903757.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-01
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing technologies suffer from high noise levels in power data and low accuracy in anomaly detection. They also fail to effectively combine power consumption characteristics with topology information, resulting in insufficient timeliness and accuracy in power anomaly detection in smart grids, which may lead to economic losses and safety risks.

Method used

A CAEGRU-based smart grid power anomaly detection method is adopted. Through data cleaning, feature extraction and deep learning modeling, a CAEGRU model is constructed. Combined with a convolutional autoencoder and a gated recurrent unit, power data features are trained to achieve real-time anomaly detection.

Benefits of technology

It improves the accuracy and robustness of power data anomaly detection, enabling timely discovery of potential anomalies, ensuring stable operation of the power system, and reducing economic losses and safety risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120995190A_ABST
    Figure CN120995190A_ABST
Patent Text Reader

Abstract

The invention discloses a CAEGRU-based intelligent power grid electric quantity abnormity detection method, system and device and a storage medium, and belongs to the field of electric quantity abnormity detection, and the method comprises the steps: obtaining the electric quantity data of a target station area user from a power grid metering center database, and carrying out the cleaning and preprocessing; on the basis of the preprocessed data, according to a transformer area topological structure, the length of a transformer area line loss selection sequence is calculated through main table data and sub-table data, and a feature set of power utilization characteristics is constructed; and constructing a CAEGRU model based on a convolutional automatic encoder and a gating cycle unit, training the feature set, and outputting an electric quantity anomaly detection result. According to the method, the CAE and the GRU are combined to construct the features, the features and rules of the power data are comprehensively reflected, and the anomaly detection precision is improved. Compared with a traditional method, the method has higher robustness when processing complex power data. The sliding window technology realizes real-time detection of electric quantity data of the smart power grid, and potential abnormal problems are found in time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power anomaly detection technology, specifically to a smart grid power anomaly detection method, system, device, and storage medium based on CAEGRU (Convolutional Autoencoder Gated Recurrent Unit). Background Technology

[0002] With the continued growth of global energy demand and the increasing complexity of power systems, smart grid technology has been widely applied. In smart grids, power anomaly detection is a core task to ensure power supply stability and economy. Power anomalies are typically caused by hardware failures or unacceptable non-technical loss events, such as user tampering with metering equipment to steal electricity, malfunctions in power metering and communication equipment, and aging cable insulation. Failure to detect these anomalies in a timely manner can lead to serious economic losses, energy waste, and even severe security risks. Summary of the Invention

[0003] To address the aforementioned technical issues, a smart grid power anomaly detection method based on CAEGRU is proposed, which includes obtaining power data of users in the target distribution area from the power grid metering center database and performing cleaning and preprocessing. Based on the preprocessed electricity consumption data of users in the transformer area, the line loss of the transformer area is calculated from the main table and sub-table data according to the transformer area topology. An appropriate sequence length is selected, and a feature set of electricity consumption characteristics is constructed by calculating the line loss of the transformer area and the meter error. A CAEGRU model is constructed based on a convolutional autoencoder and a gated recurrent unit, and trained on a feature set. Real-time electricity consumption data is input into the CAEGRU model for training, and the output is the result of abnormal electricity consumption detection.

[0004] As a preferred embodiment of the smart grid power anomaly detection method based on CAEGRU described in this invention, the step of obtaining the power data of the target transformer area users includes obtaining the daily power consumption of the users and the power consumption data of the transformer main meter of the transformer area. Based on the topological relationship of the main and sub-tables of the transformer area Extract electricity consumption data of users in the Taizhou area. and the main table data of the station area ; in, Indicates the first One user, Taiwan District The next One user, This represents the total number of users within the designated area. representing the user power consumption data, representing the extracted power consumption data at the acquisition time point, representing the user power consumption data at the acquisition time point.

[0005] As a preferred scheme of the CAEGRU-based intelligent power grid power anomaly detection method, the power consumption data of the target substation user is obtained from the power grid metering center database, and cleaning and preprocessing includes cleaning and preprocessing of user power consumption time series numerical data; The extracted data is cleaned and arranged, and if the extracted power consumption data is missing more than t acquisition time points, the data collected by the current sample is invalid, and the sample is discarded; If the user power consumption data column is not continuous in time and the data column within t acquisition time points is missing, the mean value is used for interpolation, and the unreasonable data is judged as invalid and the current sample is discarded; The abnormal values and missing values in the data are processed, and for the extracted power consumption data, 3 rules are used to remove abnormal values from the entire data; Linear interpolation technology is adopted, and the missing data is filled by calculating the average value of adjacent data points to replace the missing value.

[0006] As a preferred scheme of the CAEGRU-based intelligent power grid power anomaly detection method, the power consumption data of the target substation user is obtained from the power grid metering center database, and cleaning and preprocessing includes cleaning and preprocessing of user power consumption time series numerical data; The substation line loss is calculated according to the substation topology structure from the main table and subtable data, and the appropriate sequence length is selected, and the feature set of power consumption characteristics is constructed by calculating the substation line loss and the power meter error, including The substation line loss is calculated according to the substation topology structure from the main table and subtable data, and the appropriate sequence length is selected, and the feature set of power consumption characteristics is constructed by calculating the substation line loss and the power meter error, including , wherein, is the daily difference between the main table and the subtable reading, is the daily reading of the main table, represents the reading of the subtable on the day, is the number of subtables under the substation; A sliding window is adopted, the window length is selected, the user power consumption data is divided, and the monomial time series power consumption data is divided into a series of non-overlapping subsequences with a length of M by the sliding window, and the correlation of the user power consumption and the substation line loss in the window is calculated.

[0007] As a preferred scheme of the CAEGRU-based intelligent power grid power anomaly detection method, the method comprises the following steps: preprocessing the power consumption data of the transformer area user, calculating the transformer area line loss according to the transformer area topology structure from the master table and the sub-table data, selecting a suitable sequence length, and constructing a feature set of power consumption characteristics by calculating the transformer area line loss and the power meter error. According to the power supply structure and the energy conservation principle, an algorithm is written to calculate the user power meter error. The transformer area metering device adopts a hierarchical configuration mode, in which the transformer area terminal master table is a first-level metering device, and the user-side power meter is a second-level metering device. The first-level metering device and the second-level metering device are combined to form a tree-shaped metering network architecture.

[0008] According to the topological relationship of the tree-shaped metering network and the energy conservation principle: The transformer area power balance equation is that the total amount of power recorded by the first-level metering device is equal to the algebraic sum of the sum of the readings of all second-level metering devices, the line dynamic loss, and the inherent loss of the metering device, and the expression is: , , Among them, in the metering period , is the total power supply of the transformer area total meter, is the operation error rate of the first sub-meter, is the daily power consumption of the first sub-meter, is the fixed loss, is the line variable loss rate, is the transformer area line loss; m daily power consumption data is input into the transformer area power meter error calculation model, and , the matrix expression is: , , , , , Among them, is the transformer line loss matrix, is the coefficient matrix of the power meter error relationship, is the solution of the equation, is the vector transpose; After calculating the correlation between the power and the transformer area line loss and the power meter error, the data set for training the anomaly detection model is obtained , wherein represents the power consumption data in the Nth window after window division, represents the correlation between the calculated power consumption and the feeder line loss in the Nth window, represents the calculated meter error.

[0009] As a preferred scheme of the CAEGRU-based intelligent power grid power anomaly detection method, the CAEGRU model is constructed based on the convolutional autoencoder and the gated recurrent unit, and the training of the feature set includes assembling a neural network model based on the convolutional autoencoder, the gated recurrent unit, the decoder, and the fully connected layer. The update gate adjusts the inheritance information of the hidden state from the previous hidden state, and the reset gate adjusts the contribution of the previous state to the current calculation. Under the influence of the reset gate, the candidate hidden state is calculated based on the current input and the candidate information of the previous hidden state, and the update gate is used to weight and sum the previous hidden state and the candidate hidden state to obtain the final hidden state.

[0010] As a preferred scheme of the CAEGRU-based intelligent power grid power anomaly detection method, the CAEGRU model is trained by inputting real-time power consumption data, and the power anomaly detection result is outputted, including The real-time collected intelligent power grid power data is preprocessed and feature constructed to obtain a data set containing two features of power consumption data features and correlation and meter error , which is inputted into the CAEGRU model for training, the features extracted by the fully connected layer are integrated and inputted into the probability density function softmax, the softmax function converts the output of the fully connected layer into probability values of two categories, respectively representing the probability that the data belongs to normal and abnormal, and according to the set threshold value, the result of whether the power consumption is abnormal is outputted.

[0011] Another object of the present application is to provide a CAEGRU-based intelligent power grid power anomaly detection system, which solves the problems of large power data noise, low anomaly detection precision, and inability to effectively combine power consumption characteristics and topology information in the prior art, and realizes accurate identification and efficient detection of intelligent power grid user power consumption anomalies through data cleaning, feature extraction, deep learning modeling, and real-time classification output.

[0012] As a preferred scheme of the CAEGRU-based intelligent power grid power anomaly detection system, it is characterized by comprising a data cleaning and preprocessing module, a feature extraction and construction module, a CAEGRU model training module, and a real-time detection and classification output module. The data cleaning and preprocessing module extracts electricity consumption data of users in the power grid metering center database, removes abnormal data, and fills in missing values ​​through mean interpolation and linear interpolation; The feature extraction and construction module calculates line loss based on preprocessed data and the topological relationship between the main meter and sub-meters in the transformer area. It also deduces meter error based on the principle of energy conservation. By dividing the electricity consumption time series data through a sliding window, it extracts the correlation between user electricity consumption, line loss and meter error features to form a complete training sample. The CAEGRU model training module uses a convolutional autoencoder to extract spatial features and a gated recurrent unit to capture time series characteristics, constructs a CAEGRU model, trains the feature data, and learns the difference between normal electricity consumption behavior and potential abnormal patterns. The real-time detection and classification output module performs the same preprocessing and feature extraction on the real-time collected electricity consumption data, inputs the results into the trained CAEGRU model, and outputs the anomaly detection results through the fully connected layer and the Softmax classifier to complete real-time anomaly identification.

[0013] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the CAEGRU-based smart grid power anomaly detection method.

[0014] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the CAEGRU-based smart grid power anomaly detection method.

[0015] The beneficial effects of this invention are as follows: This invention combines the advantages of CAE (Convolutional Auto-Encoder) and GRU (Gated Recurrent Unit) to construct more effective features, which can more comprehensively reflect the characteristics and patterns of power data and improve the accuracy of anomaly detection. Compared with traditional methods, the model of this invention has higher robustness when processing complex power data and can better adapt to various changes in the operation of the power system. The sliding window technique enables real-time detection of smart grid power data, which can promptly identify potential anomalies, providing strong support for the optimized operation of the smart grid, ensuring the stable operation of the power system, and reducing economic losses and safety risks. Attached Figure Description

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0017] Figure 1 A general flowchart of a CAEGRU-based intelligent power grid power anomaly detection method provided by an embodiment of the present application.

[0018] Figure 2 A loss value effect diagram of a CAEGRU-based intelligent power grid power anomaly detection method provided by an embodiment of the present application.

[0019] Figure 3 A verification accuracy effect diagram of a CAEGRU-based intelligent power grid power anomaly detection method provided by an embodiment of the present application.

[0020] Figure 4 A CAEGRU anomaly detection model structure diagram based on CAEGRU provided by an embodiment of the present application.

[0021] Figure 5 A performance comparison diagram of a CAEGRU-based intelligent power grid power anomaly detection method provided by two embodiments of the present application. DETAILED DESCRIPTION

[0022] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific embodiments of the present application will be described in detail below with reference to the drawings in the specification. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort should be within the scope of protection of the present application.

[0023] Embodiment 1, refer to Figures 1-4 For the first embodiment of the present application, the embodiment provides a CAEGRU-based intelligent power grid power anomaly detection method, which comprises: S1, obtaining power data of target substation users from a power grid metering center database, specifically including daily power consumption of users and power consumption data of substation transformer main meter.

[0024] S11, according to the topological relationship of the substation main meter , extracting the power consumption data of the users under the substation and the substation main meter data ; Among them, Indicates the first One user, Taiwan District The next One user, This represents the total number of users within the designated area. Indicates user Electricity consumption data This indicates the extracted electricity consumption data. Each data collection time point Indicates user In the Electricity consumption data at each collection time point.

[0025] S2. After collecting the target data in step S1, since data loss, redundancy or invalidity may occur during the data acquisition and measurement process, it is necessary to clean and preprocess the user's electricity consumption time series data.

[0026] S21. Clean and organize the extracted data. If the extracted electricity consumption data is missing for more than t collection time points, the data collected in that sample is considered invalid and discarded. For data columns that are discontinuous in time and have missing data points within t time points, the mean is used for interpolation; for unreasonable data, such as the sum of the electricity consumption readings of the sub-meters in the transformer area being greater than the reading of the main meter in the transformer area, the sample is considered invalid and discarded.

[0027] S22. In addition, it is necessary to handle outliers and missing values ​​in the data. For the extracted electricity consumption data, use 3 The rules remove outliers from the entire dataset. Missing values ​​can occur due to measurement equipment malfunctions or communication failures, potentially misleading the model and causing it to incorrectly identify abnormalities in power grid equipment operation or power consumption. Linear interpolation is used to fill in missing data by calculating the average of adjacent data points, ensuring data integrity and continuity.

[0028] S3. Based on the processed electricity consumption data of users in the transformer area, calculate the line loss of the transformer area from the main table and sub-table data according to the transformer area topology. Then, select an appropriate sequence length M and construct features by calculating the line loss of the transformer area and the meter error.

[0029] S31. Calculate the line loss of the transformer area based on the data in the main table and sub-table according to the transformer area topology. The formula is as follows: , in, This represents the daily difference between the main table and the sub-table readings. This represents the daily reading of the main table. Indicates the first a sub-meter in the first day.

[0030] S32, adopt sliding window to select window length, divide user electricity consumption data, divide monomial time series electricity consumption data into a series of non-overlapping subsequences with length M through sliding window, and calculate the correlation of user electricity consumption and line loss in the window.

[0031] The specific method is as follows: first, standardize the user electricity consumption data and line loss data in each window to eliminate the influence of dimension. Then use Pearson correlation coefficient to calculate the linear correlation between user electricity consumption data and line loss data. The formula is as follows: ,

[0032] Wherein, represents the user electricity consumption data, represents the line loss data, , and, is the linear correlation between user electricity consumption data and line loss data.

[0033] By calculating the correlation of user electricity consumption and line loss in the window, the relationship between the two can be better understood, and more abundant features can be provided for anomaly detection.

[0034] S33, at the same time, according to the power supply structure and the principle of energy conservation, the user meter error is calculated by constructing the meter error calculation model. The specific introduction of the meter error calculation model is as follows.

[0035] In the power distribution network measurement system, the metering device adopts hierarchical configuration mode, in which the terminal master meter of the substation (as a primary metering device) and the user side electric energy meter (as a secondary metering device) constitute a typical tree-shaped metering network architecture.

[0036] Based on the analysis of the operating characteristics of the metering device, the primary metering device has the following technical features: its accuracy level is generally better than 1.0 level (i.e. the measurement error is not more than ±2%), and it carries out regular operation and calibration work, so it can be used as the reference value of the power supply of the substation. The secondary metering device usually maintains relatively stable measurement characteristics within the analysis period.

[0037] According to the topological relationship of the tree measurement network and the principle of energy conservation, the power balance equation of the transformer area can be expressed as: the total amount of electric energy recorded by the primary measurement device is equal to the sum of the readings of all secondary measurement devices, the dynamic loss of the line, and the algebraic sum of the inherent loss of the measurement device. This quantitative relationship provides a theoretical basis for the analysis of transformer area line loss and user-side electric energy meter accuracy. The formula is as follows:

[0038]

[0039] Among them, there are meters under the transformer area, and in the measurement period , is the power supply to the transformer area total meter, is the running error rate of the th meter, is the daily electric quantity of the th meter, is the fixed loss, is the line variable loss rate, is the transformer area line loss.

[0040] Input daily electric quantity data, set , formula (1) can be transformed into matrix form:

[0041] Among them:

[0042]

[0043]

[0044] The solution of the equation group is the calculated electric meter error:

[0045] S34, after finally calculating the correlation between electric quantity and transformer area line loss and the electric meter error, the data set used for subsequent CAEGRU abnormal detection model training is obtained .

[0046] Among them, represents the electricity consumption data in the Nth window after window division, represents the correlation between the calculated electricity consumption and the transformer area line loss in the Nth window, The calculated meter error.

[0047] S4, on the basis of data introduction and analysis step, model construction is carried out, and the application proposes a network structure based on gated recurrent unit (GRU) for the method of electric quantity anomaly.

[0048] Gated recurrent unit (GRU) is another variant of recurrent neural network RNN, aiming to further simplify the structure of LSTM model while retaining its ability to handle long sequences.

[0049] For this purpose, GRU introduces two key components: update gate and reset gate. The update gate controls how new information updates the hidden state, while the reset gate determines which parts of the hidden state should be forgotten. The calculation mechanism of these gates is as follows: , The above equation describes the core calculation process of gated recurrent unit (GRU). The update gate regulates the hidden state to inherit information from the previous hidden state , while the reset gate regulates the contribution of the previous state to the current calculation. Then, based on the candidate information of the current input and the previous hidden state ,

[0050] Finally, the update gate is used to weight the sum of the previous hidden state and the candidate hidden state, resulting in the final hidden state . Through this gating mechanism, GRU effectively controls the forgetting and propagation of information, capturing long-term dependencies while reducing computational complexity. This improves the training efficiency and prediction performance of the model.

[0051] For the feature extraction and anomaly detection needs of electric power time series data, the application proposes a hybrid neural network architecture (CAEGRU). This model innovatively combines the feature extraction ability of convolutional autoencoder and the time series modeling advantage of gated recurrent unit, integrating the excellent feature extraction ability of convolutional autoencoder (CAE) and the unique advantage of autoencoder network structure in anomaly detection, while utilizing the powerful time modeling ability of gated recurrent unit (GRU).

[0052] This combination provides an efficient and accurate solution for the prediction and anomaly detection tasks of electric power time series data. The core architecture of the model consists of an encoder, a GRU layer, a decoder and a fully connected layer, all of which work together to achieve accurate modeling of electric power time series data.

[0053] Referring to Figure 4 , the CAEGRU anomaly detection model is constructed based on the convolutional autoencoder and the gated recurrent unit. The specific steps are as follows: The convolutional autoencoder (CAE) part is divided into an encoder and a decoder. The encoder is composed of convolutional layers and pooling layers. The convolutional layers are used to extract the spatial features of the input data, and the pooling layers are used to reduce the spatial size of the feature maps and increase the number of channels. The input of the encoder is the preprocessed data, and the output is a low-dimensional feature representation. The decoder is composed of multiple transpose convolutional layers, which are used to restore the low-dimensional feature representation output by the encoder back to the reconstructed data with a spatial size similar to the input data.

[0054] The gated recurrent unit (GRU) layer receives the low-dimensional feature representation output by the encoder and controls the flow of information through the update gate and the reset gate. The update gate adjusts the degree of inheritance of the hidden state from the previous hidden state, and the reset gate adjusts the contribution of the previous hidden state to the current calculation. The GRU layer outputs a time series feature representation.

[0055] Finally, the comprehensive feature vector output by the GRU layer and the decoder after learning is obtained. The fully connected layer receives the comprehensive feature vector and performs a nonlinear transformation through the softmax activation function, and finally outputs the results for classification.

[0056] Figure 4 The structure of the CAEGRU anomaly detection model is shown, which is mainly composed of a convolutional autoencoder, a gated recurrent unit, a decoder, and a fully connected layer. The encoder extracts the spatial features of the input data through a multi-layer convolutional neural network, generating a low-dimensional feature representation. These low-dimensional feature representations are then passed to the GRU layer, which captures the dynamic changes of the data in the time series through its internal update gate and reset gate mechanisms. Then the decoder reconstructs the input data using these feature vectors with time series characteristics.

[0057] After the decoder completes learning, the feature vector output from the decoder is input to the fully connected layer. Then the fully connected layer integrates the features and outputs the final result through the probability density function softmax classification layer, realizing anomaly detection.

[0058] Through this fusion mechanism, the CAEGRU anomaly detection model can effectively combine spatial features and time series characteristics, thereby improving the accuracy of anomaly detection.

[0059] After designing the overall model and framework of anomaly detection, the collected electricity consumption data is preprocessed and feature calculated, and then the constructed dataset is input into the CAEGRU anomaly detection model for training.

[0060] S5, model training step, the real-time collected smart grid power data is processed according to the method of the above data preprocessing and feature construction step, and a data set containing power consumption data features, correlations and meter error features is obtained .

[0061] Then input to the designed CAEGRU anomaly detection model for training, output the determination result of whether the power consumption is abnormal. The specific training process is as follows: first, the preprocessed power consumption data, line loss correlation and meter error are input into the CAEGRU anomaly detection model as features.

[0062] Then the anomaly detection model extracts spatial features through the convolutional autoencoder, combines the gated recurrent unit to capture the time series characteristics, and learns the difference between normal power consumption behavior and potential abnormal patterns.

[0063] Finally, the anomaly detection model trains the weights of each layer according to the input data, and finally outputs the anomaly detection result through the full connection layer and the probability density function softmax, discovers meter failure, load abnormality and other problems in time, and provides basis for the operation and maintenance of smart grid.

[0064] During the training process, the loss function value and the accuracy of the validation set are recorded. For example Figures 2-3 , the training process loss value and validation accuracy value curve, from the figure, it can be seen that the loss value in the training process decreases rapidly in the initial stage, the accuracy improves significantly, and tends to be stable in the subsequent training process. The final accuracy of the validation set is more than 90%, which proves the effectiveness of the model.

[0065] S6, anomaly detection performance test and model evaluation, the smart grid power data that needs to be detected for anomaly is processed according to the method of the above data preprocessing and feature construction, and the data with the same shape as the training data set is obtained, then input into the trained CAEGRU anomaly detection model, the model can output the anomaly detection result according to the input data.

[0066] Embodiment 2, refer to Figure 5 , the second embodiment of the application provides a smart grid power anomaly detection method based on CAEGRU, in order to verify the beneficial effects of the application, scientific demonstration is carried out through experiment.

[0067] In order to accurately evaluate the performance of each model and highlight the characteristics of the proposed model, the present application compares the proposed model with the benchmark model in the same environment, involving multiple key indicators. The experiments of the present application are all carried out on a server of NVIDIA GeForce RTX 4060 GPU, and under the condition that the time series window length is 100, i.e. the number of daily power consumptions in the sample window of the data set, the CAEGRU model is compared with the CNN (Convolutional Neural Network), GRU and ConvAE (Convolutional Autoencoder) model methods, and the models show differences in accuracy, precision, recall and F1 score, such as Figure 5 The CAEGRU designed by the present application performs better than the benchmark comparison model in several performance evaluation indicators, and the results of this experiment fully verify the effectiveness and superiority of the proposed CAEGRU model in the power anomaly detection task. This shows that the model has better effect in anomaly detection, and can help to discover problems such as meter failure and load anomaly in time and effectively, and provides basis for the operation and maintenance of smart grid.

[0068] The CAEGRU designed by the present application performs better than the benchmark comparison model in several performance evaluation indicators, and the results of this experiment fully verify the effectiveness and superiority of the proposed CAEGRU model in the power anomaly detection task. This shows that the model has better effect in anomaly detection, and can help to discover problems such as meter failure and load anomaly in time and effectively, and provides basis for the operation and maintenance of smart grid.

[0069] Embodiment 3 is the third embodiment of the present application, which is different from the first two embodiments: If the function is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts that essentially contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various storage medium that can store program codes.

[0070] The logic and / or steps represented in flow diagrams or otherwise described herein, for example, can be considered as a sequence of executable instructions for implementing logic functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. In the context of this specification, a "computer-readable medium" can be any means that can contain, store, communicate, propagate or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

[0071] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or other suitable material upon which the program is printed, as the program can be electronically captured, for example, via an optical scanner, then compiled, interpreted, or otherwise processed, and stored in a computer memory in a form that is then employable by a computer.

[0072] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies known in the art can be used: discrete logic circuitry having logic gates for implementing logic functions upon data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.

[0073] Embodiment 4 is a fourth embodiment of the present application, which provides a CAEGRU-based intelligent power grid power anomaly detection system, comprising a data cleaning and preprocessing module, a feature extraction and construction module, a CAEGRU model training module, and a real-time detection and classification output module; The data cleaning and preprocessing module extracts the power consumption data of the users in the transformer area from the power grid metering center database, eliminates abnormal data, and fills in missing values through mean interpolation and linear interpolation; The feature extraction and construction module is based on the pre-processed data, combines the topological relationship of the main table and the sub-table of the district, calculates the line loss, and deduces the meter error according to the principle of power supply energy conservation. The sliding window is used to divide the time series data of power consumption, the features of user power consumption, line loss correlation and meter error are extracted, and complete training samples are formed. The CAEGRU model training module extracts spatial features by using a convolutional autoencoder, captures time sequence characteristics by using a gated recurrent unit, constructs a CAEGRU model, trains the feature data, and learns the difference between normal power consumption behavior and potential abnormal patterns. The real-time detection and classification output module performs the same preprocessing and feature extraction on the real-time collected power consumption data, inputs the results into the trained CAEGRU model, outputs the abnormal detection results through a fully connected layer and a Softmax classifier, and completes the real-time abnormal identification.

[0074] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and are not limited. Although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solutions of the present application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the present application, which should be covered in the scope of the claims of the present application.

Claims

1. A smart grid power anomaly detection method based on CAEGRU, characterized in that: include, Data on the distribution area topology is obtained from the power grid metering center database and preprocessed. Based on the preprocessed transformer area topology data, the transformer area line loss is calculated, and the sequence length is set. By calculating the transformer area line loss and the meter error, a feature set of electricity consumption characteristics is constructed. A CAEGRU model is constructed based on a convolutional autoencoder and a gated recurrent unit, and trained on a feature set. Real-time electricity consumption data is input into the CAEGRU model for training, and the output results show abnormal electricity consumption detection. A transformer substation topology consists of a main table and several sub-tables. The main table collects the electricity consumption data of the transformer substations, while the sub-tables collect the daily electricity consumption data of users.

2. The CA-GRU based intelligent power grid electricity anomaly detection method of claim 1, wherein: The process of obtaining the distribution area topology data from the power grid metering center database includes using a main table to collect the electricity consumption data of the main table of the distribution area transformers, and using a sub-table to collect the daily electricity consumption of users. Extract the main table transformer power consumption data , according to the transformer topology structure , extract the daily power consumption data of the user under the transformer ; in, Indicates the first One user, Taiwan District The next One user, This represents the total number of users within the designated area. Indicates user Electricity consumption data This indicates the extracted electricity consumption data. Each data collection time point Indicates user In the Electricity consumption data at each collection time point.

3. The CA-EGRU based intelligent power grid electricity anomaly detection method of claim 2, wherein: The process of obtaining transformer area topology data from the power grid metering center database and performing preprocessing includes preprocessing the time-series data of users' daily electricity consumption. The extracted data is cleaned and organized. If the extracted electricity consumption data is missing for more than t collection time points, the data collected in the current sample is invalid and the sample is discarded. If the user's battery data column is not continuous in time and the data column within t collection time points is missing, the mean is used for interpolation. Unreasonable data is judged as invalid and the current sample is discarded. The abnormal values and missing values in the data are processed. For the extracted power consumption data, the abnormal values are removed from the entire data by using 3 rules. Linear interpolation is used to fill in missing data by calculating the average of adjacent data points to replace missing values.

4. The CA-GRU based intelligent power grid electricity anomaly detection method of claim 3, wherein: The calculation of transformer area line loss based on preprocessed transformer area topology data, and the setting of sequence length, along with the construction of a feature set of electricity consumption characteristics by calculating transformer area line loss and meter error, includes... The line loss of a transformer area is calculated from the data in the main table and sub-table based on the transformer area topology. The expression is as follows: , wherein, is the daily difference between the readings of the master meter and the submeters, is the daily reading of the master meter, represents the reading of the th submeter on the th day, is the number of submeters under the transformer area; A sliding window is used to divide the user's electricity consumption data by selecting the window length. The univariate time series electricity consumption data is divided into a series of non-overlapping subsequences of length M by the sliding window, and the correlation between user electricity consumption and transformer area line loss within the window is calculated.

5. The CA-GRU based intelligent power grid electricity anomaly detection method of claim 4, wherein: The process of calculating transformer area line losses based on preprocessed transformer area topology data, setting a sequence length, and constructing a feature set of electricity consumption characteristics by calculating transformer area line losses and meter errors also includes... Based on the power supply structure and the principle of energy conservation, an algorithm was developed to calculate the error of user electricity meters; The metering devices in the distribution area adopt a hierarchical configuration mode, in which the main meter of the distribution area terminal is the primary metering device, the user-side energy meter is the secondary metering device, and the combination forms a tree-like metering network architecture. Based on the topological relationship of the tree-structured metering network and the principle of energy conservation, the power balance equation for the transformer area is: the total electrical energy recorded by the primary metering device equals the sum of the readings of all secondary metering devices, the dynamic losses of the lines, and the algebraic sum of the inherent losses of the metering devices. The expression is: , , Wherein, in the metering period , is the total metered power supply for the transformer area, is the running error rate of the first meter, is the daily power supply of the first meter, is the fixed loss, is the line variable loss rate, is the line loss of the transformer area; The m daily electric quantity data are input into the error calculation model of the transformer area electric meter, and it is assumed that The matrix expression is as follows. , , , , , wherein, is the line loss matrix of the transformer area, is the coefficient matrix of the error relationship of the electric meter, is the solution of the equation, is the vector transpose; After calculating the correlation between the power consumption and the transformer area line loss and the meter error, the data set for training the anomaly detection model is obtained wherein represents the power consumption data in the Nth window after window division, represents the correlation between the power consumption and the transformer area line loss calculated in the Nth window, represents the calculated meter error.

6. The CA-GRU based intelligent power grid electricity anomaly detection method of claim 4, wherein: The CAEGRU model constructed based on convolutional autoencoders and gated recurrent units, and the training of the feature set, includes constructing a neural network model based on convolutional autoencoders, gated recurrent units, decoders, and fully connected layers. The gating recurrent unit introduces an update gate and a reset gate, the update gate adjusts the information inherited from the previous hidden state, and the reset gate adjusts the contribution of the previous state to the current calculation; Under the influence of the reset gate, the candidate hidden state is calculated based on the current input and the candidate information of the previous hidden state, and the update gate is used to weight and sum the previous hidden state and the candidate hidden state to obtain the final hidden state.

7. The CA-EGRU based intelligent power grid electricity anomaly detection method of claim 4, wherein: The real-time power consumption data is input into the CAEGRU model for training, and the power abnormality detection result is output. The real-time collected smart grid power data is preprocessed and features are constructed to obtain a dataset containing power consumption data features, correlation and meter error features The dataset is input into the CAEGRU model for training, the features extracted by the fully connected layer are integrated and input into the probability density function softmax, the softmax function converts the output of the fully connected layer into probability values of two categories, respectively representing the probability that the data belongs to normal and abnormal, and according to the set threshold value, the result of whether the power consumption is abnormal is output.

8. A CAEGRU-based intelligent power grid electricity abnormality detection system, applying the CAEGRU-based intelligent power grid electricity abnormality detection method according to any one of claims 1-7. It includes: data cleaning and preprocessing module, feature extraction and construction module, CAEGRU model training module and real-time detection and classification output module. The data cleaning and preprocessing module extracts the power consumption data of the user in the area from the power grid metering center database, eliminates abnormal data, and fills in the missing values through mean interpolation and linear interpolation. The feature extraction and construction module is based on the preprocessed data, combined with the topological relationship of the main table and the sub-table of the area, calculates the line loss, and deduces the meter error according to the principle of power supply energy conservation. Through the sliding window division of power consumption time series data, the user power consumption, line loss correlation and meter error features are extracted to form complete training samples. The CAEGRU model training module is to extract spatial features with convolutional autoencoder, combined with gated recurrent unit to capture time series characteristics, construct CAEGRU model, train feature data, and learn the difference between normal power consumption behavior and potential abnormal patterns. The real-time detection and classification output module is to preprocess and extract features from the real-time collected power consumption data, input the results into the trained CAEGRU model, output the abnormality detection result through the full connection layer and Softmax classifier, and complete the real-time anomaly recognition. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to realize the steps of the CAEGRU-based intelligent power grid power abnormality detection method in any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the CAEGRU-based intelligent power grid power abnormality detection method in any one of claims 1 to 7.

Citation Information

Cited By

  • Method and system for detecting operation error of electric energy meter in low-voltage transformer area based on graph calculation

    CN121614914A