Meter abnormal power consumption behavior diagnosis method and system based on edge computing

By using edge computing technology to collect and analyze meter box data in real time, generating a spatiotemporal feature matrix and constructing a classification decision tree, the problem of low efficiency and high energy consumption in identifying abnormal electricity consumption behavior of meter boxes is solved, and accurate diagnosis of electricity theft behavior and energy consumption optimization are achieved.

CN121167513BActive Publication Date: 2026-04-10陕西中恒电气有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

The existing methods for identifying abnormal electricity consumption behavior in metering boxes rely on manual inspections, which are inefficient, costly, and susceptible to human factors. Traditional centralized data analysis suffers from data transmission delays and excessive computational resource consumption, and it is difficult to accurately distinguish the types of abnormalities. The long-term operation of magnetic field sensors leads to energy waste.

Method used

The edge computing-based method for diagnosing abnormal electricity consumption behavior in metering boxes collects voltage, current, and physical state information in real time at the edge, generates a spatiotemporal feature matrix, and constructs an abnormal electricity consumption classification tree by combining an electrical parameter feature mask pruning algorithm and magnetic field data. An intermittent abnormal trajectory splicing algorithm is used to generate electricity theft trajectories and dynamically updates the spatiotemporal feature weights.

Benefits of technology

It enables real-time and accurate diagnosis of abnormal electricity consumption behavior of meter boxes, reduces energy consumption, and improves diagnostic efficiency and accuracy. It can distinguish between three types of behavior: meter box malfunction, unintentional electricity theft, and intentional electricity theft.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121167513B_ABST
    Figure CN121167513B_ABST
Patent Text Reader

Abstract

The application discloses an edge-computing-based meter box abnormal power utilization behavior diagnosis method and system, and belongs to the technical field of electric power monitoring. The method comprises the following steps: collecting voltage, current and time tag data of a meter box in real time through an edge terminal, synchronously acquiring physical state information such as a meter door state, generating a time-space feature matrix through an electric parameter time-space coupling analysis method, inputting the electric parameter feature mask pruning algorithm to obtain an optimized feature set, triggering an edge-sensor hibernation and wake-up linkage device when an abnormal current is monitored, and collecting magnetic field data; performing total and partial electric energy difference calculation on the edge terminal, combining the magnetic field data and the meter door state, constructing a power utilization abnormality classification decision tree through a metering error-power stealing behavior coupling diagnosis method, and distinguishing power stealing behaviors; adopting an intermittent abnormal trajectory splicing algorithm to process fragmented abnormal data to generate a power stealing trajectory, and feeding back to the electric parameter time-space coupling analysis method to dynamically update time-space feature weights. The application improves abnormal diagnosis accuracy and real-time performance, and reduces energy consumption.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of power monitoring, and in particular to a meter box abnormal electricity use behavior diagnosis method and system based on edge computing. BACKGROUND

[0002] At present, the abnormal electricity use behavior identification of the meter box mainly relies on manual inspection or traditional centralized data analysis, which has obvious defects: on the one hand, manual inspection is low in efficiency and high in cost, and it is difficult to realize real-time monitoring and is easily affected by human factors to cause missed judgment and misjudgment; on the other hand, the traditional centralized data analysis needs to transmit a large amount of original data to the cloud for processing, which not only causes data transmission delay and affects the abnormal response speed, but also occupies too much bandwidth and computing resources due to redundant data, thereby reducing the diagnosis efficiency. At the same time, the existing diagnosis technology can only judge whether there is an abnormality, and cannot accurately distinguish the abnormal type, which makes it difficult to continuously improve the subsequent diagnosis accuracy; in addition, if the auxiliary monitoring devices such as magnetic field sensors are in the working state for a long time, unnecessary energy waste will be caused, which does not meet the low-power operation requirement. Therefore, there is an urgent need for a meter box abnormal electricity use behavior diagnosis method which can realize real-time, accurate and low-power operation and can be dynamically optimized to solve the above problems. SUMMARY

[0003] In view of the defects of the prior art, the application provides a meter box abnormal electricity use behavior diagnosis method and system based on edge computing, which collects the voltage, current and time tag data of the meter box in real time through the edge end, synchronously obtains the physical state information such as the meter box door state, generates a time-space feature matrix through an electric parameter space-time coupling analysis method, inputs an electric parameter feature mask pruning algorithm to obtain an optimized feature set, triggers an edge-sensor hibernation and wake-up linkage device when an abnormal current is monitored, and collects the magnetic field data; the edge end calculates the total and partial power difference, combines the magnetic field data and the meter box door state, constructs an electricity use abnormality classification decision tree through a metering error-electric larceny behavior coupling diagnosis method to distinguish the electric larceny behavior; an intermittent abnormal trajectory splicing algorithm is used to process the fragmented abnormal data to generate an electric larceny trajectory, and the electric larceny trajectory is fed back to the electric parameter space-time coupling analysis method to dynamically update the time-space feature weight; the application improves the abnormal diagnosis accuracy and real-time performance and reduces the energy consumption.

[0004] To achieve the above-mentioned purpose, the application provides the following technical scheme:

[0005] The meter box abnormal electricity use behavior diagnosis method based on edge computing comprises:

[0006] The edge end collects the voltage, current and time tag data of the meter box in real time, simultaneously obtains the physical state information of the meter box, and generates a time-space feature matrix through an electric parameter space-time coupling analysis method;

[0007] The spatio-temporal feature matrix is input into an electric parameter feature mask pruning algorithm to obtain an optimized feature set, and the optimized feature set is monitored, and when current anomalies are detected, an edge-sensor sleep wake-up linkage device is triggered;

[0008] The edge-sensor sleep wake-up linkage device sends a low-power pulse signal to the magnetic field sensor to wake up the magnetic field sensor, and the magnetic field data is collected by the woken-up magnetic field sensor;

[0009] The total and partial electric energy difference of the edge-end computing metering box is combined with the collected magnetic field data and the pre-acquired box door state, a metering error-electricity stealing behavior coupling diagnosis method is used to construct an electricity use anomaly classification decision tree, and the electricity use anomaly classification decision tree is used to distinguish three types of electricity stealing behaviors, namely metering box failure, unintentional electricity stealing and intentional electricity stealing;

[0010] For the diagnosed electricity stealing behavior, the edge-end uses an intermittent abnormal trajectory splicing algorithm to process the fragmented abnormal data generated during the diagnosis into an electricity stealing trajectory;

[0011] The electricity stealing trajectory is fed back to the electric parameter spatio-temporal coupling analysis method to dynamically update the spatio-temporal feature weight.

[0012] Specifically, the spatio-temporal feature matrix is generated by the electric parameter spatio-temporal coupling analysis method, which includes:

[0013] The voltage, current and time tag data collected and calibrated by the edge-end are used as time dimension data, and the physical state information of the metering box is used as spatial dimension data to construct a spatio-temporal data matrix; the time tag data refers to a time tag recording the voltage and current collection time; the physical state information of the metering box includes the box door opening and closing state, the box body vibration data and the environmental temperature data; the box door opening and closing state is collected by a Hall sensor installed at the box door, the box body vibration data is collected by a vibration sensor pasted on the surface of the box body, and the environmental temperature data is collected by a temperature sensor installed in the box;

[0014] The convolution operation is used to extract features from the spatio-temporal data matrix to obtain preliminary spatio-temporal features;

[0015] The preliminary spatio-temporal features are normalized and then nonlinearly transformed by a ReLU activation function to finally generate a spatio-temporal feature matrix.

[0016] Specifically, the spatio-temporal feature matrix is input into an electric parameter feature mask pruning algorithm to obtain an optimized feature set, which includes:

