Power consumption anomaly detection method and system based on Beidou synchronous multi-source data and LSTM

Through the power consumption abnormality detection method based on Beidou synchronous multi-source data and LSTM, the problems of low detection accuracy, small application scope and high cost in the prior art are solved, and high-precision, low-cost and easy-to-operate user power consumption abnormality detection is achieved, adapting to a complex full-link environment.

CN119719853APending Publication Date: 2025-03-28STATE GRID JIANGSU ELECTRIC POWER CO LTD MARKETING SERVICE CENT
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411802483.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The prior art has problems such as poor use effect, small scope of application, difficult to achieve and high cost in user power abnormal detection. Especially when dealing with complex full-link power data, it is difficult to accurately capture abnormal characteristics.

Method used

The power consumption abnormality detection method based on Beidou synchronous multi-source data and LSTM is adopted. Multi-source power consumption data is collected through multi-source data sensors and smart electricity meters, pre-processing and data characteristics are combined, and the user power consumption abnormality detection model is used to build a user power consumption abnormality detection model to achieve real-time detection.

Benefits of technology

It improves the accuracy, response speed and robustness of detection, effectively integrates multi-dimensional power consumption information, reduces false alarms and missed reports, adapts to complex and changeable power consumption environments, and has stronger adaptability and real-timeness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719853A_ABST
    Figure CN119719853A_ABST
Patent Text Reader

Abstract

The invention discloses an electricity consumption anomaly detection method and system based on Beidou synchronous multi-source data and LSTM, and the method comprises the steps: collecting multi-source electricity consumption data based on a multi-source data sensor and an intelligent electric meter, and carrying out the preprocessing of the multi-source electricity consumption data; performing data feature fusion on the preprocessed multi-source power consumption data through a comprehensive graph neural network and a variational auto-encoder to obtain fused data, performing feature extraction on the fused data to obtain multi-dimensional feature data, and constructing and training a user power consumption anomaly detection model based on LSTM to obtain a user power consumption anomaly detection result; and inputting the multi-dimensional feature data obtained in real time into the trained user electricity consumption anomaly detection model, and carrying out real-time detection on the user electricity consumption anomaly. According to the method, multi-dimensional electricity utilization information is effectively fused through feature recognition of various sensor data, false alarm and missing alarm are reduced based on multi-dimensional perception and feature recognition, and the method adapts to complex and changeable electricity utilization environments and has higher adaptivity and real-time performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of power consumption anomaly detection, and in particular, relates to a power consumption anomaly detection method and system based on Beidou synchronized multi-source data and LSTM. Background Art

[0002] With the rapid development of the modern economy and the continuous expansion of infrastructure construction, the demand for electricity is also increasing. At the same time, the reliability and safety of power supply have become key issues that need to be solved urgently. Especially in the process of urbanization, the number of power users has increased rapidly, and the detection and management of abnormal power consumption by users is particularly important. Abnormal power consumption by users not only affects the stable operation of the power system, but may also cause serious safety hazards. Therefore, how to efficiently and accurately detect abnormal power consumption by users has become an important issue that needs to be solved in the power industry.

[0003] At present, traditional methods for detecting abnormal electricity consumption by users mainly rely on manual experience, simple meter data analysis, and empirical judgment. These methods have obvious limitations in quickly detecting abnormal electricity consumption by users. Manual experience and simple data analysis cannot monitor user electricity consumption behavior in real time, and it is difficult to capture early signals of abnormalities; methods that rely on manual experience are highly subjective, have large errors, and are inefficient. Although advanced detection equipment can improve detection accuracy, it is expensive, complex to operate, and difficult to promote on a large scale. Therefore, there is an urgent need for a new detection method that can integrate multi-dimensional data to provide a high-precision, low-cost, and easy-to-operate user electricity abnormality detection solution.

[0004] Therefore, it is necessary to propose a solution to improve one or more problems existing in the above-mentioned related technical solutions.

[0005] CN118940008A relates to the technical field of cable stranding, and discloses a cable stranding disconnection warning method, device, equipment and storage medium. The method includes: performing multi-modal sensor data acquisition on the cable stranding system to obtain vibration acceleration data and stress strain data; performing multi-band distributed analysis to obtain a global vibration state diagram and extracting time-frequency domain features to obtain a stress strain feature diagram; performing data fusion and adaptive feature selection to obtain a target fusion feature set; constructing an adaptive Kalman filter combined warning algorithm and performing cable state estimation to obtain a cable state estimation result; performing a multi-layer machine learning model analysis on the cable state estimation result to obtain a disconnection risk prediction value and perform multi-level warning strategy decision-making, and output intelligent disconnection warning information. This patent detects anomalies by analyzing the frequency characteristics of user power consumption signals, and can identify abnormal fluctuations within a specific frequency range. However, in practical applications, users' power consumption behaviors are usually highly random and complex, and frequency domain analysis methods are often difficult to accurately capture abnormal features when dealing with such complex signals. And wavelet transform WT, as a time-frequency analysis tool, can analyze the detailed changes of user power consumption data at multiple scales and better identify anomalies. However, the wavelet transform may face computing resource challenges when processing large-scale and complex full-link electricity consumption data, and the interpretation of its results is also relatively complex. Therefore, the method of this patent is not effective and has a small scope of application.

[0006] CN118311934A discloses an electrical automation control system, which relates to the field of electrical automation technology. The present invention uses a variety of sensors to obtain the electrical and mechanical parameter data of the equipment, and uses signal processing technology to accurately monitor and diagnose bearing wear, unbalanced vibration and capacitor aging problems. In practical applications, this patented machine learning method requires a large amount of labeled data for training, and the complexity of the model increases the deployment and maintenance costs of the system. These existing technical solutions have their own advantages and disadvantages in detecting abnormal power consumption by users, but there are still certain limitations when applied in a complex full-link environment. This patent has the disadvantages of being difficult to implement and high cost. Summary of the invention

[0007] In order to solve the shortcomings of the prior art such as poor use effect, small scope of application, difficulty in implementation and high cost, the present invention provides a method and system for detecting power consumption anomaly based on Beidou synchronized multi-source data and LSTM.

[0008] The present invention adopts the following technical solution.

[0009] On the one hand, the present invention discloses a method for detecting power consumption anomaly based on Beidou synchronous multi-source data and LSTM, comprising:

[0010] Collecting multi-source electricity consumption data based on multi-source data sensors and smart meters; the multi-source data sensors and smart meters are synchronized based on clock information of Beidou satellites;

[0011] Preprocessing the multi-source electricity consumption data, and fusing data features of the preprocessed multi-source electricity consumption data by using a comprehensive graph neural network and a variational autoencoder to obtain fused data;

[0012] Perform feature extraction on the fused data to obtain multi-dimensional feature data; set labels for the multi-dimensional feature data to obtain a labeled data set;

