Ammeter data detection method and device and readable storage medium

By extracting the energy consumption characteristics of the power consumption data of smart meter and using the target detection model for detection, the problem of low data detection efficiency of smart meter data is solved, and high -efficiency data detection and real -time processing on low power consumption devices are realized.

CN119357867APending Publication Date: 2025-01-24GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411488670.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In the prior art, smart meter data detection efficiency is low, especially in scenarios where large-scale data processing and real-time requirements are high, it is difficult to adapt to low-power devices.

Method used

By obtaining the electricity consumption data of the electric meter, extracting the energy consumption characteristics and inputting them into the target detection model for detection, the initial detection model is trained using historical detection data samples to obtain the target detection model to determine the normal or abnormal status of the electricity consumption data.

Benefits of technology

The efficiency of the data detection of smart meter data is improved, which can effectively process large -scale data on low power consumption equipment, meet real -time requirements, and timely discover and prevent malicious tampering or fraud.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357867A_ABST
    Figure CN119357867A_ABST
Patent Text Reader

Abstract

The invention discloses an ammeter data detection method and device and a readable storage medium, and relates to the technical field of power dispatching. The method comprises the steps that power utilization data of an electric meter are acquired, and the power utilization data are used for indicating the use state of power in the electric meter; extracting energy consumption characteristics of the electricity meter from the electricity consumption data, the energy consumption characteristics being used for indicating use behaviors of electricity in the electricity meter; and inputting the energy consumption characteristics into a target detection model for detection to obtain a detection result of the power consumption data, the detection result being used for indicating that the power consumption data is in a normal use state or an abnormal use state, and the target detection model being obtained by training historical detection data samples. The technical problem of low electricity meter data detection efficiency is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data detection, and in particular to a method, a device and a readable storage medium for detecting electric meter data. Background Art

[0002] At present, with the popularization of smart meters, abnormal data detection of smart meters is of great significance for protecting user rights, improving power management efficiency and promoting stable operation of power grids, and is a key link in the management and development of the power industry. Abnormal data detection of smart meters can timely detect and prevent malicious tampering of meter data or fraudulent behavior, ensuring that users' electricity consumption and cost data are true and reliable.

[0003] Related technologies usually include methods based on traditional machine learning, statistical analysis, and deep learning. Deep learning methods usually require a lot of computing resources when processing large-scale smart meter data, especially in real-time data processing environments. This leads to high time and computing costs for training and reasoning, especially in scenarios where the amount of smart meter data is large and real-time requirements are high, and it is difficult to adapt to low-power devices. Therefore, there is a technical problem of low efficiency in meter data detection.

[0004] Currently, no effective solution has been proposed to the above-mentioned technical problem of low efficiency in electricity meter data detection. Summary of the invention

[0005] The embodiments of the present invention provide a method, a device and a readable storage medium for detecting electric meter data, so as to at least solve the technical problem of low efficiency in detecting electric meter data.

[0006] According to one aspect of an embodiment of the present invention, a method for detecting meter data is provided. The method may include: obtaining electricity consumption data of an electricity meter, wherein the electricity consumption data is used to indicate the usage status of electricity in the electricity meter; extracting energy consumption characteristics of the electricity meter from the electricity consumption data, wherein the energy consumption characteristics are used to indicate the usage behavior of electricity in the electricity meter; inputting the energy consumption characteristics into a target detection model for detection, and obtaining a detection result of the electricity consumption data, wherein the detection result is used to indicate whether the electricity consumption data is in a normal usage state or an abnormal usage state, and the target detection model is obtained by training using historical detection data samples.

[0007] Optionally, extracting energy consumption characteristics of the electric meter from the electricity usage data includes: preprocessing the electricity usage data; respectively determining contribution rates of multiple characteristic data in the preprocessed electricity usage data, wherein the contribution rates are used to indicate the importance of each characteristic data in the electricity usage data; and extracting energy consumption characteristics of the electric meter from the electricity usage data based on the contribution rates.

[0008] Optionally, based on the contribution rate, energy consumption characteristics of the electric meter are extracted from the electricity consumption data, including: in response to the contribution rate being greater than a contribution rate threshold, determining characteristic data corresponding to the contribution rate as an energy consumption characteristic of the electric meter.

[0009] Optionally, the method for detecting electric meter data further includes: acquiring historical detection data samples of the electric meter; and training an initial detection model using the historical detection data samples to obtain a target detection model.

[0010] Optionally, before inputting the historical detection data samples into the initial detection model for training to obtain the target detection model, the method for detecting the electric meter data further includes: performing dimensionality reduction preprocessing on the historical detection data samples.

