Power consumption behavior diagnosis system and method based on anomaly detection model

By adopting a hierarchical latent spatial model based on variational autoencoder in the electricity consumption behavior diagnosis system, the problem of insufficient modeling capabilities of complex multi-dimensional timing data and relying on manual feature extraction is solved, and efficient and accurate detection and diagnosis of electricity consumption behavior abnormalities is achieved.

CN119918005APending Publication Date: 2025-05-02STATE GRID HUBEI MARKETING SERVICE CENT (MEASUREMENT CENT)

Patent Information

Application Number
CN202510001004.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

The prior art lacks modeling capabilities when processing complex multi-dimensional timing data, feature extraction and selection rely on manual information to cause loss, and the abnormal detection accuracy and calculation efficiency are difficult to balance.

Method used

The power consumption behavior diagnosis system based on the abnormality detection model is adopted, including data acquisition, preprocessing, feature extraction, feature selection and abnormality detection modules, and the hierarchical latent spatial model of the variational autoencoder framework is used for feature encoding and decoding, and the abnormal score is calculated based on reconstruction error, temporal context error and latent spatial consistency difference.

Benefits of technology

It improves the accuracy and diagnostic accuracy of abnormal identification of electricity consumption behavior, takes into account calculation efficiency and robustness, and can effectively process large-scale user data and meet real-time processing requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119918005A_ABST
    Figure CN119918005A_ABST
Patent Text Reader

Abstract

The invention provides a power consumption behavior diagnosis system and method based on an anomaly detection model, and relates to the technical field of power system anomaly diagnosis, and the system comprises a data collection module which is used for collecting the data of the power consumption behavior of a user; the data preprocessing module is used for obtaining basic time sequence data; the feature extraction module is used for extracting multi-dimensional features; the feature selection module is used for screening the multi-dimensional features by adopting a feature screening function to obtain a screened feature set; the model processing module is used for inputting the screened feature set into a pre-trained anomaly detection model to generate a reconstructed feature sequence; the anomaly recognition module is used for calculating an anomaly score; and the diagnosis output module is used for outputting the abnormal level and generating an abnormal diagnosis report of the power consumption behavior of the user. The method can effectively solve the problems that in the prior art, the modeling capacity of complex multi-dimensional time series data is insufficient, feature extraction and selection depend on manual work, information loss is likely to be caused, and the anomaly detection precision and the calculation efficiency are difficult to balance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system abnormality diagnosis, and in particular to a power consumption behavior diagnosis system and method based on an abnormality detection model. Background Art

[0002] With the rapid development of power systems and the widespread application of smart grids, the monitoring and analysis of user electricity consumption behavior has become particularly important in power management. By detecting abnormalities in user electricity consumption behavior, potential equipment failures, electricity safety hazards, and electricity theft can be discovered in a timely manner, thereby ensuring the safety and stability of the power system. In addition, the diagnosis of abnormal electricity consumption behavior can also provide a basis for the optimal allocation of power resources, improve the efficiency of power grid operation, and reduce operating costs. Therefore, the development of efficient and accurate electricity consumption behavior anomaly identification technology has become an important research direction in the current power industry.

[0003] At present, a variety of technical means have been proposed and applied to identify abnormal user electricity consumption behavior. For example, the rule-based method detects abnormal behavior by setting fixed thresholds or rules. This method is simple to implement, but it is difficult to adapt to complex electricity consumption behavior patterns; the statistical analysis-based method uses the statistical characteristics of historical data (such as mean, variance, etc.) to identify abnormal points, which can capture abnormal features to a certain extent, but has limited performance when processing multi-dimensional time series data. In recent years, machine learning and deep learning technologies have gradually been introduced into the detection of abnormal electricity consumption behavior. By building classifiers or prediction models to identify abnormal behaviors, these methods have improved the accuracy of detection to a certain extent, but there are still some technical defects. For example, the rule-based or statistical analysis method is difficult to effectively model complex multi-dimensional time series data, and cannot fully capture the time dependency and interactive characteristics between dimensions in the user's electricity consumption behavior; and although the machine learning and deep learning methods can process a certain degree of complex data, they rely on manual design in feature extraction and selection, which easily leads to feature redundancy or information loss. In addition, it is difficult for existing technologies to strike a balance between detection accuracy and efficiency. Especially when processing large-scale user data, the computational complexity and real-time performance of the model are still urgent problems to be solved. Summary of the invention

[0004] In view of this, the present invention proposes an electricity consumption behavior diagnosis system and method based on anomaly detection model, which can effectively solve the problems in the prior art such as insufficient modeling ability of complex multi-dimensional time series data, feature extraction and selection relying on manual work and easily leading to information loss, and difficulty in balancing anomaly detection accuracy and computational efficiency, thereby improving the ability to identify abnormalities in user electricity consumption behavior and the accuracy of diagnosis.

[0005] The technical solution of the present invention is achieved in this way:

[0006] In one aspect, the present invention provides a power consumption behavior diagnosis system based on anomaly detection model, comprising:

[0007] A data collection module is used to collect data on users' electricity consumption behavior from the power system and organize the collected data into a multi-dimensional time series data sequence;

[0008] The data preprocessing module is used to perform data cleaning, data correction, time alignment, sliding window segmentation and standardization on the multi-dimensional time series data sequence to obtain basic time series data;

[0009] Feature extraction module, used to perform time domain analysis and statistical analysis on basic time series data and extract multi-dimensional features;

[0010] A feature selection module is used to filter multidimensional features using a feature filtering function to obtain a filtered feature set;

[0011] A model processing module is used to input the filtered feature set into a pre-trained anomaly detection model, encode and decode the filtered feature set, and generate a reconstructed feature sequence, wherein the anomaly detection model is a hierarchical latent space model based on a variational autoencoder framework;

[0012] An anomaly identification module, used to calculate an anomaly score based on the reconstructed feature sequence and the filtered feature set, where the anomaly score is comprehensively evaluated based on the reconstruction error, the temporal context error, and the consistency difference between the global latent space and the local latent space;

[0013] The diagnosis output module is used to diagnose the user's electricity usage behavior according to the abnormal score and the preset score threshold, output the abnormal level, and generate an abnormal diagnosis report of the user's electricity usage behavior.

[0014] Preferably, the data on user electricity usage behavior includes a variety of power parameters, including voltage data, current data, active power data, reactive power data, power factor data and frequency data; the voltage data includes three-phase voltage and phase-to-phase voltage, and the current data includes three-phase current; the multi-dimensional time series data sequence is organized in such a way that the data on user electricity usage behavior are aligning and arranging according to sampling time points to form a multi-dimensional time series data sequence.