[0013] Build a user power consumption anomaly detection model based on LSTM;

[0014] Train the user power consumption anomaly detection model based on the labeled data set;

[0015] Collect multi-source electricity consumption data in real time, perform the aforementioned preprocessing, feature fusion and feature extraction on the real-time collected data, input the multi-dimensional feature data obtained in real time into the trained user electricity consumption anomaly detection model, and perform real-time detection of user electricity consumption anomalies.

[0016] More preferably,

[0017] The multi-source data sensor includes an electromagnetic field sensor, a current sensor and a voltage sensor;

[0018] The multi-source electricity consumption data includes electric field strength, magnetic field strength, user electricity consumption, current and voltage.

[0019] More preferably,

[0020] The preprocessing includes low-pass filtering the electric field strength and magnetic field strength, filling missing values ​​in the user's power consumption data, low-pass filtering the current and voltage data, and normalizing the data after the above processing.

[0021] More preferably,

[0022] The method of fusing data features of preprocessed multi-source electricity consumption data by integrating graph neural network and variational autoencoder is as follows:

[0023] The device corresponding to each item of data in the preprocessed multi-source electricity consumption data is taken as a node; the edge weight is constructed according to the association relationship between the sensor and the smart meter; and the adjacency matrix of the graph structure is generated based on the edge weight;

[0024] The graph neural network propagates and updates the preprocessed multi-source electricity consumption data based on the adjacency matrix, and obtains a new feature representation of each node through the propagation of the multi-layer graph neural network;

[0025] The obtained feature representation is input into the variational autoencoder. The encoder in the variational autoencoder maps the feature representation to the latent space to obtain the latent variable. The decoder in the variational autoencoder then decodes the latent variable back to the original data space to obtain the reconstructed multi-source electricity consumption data.

[0026] When the calculated result of the graph neural network loss function is greater than the set loss threshold, the reconstruction result is re-input into the graph neural network for the next round of iteration;

[0027] When the calculation result of the graph neural network loss function is less than the set loss threshold, the iteration is stopped to obtain the fused data.

[0028] More preferably,

[0029] The multi-dimensional feature data includes electric field features, magnetic field features, power consumption features, current features and voltage features;

[0030] Among them, the electric field characteristics include the electric field average value, the electric field standard deviation, the electric field main frequency and the electric field frequency band energy;

[0031] The magnetic field characteristics include the magnetic field average value, magnetic field standard deviation, magnetic field main frequency and magnetic field frequency band energy;

[0032] Electricity consumption characteristics include electricity consumption fluctuation rate and electricity consumption standard deviation;

[0033] Current characteristics include current waveform characteristics and current harmonic components;

[0034] Voltage characteristics include voltage waveform characteristics and voltage harmonic components.

[0035] More preferably,

[0036] The label is set to two types: label 0 and label 1. When the label is 0 / 1, it indicates that an abnormality exists, and when the label is 1 / 0, it indicates that no abnormality exists.

[0037] More preferably,

[0038] In the process of training the user power consumption anomaly detection model based on the labeled data set, the set anomaly detection model loss function is used, as shown in the following formula:

[0039]

[0040] Where i is an integer, and i∈[1,N], N is the total number of samples; y i The true value of the i-th sample; The predicted value of the i-th sample; σ is the Gaussian kernel bandwidth; α is the first balance weight; β is the second balance weight.

[0041] On the other hand, the present invention discloses a power consumption anomaly detection system based on Beidou synchronized multi-source data and LSTM based on the power consumption anomaly detection method, including a multi-source data acquisition module, a data fusion module, a feature extraction module, a power consumption anomaly detection model construction module, a power consumption anomaly detection model training module and a power consumption anomaly real-time detection module:

[0042] The multi-source data acquisition module collects multi-source electricity consumption data based on multi-source data sensors and smart meters;

[0043] The data fusion module preprocesses the multi-source electricity consumption data, and performs data feature fusion on the preprocessed multi-source electricity consumption data through a comprehensive graph neural network and a variational autoencoder to obtain fused data;

[0044] The feature extraction module extracts features from the fused data to obtain multi-dimensional feature data; annotates the multi-dimensional feature data to obtain an annotated data set;

[0045] The power consumption anomaly detection model building module builds a user power consumption anomaly detection model based on LSTM;

[0046] The power consumption anomaly detection model training module trains the user power consumption anomaly detection model based on the labeled data set;

[0047] The real-time power consumption anomaly detection module collects multi-source power consumption data in real time, performs the aforementioned preprocessing, feature fusion and feature extraction on the real-time collected data, inputs the multi-dimensional feature data obtained in real time into the trained user power consumption anomaly detection model, and performs real-time detection of user power consumption anomalies.

[0048] On the other hand, the present application discloses an electronic device, including a processor and a storage medium; the characteristics are:

[0049] The storage medium is used to store instructions;

[0050] The processor is used to operate according to the instructions to execute the above-mentioned power consumption abnormality detection method.

[0051] The present application also discloses a computer-readable storage medium having a computer program stored thereon, wherein the program implements the power consumption anomaly detection method when executed by a processor.

[0052] The beneficial effect of the present invention is that, compared with the prior art,

[0053] On the one hand, the feature recognition algorithm of multiple raw data can improve the detection accuracy, response speed and robustness; on the other hand, it can effectively integrate power consumption information from multiple dimensions, such as current, voltage, power, frequency, etc., and realize accurate identification of user power consumption status through feature extraction and machine learning algorithms; on the other hand, based on multi-dimensional perception and feature recognition, it reduces false alarms and missed alarms, adapts to the complex and changeable power consumption environment, and has stronger adaptability and real-time performance.

[0054] In the embodiment of the present disclosure, a method and system for detecting power consumption anomaly based on Beidou synchronized multi-source data and LSTM are proposed, which may include the following beneficial effects: on the one hand, the detection accuracy, response speed and robustness are improved through the feature recognition algorithm of multi-source data; on the other hand, the power consumption information from multiple dimensions, such as current, voltage, power, frequency, etc., is effectively integrated, and the user's power consumption status is accurately identified through feature extraction and machine learning algorithms; on the other hand, based on multi-dimensional perception and feature recognition, false alarms and missed alarms are reduced, adapting to the complex and changeable power consumption environment, and having stronger adaptability and real-time performance.

[0055] In addition, the present invention has the outstanding advantages of good use effect, wide application range, easy implementation and low cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A schematic diagram showing the steps of a method for detecting power consumption anomaly based on Beidou synchronized multi-source data and LSTM in an exemplary embodiment of the present disclosure is shown;

[0057] Figure 2 A schematic diagram showing the steps of data preprocessing and data fusion in an exemplary embodiment of the present disclosure is shown;

[0058] Figure 3 A schematic diagram of a process for detecting abnormal power consumption of a user based on an LSTM network and time series data processed by standardization in an exemplary embodiment of the present disclosure is shown;

