Smart meter data analysis and anomaly detection method and system

By identifying and simulating complex power theft behaviors through generative adversarial networks and association rule learning algorithms, it solves the problem that traditional methods cannot effectively deal with organized power theft and data processing delays, and achieves efficient and accurate power theft detection and identification.

CN118378131BActive Publication Date: 2024-09-20SHANDONG OUTONG INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410804721.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-20
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

Traditional power theft detection methods cannot effectively deal with complex or covert power theft behaviors, especially when faced with organized power theft, and there is a delay in data processing and low processing efficiency.

Method used

Using a generative adversarial network combined with an association rule learning algorithm, through real-time collection of smart meter data, synthetic data similar to real power theft behavior is generated, organized group power theft patterns are identified, and the generator is optimized through a deep learning network and association rule model and discriminator to improve recognition accuracy and timeliness.

Benefits of technology

It improves the timeliness and accuracy of power theft detection, can identify complex power theft behaviors, enhances the safety and reliability of the power system, reduces manual intervention, and improves the speed and efficiency of handling power theft incidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118378131B
    Figure CN118378131B
Patent Text Reader

Abstract

The present invention belongs to the technical field of meter data analysis, and in particular to a method and system for data analysis and anomaly detection of smart meters, the method comprising real-time collection of power usage data from smart meters; inputting the collected power usage data into a pre-trained deep learning network to identify synthetic data that is similar to real power data but is actually theft behavior; analyzing the synthetic data through a pre-built association rule model based on an association rule learning algorithm to obtain abnormal correlations between multiple users and identify organized group power theft patterns; executing response measures according to the identification results; the system comprises a data collection unit, a deep learning analysis module, an association analysis unit and a real-time response module. The present invention improves the timeliness and accuracy of power theft detection, can more accurately distinguish between normal power usage and power theft behavior, thereby improving recognition accuracy, and can accurately identify group power theft patterns.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electric meter data analysis, and in particular to a smart electric meter data analysis and anomaly detection method and system. Background Art

[0002] In modern power systems, smart meters are widely used to monitor and manage power consumption in real time. Although smart meters bring the potential to improve energy efficiency and optimize resource allocation, power theft still exists, causing economic losses to power companies and consumers, and may endanger the stability of the power grid.

[0003] Traditional power theft detection methods rely on simple threshold judgments or basic statistical analysis, which cannot effectively deal with complex or hidden power theft behaviors, especially when faced with organized power theft; traditional methods mainly rely on preset abnormal conditions to identify power theft incidents, which limits their effectiveness in the face of unknown or new power theft strategies; traditional methods often have delays in data processing and are less efficient in handling power theft incidents. Summary of the invention

[0004] In view of the above deficiencies in the prior art, the purpose of the present invention is to provide a smart meter data analysis and anomaly detection method and system, which improves the timeliness and accuracy of power theft detection and can accurately identify group power theft patterns.

[0005] The technical solution adopted by the present invention is:

[0006] A smart meter data analysis and anomaly detection method is provided, comprising the following steps:

[0007] S1, collect power usage data from smart meters in real time;

[0008] S2. Input the collected electricity usage data into a pre-trained deep learning network to identify synthetic data that is similar to real electricity data but is actually theft; the deep learning network is a generative adversarial network, which generates synthetic data similar to real electricity theft data through a generator, and distinguishes the synthetic data generated by the generator from the real electricity theft data through a discriminator; and adopts an adversarial training method to optimize the generator to generate more accurate electricity theft data by alternately training the generator and the discriminator, while improving the recognition accuracy of the discriminator;

[0009] S3, analyzing the synthetic data through a pre-built association rule model based on an association rule learning algorithm, obtaining abnormal correlations between multiple users and identifying organized group electricity theft patterns;

[0010] S4. Execute response measures based on the identification results.

[0011] As a preferred solution of the present invention, the power usage data includes current, voltage, and instantaneous power consumption of the electric meter.

[0012] As a preferred solution of the present invention, the generative adversarial network is a conditional generative adversarial network based on a reverse engineering strategy, which guides the generator to generate targeted electricity theft case data by analyzing known electricity theft strategies, so as to adapt it to the new electricity theft strategies or new behavior patterns of electricity thieves.

[0013] As a preferred solution of the present invention, the input of the generator is a random noise vector, the output is synthesized power data, and the goal of the generator is to maximize the probability that the discriminator misjudges its synthesized power data as real data.

[0014] As a preferred solution of the present invention, the input of the discriminator is power data, and the output is a probability value indicating that the power data is real data; the goal of the discriminator is to maximize the probability of correctly identifying real power data, and to maximize the logarithmic probability of identifying synthetic power data as false data.

[0015] As a preferred embodiment of the present invention, step S3 specifically includes the following steps:

[0016] S31, extracting key features related to power usage patterns through association rule models, including peak power usage time, minimum power usage, and average power usage;

[0017] S32, analyzing the periodic pattern of power consumption according to the extracted key features to generate a frequent item set, where the frequent item set includes power usage patterns that frequently appear together within a certain period of time;