[0015] Preferably, the data preprocessing module includes:

[0016] A data cleaning unit, used for removing abnormal sampling points in the multi-dimensional time series data sequence based on rule screening, wherein the abnormal sampling points include over-range data, unreasonable data and signal interruption data;

[0017] A data correction unit is used to correct missing data in the cleaned data. The correction process uses adjacent data interpolation or Gaussian mixture model to fill in the data.

[0018] A time alignment unit is used to resample the corrected data according to a uniform time step to generate time series data with equal interval sampling;

[0019] The sliding window unit is used to perform sliding window segmentation on the time-aligned data, dividing the time series data into multiple groups of time windows of fixed length. The length of the sliding window is L, and the sliding step is S, where L and S are determined according to the periodic characteristics of the electricity consumption behavior;

[0020] The standardization unit is used to standardize the data after the sliding window segmentation, normalize the data of each dimension to the same numerical range, and obtain the basic time series data.

[0021] Preferably, the feature extraction module includes a time domain feature extraction unit and a statistical feature extraction unit;

[0022] The time domain feature extraction unit is used to extract time domain features, including:

[0023] Trend characteristics: Use polynomial fitting to extract the trend term coefficients of the characteristic sequence;

[0024] Fluctuation characteristics: Calculate the difference sequence of adjacent sampling points and extract the fluctuation amplitude and frequency;

[0025] Periodic features: Autocorrelation analysis is used to extract the periodic features of the sequence;

[0026] The statistical feature extraction unit is used to extract statistical features, including:

[0027] Basic statistics: calculate the mean, standard deviation, variance, skewness and kurtosis of the sequence;

[0028] Interval statistics: calculate maximum, minimum, quartiles, and median;

[0029] Correlation statistics: calculate the correlation coefficient and mutual information between features of different dimensions;

[0030] The feature extraction module organizes the extracted features into a feature matrix with a dimension of M×N, i.e., multi-dimensional features, where M is the time window length and N is the feature dimension.

[0031] Preferably, the screening process of the feature selection module is as follows:

[0032] Step 1: Initialize the candidate feature set F candidate , put all the features to be selected into this set; at the same time, initialize the selected feature set

[0033] Step 2: Use the feature screening function to calculate the candidate feature set F in sequence candidate Each candidate feature f i The score S(f i ), initial stage When RE(f i ,F selected ) is 0;

[0034] Step 3: According to the score S(f i ) Select the feature f with the highest score best , and select it from the candidate feature set F candidate Remove from and add to the selected feature set F selected ;

[0035] Step 4: Recalculate the score S(f i ), and update RE(f i ,F selected );

[0036] Step 5. Repeat steps 2 to 4 until F selected The size of the feature set reaches the preset size K, and the filtered feature set is output;

[0037] Among them, the expression of the feature screening function is:

[0038] S(f i )=α1·UT(f i )+α2·MI(f i ,y proxy )-α3·RE(f i ,F selected )

[0039]

[0040] MI(f i ,y proxy )=H(y proxy )+H(f i )-H(f i ,y proxy )

[0041]

[0042] In the formula, S(f i ) represents the feature f i Screening score; UT(f i ) is the feature f i Contribution of MI(f i ,y proxy ) is the feature f i With the proxy target yproxy The mutual information of RE(f i ,F selected ) is the feature f i With the selected feature set F selected The redundancy between i ) is the feature f i The standard deviation of the values ​​in all time windows; μ(f i ) is the feature f i The mean of the values ​​in all time windows; y proxy It is a time indicator related to the target task generated in each time window based on the original data. As the proxy target, the proxy target of time window t It is expressed as: is the original data in the time window t, G(·) is the calculation function used to extract the characteristics of electricity consumption behavior; H(·) is the information entropy; H(f i ,y proxy ) is the joint entropy; Corr(f i ,f j ) represents the feature f i With f j of relevance.

[0043] Preferably, the anomaly detection model includes an input layer, a GRU encoder, a hidden layer, a GRU decoder and an output layer; the GRU encoder and the GRU decoder both include two GRU layers, the GRU layer of the GRU encoder is a bidirectional design, the forward GRU processes the sequence information before time t, and the backward GRU processes the sequence information after time t, and the GRU decoder also includes an attention mechanism; the hidden layer includes two layers of latent space, which are divided into a first latent space and a second latent space, and each layer of the latent space is composed of a fully connected network, wherein the output of the first latent space guides the second latent space and the GRU decoder.

[0044] Preferably, the step of the model processing module processing the filtered feature set includes:

[0045] The input layer receives the filtered feature set. For each feature sequence X, its shape is [T, F], where T is the time step and F is the feature dimension of each time step.

[0046] Use the GRU encoder to process the feature sequence X to obtain the hidden state sequence: h t =BiGRU2(BiGRU1(x t )),t∈[1,T], BiGRU1 and BiGRU2 are the first and second bidirectional GRU layers respectively, x t is the original input at time step t;

[0047] Extract the hidden state h of the last time step of the GRU encoder T , the distribution parameters of the first latent space are generated through the fully connected layer: Where μ1 is the mean of the global latent variable z1, is the logarithmic variance of the global latent variable z1, FC1 represents the fully connected layer;

[0048] Generate the global latent variable z1 by reparameterization: In the formula, Indicates that ∈ follows a normal distribution;

[0049] For each time step, the hidden state h t Concatenate with the global latent variable z1 to generate the distribution parameters of the second latent space: In the formula, μ 2,t is the local latent variable z at time step t 2,t The mean of is the local latent variable z at time step t 2,t The logarithmic variance of , concat represents the concatenation operation, and FC2 is the fully connected layer;

[0050] Generate local latent variables z by reparameterization 2,t : In the formula, Represents ∈ t Follows normal distribution;

[0051] For each time step t, the global latent variable z1 is compared with the local latent variable z 2,t Concatenate to generate the decoder input g t =concat(z1,z 2,t );

[0052] Use the GRU decoder to generate the decoded hidden state h at each time step t,dec : GRU1 and GRU2 are the first and second layers of the GRU decoder, respectively;

[0053] Calculate the current decoded hidden state The attention context vector with the global latent variable z1:

[0054]

[0055] Will decode the hidden state and the attention context vector Context t Splicing, generating reconstruction features through the fully connected layer: is the reconstructed feature at time step t;

[0056] The decoder generates a complete reconstructed sequence time step by time step:

[0057] Preferably, the loss function used in the pre-training of the anomaly detection model is as follows:

[0058]

[0059] L KL1 =KL(q(z1|X)‖p(z1))

[0060] L KL2 =KL(q(z2|X)‖p(z2|z1))

[0061] In the formula, is the total loss function; L rec is the reconstruction error; L KL1 is the KL divergence of the first layer of latent space, which measures the global latent variable z1 and the standard normal distribution The deviation between KL2 is the KL divergence of the second-layer latent space, which measures the deviation of the local latent variable z2 from its conditional distribution p(z2|z1); X and Represent the original input sequence and the reconstructed feature sequence respectively; ‖·‖ 2 represents the square of the Euclidean norm; β1 and β2 are hyperparameters used to balance the weights of reconstruction error and latent space distribution regularization.

[0062] Preferably, the calculation formula of the anomaly score is as follows:

[0063] A s =δ1·E r +δ2·E t +δ3·E c

[0064]

[0065] E t =std(E r (t-1),E r (t),E r (t+1))

[0066] E c =‖mean(z2)-z1‖ 2

[0067] In the formula, A s is the anomaly score; E r is the reconstruction error; X and Represent the original input sequence and the reconstructed feature sequence respectively; ‖·‖ 2represents the square of the Euclidean norm; E t is the temporal context error; E r (t-1) represents the reconstruction error at time step t-1; E r (t) represents the reconstruction error at time step t; E r (t+1) represents the reconstruction error at time step t+1; std(·) is the standard deviation operator; E c is the consistency error; z1 is the global latent variable, which is generated by the last hidden state of the GRU encoder through the fully connected layer and represents the global characteristics of the time series; z2 is the local latent variable, which contains the local latent variables of all time steps [z 2,1 ,z 2,2 ,...,z 2,T ]; mean(z2) represents the mean of the local latent variable; δ1, δ2, δ3 are weight coefficients.

[0068] On the other hand, the present invention further provides a method for diagnosing power consumption behavior based on an abnormality detection model, the method being executed in any of the above-mentioned systems, the method comprising:

[0069] S1. Collecting user electricity consumption behavior data from the power system through a data acquisition module and organizing it into a multi-dimensional time series data sequence;

[0070] S2, through the data preprocessing module, the collected multi-dimensional time series data sequence is cleaned, corrected, time aligned, segmented by sliding windows, and standardized to generate basic time series feature data;

[0071] S3, performing time domain analysis and statistical analysis on the basic time series feature data through a feature extraction module, extracting multi-dimensional features, and forming a feature matrix;

[0072] S4, using a feature selection module to filter the feature matrix using a feature filtering function to obtain a filtered feature set;

[0073] S5, inputting the filtered feature set into a pre-trained anomaly detection model, wherein the anomaly detection model is a hierarchical latent space model based on a variational autoencoder framework, encoding and decoding the feature set to generate a reconstructed feature sequence;

[0074] S6. Calculate an anomaly score according to the reconstructed feature sequence and the filtered feature set through an anomaly recognition module, wherein the anomaly score is comprehensively evaluated based on the reconstruction error, the temporal context error, and the consistency difference between the global latent space and the local latent space;

[0075] S7. The diagnostic output module diagnoses the user's electricity usage behavior according to the abnormality score and the preset score threshold, and outputs the abnormality level and diagnostic report.

[0076] Compared with the prior art, the present invention has the following beneficial effects:

[0077] (1) The present invention can comprehensively implement the complete process from data acquisition, preprocessing, feature extraction, feature selection to anomaly detection and diagnostic output. The functions of each module are clear and coordinated with each other, so that the entire system can efficiently process complex multi-dimensional time series data and adapt to the needs of multiple scenarios in practical applications. The overall solution not only improves the accuracy of abnormal detection of power consumption behavior, but also takes into account the computational efficiency and robustness of the system, and can meet the requirements of real-time processing of large-scale data;

[0078] (2) The present invention adopts a method that comprehensively considers the contribution (UT), mutual information (MI) and redundancy The feature screening method can effectively extract key features from multi-dimensional time series data by coordinating the importance, relevance and redundancy of features through weight parameters. While reducing feature redundancy, it fully retains feature information that contributes significantly to anomaly detection, thereby improving the quality of model input data;

[0079] (3) The present invention introduces a variational autoencoder model based on a hierarchical latent space to construct a synergistic mechanism of global latent variables and local latent variables in the latent space. The global variables capture the overall characteristics of the user's electricity consumption behavior pattern, and the local variables capture the dynamic changes of the time series at each time step, thereby comprehensively modeling the time series dependency and the interaction characteristics between dimensions in multidimensional time series data;

[0080] (4) The present invention proposes a method for calculating anomaly scores by combining reconstruction error, temporal context error, and latent space consistency difference to evaluate the degree of abnormality of user electricity consumption behavior from multiple dimensions. This method makes full use of the deviation of model reconstruction ability, error change in time-dependent context, and consistency change characteristics of latent variables. Through multi-dimensional collaborative evaluation, it can more comprehensively and accurately identify abnormal behavior. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0082] Figure 1 is a system framework diagram of an embodiment of the present invention;

[0083] Figure 2 This is a feature screening flow chart of an embodiment of the present invention;

[0084] Figure 3 This is a structural diagram of an anomaly detection model according to an embodiment of the present invention;

[0085] Figure 4 The figure is a flow chart of a method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0086] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0087] like Figure 1 As shown, first, the present invention provides a power consumption behavior diagnosis system based on an abnormality detection model, comprising:

[0088] A data collection module is used to collect data on users' electricity consumption behavior from the power system and organize the collected data into a multi-dimensional time series data sequence;

[0089] The data preprocessing module is used to perform data cleaning, data correction, time alignment, sliding window segmentation and standardization on the multi-dimensional time series data sequence to obtain basic time series data;

[0090] Feature extraction module, used to perform time domain analysis and statistical analysis on basic time series data and extract multi-dimensional features;

[0091] A feature selection module is used to filter multidimensional features using a feature filtering function to obtain a filtered feature set;

[0092] A model processing module is used to input the filtered feature set into a pre-trained anomaly detection model, encode and decode the filtered feature set, and generate a reconstructed feature sequence, wherein the anomaly detection model is a hierarchical latent space model based on a variational autoencoder framework;

[0093] An anomaly identification module, used to calculate an anomaly score based on the reconstructed feature sequence and the filtered feature set, where the anomaly score is comprehensively evaluated based on the reconstruction error, the temporal context error, and the consistency difference between the global latent space and the local latent space;