[0017] The spatio-temporal feature matrix generated by the electric parameter spatio-temporal coupling analysis method is input into the electric parameter feature mask pruning algorithm, and the electric parameter feature mask pruning algorithm evaluates the feature importance of the input spatio-temporal feature matrix in the channel dimension, and calculates the weight coefficients of each feature channel using regularization.

[0018] setting a weight coefficient threshold, marking a feature channel with a weight coefficient less than the weight coefficient threshold as a redundant channel, generating a mask matrix consistent with the channel dimension of the spatiotemporal feature matrix, wherein the redundant channel corresponds to a mask matrix element set to 0, and the non-redundant channel corresponds to a mask matrix element set to 1;

[0019] element-by-element multiplication of the spatiotemporal feature matrix and the mask matrix to obtain a shielded feature matrix;

[0020] global average pooling of the shielded feature matrix to obtain an optimized feature set; the optimized feature set includes current amplitude features and current rate of change features.

[0021] Specifically, the optimized feature set is monitored, and when a current anomaly is detected, an edge-sensing hibernation and wake-up linkage device is triggered, including:

[0022] training a current anomaly detection model with the optimized feature set samples in the normal power consumption scenario as training data; the current anomaly detection model uses a support vector machine algorithm, and takes the current amplitude features and the current rate of change features in the optimized feature set as input variables, and takes normal and abnormal as output labels;

[0023] inputting the real-time obtained optimized feature set into the trained current anomaly detection model, and the current anomaly detection model outputs corresponding labels after analyzing the input current amplitude features and current rate of change features;

[0024] when the current anomaly detection model outputs an abnormal label, it is determined that a current anomaly is detected, and an edge-sensing hibernation and wake-up linkage device is triggered; the trigger signal is a high-level signal;

[0025] The edge-sensing hibernation and wake-up linkage device includes a microcontroller and a low-power radio frequency module. When receiving a current anomaly trigger signal, the microcontroller controls the low-power radio frequency module to generate a low-power pulse signal to wake up the magnetic field sensor in the hibernation state.

[0026] Specifically, for the diagnosed electricity stealing behavior, the edge uses an intermittent abnormal trajectory splicing algorithm to process the fragmented abnormal data generated during the diagnosis process into electricity stealing trajectories, including:

[0027] Collecting fragmented abnormal data generated during the diagnosis of electricity stealing behavior; the fragmented abnormal data includes abnormal current fragments, abnormal magnetic field data fragments, abnormal total and partial power difference fragments, and corresponding timestamp data generated during the diagnosis process;

[0028] The edge transmits the fragmented abnormal data to the processing module of the intermittent abnormal trajectory splicing algorithm in real time through a data acquisition interface;

[0029] The window length and sliding step of the sliding window are set, and the real-time received fragmented abnormal data is stored in the sliding window in timestamp order. When the data storage time in the window exceeds the window length, the window automatically slides forward by one step, discards the historical data exceeding the window length, and retains the fragmented abnormal data in the latest window length.

[0030] The state set of the hidden Markov model is defined, the state transition matrix, the observation probability matrix and the initial state probability vector of the hidden Markov model are trained based on complete data of historical electricity stealing behaviors, and a trained hidden Markov model is obtained. The state set includes five states of current abnormal initial state, current abnormal sustained state, magnetic field abnormal state, electric energy difference abnormal state and abnormal termination state.

[0031] Specifically, for the diagnosed electricity stealing behavior, the edge uses an intermittent abnormal trajectory splicing algorithm to process the fragmented abnormal data generated in the diagnosis process into an electricity stealing trajectory, and further includes:

[0032] The fragmented abnormal data cached by the sliding window is taken as an observation sequence, and is input into the trained hidden Markov model. The forward-backward algorithm is used to calculate the state probability of each time corresponding to the observation sequence.

[0033] Based on the state probability, the state transition probability corresponding to any two adjacent fragmented data segments is calculated to obtain a state transition probability matrix.

[0034] A state transition probability threshold is set, the earliest abnormal fragmented data segment in timestamp is selected from the fragmented abnormal data cached by the sliding window as a starting segment, and the state transition probability of the starting segment and each fragmented data segment is calculated.

[0035] When the state transition probability of any fragmented data segment and the starting segment is greater than the state transition probability threshold, it is determined that there is a time sequence correlation between the two, and the fragmented data segment and the starting segment are spliced in timestamp order to form a spliced data sequence.

[0036] The state transition probability of the spliced data sequence and each remaining fragmented data segment is calculated in turn, and the fragmented data segment meeting the state transition probability threshold requirement is selected.

[0037] When all the fragmented data segments in the sliding window are processed, a complete electricity stealing trajectory including abnormal starting time, abnormal type evolution and abnormal duration is formed. The electricity stealing trajectory is stored in the form of a time sequence data linked list.

[0038] Specifically, the electricity consumption abnormal classification decision tree is constructed by using the metering error-electricity stealing behavior coupling diagnosis method, and the electricity consumption abnormal classification decision tree is used to distinguish three types of electricity stealing behaviors, i.e. metering box failure, unintentional electricity stealing and intentional electricity stealing, which includes:

[0039] The total-branch power difference, the magnetic field distortion rate in the magnetic field data, and the box door state are used as input features of the electricity consumption anomaly classification decision tree. The total-branch power difference is the difference between the total power metering value of the edge computing and the sum of the branch circuit power metering values. The magnetic field distortion rate is the percentage of the difference between the actual magnetic field strength and the normal magnetic field strength to the normal magnetic field strength. The box door state is the box door opening and closing information collected by the Hall sensor, 0 indicating closed and 1 indicating opened.

[0040] Based on the historical record of the metering box fault case, the unintentional electricity stealing case and the intentional electricity stealing case data, a training data set is formed. Each sample in the training data set contains specific values of three features of the total-branch power difference, the magnetic field distortion rate and the box door state, and the corresponding sample label. The sample label is divided into three categories of metering device failure, unintentional electricity stealing and intentional electricity stealing.

[0041] Specifically, the electricity consumption anomaly classification decision tree is constructed by using the metering error-electricity stealing behavior coupling diagnosis method, and the electricity consumption anomaly classification decision tree is used to distinguish the three electricity stealing behaviors of metering box failure, unintentional electricity stealing and intentional electricity stealing, which further includes:

[0042] Taking the information gain maximization as the feature selection criterion, whether the total-branch power difference is 0 is taken as the root node. For the branch where the total-branch power difference is not equal to 0, whether the magnetic field distortion rate is 0 is taken as the next level of sub-node. For the branch where the magnetic field distortion rate is not equal to 0, whether the box door state is 1 is taken as the next level of sub-node. The sample space is gradually divided through three levels of nodes to form a preliminary electricity consumption anomaly classification decision tree.

[0043] A pre-pruning strategy is adopted. When the number of samples of the preliminary electricity consumption anomaly classification decision tree node is less than 5, the splitting is stopped, and the current node is reserved as a leaf node to form the electricity consumption anomaly classification decision tree.

[0044] The total-branch power difference of the edge computing, the magnetic field distortion rate converted from the magnetic field data collected by the magnetic field sensor, and the box door state collected by the Hall sensor are input into the electricity consumption anomaly classification decision tree. Through the determination rule of the nodes in the electricity consumption anomaly classification decision tree, the diagnosis result is output.

[0045] The determination rule includes:

[0046] If the total-branch power difference is not equal to 0, the magnetic field distortion rate is equal to 0, and the box door state is equal to 0, it is determined that the metering device fails.

[0047] If the total-branch power difference is not equal to 0, the magnetic field distortion rate is equal to 0, the box door state is equal to 0, and there is a user miswiring record, it is determined that the user unintentionally steals electricity.

[0048] If the total-part power difference is not equal to 0, the magnetic field distortion rate is not equal to 0, and the box door state is equal to 1, it is determined that the electricity is stolen intentionally.