[0059] Figure 4 A module schematic diagram of a power consumption anomaly detection system based on Beidou synchronized multi-source data and LSTM in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only embodiments of a part of the present invention, rather than all embodiments. Based on the spirit of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the protection scope of the present invention.

[0061] The present application discloses a method for detecting power consumption anomaly based on Beidou synchronized multi-source data and LSTM, including:

[0062] Collecting multi-source electricity consumption data based on multi-source data sensors and smart meters; the multi-source data sensors and smart meters are synchronized based on clock information of Beidou satellites;

[0063] The multi-source data sensor includes an electromagnetic field sensor, a current sensor and a voltage sensor;

[0064] The multi-source electricity consumption data includes electric field strength, magnetic field strength, user electricity consumption, current and voltage.

[0065] Preprocessing the multi-source electricity consumption data, and fusing data features of the preprocessed multi-source electricity consumption data by using a comprehensive graph neural network and a variational autoencoder to obtain fused data;

[0066] The preprocessing includes low-pass filtering the electric field strength and magnetic field strength, filling missing values ​​in the user's power consumption data, low-pass filtering the current and voltage data, and normalizing the data after the above processing.

[0067] The method of fusing data features of preprocessed multi-source electricity consumption data by integrating graph neural network and variational autoencoder is as follows:

[0068] The device corresponding to each item of data in the preprocessed multi-source electricity consumption data is taken as a node; the edge weight is constructed according to the association relationship between the sensor and the smart meter; and the adjacency matrix of the graph structure is generated based on the edge weight;

[0069] The graph neural network propagates and updates the preprocessed multi-source electricity consumption data based on the adjacency matrix, and obtains a new feature representation of each node through the propagation of the multi-layer graph neural network;

[0070] The obtained feature representation is input into the variational autoencoder. The encoder in the variational autoencoder maps the feature representation to the latent space to obtain the latent variable. The decoder in the variational autoencoder then decodes the latent variable back to the original data space to obtain the reconstructed multi-source electricity consumption data.

[0071] When the calculated result of the graph neural network loss function is greater than the set loss threshold, the reconstruction result is re-input into the graph neural network for the next round of iteration;

[0072] When the calculation result of the graph neural network loss function is less than the set loss threshold, the iteration is stopped to obtain the fused data.

[0073] Perform feature extraction on the fused data to obtain multi-dimensional feature data; set labels for the multi-dimensional feature data to obtain a labeled data set;

[0074] The multi-dimensional feature data includes electric field features, magnetic field features, power consumption features, current features and voltage features;

[0075] Among them, the electric field characteristics include the electric field average value, the electric field standard deviation, the electric field main frequency and the electric field frequency band energy;

[0076] The magnetic field characteristics include the magnetic field average value, magnetic field standard deviation, magnetic field main frequency and magnetic field frequency band energy;

[0077] Electricity consumption characteristics include electricity consumption fluctuation rate and electricity consumption standard deviation;

[0078] Current characteristics include current waveform characteristics and current harmonic components;

[0079] Voltage characteristics include voltage waveform characteristics and voltage harmonic components.

[0080] The label is set to two types: label 0 and label 1. When the label is 0 / 1, it indicates that an abnormality exists, and when the label is 1 / 0, it indicates that no abnormality exists.

[0081] Build a user power consumption anomaly detection model based on LSTM;

[0082] Train the user power consumption anomaly detection model based on the labeled data set;

[0083] In the process of training the user power consumption anomaly detection model based on the labeled data set, the set anomaly detection model loss function is used, as shown in the following formula:

[0084]

[0085] Where i is an integer, and i∈[1,N], N is the total number of samples; y i The true value of the i-th sample; The predicted value of the i-th sample; σ is the Gaussian kernel bandwidth; α is the first balance weight; β is the second balance weight.

[0086] Collect multi-source electricity consumption data in real time, perform the aforementioned preprocessing, feature fusion and feature extraction on the real-time collected data, input the multi-dimensional feature data obtained in real time into the trained user electricity consumption anomaly detection model, and perform real-time detection of user electricity consumption anomalies.

[0087] Example 1

[0088] This example implementation provides a method for detecting power consumption anomalies based on Beidou synchronized multi-source data and LSTM. Figure 1 As shown, the following steps may be included:

[0089] Step S101: Collecting multi-source electricity consumption data based on multi-source data sensors and smart meters;

[0090] Combining multiple sensors into a multi-source data sensor according to detection requirements, and using the multi-source data sensor and a smart meter to collect multi-dimensional electricity consumption data to obtain multi-source collected data;

[0091] Specifically: Sensor selection: Multiple sensors can be selected according to equipment conditions and actual needs. In the preferred embodiment of the present invention, the multi-source data sensor includes an electromagnetic field sensor, a current sensor, and a voltage sensor:

[0092] The electromagnetic field sensor is used to detect changes in electric and magnetic fields around the cable.

[0093] In the embodiment of the present invention, the electromagnetic field sensor is not limited to a specific implementation form, and may also include a separate electric field sensor and a magnetic induction sensor.

[0094] The electromagnetic field sensor is used to collect the electric field strength and magnetic field strength of the cable.

[0095] The smart meter is used to collect user electricity consumption data, the unit of which is kWh.

[0096] The current sensor and the voltage sensor are used to measure changes in current and voltage inside the cable respectively.

[0097] Step S102: The multi-source data sensor and the smart meter perform clock synchronization with the clock information based on the Beidou satellite when collecting data, wherein time information is added to the multi-source collected data in step 1 to form multi-source electricity consumption data.

[0098] Specifically: In order to effectively and quickly judge abnormal electricity consumption of users, it is necessary to establish a multi-source data acquisition system, which includes a Beidou receiver, a multi-source data sensor and a smart meter.

[0099] The multi-source data acquisition system transmits the time signal received by the Beidou receiver to the multi-source data sensor and smart meter to achieve time synchronization. It also stores and manages the synchronized data to ensure the synchronous acquisition of data from each sensor. High-frequency sampling and precise time synchronization are essential to capture subtle signal changes. The following are the specific steps and methods:

[0100] In this embodiment, the sensor type and the data format of the smart meter are expressed as:

[0101] Electromagnetic field sensor:

[0102] Data content: Electric field strength E(t), magnetic field strength H(t)

[0103] Data format: timestamp, E(t), H(t)

[0104] Sampling frequency: 1kHz

[0105] Example: 2024-07-23 12:00:00.001,0.5,1.2

[0106] Smart Meter:

[0107] Data content: Power consumption Q(t)

[0108] Data format: timestamp, Q(t)

[0109] Sampling frequency: 1HZ

[0110] Example: 2024-07-23 12:00:00.001,11.5

[0111] Current and Voltage Sensors:

[0112] Data content: current I(t), voltage V(t)