[0018] S33, constructing association rules based on frequent item sets, and setting support, confidence threshold and lift to evaluate and filter association rules, where the association rules reflect potential abnormal power usage associations between users;

[0019] S34. Analyze the power usage relationship between multiple users using association rules, identify patterns that are different from regular power usage patterns, and observe user groups that show similar abnormal power usage behaviors within a certain time window.

[0020] The present invention also provides a smart meter data analysis and anomaly detection system, comprising:

[0021] A data collection unit, used to collect power usage data from smart meters in real time;

[0022] A deep learning analysis module is used to input the collected power usage data into a pre-trained deep learning network to identify synthetic data that is similar to real power data but is actually theft behavior; the deep learning network is a generative adversarial network, which generates synthetic data similar to real power theft behavior data through a generator, and distinguishes the synthetic data generated by the generator from the real power theft data through a discriminator; and adopts an adversarial training method to optimize the generator to generate more accurate power theft behavior data by alternately training the generator and the discriminator, while improving the recognition accuracy of the discriminator;

[0023] An association analysis unit, used to analyze the synthetic data through a pre-built association rule model based on an association rule learning algorithm, obtain abnormal correlations between multiple users, and identify organized group electricity theft patterns;

[0024] The real-time response module is used to execute response measures according to the recognition results.

[0025] As a preferred solution of the present invention, executing response measures includes adjusting the power grid management strategy or notifying relevant personnel to conduct on-site inspection.

[0026] As a preferred embodiment of the present invention, the association analysis unit specifically includes:

[0027] A key feature extraction module is used to extract key features related to power usage patterns through an association rule model, including peak power usage time, minimum power usage, and average power usage;

[0028] A frequent itemset construction module is used to generate frequent itemsets by analyzing the periodic pattern of electricity consumption according to the extracted key features, where the frequent itemsets include electricity usage patterns that frequently appear together within a certain period of time;

[0029] The association rule construction module is used to construct association rules based on frequent item sets to reflect the potential abnormal power usage associations between users; and set the support, confidence threshold and lift to evaluate and screen the association rules;

[0030] The identification module is used to analyze the power usage relationship between multiple users using association rules, identify patterns that are different from the normal power usage pattern, and observe user groups that show similar abnormal power usage behavior within a certain time window.

[0031] The present invention also provides a computer storage medium, which stores a computer program that can be executed by a processor, and the computer program executes the smart meter data analysis and anomaly detection method described in any one of the above technical solutions.

[0032] The beneficial effects produced by the present invention are:

[0033] The present invention utilizes a generative adversarial network to simulate complex electricity theft behaviors. By generating synthetic data similar to real electricity theft behavior data, the ability of the discriminator is enhanced, enabling it to more accurately distinguish between normal electricity use and electricity theft behaviors, thereby improving recognition accuracy.

[0034] By analyzing the electricity usage data among multiple users, the present invention can identify the organized group electricity theft pattern, and use the association rule algorithm to generate frequent item sets and association rules from the user electricity usage data. These rules reveal abnormal electricity usage relationships, especially the abnormal group electricity usage behavior in unconventional time periods. This can not only help power companies to promptly discover and prevent organized electricity theft activities, but also enhance the safety and reliability of the entire power system.

[0035] The present invention adds a conditional adversarial network based on reverse engineering to the deep learning network, and guides the generator to generate targeted electricity theft case data by analyzing known electricity theft strategies. Even when the electricity thieves adopt new strategies or change their behavior patterns, they can still be effectively identified, thereby greatly improving the timeliness and accuracy of electricity theft detection.

[0036] The present invention can automatically execute response measures based on the data collected from the deep learning analysis module and the correlation analysis unit, including adjusting the power grid management strategy or notifying relevant personnel to conduct on-site inspections. The automated operation reduces manual intervention and improves the speed and efficiency of handling power theft incidents. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a flow chart of the smart meter data analysis and anomaly detection method in Embodiment 1 of the present invention;

[0038] Figure 2 yes Figure 1 Flow chart of step S3;

[0039] Figure 3 is a structural diagram of a smart meter data analysis and anomaly detection system in Embodiment 4 of the present invention;

[0040] Figure 4 is a schematic diagram of the structure of the deep learning analysis module in Example 4 of the present invention;

[0041] Figure 5 It is a schematic diagram of the structure of the smart meter data analysis and anomaly detection system in Example 5 of the present invention. DETAILED DESCRIPTION

[0042] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0043] Example 1

[0044] like Figure 1 As shown, the smart meter data analysis and anomaly detection method includes the following steps:

[0045] S1, collect power usage data from smart meters in real time;

[0046] S2. Input the collected electricity usage data into a pre-trained deep learning network to identify synthetic data that is similar to real electricity data but is actually theft. The deep learning network is a generative adversarial network (GANs), which generates synthetic data similar to real electricity theft data through a generator and distinguishes the synthetic data generated by the generator from real electricity theft data through a discriminator. The adversarial training method is used to alternately train the generator and the discriminator to optimize the generator to generate more accurate electricity theft data, while improving the recognition accuracy of the discriminator.