[0049] The metering box abnormal power consumption behavior diagnosis system based on edge computing comprises an edge acquisition module, a coupling analysis module, a pruning and monitoring module, a magnetic field data acquisition module, a classification and determination module and a electricity stealing trajectory splicing module.

[0050] The edge acquisition module is used for collecting voltage, current, time scale data and physical state data of the metering box in real time. The coupling analysis module is used for performing time-space dimension feature fusion on the collected electric parameter data and physical state data to form a space-time feature matrix. The pruning and monitoring module is used for performing redundant feature elimination and real-time anomaly monitoring on the space-time feature matrix. The magnetic field data acquisition module is used for activating a low-power sleep magnetic field sensor to collect the magnetic field data around the metering box after detecting current anomaly. The classification and determination module constructs a diagnosis model by comprehensively considering the total-part power difference, magnetic field data and box door state, accurately distinguishes three types of abnormal behaviors of metering box fault, unintentional electricity stealing and intentional electricity stealing, and outputs diagnosis results. The electricity stealing trajectory splicing module is used for integrating fragmented abnormal data of intentional electricity stealing into a complete electricity stealing trajectory.

[0051] Compared with the prior art, the beneficial effects of the present application are:

[0052] The present application proposes a metering box abnormal power consumption behavior diagnosis method based on edge computing. The method realizes real-time data acquisition and analysis based on the edge, generates a space-time feature matrix through space-time coupling analysis of electric parameters, extracts an optimized feature set through an electric parameter feature mask pruning algorithm, reduces the occupation of redundant data on computing resources, quickly and accurately monitors current anomaly, wakes up the magnetic field sensor only when abnormality occurs with the help of an edge-sensor sleep and wake-up linkage device, avoids high energy consumption caused by continuous work of the sensor, considers the real-time diagnosis and low power consumption requirements, and effectively improves the efficiency of metering box abnormal monitoring.

[0053] The present application proposes a metering box abnormal power consumption behavior diagnosis method based on edge computing. The method distinguishes three types of situations of metering box fault, unintentional electricity stealing and intentional electricity stealing through multi-dimensional data fusion of total-part power difference, magnetic field data and box door state, constructs a decision tree by combining metering error-electricity stealing behavior coupling diagnosis method, solves the problem that traditional diagnosis cannot accurately classify, generates electricity stealing trajectory through intermittent abnormal trajectory splicing algorithm, feeds back optimized space-time feature weight, forms a closed loop of diagnosis-feedback-optimization. BRIEF DESCRIPTION OF DRAWINGS

[0054] Figure 1 It is a principle flow chart of the metering box abnormal power consumption behavior diagnosis method based on edge computing.

[0055] Figure 2 The application provides an edge-computing-based meter box abnormal electricity use behavior diagnosis method. DETAILED DESCRIPTION

[0056] Embodiment 1

[0057] Please refer to Figure 1 and Figure 2 An embodiment provided by the application is an edge-computing-based meter box abnormal electricity use behavior diagnosis method, which comprises S1-S6 and comprises the following steps.

[0058] S1: collecting, in real time, voltage, current and time tag data of a meter box at an edge end, simultaneously acquiring physical state information of the meter box, and generating a time-space feature matrix through an electric parameter time-space coupling analysis method;

[0059] S2: inputting the time-space feature matrix into an electric parameter feature mask pruning algorithm to obtain an optimized feature set, and monitoring the optimized feature set, when an abnormal current is detected, triggering an edge-sensor hibernation and wake-up linkage device;

[0060] S3: sending, by the edge-sensor hibernation and wake-up linkage device, a low-power pulse signal to a magnetic field sensor to wake up the magnetic field sensor, and collecting magnetic field data by the woken-up magnetic field sensor;

[0061] S4: calculating, at the edge end, a total-substation power difference of the meter box, combining collected magnetic field data and pre-acquired box door states, adopting a metering error-electricity stealing behavior coupling diagnosis method to construct an electricity use abnormality classification and determination tree, and distinguishing, through the electricity use abnormality classification and determination tree, three electricity stealing behaviors of meter box failure, unintentional electricity stealing and intentional electricity stealing;

[0062] S5: for the diagnosed electricity stealing behavior, the edge end adopts an intermittent abnormality trajectory splicing algorithm to process fragmented abnormal data generated in the diagnosis process into an electricity stealing trajectory;

[0063] S6: feeding back the electricity stealing trajectory to the electric parameter time-space coupling analysis method to dynamically update time-space feature weights.

[0064] The time-space feature matrix is generated through the electric parameter time-space coupling analysis method, comprising:

[0065] The voltage, current and time mark data collected at the edge and calibrated are taken as time dimension data, and the physical state information of the metering box is taken as spatial dimension data to construct a space-time data matrix; the time mark data refers to a time mark recording the time of voltage and current collection; the physical state information of the metering box includes the opening and closing state of the box door, the box body vibration data and the environmental temperature data; the opening and closing state of the box door is collected by a Hall sensor installed at the box door, the box body vibration data is collected by a vibration sensor pasted on the surface of the box body, and the environmental temperature data is collected by a temperature sensor installed in the box;

[0066] A convolution operation is adopted to extract features from the space-time data matrix to obtain preliminary space-time features, wherein the size of the time dimension convolution kernel is set to 3x1, and the size of the space dimension convolution kernel is set to 1x3;

[0067] The preliminary space-time features are normalized and then subjected to nonlinear transformation by a ReLU activation function to finally generate a space-time feature matrix, wherein the normalization method and the ReLU activation function are prior art contents in the field and are not the inventive scheme of the present application, and thus will not be described here.

[0068] The space-time feature matrix is input into an electric parameter feature mask pruning algorithm to obtain an optimized feature set, including:

[0069] A1: inputting the space-time feature matrix generated by the electric parameter space-time coupling analysis method into an electric parameter feature mask pruning algorithm, wherein the electric parameter feature mask pruning algorithm performs feature importance evaluation on the channel dimension of the input space-time feature matrix, and adopts regularization to calculate the weight coefficient of each feature channel;

[0070] Further, the specific steps of A1 include:

[0071] (1) performing a preprocessing operation on the space-time feature matrix generated by the electric parameter space-time coupling analysis method, specifically, first performing smoothing processing on each element in the space-time feature matrix by a sliding window filtering method, wherein the window size is determined according to the sampling frequency of the electric parameter data; then performing normalization processing on the smoothed space-time feature matrix, wherein a minimum-maximum normalization method is adopted to map the numerical values of all elements in the matrix to the interval of 0 to 1, and a standardized space-time feature matrix is obtained after the preprocessing is completed;

[0072] (2) Based on the structural characteristics of the standardized space-time feature matrix, the feature channel dimension is divided, including: first, the composition of the space-time feature matrix is determined, the row dimension of the matrix corresponds to the time sequence dimension, records the change of electrical parameter data at different time points, the column dimension corresponds to the spatial feature dimension, reflects the feature information of different monitoring points or different types of electrical parameters, and the feature channel is an independent feature set formed by further splitting the column dimension according to the electrical parameter type or the monitoring area, for example, if the column dimension of the matrix includes the spatial features of voltage, current and power, the column dimension is divided into three independent feature channels, namely the voltage feature channel, the current feature channel and the power feature channel, and through the division, each feature channel corresponds to a type of electrical parameter feature with clear physical meaning;

[0073] (3) The weight coefficient of each divided feature channel is initialized, wherein the initial value of the weight coefficient is set in combination with the physical properties of the electrical parameter feature and the statistical results of the historical data;

[0074] (4) The standardized space-time feature matrix and the initialized channel weight coefficient are input into the L1 regularization calculation module, the weight coefficient of each feature channel is iteratively optimized through the L1 regularization algorithm, and finally the optimal weight coefficient of each feature channel is obtained, wherein the L1 regularization algorithm is a prior art content in the field and is not the inventive scheme of the present application, and will not be described here;