[0113] Data format: timestamp, I(t), V(t)

[0114] Sampling frequency: 1kHz

[0115] Example: 2024-07-23 12:00:00.001,10.5,230.0

[0116] To ensure that all data has the same time reference, the BeiDou system is used for time synchronization. The following are the specific steps:

[0117] Step S1021: Install a Beidou receiver in the data acquisition system to receive the time signal of the Beidou satellite.

[0118] Step S1022: The Beidou receiver transmits the time synchronization signal to each sensor and smart meter for time synchronization. It should be understood that during the signal transmission process, the Beidou receiver transmits the time synchronization signal to each sensor and smart meter, and the Beidou receiver transmits the time synchronization signal to each sensor and smart meter through a hardware interface to achieve time synchronization; the hardware interface includes a synchronization line, a network interface, etc.

[0119] Step S1023: Each sensor and smart meter records data using the standard timestamp provided by the Beidou receiver when collecting data.

[0120] Step S1024: Regularly calibrate the clock of each sensor and smart meter to eliminate accumulated time deviations.

[0121] In this embodiment, during the data collection and synchronization process, it is necessary to ensure that all data is recorded according to a unified time reference. The synchronized data structure, i.e., multi-source data, is as follows:

[0122] Timestamp, electric field strength (E), magnetic field strength (H), power consumption (Q), current (I), voltage (V)

[0123] Example:

[0124]

[0125] The multi-source data is stored and managed. For small-scale data, CSV files are used for storage; for large-scale data storage, relational databases such as MySQL are used for structured data storage.

[0126] Ensure synchronous collection of sensor data when collecting multiple raw data. Use the Beidou system for time synchronization to ensure that each data has a consistent time reference, providing a basis for subsequent data fusion and analysis.

[0127] Step S103: pre-process the multi-source electricity consumption data, and fuse the pre-processed multi-source electricity consumption data with data features by using a comprehensive graph neural network and a variational autoencoder to obtain fused data; as shown in the attached figure Figure 2 As shown:

[0128] Step S1031: pre-process the multi-source data, process the pre-processed multi-source data using the weight relationship between sensors and smart meters, and perform data fusion using a method based on graph neural network GNN and variational autoencoder VAE.

[0129] The data preprocessing of the collected multi-source data includes low-pass filtering of the electromagnetic field data, removing high-frequency noise, filling missing values ​​of the power consumption data, low-pass filtering of the current and voltage data, and normalizing the data after the above processing.

[0130] Those skilled in the art should know that low-pass filtering can be used to remove high-frequency noise, and those skilled in the art can construct low-pass filtering according to actual conditions.

[0131] Preferably, low-pass filtering and high-frequency noise removal of electromagnetic field data removes high-frequency noise and retains the low-frequency effective part of the signal. The low-pass filtering formula is:

[0132]

[0133] Where: x[n] is the original electromagnetic field signal, that is, the electric field intensity E or the magnetic field intensity H; y[n] is the filtered signal; h[k] is the filter coefficient of the low-pass filter; M is the filter length, and an FIR filter or an IIR filter is used, and the cutoff frequency of the filter is set below the main frequency component of the signal.

[0134] Low-pass filtering of current and voltage data removes high-frequency interference in the measurement and retains the main frequency components of current and voltage signals. The low-pass filtering formula is the same as that of electromagnetic field data, using:

[0135]

[0136] The filter is designed according to the grid frequency, such as 50Hz or 60Hz; the cut-off frequency is selected to be slightly higher than the base frequency, such as 70Hz.

[0137] For electricity consumption data, missing values ​​may be generated during the data collection process due to sensor failure, communication interruption, etc. In order to ensure the integrity of the data and the accuracy of subsequent analysis, the present invention uses a linear interpolation method to fill in the missing values:

[0138]

[0139] Among them, Q t The electricity consumption data Q supplemented at the missing point t-1 , Q t+1 They are the electricity consumption data of the time steps before and after the missing point. t-1 ,t t+1 are the timestamps of the time steps before and after the missing point. t is the timestamp of the missing time step.

[0140] After the aforementioned preprocessing, the multi-source data is normalized to the same range. The expression of data normalization is:

[0141]

[0142]

[0143]

[0144]

[0145]

[0146] Among them, E t is the electric field strength at time t. t is the magnetic field strength value at time t. t is the current value at time t. V tis the voltage value at time t. Q t is the power value at time t. E max is the maximum value of the electric field strength. min : The minimum value of the electric field strength. H max , H min are the maximum and minimum values ​​of the magnetic field intensity respectively. max ,I min are the maximum and minimum current respectively. V max 、V min are the maximum and minimum voltage respectively. Q max , Q min are the maximum and minimum values ​​of the electricity respectively.

[0147] Step S1032: fusing data features of the pre-processed multi-source electricity consumption data through a comprehensive graph neural network and a variational autoencoder to obtain fused data;

[0148] Simply putting the data together may lead to the following problems: Noise and error accumulation: Data from different sensors may contain noise and measurement errors. Direct merging will accumulate these uncertainties and affect the accuracy of the system. Information redundancy and contradiction: There may be data redundancy and information conflicts between sensors. Direct merging will lead to inconsistent information. The present invention uses a comprehensive graph neural network and a variational autoencoder to fuse the preprocessed multi-source electricity consumption data to obtain the fused data. The method is as follows:

[0149] Step S10321: Process the preprocessed multi-source data using the weight relationship between sensors.

[0150] Preferably, the original multi-dimensional data is constructed as a node. Assuming that the collected data comes from multiple sensors and smart meters, the original data can be expressed in the following matrix form:

[0151]

[0152] Among them, X is the node feature matrix, which represents the input features of each node. N is the number of sensors and smart meters, and each row represents the data of each node at a certain time. m is the total number of nodes; E1 is the electric field strength of node 1. E2 is the electric field strength of node 2. For node n m H1 is the electric field strength at node 1. H2 is the magnetic field strength at node 2. For node n m I1 is the current value at node 1. I2 is the current value at node 2. For node n mV1 is the voltage value at node 1. V2 is the voltage value at node 2. For node n m Q1 is the voltage value of node 1. Q2 is the power value of node 2. For node n m The power value.

[0153] It is expressed as:

[0154] x j =[E j ,H j ,I j ,V j ,Q j ]

[0155] Where j = 1, 2, ..., n m ;x j is the feature vector of node j; E j is the electric field strength at node j. j is the magnetic field strength at node j. j is the current value of node j. V j is the voltage value of node j. Q j is the power value of node j.

[0156] Preferably, a graph structure of multidimensional data is constructed based on the physical or logical relationship between sensors and smart meters.

[0157] Adopt Node Indicates that each sensor or smart meter is considered as a node.

[0158] x j Edge B is the edge weight constructed based on the relationship between the sensor and the smart meter.