[0047] S3, analyzing the synthetic data through a pre-built association rule model based on an association rule learning algorithm, obtaining abnormal correlations between multiple users and identifying organized group electricity theft patterns;

[0048] S4. Execute response measures based on the identification results.

[0049] In this embodiment, the generative adversarial network and association rule learning algorithm are used to identify and simulate complex electricity theft behaviors. The generative adversarial network GANs model mainly generates synthetic data similar to real electricity theft behavior data, thereby enhancing the ability of the discriminator, enabling it to more accurately distinguish between normal electricity use and electricity theft behaviors, ensuring that even when the electricity thief adopts new strategies or changes behavior patterns, it can still be effectively identified, thereby greatly improving the timeliness and accuracy of electricity theft detection.

[0050] The power usage data mainly includes current, voltage, and the instantaneous power consumption of the meter (which can be calculated based on the real-time collected data). The voltage sensed by the real-time current and voltage sensors can be directly collected from the smart meter. The instantaneous power consumption of the meter is calculated by real-time monitoring and recording of current and voltage data. The collected power usage data can be sent to a central data processing unit at preset time intervals for preprocessing.

[0051] Specifically, the deep learning network can optimize the learning network through pre-training to improve the accuracy of classification. Historical power usage data can be obtained and used as training data, and the training data can be labeled to distinguish between normal power usage data sets and known power theft data sets.

[0052] Furthermore, the generative adversarial network can add restrictive conditions on the basis of GANs, that is, by adding additional conditional information to the generator and discriminator to guide the generation process, and based on reverse engineering, the generative adversarial network is extended to conditional generative adversarial network, and the conditional vector c is added to represent the characteristics of electricity theft. The conditional generative adversarial network cGANs based on the reverse engineering strategy guides the generator to generate targeted electricity theft case data by analyzing known electricity theft strategies, so that it can adapt to the new electricity theft strategies or new behavior patterns of electricity thieves, so that it can be effectively identified even when the electricity thieves adopt new strategies or change behavior patterns. The conditional generative adversarial network cGANs mainly identifies the electricity theft behavior data in the collected power usage data through reverse engineering strategies.

[0053] In this embodiment, power theft cases can be obtained from the case database of the power company, including behavior patterns, time, location, technology used, and strategies. Common real power theft behaviors and their manifestations in power data are as follows:

[0054] 1. Direct connection (stealing wiring);

[0055] Data performance:

[0056] Sustained high electricity usage: Unexpectedly high electricity consumption is observed during periods of typically low electricity usage (such as at night) and is significantly inconsistent with historical data or typical electricity usage patterns of similar user groups.

[0057] 2. Electricity meter tampering;

[0058] When the meter is inverted, the data shows that the power consumption recorded by the meter decreases abnormally, or the meter reading increases in the opposite direction.

[0059] Magnetic interference, data performance: The electricity consumption recorded by the meter suddenly drops, which may be accompanied by discontinuous data or interrupted recording.

[0060] Circuit tampering, data performance: The electricity consumption recorded by the meter is unstable, showing periodic abnormal high and low fluctuations.

[0061] 3. Software tampering;

[0062] Data performance:

[0063] Data that does not conform to the physical model: After the meter software is tampered with, the displayed power consumption suddenly drops to an unreasonable level, or it continues to display power consumption when there is no power consumption.

[0064] Timestamp anomaly: The timestamp of the data record does not match the actual time, indicating that the meter record may have been modified later.

[0065] 4. Using illegal equipment;

[0066] Data performance:

[0067] Periodic interference signals: Interference signals sent by illegal devices can cause the meter to fail or record errors periodically, with the data showing up as regular abnormal readings.

[0068] Sudden reading changes: If interfering equipment is suddenly turned on or off, it may cause the meter reading to jump suddenly.

[0069] By analyzing the data performance and anomalies of the above-mentioned known electricity theft cases, the generator is guided to generate targeted electricity theft case data, thereby simulating derived electricity theft strategies or theft behavior patterns. When electricity thieves adopt new strategies or change behavior patterns, they can also be effectively identified.

[0070] Specifically, the input of the generator is a random noise vector, the output is synthesized power data, and the goal of the generator is to maximize the probability that the discriminator misclassifies its synthesized power data as real data.

[0071] The input of the discriminator is power data, and the output is the probability value indicating that the power data is real data; the goal of the discriminator is to maximize the probability of correctly identifying real power data and to maximize the logarithmic probability of identifying synthetic power data as false data.

[0072] like Figure 2 As shown, step S3 specifically includes the following steps:

[0073] S31, extracting key features related to power usage patterns through association rule models, including peak power usage time, minimum power usage, and average power usage;

[0074] S32, analyzing the periodic pattern of power consumption according to the extracted key features to generate a frequent item set, where the frequent item set includes power usage patterns that frequently appear together within a certain period of time;

[0075] S33, constructing association rules based on frequent item sets, and setting support, confidence threshold and lift to evaluate and filter association rules, where the association rules reflect potential abnormal power usage associations between users;