[0075] (5) According to the optimal weight coefficient of each feature channel obtained by iteration and optimization, the importance of all feature channels is sorted, wherein the feature channels are arranged in order according to the weight coefficient from large to small, for example, if the weight coefficient of the voltage feature channel is 0.72, the weight coefficient of the current feature channel is 0.58, and the weight coefficient of the power feature channel is 0.35, then the sorting result is voltage feature channel>current feature channel>power feature channel, and a feature importance evaluation report is generated, which records the name of each feature channel, the corresponding optimal weight coefficient, the sorting result and the calculation process of the weight coefficient in detail.

[0076] A2: Set a weight coefficient threshold, mark the feature channels with weight coefficients less than the weight coefficient threshold as redundant channels, and generate a mask matrix consistent with the channel dimension of the space-time feature matrix, wherein the elements of the mask matrix corresponding to the redundant channels are set to 0, and the elements of the mask matrix corresponding to the non-redundant channels are set to 1;

[0077] A3: Multiply the space-time feature matrix and the mask matrix element by element to obtain a shielded feature matrix;

[0078] A4: Perform global average pooling on the shielded feature matrix to obtain an optimized feature set; the optimized feature set includes current amplitude features and current change rate features, wherein the global average pooling is a prior art content in the field and is not the inventive scheme of the present application, and will not be described here.

[0079] The monitoring of the optimized feature set, and the triggering of the edge-sensor sleep-wake linkage device when an abnormal current is detected, includes:

[0080] B1: The current anomaly detection model is trained using optimized feature set samples under normal power consumption scenarios as training data; the current anomaly detection model adopts the support vector machine algorithm, with the current amplitude feature and current change rate feature in the optimized feature set as input variables, and normal and abnormal as output labels. The core principle of the support vector machine algorithm is to classify the data by finding an optimal hyperplane. The support vector machine algorithm is the existing technology in this field and is not an inventive solution of this application, so it will not be described in detail here.

[0081] B2: Input the optimized feature set obtained in real time into the trained current anomaly detection model. After analyzing the input current amplitude features and current change rate features, the current anomaly detection model outputs the corresponding labels.

[0082] When the current anomaly detection model outputs an abnormal label, it determines that a current anomaly has been detected and triggers the edge-sensor sleep-wake linkage device; the trigger signal is a high-level signal.

[0083] The edge-sensor sleep-wake linkage device includes a microcontroller and a low-power radio frequency module. When an abnormal current trigger signal is received, the microcontroller controls the low-power radio frequency module to generate a low-power pulse signal to wake up the magnetic field sensor in sleep mode.

[0084] Furthermore, the specific process by which the current anomaly detection model analyzes the input current amplitude characteristics and current change rate characteristics includes:

[0085] (1) Extract current amplitude features and current change rate features from the optimized feature set generated in real time; the current amplitude features and current change rate features are the core input items of the current anomaly detection model. Among them, the current amplitude features reflect the magnitude of the current, and the current change rate features reflect the magnitude of the change of the current value per unit time.

[0086] (2) Input the extracted current amplitude features and current change rate features into the already trained current anomaly detection model;

[0087] (3) After the current anomaly detection model is trained, it first preprocesses the current amplitude feature and the current change rate feature to ensure that their format and numerical range are consistent with the features used during model training, so as to avoid the model judgment being affected by the difference in data form. The preprocessing process includes mapping the feature values ​​to the same numerical range as the training data to eliminate the possible differences in units under different acquisition scenarios.

[0088] (4) using the support vector and hyperplane parameters determined in the training process, performing spatial mapping on the input current amplitude feature and current rate of change feature, specifically, mapping the two-dimensional data points formed by the current amplitude feature and the current rate of change feature to a high-dimensional feature space, in this high-dimensional space, the trained current anomaly detection model calculates the distance between the data points and the optimal hyperplane;

[0089] (5) the calculation result of the distance directly determines the category to which the data point belongs, if the data point is located on one side of the hyperplane and the distance from the hyperplane is greater than a preset threshold, the trained current anomaly detection model determines that the current state corresponding to the data point is normal, at this time the output label is normal; if the data point is located on the other side of the hyperplane and the distance from the hyperplane exceeds the preset threshold, the trained current anomaly detection model determines that the current state corresponding to the data point is abnormal, at this time the output label is abnormal.

[0090] For the diagnosed electricity stealing behavior, the edge uses an intermittent abnormal trajectory splicing algorithm to process the fragmented abnormal data generated in the diagnosis process into electricity stealing trajectories, including:

[0091] C1: collect fragmented abnormal data generated in the process of diagnosing electricity stealing behavior; the fragmented abnormal data includes abnormal current segments, abnormal magnetic field data segments, abnormal total and partial power difference segments and corresponding timestamp data generated in the diagnosis process;

[0092] C2: the edge transmits the fragmented abnormal data to the processing module of the intermittent abnormal trajectory splicing algorithm in real time through a data acquisition interface;

[0093] C3: set the window length and sliding step of the sliding window, and store the real-time received fragmented abnormal data in the sliding window in timestamp order, when the data storage time in the window exceeds the window length, the window automatically slides forward by one step, discards the historical data exceeding the window length, and retains the fragmented abnormal data in the latest window length;

[0094] C4: define a state set of a hidden Markov model, train the state transition matrix, observation probability matrix and initial state probability vector of the hidden Markov model based on complete data of historical electricity stealing behavior, and obtain a trained hidden Markov model; the state set includes five states of current abnormal initial state, current abnormal sustained state, magnetic field abnormal state, power difference abnormal state and abnormal termination state;

[0095] Further, the hidden Markov model is a prior art in the field and is not the inventive scheme of the present application, and will not be described here.

[0096] C5: input the fragmented abnormal data cached in the sliding window as an observation sequence into the trained hidden Markov model, and calculate the state probability of each time point corresponding to the observation sequence by using the forward-backward algorithm;

[0097] Further, the specific steps of C5 include:

[0098] (1) Preprocess the fragmented abnormal data cached in the sliding window to ensure that it meets the input requirements of the hidden Markov model. First, check the integrity of the data, traverse each piece of fragmented abnormal data, and confirm whether it contains necessary information such as timestamps and abnormal feature values. If there are missing items, perform interpolation to complete them according to the trend of adjacent data, for example, if any piece of data is missing an abnormal feature value, take the average of the feature values of the previous and next two pieces of data to fill it in. Then, align the data by time, sort all abnormal data by timestamp to ensure the time sequence of the observation sequence is coherent, and if there are repeated timestamps, keep the piece with more significant feature values and delete the redundant one. Finally, standardize the abnormal feature values so that all feature values fall between zero and one;

[0099] (2) Load all parameters of the trained hidden Markov model, including the initial state probability distribution, the state transition probability matrix, and the observation probability matrix. The initial state probability distribution describes the probability of the model being in each hidden state at the initial time, the state transition probability matrix records the probability of transitioning from one hidden state to another, and the observation probability matrix represents the probability of generating a specific observation value under any hidden state. After loading, initialize the trained hidden Markov model, reset the storage space of intermediate variables required by the forward-backward algorithm such as the forward probability matrix and the backward probability matrix, and ensure that the model is in the initial state to process new observation sequences;

[0100] (3) Group the preprocessed fragmented abnormal data into a complete observation sequence in chronological order, then segment the observation sequence, determine the length of each sequence according to the size of the sliding window, for example, if the sliding window contains data of ten time points, each observation sequence contains ten consecutive abnormal data, then establish a mapping relationship between the observation value and the index, convert each specific abnormal feature value into a discrete index recognizable by the model, for example, divide the standardized feature values into five intervals, each interval corresponds to an integer index, so that the continuous observation values are converted into discrete symbol sequences, which meet the discretization requirements of the hidden Markov model for observation sequences. If any abnormal feature value falls on the boundary of the divided interval, it is assigned to the index corresponding to the interval with smaller value to ensure the uniqueness of the mapping relationship;