[0159] The edge weights are constructed based on the relationship between each sensor and smart meter, as well as spatial proximity or data correlation.

[0160] The edge weight is constructed based on the relationship between each sensor and smart meter and the spatial proximity. It is obtained according to the inverse of the physical distance between each sensor and smart meter. The formula is as follows:

[0161]

[0162] Where h = 1, 2, ..., n m ;weight jh is the edge weight between node j and node h; distance jh is the distance between node j and node h.

[0163] Based on the relationship between each sensor and smart meter, and the data correlation, the edge weight is constructed to calculate the cosine similarity of multi-source data:

[0164]

[0165] Among them, x h is the feature vector of node h; x j ·x h Represents vector x j With vector x h Multiplication; || f e || means to find the vector f e The weight jh W jh , thus generating the adjacency matrix A of the graph structure shown below:

[0166]

[0167] Among them, w 11 represents the weight of the edge between node 1 and node 1; w 12 represents the weight of the edge between node 1 and node 2; Represents node 1 and node n m The weight of the edge between 21 represents the weight of the edge between node 2 and node 1; w 22 represents the weight of the edge between node 2 and node 2; Represents node 2 and node n m The weight of the edge between them; Represents node n m The weight of the edge between and node 1; Represents node n m The weight of the edge between and node 2; Represents node n m and node n m The weight of the edge between them; Represents an N×N matrix space, where each element of the matrix is ​​a real number. jh Represents the weight of the edge between node j and node h. It reflects the degree of association or similarity between the nodes.

[0168] Step S10322: Perform data fusion. The method based on GNN and VAE to perform data fusion includes:

[0169] 1. Node feature initialization

[0170] The feature vector x of each sensor and smart meter i The nodes input to the graph neural network are initialized as:

[0171]

[0172] in, is the initial eigenvector of the jth node.

[0173] 2. Feature Propagation of Graph Neural Networks

[0174] GNN is used to perform multi-layer feature aggregation to capture the complex relationship between sensors and smart meters. The feature propagation rules of each layer are as follows:

[0175]

[0176] in, is the set of neighbor nodes of node j. (l) is the weight matrix of the lth layer. (l) is the bias term. σ is the activation function (ReLU). deg(j) is the degree of node j; deg(h) is the degree of node h; is the feature vector of the jth node in the l+1th layer; is the feature vector of the hth node in the lth layer; it is calculated by propagating the feature of the lth layer. It indicates that the feature of the current node is updated after the neighbor feature aggregation; A jh is an element in the adjacency matrix, representing the edge weight between node j and node h.

[0177] The final output node features:

[0178]

[0179] in, is the final feature representation of node j, that is, the output feature after GNN processing. GNN(A,X) means processing graph structure data through GNN, that is, processing the adjacency matrix A and the node feature matrix X to update and generate new node features.

[0180] The final feature vector of each node contains its comprehensive relationship after fusion with its neighboring nodes.

[0181] Global distribution modeling based on VAE

[0182] 1. Input GNN features

[0183] Use the GNN output features as the input of VAE:

[0184]

[0185] Where H: Final node feature matrix, containing the final feature representations of all nodes in the graph. Each column of the matrix is ​​the final feature vector of a node. is the final feature representation of node 1; is the final feature representation of node 2; For node n m The final feature representation of is the final feature representation of node j, referred to as h in subsequent steps j .

[0186] 2. VAE Encoder

[0187] Use the encoder to map the output features of the GNN to the latent space:

[0188]

[0189] Among them, z j is the latent space representation of node j, which is the output of the encoder and is used to represent the compressed features of node j. j is the input feature vector of node j. φ (z j |h j ) is the approximate posterior distribution generated by the encoder, representing the feature h of a given node j j When the latent variable z j The distribution of μ φ (h j ) and Σ φ (h j ) is the mean vector and covariance matrix of node j calculated by the neural network; represents the latent variable z j The approximate posterior distribution of is a Gaussian distribution.

[0190] Sampling from a latent distribution:

[0191] z s ~q φ (z s |h s )

[0192] Among them, z s is the sth latent variable obtained by sampling; s=1,2,……,n m ;q φ (z s |h s ) is the approximate posterior distribution generated by the encoder corresponding to the sampled s-th latent variable.

[0193] 3. VAE Decoder

[0194] Use the decoder to reconstruct node features:

[0195]

[0196] in, is the reconstructed feature vector of node s. θ (h s |z s ) is the conditional probability distribution of node s, indicating that given the latent space z s Under the condition represented by s The probability distribution of s ).

[0197] 4. The graph neural network loss function is shown as follows:

[0198]

[0199] Among them, λ is the graph neural network loss coefficient, and its preferred value is 0.3-0.5; As shown below:

[0200]

[0201] Among them, ||h j -h j || means to find h j and h j The Euclidean distance between .

[0202] in As shown below:

[0203]

[0204] Among them, D KL (a||b) means to find the KL divergence between a and b; p(z j ) is the conditional probability distribution of node j.

[0205] Output the fusion result. The final fused feature is the output of VAE. The fusion features of each node The relationships of all neighbor nodes are fused, and the robustness to noise and dynamic changes is enhanced through latent distribution modeling.

[0206] After the above step S103, the multi-dimensional data can be effectively fused, and the data from different sensors and smart meters can be aligned and integrated in time and space to form a unified, time-synchronized data set. This fusion provides a complete view, comprehensively considers each collected data, and reduces the errors and uncertainties that may exist in a single sensor.

[0207] The purpose of data fusion is to combine the data from multiple sensors and smart meters to provide a more accurate and reliable estimate of the system state. The data fusion method set in the present invention is a recursive algorithm for state estimation of dynamic systems. It effectively fuses multi-source data through prediction and update steps to provide the best estimate. Its main advantages include: Noise suppression: The data fusion method set in this application can provide the best estimate in a noisy environment and reduce the impact of measurement noise. Dynamic tracking: It can dynamically track changes in system status and is suitable for real-time monitoring. Optimized fusion: Reduce data redundancy and information conflicts by optimally weighted fusion of data from different sources.

[0208] The data fusion method set in the present invention is only a preferred implementation scheme. In addition to using the set data fusion for data fusion, the data fusion method can also use Kalman filtering, extended Kalman filtering KEF, i.e. Extended Kalman Filter, unscented Kalman filtering UKF, i.e. Unscented Kalman Filter, particle filtering PF, i.e. Particle Filter, Bayesian Fusion, weighted average method, and information filtering Information Filtering and other methods for data fusion.

[0209] Step S104: extract features from the fused data, and represent the extracted feature data as multi-dimensional feature data. Label the multi-dimensional feature data to obtain a labeled data set.

[0210] Specifically: Feature extraction is performed for different parameters, including electromagnetic field features, power consumption features, current and voltage features.