[0076] S34. Analyze the power usage relationship between multiple users using association rules, identify patterns that are different from regular power usage patterns, and observe user groups that show similar abnormal power usage behaviors within a certain time window.

[0077] It can be seen that by analyzing the electricity usage data among multiple users, it is possible to identify the organized group electricity theft pattern, and use the association rule algorithm to generate frequent item sets and association rules from the user electricity usage data. These rules reveal abnormal electricity usage relationships, especially the abnormal group electricity usage behavior in unconventional time periods, which not only helps power companies to promptly detect and prevent organized electricity theft activities, but also enhances the safety and reliability of the entire power system.

[0078] Example 2

[0079] This embodiment is based on the above-mentioned embodiment 1, but the difference is that the deep learning analysis network and association rule learning are further explored and implemented.

[0080] Among them, the generative adversarial network GANs mainly consists of a pair of generators G and discriminators D. The input of the generator is a random noise vector z, and the output is the synthesized power data , the objective function of the generator is:

[0081] ;

[0082] Among them, G(z) represents the data generated by the generator based on the noise z, and D(G(z)) is the probability of the discriminator evaluating the generated data and using "real data" for power. The goal of the generator is to maximize the probability that the discriminator misclassifies its generated data as real data, that is, the generated data is "real" enough that the discriminator cannot distinguish it.

[0083] The generator operates as follows:

[0084] Input: random noise vector z;

[0085] Processing: The noise vector passes through a generator network, which consists of multiple fully connected or convolutional layers.

[0086] Output: Generated electricity usage data, simulating real electricity theft behavior data.

[0087] The input of the discriminator is power data (whether real or synthetic), and the output is a probability value indicating the probability that the data is real data. The objective function of the discriminator is:

[0088] ;

[0089] Among them, the first part The discriminator outputs the logarithmic probability of the real data x based on the real data, which is used to maximize the probability of the first part, that is, the probability of correctly identifying the real data, and the second part The discriminator outputs the logarithmic probability of the generated data G(z) being false data based on the generated data; it aims to maximize the probability of the second part, that is, correctly identifying the generated data.

[0090] The operation of the discriminator is as follows:

[0091] Input: power data;

[0092] Processing: The data passes through a discriminator network, which consists of multiple fully connected or convolutional layers.

[0093] Output: probability value, indicating the probability that the input data is true data.

[0094] In the scenario of power theft detection, GANs are trained to generate seemingly real power theft data, which helps the discriminator learn how to more effectively identify various complex power theft behaviors. The generator tries to imitate various possible scenarios of power theft, while the discriminator continuously learns how to distinguish between real power theft data and data generated by the generator.

[0095] In adversarial training, the generator and discriminator are updated alternately, where;

[0096] Discriminator update: When the generator is fixed, the discriminator parameters are improved to minimize L D ;

[0097] Steps:

[0098] Data preparation: prepare real data samples x and fake data samples G(z) generated by generator G.

[0099] Forward propagation, input these data samples into the discriminator D, and calculate the corresponding discriminator outputs D(x) and D(G(z)).

[0100] Calculate the loss and calculate L based on the output of the discriminator D .

[0101] Back propagation and parameter update, using gradient descent to calculate the loss function L D The gradient of the discriminator parameters is calculated and the parameters of the discriminator D are updated to reduce L D .

[0102] Generator update: While fixing the discriminator, adjust the parameters of the generator to minimize L G .

[0103] Steps:

[0104] Generate fake data. The generator G receives random noise z and generates fake data samples G(z).

[0105] Forward propagation: input the fake data sample G(z) into the discriminator D to obtain the discriminator's evaluation of the fake data D(G(z)).

[0106] Calculate the loss. Based on the evaluation of the discriminator, calculate the loss L of the generator G .

[0107] Back propagation and parameter update, using gradient ascent to calculate the loss function L G The gradient of the generator parameters is calculated and the parameters of the generator G are updated to increase L G (Because the goal of the generator is to fool the discriminator, even though the discriminator is more likely to mistake the generated fake data as real data).

[0108] The correlation analysis specifically includes:

[0109] Collect electricity usage data from multiple users, and clean and pre-process the collected data;

[0110] Feature extraction: Extract key features related to electricity usage patterns, including peak power usage time, minimum power usage, and average power usage, and analyze periodic patterns of power consumption, such as the comparison of power usage on weekends and weekdays;

[0111] Constructing association rule model: Applying Apriori algorithm, generate frequent item sets from power usage data. Frequent item sets include power usage patterns that frequently appear together within a certain period of time. Construct association rules from frequent item sets, set support, confidence threshold and lift to evaluate and filter association rules. Key rules reflect potential abnormal power usage associations between users.

[0112] Abnormal pattern recognition: Use association rules to analyze the power usage relationship between multiple users, identify patterns that are different from regular power usage patterns, and observe user groups that show similar abnormal power usage behaviors within a certain time window, which may involve organized power theft.

[0113] Among them, support is the frequency of an item set (a combination of items) appearing in all transactions, expressed as:

[0114] ;