[0101] (4) The forward algorithm starts from the initial time of the observation sequence and gradually calculates the probability of each time being in each hidden state, including: first, the forward probability of the initial time is calculated, combining the initial state probability distribution and the observation probability matrix, to obtain the probability value of the model being in each hidden state when the first abnormal data is observed at the initial time, for example, the initial time observes the abnormal value of index 2, the initial forward probability of each hidden state is equal to the initial probability of the state multiplied by the probability of generating the observation value of index 2 in the state; then, the forward probability of the subsequent time is calculated in time sequence, for each hidden state at each time, its forward probability is equal to the sum of the product of the forward probability of all hidden states at the previous time and the corresponding state transition probability, and then multiplied by the probability of generating the observation value at the current state; during the calculation, the forward probability of each time is normalized to avoid underflow caused by multiple multiplications,

[0102] (5) The backward algorithm starts from the last time of the observation sequence and reversely calculates the probability of each time being in each hidden state, including: first, the backward probability of the last time is set as the initial value, assuming that there is no observation value after the last time, the backward probability of each hidden state is one; then, starting from the second last time, the backward probability of each time is reversely calculated, for each hidden state at each time, its subsequent probability is equal to the sum of the product of the subsequent probability of all hidden states at the next time and the transition probability from the current state to the next state, and then multiplied by the probability of generating the observation value at the next state; the same as the forward probability calculation, the backward probability of each time is normalized;

[0103] (6) For each hidden state at each time, the state probability is equal to the product of the forward probability and the backward probability of the state at the time, and then divided by the probability of the entire observation sequence, that is, the sum of all forward probabilities at the last time calculated by the forward algorithm, in this way, the conditional probability of the model being in each hidden state at each time is obtained;

[0104] (7) After the calculation is completed, the state probability of each time is checked to check whether the sum of the probabilities of all hidden states is one, if there is a deviation, the calculation process of the forward and backward probabilities is rechecked, the error is corrected, and finally the probability distribution of each hidden state at each time is output.

[0105] C6: Calculate the state transition probability corresponding to any two adjacent fragmented data segments based on the state probability, to obtain a state transition probability matrix;

[0106] Further, the specific steps of C6 include:

[0107] (1) From the calculated state probability at each time, the time point corresponding to the fragmented abnormal fragmented data segment cached in the sliding window is extracted, ensuring that each fragmented data segment has a unique corresponding time state probability, and adjacent two fragmented data segments are paired in time sequence, for example, the first segment corresponds to the state probability at time t, the second segment corresponds to the state probability at time t+1, forming a plurality of state probability pairs of adjacent segments, each pair contains the probability distribution of each hidden state at the previous time and the probability distribution of each hidden state at the next time, if there are discontinuous fragments in the time interval, the state probability at the intermediate time is supplemented by linear interpolation, and then adjacent pairing is performed;

[0108] (2) For each adjacent segment state probability pair, determine the most likely hidden state at each time, including: for the state probability distribution at the previous time, select the hidden state with the maximum probability value as the optimal state at that time; the same operation is performed on the state probability distribution at the next time to obtain the optimal state at the next time. For example, the previous time state probability is normal 0.2, slight abnormal 0.5, and severe abnormal 0.3, and the optimal state is slight abnormal; the next time state probability is normal 0.1, slight abnormal 0.3, and severe abnormal 0.6, and the optimal state is severe abnormal, forming a state transition record of slight abnormal-severe abnormal. If the probabilities of two hidden states are the same and are the maximum at any time, select the state that is more likely to appear combined with the historical transition rule, for example, slight abnormal is more likely to turn into severe abnormal after slight abnormal in historical data, then severe abnormal is preferentially selected as the optimal state at the next time;

[0109] (3) Traverse all adjacent segment state transition records to count the frequency of each transition type, including: establishing a two-dimensional table, the rows represent the hidden states at the previous time, and the columns represent the hidden states at the next time, and each cell in the table is used to record the number of times of transition from the corresponding row state to the corresponding column state;

[0110] (4) Normalize the transition frequency obtained to obtain the state transition probability matrix, that is, for each row in the table, the sum of the frequencies of all cells in the row is taken as the total transition times, and then the frequency of each cell is divided by the total transition times to obtain the probability of transition from the row state to the corresponding column state;

[0111] (5) Combine the domain knowledge to verify the rationality of the state transition probability matrix, for example, in the power system, the probability that the severe abnormal state remains unchanged should be higher than the probability that it suddenly turns to normal, if the probability in the matrix does not comply with this rule, the sample size needs to be increased for re-statistics or the estimation method of the optimal state is corrected until the matrix is stable and complies with the actual rule, and finally the state transition probability matrix is obtained.

[0112] C7: setting a state transition probability threshold, selecting the earliest abnormal fragmentation data segment in time stamp from the fragmented abnormal data in the sliding window cache as a starting segment, and calculating the state transition probability of the starting segment and each fragmented data segment;

[0113] Further, the specific steps of C7 include:

[0114] (1) In combination with the distribution characteristics of fragmented abnormal data and the correlation requirements of abnormal events, determine the state transition probability threshold;

[0115] (2) Time stamp sorting is performed on all fragmented abnormal fragmented data segments in the sliding window cache. First, the collection time stamp corresponding to each fragmented data segment is extracted, and all segments are sorted in chronological order to form an ordered segment sequence. In the sorted sequence, the earliest segment in time stamp is selected as the starting segment, and the key information of the starting segment is recorded, including the corresponding state probability distribution, abnormal feature value, and collection time point. If there are multiple segments with the same time stamp and all are the earliest, such as different monitoring point data collected at the same time, further analysis of the abnormal feature significance of each segment is performed, and the segment with the most significant abnormal feature value, such as the largest deviation from the normal range, is selected as the starting segment to ensure that the starting segment can effectively represent the early abnormal state;

[0116] (3) The determined starting segment is paired with all fragmented data segments in the sliding window cache except itself to form multiple pairs of starting segment-target segment combinations. Time interval verification is performed on each pair of combinations. The time stamp difference between the starting segment and the target segment is calculated. If the time interval exceeds the preset effective correlation duration, it is determined that the pair has no correlation value and is directly excluded. The effective correlation duration is determined according to the evolution speed of the abnormal event. For example, in the current abnormal event, an interval of more than ten minutes is likely to belong to different abnormal events. If the time interval is within the effective correlation duration, the pair combination is retained;

[0117] (4) For the pair combination that passes the time interval verification, the state probability distribution corresponding to the starting segment and the target segment is extracted, including: finding the state probability that completely matches the time stamp of the starting segment from the system-stored state probability data at each time point. This state probability distribution contains all hidden states, such as normal, slight abnormal, and severe abnormal, and the corresponding probability values. The state probability distribution corresponding to the target segment is extracted in the same way. If the time stamp of the target segment does not completely match the stored state probability time stamp, the linear interpolation method is used to calculate the state probability at the corresponding time point of the target segment to ensure that the state probabilities of the starting segment and the target segment are accurately aligned in the time dimension, avoiding misjudgment of the state transition relationship due to time deviation.

[0118] (5) Based on the state probability distribution of the extracted and aligned starting fragment and the target fragment, the state transition probability between the two is calculated, including: first, determine the optimal hidden state of the starting fragment and the optimal hidden state of the target fragment; Then, from the generated state transition probability matrix, find the probability value corresponding to the transition from the optimal state of the starting fragment to the optimal state of the target fragment. This probability value is the state transition probability of the starting fragment and the target fragment. If the state transition probability matrix does not contain this transition type, estimate it based on the transition rules of similar historical fragments. For example, the closest historical transition probability to this transition type is 0.7, then the current transition probability is estimated to be 0.7, and the new transition type is recorded. The optimal hidden state refers to the hidden state with the maximum state probability;