[0211] The electromagnetic field characteristics to be extracted include average value, standard deviation, spectrum characteristics, and frequency band energy; the spectrum characteristics are the main frequencies obtained by Fourier transform calculation;

[0212] The power consumption characteristics include power consumption fluctuation rate and standard deviation.

[0213] The current and voltage characteristics include the peak and zero points of the waveform, harmonic components

[0214] Each feature extraction method extracts the following new feature dimensions:

[0215] The electric field characteristics include the electric field average value, the electric field standard deviation, the electric field main frequency and the electric field frequency band energy, a total of 4 characteristics;

[0216] The magnetic field characteristics include 4 characteristics: magnetic field average value, magnetic field standard deviation, magnetic field main frequency and magnetic field frequency band energy;

[0217] The electricity consumption characteristics include volatility and standard deviation of electricity consumption, a total of 2 characteristics

[0218] The current characteristics include current waveform characteristics and current harmonic components, a total of 2 characteristics;

[0219] Voltage characteristics include voltage waveform characteristics and voltage harmonic components, a total of 2 characteristics;

[0220] It is important to understand that

[0221] In the electric field characteristics,

[0222] The electric field average value reflects the average level of the electric field strength within a set time period, and can be used to identify whether there is a persistent abnormality. Preferably, the set time period is 1 hour.

[0223] The electric field standard deviation is used to measure the degree of fluctuation of the electric field strength within a set time period. A large standard deviation indicates that there may be frequent abnormal fluctuations.

[0224] The main frequency of the electric field is calculated by Fourier transforming the fused electric field data within a set time period. It reflects the main frequency components of the electric field intensity and helps identify periodic abnormal patterns.

[0225] The electric field band energy is calculated by Fourier transforming the fused electric field data within a set time period. It refers to the energy of the electric field within a specific frequency range and can be used to detect whether there is abnormal electromagnetic activity. Preferably, the specific frequency range is a low frequency band, i.e., 0-100Hz, and the energy and harmonics of the electric field are detected in the low frequency band. The main signals in the power system are concentrated in this frequency band, and abnormal fundamental and harmonic waves can directly reflect the stability problems of the power system. In the magnetic field characteristics,

[0226] The magnetic field average is similar to the average value in the electric field characteristics, reflecting the average level of magnetic field strength within a set time period.

[0227] The magnetic field standard deviation is used to measure the degree of fluctuation of magnetic field strength within a set time period. A large standard deviation indicates that there may be frequent abnormal fluctuations.

[0228] The main frequency of the magnetic field is calculated by Fourier transforming the fused magnetic field data within a set time period. It reflects the main frequency components of the magnetic field intensity and helps identify periodic abnormal patterns.

[0229] The magnetic field band energy is calculated by Fourier transforming the fused magnetic field data within a set time period. It refers to the energy of the magnetic field within a specific frequency range and can be used to detect whether there is abnormal magnetic field activity. Preferably, the specific frequency range is a low frequency band, i.e., 0-100Hz, and the energy and harmonics of the magnetic field are detected in the low frequency band. The main signals in the power system are concentrated in this frequency band, and abnormal fundamental and harmonic waves can directly reflect the stability problems of the power system.

[0230] The power consumption characteristics,

[0231] The power consumption fluctuation rate reflects the change in power consumption within a set time period and can be used to identify whether there are abnormal load changes. A high fluctuation rate may indicate a dramatic change in power load, which is usually related to equipment startup or abnormal power consumption behavior.

[0232] The calculation formula for electricity consumption fluctuation rate is:

[0233]

[0234] Q t : The fused power consumption value at time t.

[0235] It indicates the average value of the fused power consumption values ​​corresponding to each sampling point within the set time period;

[0236] N: The total number of samples within the set time period.

[0237] The standard deviation of electricity consumption is used to measure the degree of fluctuation of electricity consumption data over a period of time. A large standard deviation may indicate that electricity consumption has large fluctuations in a short period of time, which is usually related to load instability or abnormal events.

[0238] In the current characteristics,

[0239] The current waveform feature is the number of peak or zero points of the current within a set time period, reflecting the morphological characteristics of the current signal. An abnormal waveform may indicate a device failure.

[0240] The current harmonic component reflects the presence of non-fundamental components in the current signal within a set time period. Abnormal harmonic content may indicate grid pollution or equipment failure. The current harmonic component is the average of the amplitudes corresponding to the 2nd to 15th order current harmonics.

[0241] In the voltage characteristics,

[0242] The voltage waveform feature is the number of peak or zero points of the voltage within a set time period, reflecting the morphological characteristics of the voltage signal. An abnormal waveform may indicate a device failure.

[0243] The voltage harmonic component reflects the presence of non-fundamental components in the voltage signal within a set time period. Abnormal harmonic content may indicate grid pollution or equipment failure. The voltage harmonic component includes the amplitude corresponding to the 2nd to 15th voltage harmonics.

[0244] Feature extraction is performed on multi-source fusion data. The extracted feature data can be represented as a 14-dimensional vector, where each dimension corresponds to the feature extracted from the original 8-dimensional data. The following symbols are used to represent each feature:

[0245] The electric field characteristics include the average electric field μ E , electric field standard deviation σ E , the main frequency of the electric field f E , Electric field frequency band energy E E ;

[0246] The magnetic field characteristics include the average magnetic field μ B , magnetic field standard deviation σ B , magnetic field frequency f B , magnetic field frequency band energy E B ;

[0247] The electricity consumption characteristics include electricity consumption fluctuation rate ΔQ, electricity consumption standard deviation σ Q ;

[0248] The current characteristics include the current waveform characteristics W I , current harmonic component F I ;

[0249] Voltage characteristics include voltage waveform characteristics W V , voltage harmonic component F V .

[0250] Combining the above symbolic representation, the extracted 14-dimensional feature vector can be expressed as:

[0251] F t =[μ E ,σ E ,f E ,E E ,μ B ,σ B ,f B ,E B ,ΔQ,σ Q ,W I ,F I ,W V ,F V ]

[0252] This feature fusion converts raw data into concise feature vectors, helping the LSTM model to understand and process the information more easily. It also removes some irrelevant information and reduces the computational burden, allowing the model to focus more on key signals, making training more efficient and improving detection accuracy and efficiency.

[0253] Step S105: constructing a user power consumption anomaly detection model based on LSTM; using a labeled data set to train the user power consumption anomaly detection model;

[0254] Based on the multi-dimensional feature data and the clock information of the Beidou satellite, time series data is constructed, and a user power consumption anomaly detection model is built. User power consumption anomaly detection is performed based on the neural network model and the time series data that has been standardized.

[0255] The multi-dimensional feature data is a 14-dimensional feature vector.

[0256] The method of constructing time series data according to the multi-dimensional feature data and the clock information of the Beidou satellite includes: constructing the 14-dimensional feature data of T time steps into a T*14 matrix according to the 14-dimensional feature data of each time step, wherein the time step is the time interval.