[0115] Confidence is the rule The frequency of item set X appearing under the condition that it is proven to be true is expressed as: ;

[0116] Promotion is the rule The increase in the probability of the target item Y appearing is expressed as: .

[0117] Example 3

[0118] This embodiment is based on the above-mentioned embodiment 1 or 2, and improves the generative adversarial network into a conditional adversarial network. The conditional adversarial network adds a conditional vector representing the conductive feature. Through the improved conditional adversarial network, a reverse engineering strategy is adopted, so that it can better adapt to the constantly updated stealing strategies and behavior patterns of electricity thieves.

[0119] Reverse engineering specifically includes:

[0120] Define the characteristics and indicators of power theft. Based on historical power theft behavior data, define the characteristics and indicators that can represent power theft behavior, including:

[0121] Abnormal electricity usage: unusually high or low changes in electricity usage;

[0122] Power usage time pattern: high power usage during atypical times;

[0123] Physical Tampering Indicators: Signs of physical damage to the meter or signs of tampering with external equipment;

[0124] Reverse engineering design: Taking features and indicators as input, design the reverse engineering module of the generator, including feature encoding and generating simulation data, wherein feature encoding enables the generator to accept specified power theft features as conditional input, and generates simulation data for training the generator to generate simulation data that conforms to the characteristics of power theft behavior based on the specified power theft features, including the use of conditional generative adversarial networks (cGANs) to ensure that the generated data reflects specific power theft conditions;

[0125] Train the discriminator and generator. Train the discriminator to learn to distinguish between real data (obtained from real electricity meter readings) and simulated electricity theft data generated by the generator. Optimize the generator so that the data it generates is more difficult for the discriminator to distinguish, thereby improving its ability to reproduce real-world electricity theft behavior.

[0126] Iterative optimization and verification: Through continuous iterative training process, the performance of the generator and discriminator is refined, and the performance of the model is tested on an independent validation set, which contains real electricity theft behavior data and normal electricity usage data.

[0127] In reverse engineering, the generator G is trained to generate data that meets the characteristics of electricity theft. When using conditional generative adversarial networks (cGANs), the input of the generator includes not only random noise z, but also the conditional vector c, which represents the characteristics of electricity theft. The objective functions of the generator and the discriminator will be adjusted to take into account the conditional vector c.

[0128] Therefore, the objective function of the generator is updated to:

[0129] ,in, represents the data generated by random noise z given the conditional vector c;

[0130] Training the discriminator and generator: The task of the discriminator D is to distinguish whether the input data is real or generated by the generator. When using a conditional generative adversarial network, the input of the discriminator also includes the conditional vector c. Therefore, the objective function of the discriminator is updated as follows:

[0131] ;

[0132] in, and They respectively represent that under the given conditional vector c, the discriminator judges the real data x and the generated data is the true probability.

[0133] In the iterative optimization phase, gradient descent (for the discriminator) and gradient ascent (for the generator) are used to update the parameters;

[0134] Discriminator parameter update: ;

[0135] Generator parameter update: ;

[0136] Among them, α and β are learning rates, and are the parameters of the discriminator and the generator respectively.

[0137] Example 4

[0138] like Figure 3 As shown, the smart meter data analysis and anomaly detection system of this embodiment is mainly used to implement the above method embodiment, and the system includes:

[0139] A data collection unit, used to collect power usage data from smart meters in real time;

[0140] The deep learning analysis module is used to input the collected power usage data into a pre-trained deep learning network to identify synthetic data that is similar to real power data but is actually theft. The deep learning network is a generative adversarial network (GANs), which generates synthetic data similar to real power theft data through a generator and distinguishes the synthetic data generated by the generator from the real power theft data through a discriminator. The adversarial training method is used to alternately train the generator and the discriminator to optimize the generator to generate more accurate power theft data, while improving the recognition accuracy of the discriminator.

[0141] An association analysis unit, used to analyze the synthetic data through a pre-built association rule model based on an association rule learning algorithm, obtain abnormal correlations between multiple users, and identify organized group electricity theft patterns;

[0142] The real-time response module is used to execute response measures according to the recognition results.

[0143] Response measures may include adjusting grid management strategies or notifying relevant personnel to conduct on-site inspections. Automated operations reduce the need for human intervention and improve the speed and efficiency of handling power theft incidents.

[0144] like Figure 4 As shown, the association analysis unit specifically includes:

[0145] A key feature extraction module is used to extract key features related to power usage patterns through an association rule model, including peak power usage time, minimum power usage, and average power usage;

[0146] A frequent itemset construction module is used to generate frequent itemsets by analyzing the periodic pattern of electricity consumption according to the extracted key features, where the frequent itemsets include electricity usage patterns that frequently appear together within a certain period of time;

[0147] The association rule construction module is used to construct association rules based on frequent item sets to reflect the potential abnormal power usage associations between users; and set the support, confidence threshold and lift to evaluate and screen the association rules;

[0148] The identification module is used to analyze the power usage relationship between multiple users using association rules, identify patterns that are different from the normal power usage pattern, and observe user groups that show similar abnormal power usage behavior within a certain time window.