[0011] Optionally, the method for detecting the electricity meter data further includes: in response to the detection result being that the electricity usage data is in an abnormal state, uploading the electricity usage data and the detection result to the cloud.

[0012] According to another aspect of an embodiment of the present invention, a device for detecting meter data is also provided. The device may include: an acquisition unit, used to acquire the electricity consumption data of the meter, wherein the electricity consumption data is used to indicate the usage status of the electricity in the meter; an extraction unit, used to extract the energy consumption characteristics of the meter from the electricity consumption data, wherein the energy consumption characteristics are used to indicate the usage behavior of the electricity in the meter; a detection unit, used to input the energy consumption characteristics into a target detection model for detection, and obtain the detection result of the electricity consumption data, wherein the detection result is used to indicate that the electricity consumption data is in a normal usage state or an abnormal usage state, and the target detection model is obtained by training using monitoring data samples.

[0013] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided. The computer-readable storage medium includes a stored program, wherein when the program is executed by a processor, the device where the storage medium is located is controlled to execute the method for detecting electric meter data in an embodiment of the present invention.

[0014] According to another aspect of an embodiment of the present invention, a processor is further provided. The processor is used to run a program, wherein the method for detecting electric meter data in an embodiment of the present invention is executed when the program is run.

[0015] According to another aspect of the embodiment of the present invention, a computer program product is provided, which includes computer instructions, and when the computer instructions are executed by a processor, the method for detecting the electric meter data in the embodiment of the present invention is implemented.

[0016] In an embodiment of the present invention, electricity consumption data of an electric meter is obtained, wherein the electricity consumption data is used to indicate the usage status of electricity in the electric meter; energy consumption characteristics of the electric meter are extracted from the electricity consumption data, wherein the energy consumption characteristics are used to indicate the usage behavior of electricity in the electric meter; the energy consumption characteristics are input into a target detection model for detection to obtain a detection result of the electricity consumption data, wherein the detection result is used to indicate that the electricity consumption data is in a normal usage state or an abnormal usage state, and the target detection model is obtained by training using monitoring data samples. In other words, the present invention processes the electricity consumption data of the electric meter to obtain the energy consumption characteristics of the electric meter, and then uses the target detection model to detect the electricity consumption data, thereby solving the technical problem of low efficiency of meter data detection and achieving the technical effect of improving the efficiency of meter data detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0018] Figure 1 is a flow chart of a method for detecting electric meter data according to an embodiment of the present invention;

[0019] Figure 2 is a flow chart of a method for analyzing smart meter data based on edge computing according to an embodiment of the present invention;

[0020] Figure 3 is a schematic diagram of a device for detecting electric meter data according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, functional component or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, functional components or devices.

[0023] According to an embodiment of the present invention, an embodiment of a method for detecting electric meter data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0024] Figure 1 is a flow chart of a method for detecting electric meter data according to an embodiment of the present invention. Figure 1 As shown, the method may include the following steps:

[0025] Step S101, obtaining electricity consumption data of an electric meter.

[0026] In the technical solution provided in the above step S101 of the present invention, the electricity usage data is used to indicate the usage status of electricity in the electricity meter.

[0027] In this embodiment, the electricity consumption data of the electric meter is obtained. For example, the electricity consumption data of the electric meter is collected by a data collection module. This is only an illustrative example and does not limit the specific method of obtaining the electricity consumption data of the electric meter.

[0028] Optionally, the power consumption collected by the smart meter can be used as the basic feature. By analyzing the instantaneous power consumption, it is possible to detect whether there is a sudden abnormal behavior (such as power theft).

[0029] Step S102: extracting energy consumption characteristics of the electric meter from the electric consumption data.

[0030] In the technical solution provided in step S102 of the present invention, the energy consumption characteristics are used to indicate the use behavior of electricity in the electric meter. The energy consumption characteristics include but are not limited to: time characteristics, power quality characteristics, event record characteristics, behavior pattern characteristics, statistical characteristics, equipment operation characteristics, data compression characteristics and time series characteristics.

[0031] In this embodiment, after the electricity usage data is acquired in step S101, the energy consumption characteristics of the electricity meter are extracted from the electricity usage data.

[0032] Optionally, the electricity consumption data is preprocessed, for example, the electricity consumption data is standardized and dimensionally reduced. This is only an illustrative example and does not limit the specific method of preprocessing.

[0033] For example, the data of smart meters usually contains features of multiple dimensions (such as voltage, current, power consumption, etc.), and these features have different dimensions, so they need to be standardized. After standardization, each feature of the data has the same dimension, with a mean of 0 and a standard deviation of 1.