[0094] The diagnosis output module is used to diagnose the user's electricity usage behavior according to the abnormal score and the preset score threshold, output the abnormal level, and generate an abnormal diagnosis report of the user's electricity usage behavior.

[0095] Specifically, in one embodiment of the present invention, the data collection module collects data related to the user's electricity consumption behavior by connecting with smart meters, power distribution monitoring equipment, home energy management systems (HEMS) and other equipment in the power system. The collected data includes:

[0096] Power parameter data: including voltage data, current data, active power data, reactive power data, power factor data and frequency data. Among them: voltage data includes three-phase voltage and phase-to-phase voltage; current data includes three-phase current.

[0097] Time information: records the sampling time point and is used to time align the collected data.

[0098] User attribute data: static information such as user type and geographic location, used to identify user characteristics.

[0099] The collected data are aligned and arranged according to the sampling time points to form a multi-dimensional time series data sequence.

[0100] The data collection module uses a variety of methods to obtain user electricity consumption behavior data to ensure the integrity and real-time nature of the data:

[0101] Active collection: Actively obtain real-time data through the communication interface (such as DL / T645, Modbus, IEC61850 protocol) with smart meters or other monitoring devices.

[0102] Passive collection: receiving data actively uploaded by user-end devices, such as receiving uploaded data from batches of users through a concentrator or gateway device.

[0103] Periodic collection: Set the collection time interval according to the characteristics of the device, obtain static or dynamic data regularly, and ensure data continuity.

[0104] Event-triggered acquisition: When a possible abnormal power consumption event is detected, high-resolution data acquisition is triggered in real time to capture detailed features of the abnormal behavior.

[0105] The collected data is organized according to the time dimension, user dimension and variable dimension to form a multi-dimensional time series data sequence. The specific organization method is:

[0106] The data is aligned according to the sampling time point to ensure synchronization of data of different dimensions; the multidimensional data of each time point is arranged into a vector, and the data of multiple time points form a matrix, the rows of the matrix represent the time step, and the columns represent different power parameters.

[0107] The collected data can be temporarily stored in a local cache and then uploaded to the central processing system via a data transmission protocol (such as JSON or Protobuf format).

[0108] Specifically, in one embodiment of the present invention, the data preprocessing module includes:

[0109] The data cleaning unit is used to remove abnormal sampling points in the multi-dimensional time series data sequence based on rule screening, and the abnormal sampling points include out-of-range data, unreasonable data and signal interruption data.

[0110] In this embodiment, the definition of abnormal sampling points is:

[0111] Out-of-range data: invalid data that exceeds the measurement range of the device. Irrational data: such as negative power (in non-specific scenarios) or data that obviously deviates from the normal range. Signal interruption data: null value data caused by communication interruption or device failure.

[0112] Cleaning method: Filter data based on preset rules, remove abnormal sampling points, and record cleaning logs for subsequent analysis.

[0113] The data correction unit is used to correct the missing data in the cleaned data. The correction process uses the interpolation method of adjacent data or the Gaussian mixture model to fill in the data.

[0114] In this embodiment, the interpolation method uses linear interpolation or spline interpolation. For complex missing patterns, a Gaussian mixture model (GMM) is used to model the data distribution and predict the missing values ​​based on the model.

[0115] The time alignment unit is used to resample the corrected data according to a uniform time step to generate time series data with equal interval sampling.

[0116] In this embodiment, a uniform time step is first set according to the characteristics of electricity consumption behavior and the capabilities of the sampling equipment, and then the original data is interpolated or aggregated to perform resampling so that data of all dimensions are aligned on the time axis to generate time series data with equal interval sampling.

[0117] The sliding window unit is used to perform sliding window segmentation on the time-aligned data, dividing the time series data into multiple groups of time windows of fixed length. The length of the sliding window is L, and the sliding step is S, where L and S are determined according to the periodic characteristics of electricity consumption behavior.

[0118] In this embodiment, the length and step size of the sliding window are determined according to the periodic characteristics of the power consumption behavior. For example, for daily periodic behavior, the window length can be set to 24 hours and the step size can be set to 1 hour. According to the set window length and step size, the time series data is slidingly segmented to generate multiple time windows. The data of each time window is organized into a matrix form, with rows representing time steps and columns representing different power parameters.

[0119] The standardization unit is used to standardize the data after the sliding window segmentation, normalize the data of each dimension to the same numerical range, and obtain the basic time series data.

[0120] This embodiment can improve the quality and consistency of data through the preprocessing module.

[0121] Specifically, in one embodiment of the present invention, the feature extraction module includes a time domain feature extraction unit and a statistical feature extraction unit.

[0122] The time domain feature extraction unit is used to extract time domain features, including:

[0123] Trend characteristics: Use polynomial fitting to extract the trend term coefficient of the feature sequence; reflect the overall change trend of the data.

[0124] Fluctuation characteristics: Calculate the difference sequence of adjacent sampling points and extract the fluctuation amplitude and fluctuation frequency; the fluctuation amplitude is the absolute value mean of the difference sequence, reflecting the average amplitude of data changes; the fluctuation frequency is the number of fluctuations per unit time, reflecting the frequency of data changes.

[0125] Periodic characteristics: Autocorrelation analysis is used to extract the periodic characteristics of the sequence, including the primary period and secondary period.

[0126] The statistical feature extraction unit is used to extract statistical features, including:

[0127] Basic statistics: calculate the mean, standard deviation, variance, skewness and kurtosis of the sequence; the mean, standard deviation and variance reflect the central tendency and dispersion of the data; the skewness and kurtosis reflect the symmetry and sharpness of the data distribution.

[0128] Interval statistics: calculate the maximum, minimum, quartile and median; the maximum and minimum values ​​reflect the extreme range of the data; the quartiles and median reflect the distribution position of the data.

[0129] Correlation statistics: calculate the correlation coefficient and mutual information between features of different dimensions; the correlation coefficient reflects the linear correlation between two dimensions; the mutual information reflects the nonlinear correlation between two dimensions.

[0130] The feature extraction module organizes the extracted features into a feature matrix with a dimension of M×N, i.e., multi-dimensional features, where M is the time window length and N is the feature dimension. Each row represents a feature within a time window, and each column represents a specific feature dimension.

[0131] Specifically, Figure 2 As shown, in one embodiment of the present invention, the screening process of the feature selection module is as follows:

[0132] Step 1: Initialize the candidate feature set F candidate, put all the features to be selected into this set; at the same time, initialize the selected feature set