[0257] like Figure 3 As shown, assuming we have T time steps of data, the data format of each time step is:

[0258] F t =[μ E ,σ E ,f E ,E E ,μ B ,σ B ,f B ,E B ,ΔQ,σ Q ,W I ,F I ,W V ,F V ];

[0259] F t Data at the tth time step;

[0260] The overall data format is a T×14 matrix.

[0261] The multi-source feature data is standardized so that its mean is 0 and its standard deviation is 1, which can accelerate the convergence of the model.

[0262] The expression for the standardized processing is:

[0263]

[0264] Among them, F t ′ is the data of the tth time step after standardization; μ F and σ F are the mean and standard deviation of the entire training data respectively.

[0265] Step S1051: Build a user power consumption anomaly detection model and label the multi-dimensional feature data through the LSTM network model.

[0266] The standardized 14-dimensional feature vector data of each time step is used as input, and a label is set for the data of each time step to obtain a labeled data set; the label is set to two categories: label 0 and label 1. When the label is 0 / 1, it indicates that an anomaly exists, and when the label is 1 / 0, it indicates that no anomaly exists.

[0267] In the preferred embodiment of the present invention, the user power consumption anomaly detection model is implemented by using an LSTM network model; the LSTM model includes an input layer, a first LSTM layer, a first Dropout layer, a second LSTM layer, a second Dropout layer and a fully connected layer.

[0268] The input layer is used to receive standardized feature data, each sample contains T time steps, and each time step has 14 features.

[0269] The first LSTM layer has several units, each of which processes the data of one time step and passes the information to the next time step.

[0270] The first Dropout layer prevents overfitting by randomly discarding the outputs of some neurons.

[0271] The second LSTM layer processes the output of the first LSTM layer and returns the output of the last time step.

[0272] The second Dropout layer again prevents overfitting.

[0273] The fully connected layer maps the output of the LSTM layer to an output unit, uses a sigmoid activation function, and outputs a value between 0 and 1, indicating whether there is an abnormality in the user's electricity consumption.

[0274] In a preferred embodiment of the present invention, the first LSTM layer includes 64 units, the input shape is: (T, 14), and a sequence of all time steps is returned.

[0275] The first Dropout layer is used to prevent overfitting.

[0276] The second LSTM layer consists of 64 units and only returns the output of the last time step.

[0277] The second Dropout layer is used to prevent overfitting.

[0278] The Dense layer, i.e., the fully connected layer, includes 1 unit, uses the sigmoid activation function, and outputs 0 or 1 to indicate whether there is an abnormality.

[0279] Train the user power consumption anomaly detection model based on the labeled data set;

[0280] In the process of training the user power consumption anomaly detection model based on the labeled data set, the set anomaly detection model loss function is used, as shown in the following formula:

[0281]

[0282] Where i is an integer, and i∈[1,N], N is the total number of samples; y i The true value of the i-th sample; The predicted value of the ith sample; σ is the kernel bandwidth; α is the first balancing weight, and its preferred value range is 0.6-0.8; β is the second balancing weight, and its preferred value range is 0.4-0.5; σ is the kernel bandwidth, which controls the sensitivity to error. Preferably, a Gaussian kernel is selected in the present invention, and σ is the Gaussian kernel bandwidth. While controlling the sensitivity to error, it determines the smoothness of the Gaussian kernel. Those skilled in the art can adjust it according to the actual noise level; the preferred value range of σ is 0.1-0.5.

[0283] The anomaly detection model loss function proposed in the present invention can not only capture the global distribution characteristics, but also improve the robustness and flexibility under noise.

[0284] The LSTM model is used to detect the abnormal power consumption of users on the extracted feature data. This method makes full use of the LSTM's processing ability for time series data and can effectively capture the time dependency in the data, thereby achieving accurate intrusion detection.

[0285] Step S106: Figure 3 As shown, multi-source electricity consumption data is collected in real time, and the aforementioned preprocessing, feature fusion and feature extraction are performed on the real-time collected data. The multi-dimensional feature data obtained in real time is input into the trained user electricity consumption anomaly detection model to perform real-time detection of user electricity consumption anomalies.

[0286] In addition to using the LSTM model to detect user power usage anomalies on the extracted feature data, you can also use methods such as the gated recurrent unit GRU, the autoregressive integrated moving average model ARIMA, the hidden Markov model HMM, and the temporal convolutional network TCN to quickly judge user power usage anomalies based on time series multi-source feature information.

[0287] Example 2

[0288] In one embodiment, a temporal convolutional network model is used to perform abnormal power usage detection on the extracted feature data.

[0289] Constructing a temporal convolutional network model for rapid judgment of abnormal power consumption of users

[0290] The model structure is as follows:

[0291] Input layer: accepts a 14-dimensional feature vector, which is a vector composed of features extracted from different sensors and smart meter data.

[0292] Convolutional layer: Multiple one-dimensional convolutional layers are stacked, each of which contains a certain number of filters to capture local patterns. Each convolutional layer is usually followed by a batch normalization layer and an activation function to improve the expressiveness of the model. In the present invention, the preferred activation function is ReLU.

[0293] Residual connection layer: helps the model learn deeper features and prevents gradient disappearance.

[0294] Global pooling layer: Use Global Average Pooling or Global Max Pooling to reduce the output dimension and further extract high-level features.

[0295] Fully connected layer: Finally, a fully connected layer Dense Layers is used to output a node, use the predict method to predict the new data, and determine whether there is anomaly based on the threshold.

[0296] Define a TCN block, which contains multiple one-dimensional convolutional layers with different dilation rates. Each convolutional layer is followed by batch normalization, activation function and Dropout layer. Finally, the input is added to the current output through the residual connection.

[0297] Using the Sequential model, add a TCN block as the input layer.

[0298] A GlobalAveragePooling1D layer is used to reduce the output dimension and further extract high-level features.

[0299] Finally, a fully connected layer Dense is used to output a node to represent the result of anomaly detection, and the sigmoid activation function is used.

[0300] Use the adam optimizer and the binary_crossentropy loss function, and monitor the accuracy metric.

[0301] The model is trained using a labeled dataset, where the label indicates whether an intrusion occurs in each time series.

[0302] Use the trained model to predict new data and determine whether there are any anomalies.

[0303] The time convolution model is used to detect the abnormal power usage of users on the extracted feature data. It can effectively capture the time dependency in the data, thus achieving accurate intrusion detection. The trained model is used to detect abnormal power usage of users.

[0304] The time convolution model is used to detect the abnormal power usage of users on the extracted feature data and optimize its loss function. It can effectively capture the time dependency in the data, thereby achieving accurate intrusion detection. The trained model is used for abnormal power usage detection.