[0034] Optionally, after preprocessing the electricity consumption data, the contribution rates of multiple characteristic data in the preprocessed electricity consumption data are determined, wherein the contribution rate is used to indicate the importance of each characteristic data in the electricity consumption data. Thus, the energy consumption characteristics of the electric meter are determined according to the contribution rate. The contribution rate can also be called the explained variance ratio.

[0035] For example, the most important principal components, that is, energy consumption characteristics, are extracted according to the variance contribution rate.

[0036] Step S103: input the energy consumption characteristics into the target detection model for detection to obtain the detection result of the electricity consumption data.

[0037] In the technical solution provided in the above step S103 of the present invention, the detection result is used to indicate whether the electricity usage data is in a normal usage state or an abnormal usage state, and the target detection model is trained using monitoring data samples.

[0038] In this embodiment, after extracting the energy consumption characteristics of the electric meter in step S102, the energy consumption characteristics are input into the target detection model for detection to obtain the detection result of the electricity consumption data.

[0039] Optionally, the historical detection data samples of the electric meter are obtained, and the historical detection data samples are input into an initial detection model for training to obtain a target detection model, wherein the target detection model may also be called an isolation forest model.

[0040] For example, historical detection data samples are split into training sets and test sets, where the training set is used to build an isolation forest model and the test set is used to evaluate model performance. Isolation forest is used to build a model on the training set, and anomalies in the meter electricity consumption data are detected by randomly divided isolation trees, thereby establishing a target detection model.

[0041] It should be noted that the above embodiment can be executed by a device for detecting electric meter data.

[0042] In the above steps S101 to S103 of the present invention, the electricity consumption data of the electric meter is obtained, wherein the electricity consumption data is used to indicate the usage status of the electricity in the electric meter; the energy consumption characteristics of the electric meter are extracted from the electricity consumption data, wherein the energy consumption characteristics are used to indicate the usage behavior of the electricity in the electric meter; the energy consumption characteristics are input into the target detection model for detection to obtain the detection result of the electricity consumption data, wherein the detection result is used to indicate whether the electricity consumption data is in a normal usage state or an abnormal usage state, and the target detection model is obtained by training using monitoring data samples. In other words, the present invention obtains the energy consumption characteristics of the electric meter by processing the electricity consumption data of the electric meter, and then uses the target detection model to detect the electricity consumption data, thereby solving the technical problem of low efficiency of meter data detection and achieving the technical effect of improving the efficiency of meter data detection.

[0043] The above method of this embodiment is further introduced below.

[0044] As an optional implementation method, energy consumption characteristics of an electric meter are extracted from electricity consumption data, including: preprocessing the electricity consumption data; respectively determining contribution rates of multiple characteristic data in the preprocessed electricity consumption data, wherein the contribution rates are used to indicate the importance of each characteristic data in the electricity consumption data; and based on the contribution rates, extracting energy consumption characteristics of the electric meter from the electricity consumption data.

[0045] In this embodiment, the power consumption data is preprocessed, for example, the power consumption data is preprocessed by reducing its dimension through principal component analysis (PCA).

[0046] Optionally, after preprocessing the electricity consumption data, the contribution rates of multiple feature data in the preprocessed electricity consumption data are determined; for example, the variance contribution rate of each feature data is determined by PCA, so as to extract the energy consumption characteristics of the electric meter from the electricity consumption data based on the contribution rate.

[0047] As an optional implementation manner, extracting energy consumption characteristics of the electric meter from the electricity consumption data includes: in response to the contribution rate being greater than a contribution rate threshold, determining characteristic data corresponding to the contribution rate as an energy consumption characteristic of the electric meter.

[0048] In this embodiment, the contribution rates of various characteristic data are compared. When the contribution rate is greater than the contribution rate threshold, it indicates that the characteristic data is highly important for detecting the electricity consumption data. Based on this, the characteristic data corresponding to the contribution rate can be determined as an energy consumption feature of the electricity meter.

[0049] Optionally, the energy consumption characteristics of the electric meter are determined by the contribution rate, ensuring that each selected energy consumption characteristic is meaningful for detecting abnormal data, thereby improving the efficiency of electric meter data detection.

[0050] As an optional implementation manner, the method for detecting electric meter data also includes: obtaining historical detection data samples of the electric meter; and training an initial detection model using the historical detection data samples to obtain a target detection model.

[0051] In this embodiment, historical detection data samples of the electric meter are obtained; for example, the instantaneous power consumption P(t) of the electric meter at each time point is obtained.

[0052] Optionally, historical detection data samples are input into an initial detection model for training to obtain a target detection model. By using historical detection data samples to train the initial detection model, the accuracy of detecting abnormal data is guaranteed.