[0119] (6) Compare the calculated state transition probability of the starting fragment and each target fragment with the preset state transition probability threshold value. If the transition probability of any target fragment is greater than or equal to the preset state transition probability threshold value, it is determined that the target fragment and the starting fragment belong to different stages of the same abnormal event, and they are marked as associated fragments. The association result is recorded, including the time stamp of the starting fragment and the target fragment, and the transition probability value. If the transition probability is less than the preset state transition probability threshold value, it is determined that they are not associated and do not belong to the same abnormal event. The result is also recorded for subsequent tracing;

[0120] (7) After all the paired combinations are compared, the associated fragment information is summarized to form an abnormal event fragment cluster with the starting fragment as the core.

[0121] When the state transition probability of any fragmented data fragment and the starting fragment is greater than the state transition probability threshold value, it is determined that there is a time sequence association between the two, and the fragmented data fragment and the starting fragment are spliced in chronological order to form a spliced data sequence;

[0122] C8: Calculate the state transition probability of the spliced data sequence and each remaining fragmented data fragment in turn, and select the fragmented data fragments that meet the state transition probability threshold requirement;

[0123] C9: After all the fragmented data fragments in the sliding window are processed, a complete electricity stealing trajectory containing the abnormal starting time, abnormal type evolution, and abnormal duration is formed. The electricity stealing trajectory is stored in the form of a time series data linked list.

[0124] The metering error-electricity stealing behavior coupling diagnosis method constructs a power consumption anomaly classification decision tree, which distinguishes three types of electricity stealing behaviors: metering box failure, unintentional electricity stealing, and intentional electricity stealing, including:

[0125] D1: Taking the total-branch power difference, the magnetic field distortion rate in the magnetic field data, and the box door state as the input features of the electricity abnormality classification decision tree; the total-branch power difference is the difference between the total power metering value of the edge computing and the sum of the branch circuit power metering values; the magnetic field distortion rate in the magnetic field data is the percentage of the difference between the actual magnetic field strength and the normal magnetic field strength to the normal magnetic field strength; the box door state is the box door opening and closing information collected by the Hall sensor, 0 indicating closed and 1 indicating opened;

[0126] D2: Based on the historical record of the metering box fault case, the unintentional electricity stealing case and the intentional electricity stealing case data, the training data set is formed; each sample in the training data set contains the specific values of the three features of the total-branch power difference, the magnetic field distortion rate and the box door state, and the corresponding sample label; the sample label is divided into three categories of metering device failure, unintentional electricity stealing and intentional electricity stealing;

[0127] D3: Taking the maximum information gain as the feature selection criterion, first taking whether the total-branch power difference is 0 as the root node, for the branch where the total-branch power difference is not equal to 0, then taking whether the magnetic field distortion rate is 0 as the next level of child node, for the branch where the magnetic field distortion rate is not equal to 0, then taking whether the box door state is 1 as the next level of child node, and gradually dividing the sample space through three levels of nodes to form a preliminary electricity abnormality classification decision tree;

[0128] D4: A pre-pruning strategy is adopted, when the number of samples of the preliminary electricity abnormality classification decision tree node is less than 5, the splitting is stopped, the current node is retained as a leaf node, and the electricity abnormality classification decision tree is formed;

[0129] Further, the specific steps of D4 include:

[0130] (1) Preprocessing the electricity abnormality sample data set to filter out effective samples containing complete electricity features and abnormal labels, and obtaining the preprocessed electricity abnormality sample data set, wherein the electricity features include current, voltage and power, and the abnormal labels include overload, short circuit and electric leakage;

[0131] (2) Dividing the preprocessed electricity abnormality sample data set into a training set and a validation set according to a proportion, the training set is used to construct the decision tree, and the validation set is used to evaluate the performance of the tree;

[0132] (3) Initializing the decision tree structure, taking the entire training set as the sample set of the root node, recording the total number of samples contained by the node and the distribution of each type of abnormal label, for example, the root node contains 500 samples, of which 150 are overload, 200 are short circuit and 150 are electric leakage;

[0133] (4) For the current node to be split, all available power consumption features are traversed, and the information gain or Gini index of each power consumption feature as a split basis is calculated to evaluate the contribution of the feature to the classification of samples. The greater the information gain or the smaller the Gini index, the more effectively the feature can distinguish abnormal samples of different categories. For example, the information gain of the current amplitude is 0.38, and the information gain of the voltage fluctuation range is 0.25. Therefore, the current amplitude is preferentially selected as the split feature of the current node. The calculation formula of the information gain or Gini index is a prior art content in the art and is not the inventive scheme of the present application, and is not described here.

[0134] (5) After determining the split feature, the split threshold of the feature is further determined. For continuous features such as current amplitude, the feature values are sorted from small to large, and the middle value of the adjacent two different feature values is selected as the candidate threshold. For example, the current amplitude is sorted as 5A, 10A, and 15A, and the candidate thresholds are 7.5A and 12.5A. The information gain or Gini index corresponding to each candidate threshold is calculated, and the threshold that makes the evaluation index optimal is selected as the final split threshold.

[0135] (6) According to the threshold, the samples of the current node are divided into two sub-nodes. The samples with feature values less than or equal to the threshold are assigned to the left sub-node, and the samples with feature values greater than the threshold are assigned to the right sub-node. The number of samples and the label distribution of each sub-node are recorded.

[0136] (7) After splitting, it is checked whether the number of samples contained in each sub-node meets the pre-pruning condition. If the number of samples in a sub-node is less than 5, the splitting process of the sub-node is stopped, and the sub-node is marked as a leaf node. The class of the leaf node is determined according to the majority label of the samples in the node. For example, if any sub-node contains 4 samples, 3 of which are overload labels, the class of the leaf node is determined as overload. If the number of samples in a sub-node is greater than or equal to 5, it is judged whether the node still has a split value. The purity of the node is calculated. If all samples belong to the same category, the purity is one. If the purity reaches a preset threshold, such as 0.95, the splitting is stopped even if the number of samples is sufficient, and the node is directly used as a leaf node. If the purity does not reach the preset threshold, the feature selection and splitting process are repeated, and the sub-node is further split.

[0137] (8) Starting from the root node, each node that meets the splitting condition is processed recursively according to the above splitting process, and the level of the decision tree is gradually expanded. During the recursive process, nodes with more samples and lower purity are always preferentially processed to ensure that the power consumption anomaly classification decision tree can preferentially distinguish abnormal categories with large sample sizes. After each splitting, the split feature, threshold, sub-node sample number, and class information of the node are recorded in real time to form a complete tree structure record.

[0138] (9) When all splittable nodes complete processing, that is, all child nodes either have less than 5 samples or the purity meets the standard, the preliminary power consumption anomaly classification decision tree is formed, and then verification is performed. Check whether there is an uncovered sample category, for example, the training set contains overload, short circuit and leakage three types of anomalies, if the leakage category does not appear in the leaf node of the decision tree, it means that there is deviation in the splitting process, and the splitting feature or threshold of any node needs to be adjusted to ensure that all categories have corresponding leaf nodes. At the same time, the classification accuracy of the power consumption anomaly classification decision tree is evaluated through the validation set, if the accuracy is lower than the preset standard, such as 80%, the sample number threshold of pre-pruning is reduced, such as from 5 to 3, and the power consumption anomaly classification decision tree is reconstructed to improve the classification ability; if the accuracy meets the standard, the current decision tree is retained as the final model.

[0139] D5: input the total and partial power difference of edge computing, the magnetic field distortion rate converted from the magnetic field data collected by the magnetic field sensor, and the box door state collected by the Hall sensor into the power consumption anomaly classification decision tree, output the diagnosis result by traversing the decision rules of the nodes in the power consumption anomaly classification decision tree;