[0133] Step 2: Use the feature screening function to calculate the candidate feature set F in sequence candidate Each candidate feature f i The score S(f i ), initial stage When RE(f i ,F selected ) is 0;

[0134] Step 3: According to the score S(f i ) Select the feature f with the highest score best , and select it from the candidate feature set F candidate Remove from and add to the selected feature set F selected ;

[0135] Step 4: Recalculate the score S(f i ), and update RE(f i ,F selected );

[0136] Step 5. Repeat steps 2 to 4 until F selected The size of the feature set reaches the preset size K, and the filtered feature set is output;

[0137] Among them, the expression of the feature screening function is:

[0138] S(f i )=α1·UT(f i )+α2·MI(f i ,y proxy )-α3·RE(f i ,F selected )

[0139]

[0140] MI(f i ,y proxy )=H(y proxy )+H(f i )-H(f i ,y proxy )

[0141]

[0142] In the formula, S(f i ) represents the feature f i Screening score; UT(f i ) is the feature f i Contribution of MI(fi ,y proxy ) is the feature f i With the proxy target y proxy The mutual information of RE(f i ,F selected ) is the feature f i With the selected feature set F selected The redundancy between i ) is the feature f i The standard deviation of the values ​​in all time windows; μ(f i ) is the feature f i The mean of the values ​​in all time windows; y proxy It is a time indicator related to the target task generated in each time window based on the original data. As the proxy target, the proxy target of time window t It is expressed as: is the original data in the time window t, G(·) is the calculation function used to extract the characteristics of electricity consumption behavior; H(·) is the information entropy; H(f i ,y proxy ) is the joint entropy; Corr(f i ,f j ) represents the feature f i With f j of relevance.

[0143] The goal of the feature screening function of this embodiment is to maximize the contribution of the feature and the mutual information with the proxy target, while minimizing the redundancy between features.

[0144] In this embodiment, the proxy target y proxy It is a time indicator related to the target task generated in each time window based on the original data. G(·) can be a statistical indicator based on domain knowledge (such as total electricity consumption, peak load, etc.); it can also be a specific task-related indicator generated by a pre-trained model.

[0145] Specifically, Corr(f i ,f j ) can be calculated using the Pearson correlation coefficient formula.

[0146] Specifically, Figure 3As shown, in one embodiment of the present invention, the anomaly detection model includes an input layer, a GRU encoder, a hidden layer, a GRU decoder and an output layer; the GRU encoder and the GRU decoder both include two GRU layers, the GRU layer of the GRU encoder is a bidirectional design, the forward GRU processes the sequence information before time t, and the backward GRU processes the sequence information after time t, and the GRU decoder also includes an attention mechanism; the hidden layer includes two layers of latent space, which are divided into a first latent space and a second latent space, and each layer of the latent space is composed of a fully connected network, wherein the output of the first latent space guides the second latent space and the GRU decoder.

[0147] The anomaly detection model of the present invention is based on a variational autoencoder (VAE) framework, combines a bidirectional GRU (BiGRU) encoder and a GRU decoder, and constructs a hierarchical latent space model for anomaly detection of user electricity usage behavior.

[0148] The anomaly detection model consists of the following main components:

[0149] Input layer: Receives the filtered feature set, and the input shape is [T, F], where T is the time step and F is the feature dimension of each time step.

[0150] GRU encoder: A two-layer GRU with a bidirectional design to extract global and local features of time series.

[0151] Hidden layer (latent space): It includes two layers of latent space, namely the global latent space and the local latent space, which are used to capture the global features of the time series and the local features of the time step.

[0152] GRU decoder: A two-layer GRU decoder, combined with an attention mechanism, generates a sequence of reconstructed features time-step by time-step.

[0153] Output layer: Generates a complete reconstruction feature sequence for calculating the reconstruction error.

[0154] The steps of processing the filtered feature set by the model processing module include:

[0155] The input layer receives the filtered feature set. For each feature sequence X, its shape is [T, F], where T is the time step and F is the feature dimension of each time step.

[0156] Use the GRU encoder to process the feature sequence X to obtain the hidden state sequence: h t =BiGRU2(BiGRU1(x t )),t∈[1,T], BiGRU1 and BiGRU2 are the first and second bidirectional GRU layers respectively, x t is the original input at time step t;

[0157] Extract the hidden state h of the last time step of the GRU encoder T , the distribution parameters of the first latent space are generated through the fully connected layer: Where μ1 is the mean of the global latent variable z1, is the logarithmic variance of the global latent variable z1, FC1 represents the fully connected layer;

[0158] Generate the global latent variable z1 by reparameterization: In the formula, represents ∈ obeys normal distribution; μ1 and σ1 are obtained from h through the fully connected layer T learned from

[0159] The hidden state h for each time step t Concatenate with the global latent variable z1 to generate the distribution parameters of the second latent space: In the formula, μ 2,t is the local latent variable z at time step t 2,t The mean of is the local latent variable z at time step t 2,t The logarithmic variance of μ is , concat represents the concatenation operation, FC2 is the fully connected layer; μ 2,t and σ 2,t is obtained from h through a fully connected layer t learned in

[0160] Generate local latent variables z by reparameterization 2,t : In the formula, Represents ∈ t Follows normal distribution;

[0161] For each time step t, the global latent variable z1 is compared with the local latent variable z 2,t Concatenate to generate the decoder input g t =concat(z1,z 2,t );

[0162] Use the GRU decoder to generate the decoded hidden state h at each time step t,dec : GRU1 and GRU2 are the first and second layers of the GRU decoder, respectively;

[0163] Calculate the current decoded hidden state The attention context vector with the global latent variable z1:

[0164]

[0165] Will decode the hidden state and the attention context vector Context t Splicing, generating reconstruction features through the fully connected layer: is the reconstructed feature at time step t;

[0166] The decoder generates a complete reconstructed sequence time step by time step:

[0167] In the anomaly detection model, there is an implicit guidance mechanism, that is, the output of the first latent space guides both the second latent space and the GRU decoder.

[0168] Implicit guidance during the encoding phase:

[0169] The global latent variable z1 is used as background information in the process of generating the local latent space, and indirectly guides the local latent variable z through splicing. 2,t The distribution of is generated:

[0170] Implicit guidance during the decoding phase:

[0171] The global latent variable z1 participates in the reconstruction process of each time step through the attention mechanism in the decoding stage, providing global context information and constraining the local latent variable z 2,t dynamic changes.