[0053] As an optional implementation manner, before inputting the historical detection data samples into the initial detection model for training to obtain the target detection model, the detection method of the electric meter data further includes: performing dimensionality reduction preprocessing on the historical detection data samples.

[0054] In this embodiment, the historical detection data samples are preprocessed by dimensionality reduction. By reducing the dimensionality of the historical detection data samples, the feature dimension can be reduced while retaining the main information of the data, the redundant data can be reduced and the calculation efficiency can be improved.

[0055] For example, the historical test data samples are standardized to ensure that the scales of each feature are the same. The covariance matrix is ​​calculated for the standardized historical test data samples; the covariance matrix is ​​decomposed to obtain the eigenvalues ​​and corresponding eigenvectors; according to the size of the eigenvalues, the most important eigenvectors are selected as principal components; the selected principal components are combined into a projection matrix. The historical test data samples are multiplied by the projection matrix to obtain the historical test data samples after dimensionality reduction.

[0056] As an optional implementation manner, the method for detecting electricity meter data further includes: in response to the detection result that the electricity usage data is in an abnormal state, uploading the electricity usage data and the detection result to the cloud.

[0057] In this embodiment, when the detection result shows that the electricity consumption data is in an abnormal state, it means that the data of the electric meter is abnormal. Based on this, the electricity consumption data and the detection result are uploaded to the cloud.

[0058] Optionally, by uploading the detection results corresponding to the power consumption data in an abnormal state to the cloud, the possible cause of the fault can be identified, helping users to carry out repairs and processing in a timely manner to avoid losses caused by the fault.

[0059] It should be noted that the above embodiment can be executed by a device for detecting electric meter data.

[0060] In this embodiment, the electricity consumption data of the electric meter is obtained, wherein the electricity consumption data is used to indicate the usage status of the electricity in the electric meter; the energy consumption characteristics of the electric meter are extracted from the electricity consumption data, wherein the energy consumption characteristics are used to indicate the usage behavior of the electricity in the electric meter; the energy consumption characteristics are input into the target detection model for detection, and the detection result of the electricity consumption data is obtained, wherein the detection result is used to indicate that the electricity consumption data is in a normal usage state or an abnormal usage state, and the target detection model is obtained by training using monitoring data samples. In other words, the present invention obtains the energy consumption characteristics of the electric meter by processing the electricity consumption data of the electric meter, and then uses the target detection model to detect the electricity consumption data, thereby solving the technical problem of low efficiency of meter data detection and achieving the technical effect of improving the efficiency of meter data detection.

[0061] The technical solution of the embodiment of the present invention is illustrated below in conjunction with preferred implementation modes.

[0062] At present, with the popularization of smart meters, abnormal data detection of smart meters is of great significance for protecting user rights, improving power management efficiency and promoting stable operation of power grids, and is a key link in the management and development of the power industry. Abnormal data detection of smart meters can timely detect and prevent malicious tampering of meter data or fraudulent behavior, ensuring that users' electricity consumption and cost data are true and reliable.

[0063] Related technologies usually include methods based on traditional machine learning, statistical analysis, and deep learning. Deep learning methods usually require a lot of computing resources when processing large-scale smart meter data, especially in real-time data processing environments. This leads to high time and computing costs for training and reasoning, especially in scenarios where the amount of smart meter data is large and real-time requirements are high, and it is difficult to adapt to low-power devices. Therefore, there is a technical problem of low efficiency in meter data detection. At present, no effective solution has been proposed for the above-mentioned technical problem of low efficiency in meter data detection.

[0064] However, an embodiment of the present invention proposes a method for analyzing smart meter data based on edge computing. The method collects the original data of the smart meter (such as power consumption, voltage, current, etc.) and converts the original data into features that can represent the user's power consumption behavior. These features will be used as inputs to the algorithm (isolation forest algorithm optimized based on genetic algorithm), so as to use the algorithm to detect abnormal power consumption behavior, thereby solving the technical problem of low efficiency of meter data detection and achieving the technical effect of improving the efficiency of meter data detection.

[0065] The embodiments of the present invention are further described below.

[0066] Figure 2 1 is a flow chart of a method for analyzing smart meter data based on edge computing according to an embodiment of the present invention, the analysis method comprising the following steps:

[0067] Step S201: smart meter data collection.

[0068] In this embodiment, the smart meter data is collected by the data collection module of the smart meter, wherein the data collection module is the core part of the entire smart grid system and is responsible for real-time monitoring, collection and recording of power consumption information of power users.

[0069] Optionally, obtain electricity consumption data from smart meters. Usually, each smart meter will regularly record the following information: Electricity consumption (kWh): electricity consumption recorded within a certain time interval. Timestamp: the corresponding time or date. Other features: auxiliary features such as temperature and weather (optional). The data format can be time series data or cumulative electricity consumption over a period of time. These data need to be preprocessed to ensure data integrity and consistency.