[0140] The decision rules include:

[0141] If the total and partial power difference is not equal to 0, the magnetic field distortion rate is equal to 0, and the box door state is equal to 0, it is determined that the metering device is faulty;

[0142] If the total and partial power difference is not equal to 0, the magnetic field distortion rate is equal to 0, the box door state is equal to 0, and there is a user miswiring record, it is determined that it is unintentional electricity stealing;

[0143] If the total and partial power difference is not equal to 0, the magnetic field distortion rate is not equal to 0, and the box door state is equal to 1, it is determined that it is intentional electricity stealing.

[0144] Embodiment 2:

[0145] Another embodiment provided by the application: a metering box abnormal power consumption behavior diagnosis system based on edge computing, comprising:

[0146] Edge acquisition module, coupling analysis module, pruning and monitoring module, magnetic field data acquisition module, classification decision module, electricity stealing trajectory splicing module;

[0147] The edge acquisition module is used for real-time acquisition of voltage, current, time scale data and physical state data of the metering box;

[0148] The coupling analysis module is used for time-space dimension feature fusion of the collected electric parameter data and physical state data to form a space-time feature matrix;

[0149] a pruning and monitoring module configured to remove redundant features from the spatiotemporal feature matrix and perform real-time anomaly monitoring, so as to compress the feature dimension and improve the calculation efficiency, and quickly identify current anomalies and trigger a subsequent sensing wake-up process;

[0150] a magnetic field data acquisition module configured to activate a low-power sleep magnetic field sensor to acquire magnetic field data around the metering box after detecting a current anomaly, so as to provide a key basis for fault / power stealing classification diagnosis in the magnetic field dimension;

[0151] a classification and determination module configured to construct a diagnosis model by comprehensively considering the total and partial power differences, the magnetic field data and the meter door state, accurately distinguish three types of abnormal behaviors, i.e., metering box fault, unintentional power stealing and intentional power stealing, and output a diagnosis result;

[0152] a power stealing trajectory splicing module configured to integrate fragmented abnormal data of intentional power stealing into a complete power stealing trajectory, and feed back to the front-end feature analysis module, so as to realize dynamic optimization of system diagnosis accuracy and form a closed loop.

[0153] The magnetic field data acquisition module comprises a wake-up linkage unit and a data acquisition unit.

[0154] The wake-up linkage unit comprises a microcontroller and a low-power radio frequency module, and is configured to receive a high-level trigger signal transmitted by the current anomaly detection unit, generate a low-power pulse signal by the microcontroller to control the low-power radio frequency module, and send the low-power pulse signal as a wake-up instruction to the magnetic field sensor sleep control unit.

[0155] The data acquisition unit comprises a magnetic field sensor in a sleep state, and is configured to receive a low-power pulse wake-up signal, activate the magnetic field sensor to enter a working state, acquire magnetic field strength and direction data around the metering box, calculate and extract a magnetic field distortion rate, and transmit the magnetic field raw data and the magnetic field distortion rate to the power consumption anomaly classification and determination module.

[0156] The classification and determination module comprises a difference calculation unit, a decision tree construction unit and a decision tree diagnosis unit.

[0157] The difference calculation unit is configured to receive voltage and current data transmitted by the edge data acquisition module, calculate a total and partial power difference of the metering box based on an electric energy metering formula, and transmit the difference to the decision tree construction unit.

[0158] The decision tree construction unit is configured to use a metering error-power stealing behavior coupling diagnosis method, take the total and partial power difference, the magnetic field distortion rate and the meter door state as input features, and construct a power consumption anomaly classification and determination tree.

[0159] The decision tree diagnosis unit is used for inputting the real-time multi-dimensional data into a power utilization anomaly classification decision tree, outputting diagnosis results of meter box failure, unintentional electricity stealing and intentional electricity stealing according to rules, and marking corresponding abnormal data as fragmented abnormal data and transmitting the abnormal data to the electricity stealing trajectory splicing module if the intentional electricity stealing is determined.

[0160] The embodiments of the present application are described above with reference to the drawings; however, the present application is not limited to the specific embodiments described above, which are merely illustrative but not restrictive, and a person of ordinary skill in the art can make changes, modifications, replacements and variations to the above-described embodiments without departing from the purpose of the present application and the scope of protection, which are all within the scope of protection of the present application.

Claims

1. A method for diagnosing abnormal electricity consumption behavior of a meter based on edge computing, characterized in that, The method comprises the following steps: Real-time acquisition of voltage, current and time tag data of the metering box at the edge end, acquisition of physical state information of the metering box, generation of a time-space feature matrix by a time-space coupling analysis method of electrical parameters; Inputting the time-space feature matrix into an electrical parameter feature mask pruning algorithm to obtain an optimized feature set, and monitoring the optimized feature set, and triggering an edge-sensor hibernation and wake-up linkage device when an abnormal current is detected; The edge-sensor hibernation and wake-up linkage device sends a low-power pulse signal to the magnetic field sensor to wake up the magnetic field sensor, and the magnetic field data is collected by the woken-up magnetic field sensor; The edge end calculates the total and partial power difference of the metering box, combines the collected magnetic field data and the pre-acquired box door state, adopts a metering error and electricity stealing behavior coupling diagnosis method to construct an electricity consumption anomaly classification decision tree, and distinguishes three types of electricity stealing behaviors, i.e. metering box failure, unintentional electricity stealing and intentional electricity stealing, through the electricity consumption anomaly classification decision tree; For the diagnosed electricity stealing behavior, the edge end adopts an intermittent abnormal trajectory splicing algorithm to process the fragmented abnormal data generated in the diagnosis process into an electricity stealing trajectory; The electricity stealing trajectory is fed back to the time-space coupling analysis method of electrical parameters to dynamically update the time-space feature weight; The method of adopting the metering error and electricity stealing behavior coupling diagnosis method to construct the electricity consumption anomaly classification decision tree and distinguishing the three types of electricity stealing behaviors, i.e. metering box failure, unintentional electricity stealing and intentional electricity stealing, through the electricity consumption anomaly classification decision tree, comprises the following steps: Taking the total and partial power difference, the magnetic field distortion rate in the magnetic field data and the box door state as the input features of the electricity consumption anomaly classification decision tree; the total and partial power difference is the difference between the total power metering value of the metering box calculated by the edge end and the sum of the partial loop power metering values; the magnetic field distortion rate in the magnetic field data is the percentage of the difference between the actual magnetic field intensity and the normal magnetic field intensity to the normal magnetic field intensity; the box door state is the box door opening and closing information collected by the Hall sensor, 0 indicating closed and 1 indicating opened; Based on the historical record of metering box failure cases, unintentional electricity stealing cases and intentional electricity stealing cases data, a training data set is formed; each sample in the training data set contains the specific values of the three features, i.e. the total and partial power difference, the magnetic field distortion rate and the box door state, and the corresponding sample label; the sample label is divided into three categories, i.e. metering device failure, unintentional electricity stealing and intentional electricity stealing; Taking the maximum information gain as the feature selection criterion, first taking whether the total and partial power difference is 0 as the root node, then taking whether the magnetic field distortion rate is 0 as the next level of child node for the branch where the total and partial power difference is not equal to 0, and then taking whether the box door state is 1 as the next level of child node for the branch where the magnetic field distortion rate is not equal to 0, gradually dividing the sample space through three levels of nodes to form a preliminary electricity consumption anomaly classification decision tree; A pre-pruning strategy is adopted to stop splitting when the number of samples of the preliminary electricity consumption anomaly classification decision tree is less than 5, and the current node is retained as a leaf node to form the electricity consumption anomaly classification decision tree. The total and partial power difference of edge computing, the magnetic field distortion rate converted from the magnetic field data collected by the magnetic field sensor, and the box door state input collected by the Hall sensor are input into the power consumption anomaly classification decision tree, and the diagnostic result is output by traversing the judgment rules of the nodes in the power consumption anomaly classification decision tree; the diagnostic result includes metering device failure, unintentional electricity stealing and intentional electricity stealing; For the diagnosed electricity stealing behavior, the edge uses an intermittent abnormal trajectory splicing algorithm to process the fragmented abnormal data generated during the diagnosis process into an electricity stealing trajectory, including: Collecting fragmented abnormal data generated during the diagnosis of electricity stealing behavior; the fragmented abnormal data includes abnormal current fragments, abnormal magnetic field data fragments, abnormal total and partial power difference fragments, and corresponding timestamp data generated during the diagnosis process; The edge transmits the fragmented abnormal data to the processing module of the intermittent abnormal trajectory splicing algorithm in real time through the data acquisition interface; Set the window length and sliding step of the sliding window, and store the real-time received fragmented abnormal data in the sliding window in timestamp order; when the data storage time in the window exceeds the window length, the window automatically slides forward by one step, discards the historical data exceeding the window length, and retains the fragmented abnormal data in the latest window length; Define the state set of the hidden Markov model, train the state transition matrix, the observation probability matrix and the initial state probability vector of the hidden Markov model based on the complete data of the historical electricity stealing behavior, and obtain the trained hidden Markov model; the state set includes five states: current abnormal initial state, current abnormal sustained state, magnetic field abnormal state, power difference abnormal state and abnormal termination state; Input the fragmented abnormal data cached in the sliding window as the observation sequence into the trained hidden Markov model, and calculate the state probability of each time corresponding to the observation sequence by using the forward-backward algorithm; Based on the state probability, the state transition probability corresponding to any two adjacent fragmented data fragments is calculated to obtain the state transition probability matrix; the fragmented data fragment refers to the fragmented abnormal data in any window length; Set the state transition probability threshold, select the earliest abnormal fragmented data fragment as the starting fragment from the fragmented abnormal data cached in the sliding window, and calculate the state transition probability of the starting fragment and each fragmented data fragment; When the state transition probability of any fragmented data fragment and the starting fragment is greater than the state transition probability threshold, it is determined that there is a time sequence correlation between them, and the fragmented data fragment and the starting fragment are spliced in timestamp order to form a spliced data sequence; The state transition probability of the spliced data sequence and the remaining fragmented data fragments is calculated in turn, and the fragmented data fragments that meet the state transition probability threshold requirement are selected; After all the fragmented data fragments in the sliding window are processed, a complete electricity stealing trajectory including the abnormal starting time, abnormal type evolution and abnormal duration is formed; the electricity stealing trajectory is stored in the form of a time sequence data linked list.