[0149] The various modules of the system are mainly used to implement the various steps of the above method embodiments, which will not be described in detail here.

[0150] Example 5

[0151] like Figure 5 As shown, this embodiment adds an evaluation module based on the above system embodiment 4.

[0152] This assessment module is mainly used to evaluate the extent of the theft. Specifically, based on the output of the deep learning analysis module, the duration and frequency of the theft are identified. The theft is rated based on the duration and frequency of the theft to determine its severity. The impact of electricity theft on grid security, power supply quality and economic benefits needs to be taken into account.

[0153] Duration calculation: The duration of the theft behavior refers to the time span of the behavior, which is calculated by identifying the timestamps of the start and end of the theft behavior. The duration is determined by subtracting the start time from the end time to get a time period.

[0154] Frequency calculation: The frequency of a theft behavior refers to the number of times the behavior occurs within a certain period of time. The frequency is determined by counting the number of thefts over a period of time, which can be a day, a week or a month, and adjusted as needed.

[0155] Rating basis: Based on the calculation results of duration and frequency, the theft behavior is divided into different levels, from low to high, such as low, medium, and high. The threshold is set according to the specific situation. For example, the theft behavior with a short duration and low frequency may be rated as a low level, while the theft behavior with a long duration and high frequency may be rated as a high level.

[0156] Rating Standards Development:

[0157] When developing rating criteria, combine duration and frequency to give specific definitions and ranges for different levels. Divide duration and frequency into several ranges respectively, and assign a rating to each range.

[0158] Analyze the scope of impact: Use the propagation network analysis algorithm to determine the scope of the impact of power theft on the power grid and users, including the areas, user groups and power facilities affected by the theft;

[0159] Propagation network analysis algorithms include:

[0160] Construct a power network diagram: Represent each node in the power system (smart meters, power facilities) and the connection relationship between them in the form of a graph. Each node can be an electricity meter, and each connection edge represents the power transmission relationship between nodes.

[0161] Node centrality analysis: Node centrality analysis is performed on the constructed power network graph to identify the nodes most affected by theft. The node centrality index can help identify nodes with significant influence in the power grid.

[0162] Betweenness centrality is used to identify key nodes in the power grid that connect different areas and which may be propagation paths for theft and therefore have a higher probability of being affected.

[0163] Degree centrality is used to identify nodes with the most connections in the power grid, which may play an important role in the spread of theft;

[0164] The propagation network analysis algorithm is based on node centrality analysis to identify the grid nodes or user groups most affected by the theft;

[0165] The node centrality algorithm uses the following formula to calculate the centrality index of a node:

[0166] Betweenness Centrality: ;

[0167] Degree Centrality: ;

[0168] in, represents the betweenness centrality of node v, represents the degree centrality of node v, k v is the degree of node v, is the number of shortest paths between nodes s and t, is the number of shortest paths through node v.

[0169] The propagation network analysis algorithm is used to identify the propagation path of theft in the power network, understand how theft affects different areas or user groups, and by analyzing the propagation path of theft, determine which areas or user groups are more likely to be affected, so as to adjust the power grid management strategy in a targeted manner.

[0170] The real-time response module can also intelligently adjust the strategy based on the evaluation results of the evaluation module:

[0171] Based on the assessment results, formulate corresponding response strategies and measures. For high-level and widespread power theft, emergency measures should be taken immediately, such as power outages, alarms or dispatch warnings.

[0172] For thefts of lower severity or with local impact, more gentle and targeted measures should be taken, such as increasing inspection frequency, strengthening monitoring, and improving security precautions.

[0173] Develop specific emergency response plans and disposal procedures to ensure that response measures can be implemented in a timely and effective manner and minimize the impact on users.

[0174] Example 6

[0175] The present application also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, a server, an App application store, etc., on which a computer program is stored, and when the program is executed by a processor, a corresponding function is realized. When the computer-readable storage medium of this embodiment is executed by a processor, the smart meter data analysis and anomaly detection method of the method embodiment is realized.

Claims