[0070] Step S202: feature extraction.

[0071] In this embodiment, after the data is collected in step S201, feature extraction is performed on the data.

[0072] Optionally, feature extraction related to power consumption, instantaneous power consumption: The power consumption collected by the smart meter can be used as a basic feature. By analyzing the instantaneous power consumption, it is possible to detect whether there is a sudden abnormal behavior (such as power theft). The instantaneous power consumption P(t) at each time point.

[0073] Optionally, the cumulative power consumption is based on the cumulative power consumption over a period of time, and the total energy consumption level can be calculated. In particular, in long-term observation, the change in cumulative power consumption can reflect whether there is a long-term abnormality. The feature can be: the cumulative power consumption P in a certain period of time total .

[0074] Optionally, the time feature extracts the timestamp (sequentiality). The electricity consumption behavior is closely related to time. The timestamp can help identify periodic features such as peak power consumption and night power consumption. By extracting time-related features, the power consumption pattern in a specific time period can be analyzed. Features can be: timestamp t, power consumption behavior during the day, night, holidays, etc. (such as whether it is during peak power consumption).

[0075] Optionally, the periodic feature, according to historical data, the user's power consumption pattern may have a daily cycle or a weekly cycle. By analyzing these periodic features, it can be found whether there is abnormal power consumption behavior that deviates from the normal cycle. The features can be: daily cycle, weekly cycle, etc.

[0076] Optionally, power quality characteristics, voltage: Voltage fluctuation is an important indicator of power quality. Voltage abnormalities (such as too high or too low) are usually related to equipment failure or line problems. Characteristics can be instantaneous voltage V(t), average voltage V avg .

[0077] Optionally, current: Current is also an important power parameter. By monitoring the current fluctuation, abnormal conditions such as overload or short circuit can be detected. The characteristics can be instantaneous current I(t), average current I avg The power factor reflects the efficiency of the equipment's power utilization. A low power factor may mean high power loss and low equipment efficiency, and a fluctuation in the power factor may indicate equipment failure. The characteristic can be the power factor cos(φ).

[0078] Optionally, event record features, frequency of abnormal events: The data acquisition module of the smart meter not only collects raw power consumption data, but also records abnormal events (such as overcurrent, short circuit, etc.). By counting the frequency and time of abnormal events, the health status of the device can be identified. The feature can be the frequency of abnormal events within a certain period of time (such as the number of overcurrent and short circuit alarms).

[0079] Optionally, the type of abnormal event: Different types of abnormal events may have different abnormal manifestations, such as power theft is usually manifested as a sudden increase in current, while line problems may cause voltage instability. The feature can be a type identifier of the abnormal event (such as overvoltage, leakage, etc.).

[0080] Optionally, behavioral pattern characteristics, power consumption pattern change rate: By comparing power consumption in different time periods, changes in user power consumption patterns can be identified. For example, if a user's power consumption is usually stable, but suddenly fluctuates greatly, it may indicate an abnormality. Power consumption change rate

[0081] Optionally, peak and valley power consumption: Based on the statistics of historical data, analyze the peak and valley power consumption of users in a day to compare the actual power consumption in a specific time period. The features can be peak power consumption and valley power consumption.

[0082] Optionally, statistical features, average value: the average value of power consumption, voltage, current, etc. over a period of time, can help detect whether there is a large deviation. The feature can be the mean value mean(P,V,I) of power consumption, voltage, and current.

[0083] Optionally, variance and standard deviation: can reflect the volatility of data. Large fluctuations in power consumption data may indicate problems with equipment or lines. Features can be the standard deviation of power consumption, voltage, and current σ(P,V,I).

[0084] Optionally, maximum and minimum values: Identify abnormally high or low values, which may reflect a transient abnormal state of the power system. Features can be the maximum and minimum values ​​of power consumption, voltage, and current. max ,P min .

[0085] Optionally, equipment operation characteristics, equipment status: Smart meters can also record the on or off status of equipment, monitor equipment operation, and can be used as auxiliary characteristics to analyze whether the equipment is operating normally. Characteristics can be the status identification of whether the equipment is on or off.

[0086] Optionally, data compression features, data change features after compression: During data compression and storage, the compressed data can be extracted for further analysis, such as the changes in high-frequency and low-frequency data. Features can be differences in data before and after compression, compression ratio, etc.