2. The edge-computing-based meter abnormal electricity usage behavior diagnosis method of claim 1, wherein, The judgment rules include: If the total and partial power difference is not equal to 0, the magnetic field distortion rate is equal to 0, and the box door state is equal to 0, it is determined that the metering device fails. If the total-substation power difference is not equal to 0, the magnetic field distortion rate is equal to 0, the box door state is equal to 0, and there is a user miswiring record, it is determined that there is no intentional electricity stealing; If the total-substation power difference is not equal to 0, the magnetic field distortion rate is not equal to 0, and the box door state is equal to 1, it is determined that there is intentional electricity stealing.

3. The edge computing based meter abnormal electricity behavior diagnosis method of claim 2, wherein, The time-space feature matrix generated by the electric parameter time-space coupling analysis method comprises: The voltage, current and time tag data collected and calibrated at the edge are taken as time dimension data, and the physical state information of the metering box is taken as spatial dimension data to construct a time-space data matrix; the time tag data refers to a time tag recording the voltage and current collection time; the physical state information of the metering box includes the box door opening and closing state, the box body vibration data and the environmental temperature data; the box door opening and closing state is collected by a Hall sensor installed at the box door of the metering box, the box body vibration data is collected by a vibration sensor pasted on the surface of the box body, and the environmental temperature data is collected by a temperature sensor installed in the box; The convolution operation is used to extract features from the time-space data matrix to obtain preliminary time-space features; The preliminary time-space features are normalized and then nonlinearly transformed by a ReLU activation function to finally generate a time-space feature matrix.

4. The edge computing based meter abnormal electricity behavior diagnosis method of claim 3, wherein, The time-space feature matrix is input into the electric parameter feature mask pruning algorithm to obtain an optimized feature set, which comprises: The time-space feature matrix generated by the electric parameter time-space coupling analysis method is input into the electric parameter feature mask pruning algorithm; the electric parameter feature mask pruning algorithm evaluates the feature importance of the input time-space feature matrix in the channel dimension, and calculates the weight coefficients of each feature channel by regularization; A weight coefficient threshold is set, and the feature channels with weight coefficients less than the weight coefficient threshold are marked as redundant channels to generate a mask matrix consistent with the channel dimension of the time-space feature matrix, wherein the redundant channels correspond to 0 in the mask matrix, and the non-redundant channels correspond to 1 in the mask matrix; The time-space feature matrix and the mask matrix are multiplied element by element to obtain a shielded feature matrix; The shielded feature matrix is globally averaged to obtain an optimized feature set; the optimized feature set includes current amplitude features and current change rate features.

5. The edge computing based meter abnormal electricity behavior diagnosis method of claim 4, wherein, The optimized feature set is monitored, and when a current anomaly is detected, an edge-sensor hibernation and wake-up linkage device is triggered, which comprises: An electric current anomaly detection model is trained using the optimized feature set samples in the normal power consumption scenario as training data; the electric current anomaly detection model uses a support vector machine algorithm, and takes the current amplitude features and current change rate features in the optimized feature set as input variables, and takes normal and abnormal as output labels; The optimized feature set obtained in real time is input into the trained electric current anomaly detection model, and the electric current anomaly detection model analyzes the input current amplitude features and current change rate features and outputs the corresponding labels; When the electric current anomaly detection model outputs an abnormal label, it is determined that a current anomaly is detected, and an edge-sensor hibernation and wake-up linkage device is triggered, wherein the trigger signal is a high-level signal. The edge-sensor dormancy wake-up linkage device comprises a microcontroller and a low-power radio frequency module; when receiving an abnormal current trigger signal, the microcontroller controls the low-power radio frequency module to generate a low-power pulse signal to wake up the magnetic field sensor in the dormant state.

6. The edge computing based meter abnormal electricity consumption behavior diagnosis system for implementing the edge computing based meter abnormal electricity consumption behavior diagnosis method of any one of claims 1-5, characterized in that, Comprise: Edge terminal acquisition module, coupling analysis module, pruning and monitoring module, magnetic field data acquisition module, classification and determination module, electricity stealing trajectory splicing module; The edge terminal acquisition module is used for real-time acquisition of voltage, current, time scale data and physical state data of the metering box; the coupling analysis module is used for time-space dimension feature fusion of the acquired electric parameter data and physical state data to form a space-time feature matrix; the pruning and monitoring module is used for redundant feature elimination and real-time anomaly monitoring of the space-time feature matrix; the magnetic field data acquisition module is used for activating the low-power dormant magnetic field sensor to acquire the magnetic field data around the metering box after detecting the current anomaly; the classification and determination module constructs a diagnosis model by comprehensively considering the total and partial electric energy difference, the magnetic field data and the box door state, accurately distinguishes three types of abnormal behaviors of metering box failure, unintentional electricity stealing and intentional electricity stealing, and outputs the diagnosis result; and the electricity stealing trajectory splicing module is used for integrating the fragmented abnormal data of intentional electricity stealing into a complete electricity stealing trajectory.

Citation Information

Patent Citations

  • Electric power data anomaly detection method and system combined with edge calculation

    CN120611200A

  • Power distribution equipment remote diagnosis method based on edge calculation

    CN120934199A