1. A smart meter data analysis and anomaly detection method, characterized in that: The following steps are involved: S1, collect power usage data from smart meters in real time; S2. Input the collected electricity usage data into a pre-trained deep learning network to identify synthetic data that is similar to real electricity data but is actually theft; the deep learning network is a generative adversarial network, which generates synthetic data similar to real electricity theft data through a generator and distinguishes the synthetic data generated by the generator from the real electricity theft data through a discriminator; And use the adversarial training method to optimize the generator and discriminator by alternately training the generator and discriminator; S3, analyzing the synthetic data through a pre-built association rule model based on an association rule learning algorithm, obtaining abnormal correlations between multiple users and identifying organized group electricity theft patterns; S4. Execute response measures according to the identification results; Electricity usage data includes current, voltage, and instantaneous power consumption from the meter; The generative adversarial network is a conditional generative adversarial network based on a reverse engineering strategy, which guides the generator to generate targeted electricity theft case data by analyzing known electricity theft strategies, so as to adapt the generator to the new electricity theft strategies or new behavior patterns of the electricity theft. The input of the generator is a random noise vector, and the output is synthesized power data. The goal of the generator is to maximize the probability that the discriminator misclassifies its synthesized power data as real data; The input of the discriminator is power data, and the output is the probability value indicating that the power data is real data; the goal of the discriminator is to maximize the probability of correctly identifying real power data and to maximize the logarithmic probability of identifying synthetic power data as false data; Among them, the generative adversarial network GANs mainly consists of a pair of generator G and discriminator D; the input of the generator is a random noise vector z, and the output is the synthesized power data , the objective function of the generator is: ; Among them, G(z) represents the data generated by the generator based on the noise z, and D(G(z)) is the probability of the discriminator evaluating the generated data and using "real data" for power. The goal of the generator is to maximize the probability that the discriminator misclassifies its generated data as real data; The generator operates as follows: Input: random noise vector z; Processing: The noise vector passes through a generator network, which consists of multiple fully connected or convolutional layers. Output: Generated electricity usage data, simulating real electricity theft behavior data; The input of the discriminator is power data, and the output is a probability value, which indicates the probability that the data is real data. The objective function of the discriminator is: ; Among them, the first part The discriminator outputs the logarithmic probability of the real data x based on the real data, which is used to maximize the probability of the first part, that is, the probability of correctly identifying the real data, and the second part It is the logarithmic probability that the discriminator outputs the generated data G(z) as false data; The operation of the discriminator is as follows: Input: power data; Processing: The data passes through a discriminator network, which consists of multiple fully connected or convolutional layers. Output: probability value, indicating the probability that the input data is true data; In the scenario of power theft detection, GANs are trained to generate seemingly real power theft data; the generator imitates various possible scenarios of power theft, while the discriminator continuously learns how to distinguish between real power theft data and data generated by the generator; In adversarial training, the generator and discriminator are updated alternately, where; Discriminator update: When the generator is fixed, the discriminator parameters are improved to minimize L D ; Steps: Data preparation: prepare real data samples x and fake data samples G(z) generated by generator G; Forward propagation, input these data samples into the discriminator D, and calculate the corresponding discriminator outputs D(x) and D(G(z)); Calculate the loss and calculate L based on the output of the discriminator D ; Back propagation and parameter update, using gradient descent to calculate the loss function L D The gradient of the discriminator parameters is calculated and the parameters of the discriminator D are updated to reduce L D ; Generator update: While fixing the discriminator, adjust the parameters of the generator to minimize L G ; Steps: Generate fake data. The generator G receives random noise z and generates fake data samples G(z); Forward propagation, input the false data sample G(z) into the discriminator D, and obtain the discriminator's evaluation of the false data D(G(z)); Calculate the loss. Based on the evaluation of the discriminator, calculate the loss L of the generator G ; Back propagation and parameter update, using gradient ascent to calculate the loss function L G The gradient of the generator parameters is calculated and the parameters of the generator G are updated to increase L G ; Step S3 specifically includes the following steps: S31, extracting key features related to power usage patterns through association rule models, including peak power usage time, minimum power usage, and average power usage; S32, analyzing the periodic pattern of power consumption according to the extracted key features to generate a frequent item set, where the frequent item set includes power usage patterns that frequently appear together within a certain period of time; S33, constructing association rules based on frequent item sets, and setting support, confidence threshold and lift to evaluate and filter association rules, where the association rules reflect potential abnormal power usage associations between users; S34, using association rules to analyze the power usage relationship between multiple users, identifying patterns that are different from conventional power usage patterns, and observing user groups that show similar abnormal power usage behaviors within a certain time window; Support is the frequency of an item set appearing in all transactions, expressed as: ; Confidence is the rule The frequency of item set X appearing under the condition that it is proven to be true is expressed as: ; Promotion is the rule The increase in the probability of the target item Y appearing is expressed as: ; The generative adversarial network is improved into a conditional adversarial network, which adds a conditional vector representing the conductive characteristics. Through the improved conditional adversarial network, a reverse engineering strategy is adopted to adapt to the constantly updated stealing strategies and behavior patterns of electricity thieves. Reverse engineering specifically includes: Define the characteristics and indicators of power theft. Based on historical power theft behavior data, define the characteristics and indicators that can represent power theft behavior, including: Abnormal electricity usage: unusually high or low changes in electricity usage; Power usage time pattern: high power usage during atypical times; Physical Tampering Indicators: Signs of physical damage to the meter or signs of tampering with external equipment; Reverse engineering design: Taking features and indicators as input, design the reverse engineering module of the generator, including feature encoding and generating simulation data, where feature encoding enables the generator to accept specified power theft features as conditional inputs, and generates simulation data for training the generator to generate simulation data that conforms to the characteristics of power theft behavior based on the specified power theft features, including using conditional generative adversarial networks (cGANs) to ensure that the generated data reflects specific power theft conditions; Train the discriminator and generator. Train the discriminator to learn to distinguish between real data and simulated electricity theft data generated by the generator. Optimize the generator so that the data it generates is more difficult for the discriminator to distinguish, thereby improving its ability to reproduce real-world electricity theft behavior. Iterative optimization and verification: Through continuous iterative training, the performance of the generator and discriminator is refined, and the performance of the model is tested on an independent validation set, which contains real electricity theft behavior data and normal electricity usage data; In reverse engineering, the generator G is trained to generate data that meets the characteristics of power theft. When using conditional generative adversarial networks cGANs, the input of the generator includes not only random noise z, but also a conditional vector c, which represents the characteristics of power theft. The objective functions of the generator and the discriminator will be adjusted to consider the conditional vector c; Therefore, the objective function of the generator is updated to: ,in, represents the data generated by random noise z given the conditional vector c; Training the discriminator and generator: The task of the discriminator D is to distinguish whether the input data is real or generated by the generator. When using a conditional generative adversarial network, the input of the discriminator also includes the conditional vector c. Therefore, the objective function of the discriminator is updated as follows: ; in, and They respectively represent that under the given conditional vector c, the discriminator judges the real data x and the generated data is the true probability; In the iterative optimization phase, gradient descent and gradient ascent are used to update parameters; Discriminator parameter update: ; Generator parameter update: ; Among them, α and β are learning rates, and are the parameters of the discriminator and the generator respectively.