[0087] Optionally, time series features, delayed features: Electricity meter data is a typical time series data, and extracting hysteresis features (such as the hysteresis effect of power consumption) can help capture gradually changing abnormal situations. Features can be the hysteresis value of power consumption P(t-1), P(t-2), .... Autocorrelation: Calculate the autocorrelation of power consumption at different time steps to analyze whether there is a regular change. The feature can be the autocorrelation coefficient ρ(t).

[0088] Optionally, feature selection and dimensionality reduction. Since smart meters may collect a large amount of data of different dimensions, feature selection and dimensionality reduction techniques can reduce the input dimension and reduce the computational complexity. PCA (principal component analysis) or LDA (linear discriminant analysis) can be used to extract the most representative features as input to the isolation forest. Feature selection: Select the most relevant features to reduce computing resource consumption and improve model accuracy.

[0089] Step S203: Genetic algorithm optimizes the isolation forest.

[0090] In this embodiment, the isolation forest model is optimized by a genetic algorithm to ensure the accuracy of model detection.

[0091] Optionally, the parameters of the isolation forest are encoded, and the parameters of the isolation forest (such as the number of trees, maximum depth, etc.) are encoded into a genotype, i.e., a chromosome that can evolve.

[0092] Optionally, initialize the population and randomly generate an initial population, where each individual is a set of parameter configurations of the isolation forest.

[0093] Optionally, the fitness is evaluated by using the training data set to calculate the performance index of each individual (parameter configuration) on the anomaly detection task, where the performance index can be expressed by the following formula (1):

[0094] F(i)=Fitness(i) (1)

[0095] Optionally, the selection operation uses a roulette wheel selection or tournament selection method to select individuals with high fitness as parents according to the fitness value. The probability of roulette wheel selection can be expressed by the following formula (2):

[0096]

[0097] Among them, P(i) represents the probability of individual i being selected, F(i) represents the fitness value of the individual, and N represents the size of the population.

[0098] Optionally, a crossover operation is performed on the selected parent individuals to generate new child individuals. The crossover operation can be performed using single-point crossover, double-point crossover, etc., and can be expressed by the following formula (3):

[0099] Childi=α·Parent1+(1-α) (3)

[0100] Among them, α∈[0,1] is the crossover ratio, which represents the gene mixing ratio of the two parent individuals, and Childi represents the generated offspring.

[0101] Optionally, a mutation operation is used to randomly mutate the offspring individuals to increase the diversity of the population and avoid falling into a local optimum. The range of values ​​of the parameters that can be adjusted by the mutation operation can be expressed by the following formula (4):

[0102] Childi=Childi+Mutation(δ) (4)

[0103] Among them, Mutation(δ) means making a small perturbation to the offspring according to a random value δ within a certain range.

[0104] Optionally, parameter meaning,Mutation rate: The probability of mutation operation, determines the frequency of individual gene mutation.,High mutation rate can help explore new solution space.,In smart meter anomaly detection, mutation helps find better parameter,configuration.

[0105] Optionally, the variation amplitude δ: the degree of gene change during variation, used to control the amplitude of parameter adjustment.

[0106] Optionally, the population is updated, the newly generated offspring individuals are added to the population, and some individuals with lower fitness are eliminated according to their fitness, so as to keep the population size unchanged. The specific updating method can be expressed by the following formula (5):

[0107] NextGen=Selection(Crossover(Mutation(Population))) (5)

[0108] Among them, Population represents the current population, and NextGen represents the next generation population.

[0109] Optionally, iterative optimization: the training steps are repeated until a preset number of iterations or convergence condition is reached.

[0110] Optionally, the individual with the highest fitness is finally output, which is the optimized isolation forest parameter configuration.

[0111] Alternatively, the genetic algorithm optimization process can effectively explore the parameter space of the isolation forest and find the optimal parameter combination, thereby improving the performance of anomaly detection.

[0112] Step S204: abnormal data detection.

[0113] In this embodiment, the genetic algorithm optimized isolation forest is applied to the abnormal power consumption detection of smart meters, which can effectively detect abnormal behaviors in user power consumption data, such as power theft, equipment failure, or abnormal power consumption fluctuations. In this scenario, the smart meter will regularly collect user power consumption data, detect abnormal patterns through the isolation forest algorithm, and the genetic algorithm is used to optimize the parameters of the isolation forest to improve detection accuracy and efficiency.

[0114] Optionally, when using Isolation Forest to detect abnormal electricity consumption behavior, it is necessary to define the model's hyperparameters. These hyperparameters will be optimized by genetic algorithms, including: for each node, randomly select a feature X j And select a random split point p within the value range of the feature. Divide the data into two parts: X j ≤p and X j >p, where X j is a feature randomly selected from the feature set. p is a split point randomly selected within the range of values ​​of the feature.