[0172] The anomaly detection model provided by the present invention integrates GRU and VAE. The GRU encoder extracts the global and local features of the time series and maps them to the global and local latent spaces of VAE. The GRU decoder combines the global and local features of the latent space to generate a reconstructed sequence time step by time step. A hierarchical latent space is designed, and the global latent space captures the overall behavior pattern of the time series; the local latent space captures the fine-grained features of each time step in the time series. In this model, the bidirectional GRU encoder can make full use of the context information of the time series; the hierarchical latent space design improves the model's ability to express global and local features; the attention mechanism enhances the decoder's ability to focus on key time steps; the VAE framework combines the time series modeling capabilities of GRU to achieve efficient anomaly detection.

[0173] The model training process is as follows:

[0174] Input the filtered feature set, the shape is [T, F], where T is the time step and F is the feature dimension.

[0175] Use a bidirectional GRU encoder to extract global features z1 and local features z 2,t , and mapped to the latent space.

[0176] A GRU decoder is used to combine global and local features in the latent space to generate a reconstructed sequence time-step by time-step.

[0177] The total loss function is calculated and the model parameters are optimized through back-propagation.

[0178] During training, the Adam optimizer is used, the learning rate is set to 0.001, and the model is pre-trained using normal power consumption behavior data to ensure that the model can accurately reconstruct normal behavior. During the training process, a batch of data is randomly sampled in each iteration; the total loss is calculated, and then the parameters are updated through backpropagation.

[0179] The loss function is as follows:

[0180]

[0181] L KL1 =KL(q(z1|X)‖p(z1))

[0182] L KL2 =KL(q(z2|X)‖p(z2|z1))

[0183] In the formula, is the total loss function; L rec is the reconstruction error; L KL1 is the KL divergence of the first layer of latent space, which measures the global latent variable z1 and the standard normal distribution The deviation between KL2 is the KL divergence of the second-layer latent space, which measures the deviation of the local latent variable z2 from its conditional distribution p(z2|z1); X and Represent the original input sequence and the reconstructed feature sequence respectively; ‖·‖ 2 represents the square of the Euclidean norm; β1 and β2 are hyperparameters used to balance the weights of reconstruction error and latent space distribution regularization.

[0184] In the loss function designed by the present invention, the reconstruction error reflects the model's ability to reconstruct the time series. The smaller the error, the stronger the model's ability to model normal behavior. The KL divergence of the global latent space ensures that the distribution of global features has good generalization ability by regularizing the global latent space. The KL divergence of the local latent space ensures that the distribution of local features can effectively capture the fine-grained features of the time step by regularizing the local latent space.

[0185] Specifically, in one embodiment of the present invention, the calculation formula of the anomaly score is as follows:

[0186] A s =δ1·E r +δ2·E t +δ3·E c

[0187]

[0188] E t =std(E r (t-1),E r (t),E r (t+1))

[0189] E c =‖mean(z2)-z1‖ 2

[0190] In the formula, A s is the anomaly score; E r is the reconstruction error; X and Represent the original input sequence and the reconstructed feature sequence respectively; ‖·‖ 2 represents the square of the Euclidean norm; E t is the temporal context error; E r (t-1) represents the reconstruction error at time step t-1; E r (t) represents the reconstruction error at time step t; E r (t+1) represents the reconstruction error at time step t+1; std(·) is the standard deviation operator; E c is the consistency error; z1 is the global latent variable, which is generated by the last hidden state of the GRU encoder through the fully connected layer and represents the global characteristics of the time series; z2 is the local latent variable, which contains the local latent variables of all time steps [z 2,1 ,z 2,2 ,...,z 2,T ]; mean(z2) represents the mean of the local latent variable; δ1, δ2, δ3 are weight coefficients.

[0191] In the anomaly score formula provided by the present invention, the reconstruction error is to ensure that the feature sequence of normal power consumption behavior can be accurately reconstructed by the anomaly detection model, so the reconstruction error is small; while the feature sequence of abnormal behavior deviates from the normal mode, the reconstruction error is large. The introduction of time context error is because the time series of normal power consumption behavior has strong time consistency, and the reconstruction error of adjacent time steps varies little; while the time series of abnormal behavior may cause the reconstruction error of adjacent time steps to vary greatly. The consistency difference is that the global latent variables and local latent variables of normal power consumption behavior have high consistency, so the consistency difference is small; while abnormal behavior may cause the consistency difference between global and local latent variables to increase.

[0192] Specifically, in one embodiment of the present invention, a plurality of score thresholds are preset to classify different abnormality levels, and the setting of the score thresholds can be adjusted through statistical analysis or based on domain knowledge.

[0193] In this embodiment, according to the abnormal score A s The size of the user's electricity usage behavior is divided into the following levels:

[0194] Normal behavior: A s ≤A1; Slightly abnormal: A1 s ≤A2; moderately abnormal: A2 s ≤A3; Severe abnormality: A s >A3. Among them, A1 <A2<A3。

[0195] Output the abnormal level Level of the user's electricity usage behavior, where Level∈{normal behavior, slight abnormality, moderate abnormality, severe abnormality}.

[0196] Afterwards, a diagnostic report is generated based on the anomaly score, including:

[0197] Count the distribution of abnormal scores and generate a score distribution graph; display the abnormal scores of users’ electricity usage behaviors. s Distribution in the time dimension; use line charts or bar charts to visualize the changing trend of anomaly scores. Provide statistical information of anomaly scores, including maximum, minimum, mean, and standard deviation; mark the time points when the anomaly scores exceed the threshold.

[0198] Analyze the type and time period of abnormal behavior; describe the abnormal type of user power consumption behavior according to the abnormal level, such as slight fluctuation, moderate fluctuation or severe fluctuation; analyze the specific cause of abnormal behavior by combining the reconstruction error, time context error and consistency difference of the abnormal identification module. Mark the time period when the abnormal behavior occurs; provide the duration and frequency of the abnormal behavior.

[0199] Provide diagnostic suggestions and optimization measures. Provide corresponding suggestions based on the abnormality level, for example: for minor abnormalities, it is recommended to observe subsequent power consumption behavior; for moderate abnormalities, it is recommended to check related equipment or lines; for severe abnormalities, it is recommended to take immediate measures to avoid potential risks. According to the specific causes of abnormal behavior, provide measures to optimize power consumption behavior, such as adjusting power load, checking equipment operating status, etc.

[0200] Finally, the abnormality level and diagnosis report are output.

[0201] In addition, if Figure 4 As shown, the present invention also provides a method for diagnosing power consumption behavior based on an abnormal detection model, the method is executed in any of the above-mentioned systems, and the method includes:

[0202] S1. Collecting user electricity consumption behavior data from the power system through a data acquisition module and organizing it into a multi-dimensional time series data sequence; ​​

[0203] S2, through the data preprocessing module, the collected multi-dimensional time series data sequence is cleaned, corrected, time aligned, segmented by sliding windows, and standardized to generate basic time series feature data;

[0204] S3, performing time domain analysis and statistical analysis on the basic time series feature data through a feature extraction module, extracting multi-dimensional features, and forming a feature matrix;

[0205] S4, using a feature selection module to filter the feature matrix using a feature filtering function to obtain a filtered feature set;

[0206] S5, inputting the filtered feature set into a pre-trained anomaly detection model, wherein the anomaly detection model is a hierarchical latent space model based on a variational autoencoder framework, encoding and decoding the feature set to generate a reconstructed feature sequence;

[0207] S6. Calculate an anomaly score according to the reconstructed feature sequence and the filtered feature set through an anomaly recognition module, wherein the anomaly score is comprehensively evaluated based on the reconstruction error, the temporal context error, and the consistency difference between the global latent space and the local latent space;

[0208] S7. The diagnostic output module diagnoses the user's electricity usage behavior according to the abnormality score and the preset score threshold, and outputs the abnormality level and diagnostic report.

[0209] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. The power consumption behavior diagnosis system based on the anomaly detection model is characterized by: include: A data collection module is used to collect data on users' electricity consumption behavior from the power system and organize the collected data into a multi-dimensional time series data sequence; The data preprocessing module is used to perform data cleaning, data correction, time alignment, sliding window segmentation and standardization on the multi-dimensional time series data sequence to obtain basic time series data; Feature extraction module, used to perform time domain analysis and statistical analysis on basic time series data and extract multi-dimensional features; A feature selection module is used to filter multidimensional features using a feature filtering function to obtain a filtered feature set; A model processing module is used to input the filtered feature set into a pre-trained anomaly detection model, encode and decode the filtered feature set, and generate a reconstructed feature sequence, wherein the anomaly detection model is a hierarchical latent space model based on a variational autoencoder framework; An anomaly identification module, used to calculate an anomaly score based on the reconstructed feature sequence and the filtered feature set, where the anomaly score is comprehensively evaluated based on the reconstruction error, the temporal context error, and the consistency difference between the global latent space and the local latent space; The diagnosis output module is used to diagnose the user's electricity usage behavior according to the abnormal score and the preset score threshold, output the abnormal level, and generate an abnormal diagnosis report of the user's electricity usage behavior.

2. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 1, characterized in that: The data on user electricity usage behavior includes a variety of power parameters, including voltage data, current data, active power data, reactive power data, power factor data and frequency data; the voltage data includes three-phase voltage and phase-to-phase voltage, and the current data includes three-phase current; the multi-dimensional time series data sequence is organized in such a way that the data on user electricity usage behavior are aligning and arranging according to the sampling time points to form a multi-dimensional time series data sequence.

3. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 2, characterized in that: The data preprocessing module includes: A data cleaning unit, used for removing abnormal sampling points in the multi-dimensional time series data sequence based on rule screening, wherein the abnormal sampling points include over-range data, unreasonable data and signal interruption data; A data correction unit is used to correct missing data in the cleaned data. The correction process uses adjacent data interpolation or Gaussian mixture model to fill in the data. A time alignment unit is used to resample the corrected data according to a uniform time step to generate time series data with equal interval sampling; The sliding window unit is used to perform sliding window segmentation on the time-aligned data, dividing the time series data into multiple groups of time windows of fixed length. The length of the sliding window is L, and the sliding step is S, where L and S are determined according to the periodic characteristics of the electricity consumption behavior; The standardization unit is used to standardize the data after the sliding window segmentation, normalize the data of each dimension to the same numerical range, and obtain the basic time series data.

4. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 3, characterized in that: The feature extraction module includes a time domain feature extraction unit and a statistical feature extraction unit; The time domain feature extraction unit is used to extract time domain features, including: Trend characteristics: Use polynomial fitting to extract the trend term coefficients of the characteristic sequence; Fluctuation characteristics: Calculate the difference sequence of adjacent sampling points and extract the fluctuation amplitude and frequency; Periodic features: Autocorrelation analysis is used to extract the periodic features of the sequence; The statistical feature extraction unit is used to extract statistical features, including: Basic statistics: calculate the mean, standard deviation, variance, skewness and kurtosis of the sequence; Interval statistics: calculate maximum, minimum, quartiles, and median; Correlation statistics: calculate the correlation coefficient and mutual information between features of different dimensions; The feature extraction module organizes the extracted features into a feature matrix with a dimension of M×N, i.e., multi-dimensional features, where M is the time window length and N is the feature dimension.

5. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 3, characterized in that: The screening process of the feature selection module is as follows: Step 1: Initialize the candidate feature set F candidate , put all the features to be selected into this set; at the same time, initialize the selected feature set Step 2: Use the feature screening function to calculate the candidate feature set F in sequence candidate Each candidate feature f i The score S(f i ), initial stage When RE(f i ,F selected ) is 0; Step 3: According to the score S(f i ) Select the feature f with the highest score best , and select it from the candidate feature set F candidate Remove from and add to the selected feature set F selected ; Step 4: Recalculate the score S(f i ), and update RE(f i ,F selected ); Step 5. Repeat steps 2 to 4 until F selected The size of the feature set reaches the preset size K, and the filtered feature set is output; Among them, the expression of the feature screening function is: S(f i )=α1·UT(f i )+α2·MI(f i ,y proxy )-α3·RE(f i ,F selected ) MI(f i ,y proxy )=H(y proxy )+H(f i )-H(f i ,y proxy ) In the formula, S(f i ) represents the feature f i Screening score; UT(f i ) is the feature f i Contribution of MI(f i ,y proxy ) is the feature f i With the proxy target y proxy The mutual information of RE(f i ,F selected ) is the feature f i With the selected feature set F selected The redundancy between i ) is the feature f i The standard deviation of the values ​​in all time windows; μ(f i ) is the feature f i The mean of the values ​​in all time windows; y proxy It is a time indicator related to the target task generated in each time window based on the original data. As the proxy target, the proxy target of time window t It is expressed as: is the original data in the time window t, G(·) is the calculation function used to extract the characteristics of electricity consumption behavior; H(·) is the information entropy; H(f i ,y proxy ) is the joint entropy; Corr(f i ,f j ) represents the feature f i With f j of relevance.

6. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 2, characterized in that: The anomaly detection model includes an input layer, a GRU encoder, a hidden layer, a GRU decoder and an output layer; the GRU encoder and the GRU decoder both include two GRU layers. The GRU layer of the GRU encoder is a bidirectional design. The forward GRU processes the sequence information before time t, and the backward GRU processes the sequence information after time t. The GRU decoder also includes an attention mechanism; the hidden layer includes two layers of latent space, which are divided into the first latent space and the second latent space. Each layer of the latent space is composed of a fully connected network, in which the output of the first latent space guides the second latent space and the GRU decoder.

7. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 6, characterized in that: The steps of processing the filtered feature set by the model processing module include: The input layer receives the filtered feature set. For each feature sequence X, its shape is [T, F], where T is the time step and F is the feature dimension of each time step. Use the GRU encoder to process the feature sequence X to obtain the hidden state sequence: h t =BiGRU2(BiGRU1(x t )),t∈[1,T], BiGRU1 and BiGRU2 are the first and second bidirectional GRU layers respectively, x t is the original input at time step t; Extract the hidden state h of the last time step of the GRU encoder T , the distribution parameters of the first latent space are generated through the fully connected layer: Where μ1 is the mean of the global latent variable z1, is the logarithmic variance of the global latent variable z1, FC1 represents the fully connected layer; Generate the global latent variable z1 by reparameterization: In the formula, Indicates that ∈ follows a normal distribution; For each time step, the hidden state h t Concatenate with the global latent variable z1 to generate the distribution parameters of the second latent space: In the formula, μ 2,t is the local latent variable z at time step t 2,t The mean of is the local latent variable z at time step t 2,t The logarithmic variance of , concat represents the concatenation operation, and FC2 is the fully connected layer; Generate local latent variables z by reparameterization 2,t : In the formula, Represents ∈ t It follows a normal distribution; For each time step t, the global latent variable z1 is compared with the local latent variable z 2,t Concatenate to generate the decoder input g t =concat(z1,z 2,t ); Use the GRU decoder to generate the decoded hidden state h at each time step t,dec : GRU1 and GRU2 are the first and second layers of the GRU decoder, respectively; Calculate the current decoded hidden state The attention context vector with the global latent variable z1: Will decode the hidden state and the attention context vector Context t Splicing, generating reconstruction features through the fully connected layer: is the reconstructed feature at time step t; The decoder generates a complete reconstructed sequence time step by time step:

8. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 6, characterized in that: The loss function used by the anomaly detection model during pre-training is as follows: L KL1 =KL(q(z1|X)‖p(z1)) L KL2 =KL(q(z2|X)‖p(z2|z1)) In the formula, is the total loss function; L rec is the reconstruction error; L KL1 is the KL divergence of the first layer of latent space, which measures the global latent variable z1 and the standard normal distribution The deviation between KL2 is the KL divergence of the second-layer latent space, which measures the deviation of the local latent variable z2 from its conditional distribution p(z2|z1); X and Represent the original input sequence and the reconstructed feature sequence respectively; ‖·‖ 2 represents the square of the Euclidean norm; β1 and β2 are hyperparameters used to balance the weights of reconstruction error and latent space distribution regularization.

9. The power consumption behavior diagnosis system based on the abnormal detection model according to claim 6, characterized in that: The calculation formula of anomaly score is as follows: TO s =δ1·E r +δ2·E t +δ3·E c E t =std(E r (t-1),E r (t),E r (t+1)) E c =‖mean(z2)-z1‖ 2 In the formula, A s is the anomaly score; E r is the reconstruction error; X and Represent the original input sequence and the reconstructed feature sequence respectively; ‖·‖ 2 represents the square of the Euclidean norm; E t is the temporal context error; E r (t-1) represents the reconstruction error at time step t-1; E r (t) represents the reconstruction error at time step t; E r (t+1) represents the reconstruction error at time step t+1; std(·) is the standard deviation operator; E c is the consistency error; z1 is the global latent variable, which is generated by the last hidden state of the GRU encoder through the fully connected layer and represents the global characteristics of the time series; z2 is the local latent variable, which contains the local latent variables of all time steps [z 2,1 ,z 2,2 ,...,z 2,T ]; mean(z2) represents the mean of the local latent variable; δ1, δ2, δ3 are weight coefficients.

10. A method for diagnosing power consumption behavior based on an abnormality detection model, the method being executed in the system according to any one of claims 1 to 9, the method comprising: S1. Collecting user electricity consumption behavior data from the power system through a data acquisition module and organizing it into a multi-dimensional time series data sequence; S2, through the data preprocessing module, the collected multi-dimensional time series data sequence is cleaned, corrected, time aligned, segmented by sliding windows, and standardized to generate basic time series feature data; S3, performing time domain analysis and statistical analysis on the basic time series feature data through a feature extraction module, extracting multi-dimensional features, and forming a feature matrix; S4, using a feature selection module to filter the feature matrix using a feature filtering function to obtain a filtered feature set; S5, inputting the filtered feature set into a pre-trained anomaly detection model, wherein the anomaly detection model is a hierarchical latent space model based on a variational autoencoder framework, encoding and decoding the feature set to generate a reconstructed feature sequence; S6. Calculate an anomaly score according to the reconstructed feature sequence and the filtered feature set through an anomaly recognition module, wherein the anomaly score is comprehensively evaluated based on the reconstruction error, the time context error, and the consistency difference between the global latent space and the local latent space; S7. The diagnostic output module diagnoses the user's electricity usage behavior according to the abnormality score and the preset score threshold, and outputs the abnormality level and diagnostic report.

Citation Information

Patent Citations

  • A power consumption data anomaly detection model based on isolated forest algorithm

    CN108985632A

  • Unsupervised plunger pump anomaly detection method and device based on time-dependent feature reconstruction

    CN117933344A

  • Multi-modal fusion algorithm for electrocardiosignal anomaly detection

    CN118520279A

  • Time series data anomaly detection method combining graph learning and double attention mechanism

    CN118779804A

  • Industrial internet time series data anomaly detection method and system

    CN118898045A

Cited By

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

    CN120524276A

  • A method for detecting abnormal electricity consumption in enterprises based on electricity consumption data

    CN120524276B

  • Abnormal data identification method and system for time-day-and-frequency-band characteristic engineering

    CN120995359A

  • A time-sharing day frequency band feature engineering-based abnormal data identification method and system

    CN120995359B

  • Power consumption anomaly detection method based on time-frequency behavior mismatch analysis

    CN121456731A