[0305] The present application also discloses a power consumption anomaly detection system based on the power consumption anomaly detection method, including a multi-source data acquisition module, a data fusion module, a feature extraction module, a power consumption anomaly detection model construction module, a power consumption anomaly detection model training module and a power consumption anomaly real-time detection module:

[0306] The multi-source data acquisition module collects multi-source electricity consumption data based on multi-source data sensors and smart meters;

[0307] The data fusion module preprocesses the multi-source electricity consumption data, and performs data feature fusion on the preprocessed multi-source electricity consumption data through a comprehensive graph neural network and a variational autoencoder to obtain fused data;

[0308] The feature extraction module extracts features from the fused data to obtain multi-dimensional feature data; annotates the multi-dimensional feature data to obtain an annotated data set;

[0309] The power consumption anomaly detection model building module builds a user power consumption anomaly detection model based on LSTM;

[0310] The power consumption anomaly detection model training module trains the user power consumption anomaly detection model based on the labeled data set;

[0311] The real-time power consumption anomaly detection module collects multi-source power consumption data in real time, performs the aforementioned preprocessing, feature fusion and feature extraction on the real-time collected data, inputs the multi-dimensional feature data obtained in real time into the trained user power consumption anomaly detection model, and performs real-time detection of user power consumption anomalies.

[0312] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0313] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0314] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0315] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0316] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for detecting power consumption anomaly based on Beidou synchronized multi-source data and LSTM, characterized in that: The following steps are involved: Collecting multi-source electricity consumption data based on multi-source data sensors and smart meters; the multi-source data sensors and smart meters are synchronized based on clock information of Beidou satellites; Preprocessing the multi-source electricity consumption data, and fusing data features of the preprocessed multi-source electricity consumption data by using a comprehensive graph neural network and a variational autoencoder to obtain fused data; Perform feature extraction on the fused data to obtain multi-dimensional feature data; Set labels for multi-dimensional feature data to obtain labeled data sets; Build a user power consumption anomaly detection model based on LSTM; Train the user power consumption anomaly detection model based on the labeled data set; Collect multi-source electricity consumption data in real time, perform the aforementioned preprocessing, feature fusion and feature extraction on the real-time collected data, input the multi-dimensional feature data obtained in real time into the trained user electricity consumption anomaly detection model, and perform real-time detection of user electricity consumption anomalies.

2. The method for detecting abnormal power consumption according to claim 1, characterized in that: The multi-source data sensor includes an electromagnetic field sensor, a current sensor and a voltage sensor; The multi-source electricity consumption data includes electric field strength, magnetic field strength, user electricity consumption, current and voltage.

3. The method for detecting abnormal power consumption according to claim 1 or 2, characterized in that: The preprocessing includes low-pass filtering the electric field strength and magnetic field strength, filling missing values ​​in the user's power consumption data, low-pass filtering the current and voltage data, and normalizing the data after the above processing.

4. The method for detecting abnormal power consumption according to claim 1, characterized in that: The method of fusing data features of preprocessed multi-source electricity consumption data by integrating graph neural network and variational autoencoder is as follows: The device corresponding to each item of data in the preprocessed multi-source electricity consumption data is taken as a node; the edge weight is constructed according to the association relationship between the sensor and the smart meter; Generate an adjacency matrix of a graph structure based on edge weights; The graph neural network propagates and updates the preprocessed multi-source electricity consumption data based on the adjacency matrix, and obtains a new feature representation of each node through the propagation of the multi-layer graph neural network; The obtained feature representation is input into the variational autoencoder. The encoder in the variational autoencoder maps the feature representation to the latent space to obtain the latent variable. The decoder in the variational autoencoder then decodes the latent variable back to the original data space to obtain the reconstructed multi-source electricity consumption data. When the calculated result of the graph neural network loss function is greater than the set loss threshold, the reconstruction result is re-input into the graph neural network for the next round of iteration; When the calculation result of the graph neural network loss function is less than the set loss threshold, the iteration is stopped to obtain the fused data.

5. The method for detecting abnormal power consumption according to claim 1, characterized in that: The multi-dimensional feature data includes electric field features, magnetic field features, power consumption features, current features and voltage features; Among them, the electric field characteristics include the electric field average value, the electric field standard deviation, the electric field main frequency and the electric field frequency band energy; The magnetic field characteristics include the magnetic field average value, magnetic field standard deviation, magnetic field main frequency and magnetic field frequency band energy; Electricity consumption characteristics include electricity consumption fluctuation rate and electricity consumption standard deviation; Current characteristics include current waveform characteristics and current harmonic components; Voltage characteristics include voltage waveform characteristics and voltage harmonic components.

6. The method for detecting abnormal power consumption according to claim 1, characterized in that: The label is set to two types: label 0 and label 1. When the label is 0 / 1, it indicates that an abnormality exists, and when the label is 1 / 0, it indicates that no abnormality exists.

7. The method for detecting abnormal power consumption according to claim 1, characterized in that: In the process of training the user power consumption anomaly detection model based on the labeled data set, the set anomaly detection model loss function is used, as shown in the following formula: Where i is an integer, and i∈[1,N], N is the total number of samples; y i The true value of the i-th sample; The predicted value of the i-th sample; σ is the Gaussian kernel bandwidth; α is the first balance weight; β is the second balance weight.

8. A power consumption anomaly detection system using the power consumption anomaly detection method according to any one of claims 1 to 7, characterized in that: It includes multi-source data acquisition module, data fusion module, feature extraction module, power consumption anomaly detection model construction module, power consumption anomaly detection model training module and power consumption anomaly real-time detection module: The multi-source data acquisition module collects multi-source electricity consumption data based on multi-source data sensors and smart meters; The data fusion module preprocesses the multi-source electricity consumption data, and performs data feature fusion on the preprocessed multi-source electricity consumption data through a comprehensive graph neural network and a variational autoencoder to obtain fused data; The feature extraction module extracts features from the fused data to obtain multi-dimensional feature data; annotates the multi-dimensional feature data to obtain an annotated data set; The power consumption anomaly detection model building module builds a user power consumption anomaly detection model based on LSTM; The power consumption anomaly detection model training module trains the user power consumption anomaly detection model based on the labeled data set; The real-time power consumption anomaly detection module collects multi-source power consumption data in real time, performs the aforementioned preprocessing, feature fusion and feature extraction on the real-time collected data, inputs the multi-dimensional feature data obtained in real time into the trained user power consumption anomaly detection model, and performs real-time detection of user power consumption anomalies.

9. An electronic device, comprising a processor and a storage medium; characterized in that: The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the power consumption anomaly detection method according to claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the power consumption anomaly detection method described in claims 1-7 is implemented.

Citation Information

Cited By

  • Enterprise abnormal electricity consumption detection method based on electricity consumption data

    CN120524276A

  • Power consumption anomaly detection method and system based on Bayesian model

    CN120892950A