[0115] Optionally, for a data point x in an isolated tree, the path length h(x) is recursively defined as: If x reaches a leaf node: h(x) = current depth If x has not yet reached a leaf node, continue recursively: h(x) = h 递归 (x)+1.

[0116] Alternatively, the average path length formula: Assume that the path length of a data point x in an isolated tree is h(x), and the average path length in the forest is E(h(x)). For all trees in the forest, the average path length is: where n treesis the number of trees in the isolation forest, h t (x) is the path length of data point x in the tth tree.

[0117] Optionally, the anomaly scoring formula can be expressed by the following formula (6):

[0118]

[0119] Where s(x,n) is the anomaly score of data point x, ranging from [0,1]. E(h(x)) is the average path length of data point x in the forest. c(n) is an adjustment factor used to standardize the path length, which is approximately the following formula (7):

[0120]

[0121] Where H(i) is the i-th harmonic number, which is approximately log(i)+0.5772156649 (Euler's constant).

[0122] Optionally, outlier determination: When s(x,n)≈1, it means that data point x is very likely to be an outlier. When s(x,n)≈0, it means that data point x is a normal point. n_estimators: The number of trees in the isolation forest. max_samples: The maximum number of samples used for training each tree, usually data collected by smart meters over multiple time periods. contamination: The proportion of outliers, used to estimate anomalies in electricity usage behavior, such as power theft.

[0123] Optionally, the goal of the genetic algorithm is to find the best combination of isolation forest parameters through continuous evolution so that the performance of anomaly detection is optimized. The optimization goal is usually evaluated using a fitness function, and the fitness can be measured based on the performance of the model on the detected abnormal behavior, such as through the following indicators: F1 score: It comprehensively considers the precision and recall rate of anomaly detection, balancing the accuracy and coverage of detection. Accuracy: The accuracy of detecting abnormal behavior. False alarm rate: The proportion of false alarms of the model. A low false alarm rate means that the detection results of the model are more reliable.

[0124] Optionally, data splitting: Split the dataset into training and test sets to ensure that unseen data is used for model evaluation. Training set: Used to build the Isolation Forest model. Test set: Used to evaluate model performance. Model training: Use Isolation Forest to build a model on the training set, and detect anomalies in the meter electricity usage data through randomly divided isolation trees.

[0125] Step S205, upload to the cloud server.

[0126] In this embodiment, the detection result of step S204 is uploaded to the cloud server.

[0127] In this embodiment, by collecting the original data of the smart meter (such as power consumption, voltage, current, etc.), the original data is converted into features that can represent the user's power consumption behavior. These features will be used as inputs to the algorithm (isolation forest algorithm optimized based on genetic algorithm), so that the algorithm can be used to detect abnormal power consumption behavior, thereby solving the technical problem of low efficiency of meter data detection and achieving the technical effect of improving the efficiency of meter data detection.

[0128] According to an embodiment of the present invention, a device for detecting electric meter data is also provided. It should be noted that the device for detecting electric meter data can be used to execute the method for detecting electric meter data in the method embodiment.

[0129] Figure 3 Schematic diagram of a device for detecting electric meter data according to an embodiment of the present invention. Figure 3 As shown, the device 300 for detecting the electric meter data may include: an acquisition unit 301 , an extraction unit 302 and a detection unit 303 .

[0130] An acquisition unit 301 is used to acquire electricity usage data of an electric meter, wherein the electricity usage data is used to indicate the usage status of electricity in the electric meter;

[0131] An extraction unit 302 is used to extract energy consumption characteristics of the electric meter from the electricity consumption data, wherein the energy consumption characteristics are used to indicate the use behavior of electricity in the electric meter;

[0132] The detection unit 303 is used to input the energy consumption characteristics into the target detection model for detection to obtain the detection result of the electricity consumption data, wherein the detection result is used to indicate whether the electricity consumption data is in a normal usage state or an abnormal usage state. The target detection model is trained using monitoring data samples.

[0133] Optionally, the extraction unit 302 may include: a preprocessing module for preprocessing the electricity consumption data; a first determination module for respectively determining the contribution rates of multiple characteristic data in the preprocessed electricity consumption data, wherein the contribution rates are used to indicate the importance of each characteristic data in the electricity consumption data; and an extraction module for extracting the energy consumption characteristics of the electric meter from the electricity consumption data based on the contribution rates.

[0134] Optionally, the extraction module may include: a second determination module, configured to determine the characteristic data corresponding to the contribution rate as an energy consumption characteristic of the electric meter in response to the contribution rate being greater than a contribution rate threshold.

[0135] Optionally, the device 300 for detecting electric meter data may further include: a first acquisition unit, used to acquire historical detection data samples of the electric meter; and an input unit, used to train an initial detection model using the historical detection data samples to obtain a target detection model.

[0136] Optionally, the device 300 for detecting electric meter data may include: a preprocessing unit, configured to perform dimension reduction preprocessing on historical detection data samples.

[0137] Optionally, the device 300 for detecting the electric meter data may include: an uploading unit, configured to upload the electric meter data and the detection result to the cloud in response to a detection result indicating that the electric meter data is in an abnormal state.

[0138] In this embodiment, the electricity consumption data of the electric meter is obtained, wherein the electricity consumption data is used to indicate the usage status of the electricity in the electric meter; the energy consumption characteristics of the electric meter are extracted from the electricity consumption data, wherein the energy consumption characteristics are used to indicate the usage behavior of the electricity in the electric meter; the energy consumption characteristics are input into the target detection model for detection, and the detection result of the electricity consumption data is obtained, wherein the detection result is used to indicate that the electricity consumption data is in a normal usage state or an abnormal usage state, and the target detection model is obtained by training using monitoring data samples. In other words, the present invention obtains the energy consumption characteristics of the electric meter by processing the electricity consumption data of the electric meter, and then uses the target detection model to detect the electricity consumption data, thereby solving the technical problem of low efficiency of meter data detection and achieving the technical effect of improving the efficiency of meter data detection.

[0139] According to an embodiment of the present invention, a computer-readable storage medium is further provided. The storage medium includes a stored program, wherein the program executes the method for detecting the electric meter data in the method embodiment.

[0140] According to an embodiment of the present invention, a processor is further provided. The processor is used to run a program. When the program is run, the method for detecting the electric meter data in the method embodiment is executed.

[0141] According to an embodiment of the present invention, a computer program product is further provided. The computer program product includes computer instructions. When the computer instructions are executed by a processor, the method for detecting the electric meter data in the method embodiment is implemented.

[0142] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0143] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0144] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0146] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0147] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent functional component, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software functional component, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program codes.