2. A smart meter data analysis and anomaly detection system, characterized in that: include: A data collection unit, used to collect power usage data from smart meters in real time; A deep learning analysis module is used to input the collected power usage data into a pre-trained deep learning network to identify synthetic data that is similar to real power data but is actually theft behavior; the deep learning network is a generative adversarial network, which generates synthetic data similar to real power theft behavior data through a generator and distinguishes the synthetic data generated by the generator from the real power theft data through a discriminator; And use the adversarial training method to optimize the generator and discriminator by alternately training the generator and discriminator; An association analysis unit, used to analyze the synthetic data through a pre-built association rule model based on an association rule learning algorithm, obtain abnormal correlations between multiple users, and identify organized group electricity theft patterns; A real-time response module is used to execute response measures according to the recognition results; Executing response measures includes adjusting grid management strategies or notifying relevant personnel to conduct on-site inspections; The association analysis unit specifically includes: A key feature extraction module is used to extract key features related to power usage patterns through an association rule model, including peak power usage time, minimum power usage, and average power usage; A frequent itemset construction module is used to generate frequent itemsets by analyzing the periodic pattern of electricity consumption according to the extracted key features, where the frequent itemsets include electricity usage patterns that frequently appear together within a certain period of time; The association rule construction module is used to construct association rules based on frequent item sets to reflect the potential abnormal power usage associations between users; and set the support, confidence threshold and lift to evaluate and screen the association rules; Identification module, used to analyze the power usage relationship between multiple users using association rules, identify patterns that are different from the normal power usage pattern, and observe user groups that show similar abnormal power usage behavior within a certain time window; Also included is an assessment module for assessing the extent of the theft behavior, specifically identifying the duration and frequency of the theft behavior based on the output of the deep learning analysis module, and rating the theft behavior based on the duration and frequency of the theft behavior to determine its severity; Duration calculation: The duration of the theft behavior refers to the time span of the behavior, which is calculated by identifying the timestamps of the start and end of the theft behavior; the duration is determined by subtracting the start time from the end time to obtain a time period; Frequency calculation: The frequency of theft behavior refers to the number of times the behavior occurs within a certain period of time. The frequency is determined by counting the number of theft incidents over a period of time; Rating Basis: Thefts are classified into different levels from low to high based on the calculation results of duration and frequency; When developing rating standards, combine duration and frequency to give specific definitions and ranges of different levels; divide duration and frequency into several ranges respectively, and assign a rating to each range; Analyze the scope of impact: Use the propagation network analysis algorithm to determine the scope of the impact of power theft on the power grid and users, including the areas, user groups and power facilities affected by the theft; Propagation network analysis algorithms include: Constructing a power network graph: Representing each node in the power system and the connection relationship between them in the form of a graph, where each node is an electric meter and each connection edge represents the power transmission relationship between nodes; Node centrality analysis: Node centrality analysis is performed on the constructed power network graph to identify the nodes most affected by theft. The node centrality index is used to determine the nodes with significant influence in the power grid. Betweenness centrality is used to identify key nodes in the power grid that connect different areas; Degree centrality is used to identify nodes with the most connections in the power grid; The propagation network analysis algorithm is based on node centrality analysis to identify the grid nodes or user groups most affected by the theft; The node centrality algorithm uses the following formula to calculate the centrality index of a node: Betweenness Centrality: ; Degree Centrality: ; in, represents the betweenness centrality of node v, represents the degree centrality of node v, k v is the degree of node v, is the number of shortest paths between nodes s and t, is the number of shortest paths through node v; The propagation network analysis algorithm is used to identify the propagation path of theft in the power network, understand how theft affects different areas or user groups, and by analyzing the propagation path of theft, determine which areas or user groups are more likely to be affected, so as to adjust the power grid management strategy in a targeted manner.