[0148] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for detecting electric meter data, characterized in that: include: Acquiring electricity usage data of an electric meter, wherein the electricity usage data is used to indicate the usage status of electricity in the electric meter; Extracting energy consumption characteristics of the electric meter from the electric consumption data, wherein the energy consumption characteristics are used to indicate the use behavior of the electric power in the electric meter; The energy consumption characteristics are input into a target detection model for detection to obtain a detection result of the electricity usage data, wherein the detection result is used to indicate whether the electricity usage data is in a normal usage state or an abnormal usage state, and the target detection model is trained using historical detection data samples.

2. The method according to claim 1, characterized in that Extracting energy consumption characteristics of the electric meter from the electric consumption data includes: Preprocessing the electricity consumption data; Respectively determining contribution rates of a plurality of characteristic data in the preprocessed power consumption data, wherein the contribution rates are used to indicate the importance of each characteristic data in the power consumption data; Based on the contribution rate, the energy consumption characteristics of the electric meter are extracted from the electricity consumption data.

3. The method according to claim 2, characterized in that Based on the contribution rate, extracting the energy consumption characteristics of the electric meter from the electricity consumption data includes: In response to the contribution rate being greater than the contribution rate threshold, the characteristic data corresponding to the contribution rate is determined as one of the energy consumption characteristics of the electric meter.

4. The method according to claim 1, characterized in that: The method further comprises: Acquire the historical detection data sample of the electric meter; The initial detection model is trained using the historical detection data samples to obtain the target detection model.

5. The method according to claim 4, characterized in that Before inputting the historical detection data samples into the initial detection model for training to obtain the target detection model, the method further includes: The historical detection data samples are preprocessed by dimensionality reduction.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: In response to the detection result indicating that the power usage data is in an abnormal state, the power usage data and the detection result are uploaded to the cloud.

7. A device for detecting electric meter data, characterized in that: include: an acquisition unit, configured to acquire electricity usage data of an electric meter, wherein the electricity usage data is used to indicate a usage status of electricity in the electric meter; an extraction unit, configured to extract energy consumption characteristics of the electric meter from the electric consumption data, wherein the energy consumption characteristics are used to indicate the use behavior of the electric power in the electric meter; A detection unit is used to input the energy consumption characteristics into a target detection model for detection to obtain a detection result of the electricity usage data, wherein the detection result is used to indicate whether the electricity usage data is in a normal usage state or an abnormal usage state, and the target detection model is trained using monitoring data samples.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed by a processor, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 6.

9. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 6 when running.

10. A computer program product, characterized in that The computer program product comprises computer instructions, which implement the method according to any one of claims 1 to 6 when executed by a processor.