Electricity safety early warning method and system based on electric energy meter big data

By constructing electricity consumption sequences and extracting multidimensional features, and combining them with a grid search method to optimize weight combinations, the problems of misjudgment and missed detection in traditional electricity consumption detection methods are solved, and more accurate electricity safety early warning is achieved.

CN120892976BActive Publication Date: 2026-06-05BAODING ZHAOWEI SOFTWARE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BAODING ZHAOWEI SOFTWARE TECH CO LTD
Filing Date
2025-10-10
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Traditional methods for detecting abnormal electricity usage cannot adapt to the dynamic and specific behavioral patterns of users, leading to misjudgments and missed detections, and failing to ensure electricity safety.

Method used

By constructing electricity consumption sequences, extracting multidimensional features (consistency between electricity consumption and historical patterns, consistency of electricity consumption time distribution, and similarity of electricity consumption abrupt changes), and using a grid search method to optimize weight combinations, dynamically adjusting the feature contribution ratio, and setting scientific alarm thresholds, accurate electricity consumption behavior assessment can be achieved.

Benefits of technology

It enables more comprehensive and accurate assessment of electricity consumption behavior, reduces false alarms and missed alarms, and provides more scientific electricity safety early warning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120892976B_ABST
    Figure CN120892976B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data processing, more particularly, the present application relates to a power consumption safety early warning method and system based on electric energy meter big data, the method comprises: taking the current time as the cut-off point, obtaining the rolling time-of-use power consumption in the past preset period, constructing the power consumption sequence according to the time stamp; based on the power consumption sequence, extracting the first feature, the second feature and the third feature of the user; assigning the corresponding candidate weight combination to the first feature, the second feature and the third feature, and obtaining the comprehensive abnormal index of the user at the current time through weighted summation; in the process of calculating the comprehensive abnormal index, the candidate weight combination is optimized to obtain the optimal weight combination, and the optimal weight combination is combined to obtain the final comprehensive abnormal index of the user at the current time through weighted summation; if the final comprehensive abnormal index is less than the preset alarm threshold, it is determined that the current power consumption behavior of the user is abnormal. The present application can comprehensively and accurately evaluate the power consumption behavior of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing. More specifically, this invention relates to a method and system for early warning of electricity safety based on big data from electricity meters. Background Technology

[0002] With the rapid development of smart grids, smart meters, as core devices for electricity data collection, can record users' electricity consumption, voltage, current, and other data in real time, providing basic data support for power management and user behavior analysis. Against this backdrop, abnormal electricity consumption detection has become a key technical means for the safe operation of power systems, anti-theft of electricity, optimization of electricity consumption behavior, and demand management.

[0003] However, traditional methods for detecting abnormal electricity consumption mainly rely on simple threshold judgments (such as sudden increases in electricity consumption) or outlier detection based on group statistics. Because user electricity consumption behavior varies from person to person, using threshold comparisons can easily misjudge normal fluctuations (such as seasonal changes in electricity consumption) as abnormalities. Furthermore, some abnormal behaviors (such as abnormal time-of-use distribution or a sudden increase followed by a sustained deviation from the user's historical pattern) do not show significant changes in total volume, leading to a high risk of missed detections. Summary of the Invention

[0004] To address the technical problem that traditional detection methods, which are based on static methods, cannot adapt to dynamic user-specific behavior patterns, leading to misjudgments and missed detections, and thus failing to guarantee electrical safety, this invention provides solutions in the following aspects.

[0005] In the first aspect, the electricity safety early warning method based on big data from electricity meters includes:

[0006] Using the current moment as the cutoff point, obtain the rolling time-of-use electricity consumption within the preset time period in the past, perform preprocessing, and construct the electricity consumption sequence according to the timestamp;

[0007] Based on electricity consumption sequences, multidimensional features of users' electricity consumption patterns are extracted. These multidimensional features include: a first feature, a second feature, and a third feature. The first feature is used to characterize the degree of consistency between the user's current electricity consumption and historical patterns. The second feature is used to characterize the consistency between the user's electricity consumption distribution at different times of the day and historical habits. The third feature is used to quantify the similarity between current electricity consumption mutations and the user's historical normal behavior.

[0008] Assign corresponding candidate weight combinations to the first feature, second feature, and third feature, and obtain the comprehensive anomaly index of the user at the current time by weighted summation; optimize the candidate weight combinations during the calculation of the comprehensive anomaly index to obtain the optimal weight combination, and re-weight and sum the optimal weight combinations to obtain the final comprehensive anomaly index of the user at the current time.

[0009] If the final comprehensive abnormal index is less than the preset alarm threshold, the user's current electricity consumption behavior is determined to be abnormal.

[0010] Preferably, the process of obtaining the first feature includes:

[0011] The current analysis window is determined by looking back one day from the current time, and the total electricity consumption within the current analysis window is obtained.

[0012] Extract the electricity consumption data from multiple historical time windows that are exactly the same as the current analysis window in the past month from the historical electricity consumption data, and calculate the mean and standard deviation of the electricity consumption data for all historical time windows.

[0013] Calculate the absolute value of the difference between the total electricity consumption in the current analysis window and the average electricity consumption in the historical time window. Compare this absolute value with the standard deviation of electricity consumption in the historical time window to obtain the user's electricity consumption pattern matching index, which is used as the first feature.

[0014] Preferably, the process of obtaining the second feature includes:

[0015] Using the current time as a baseline, determine the analysis interval for the day and construct the current sequence and the historical baseline sequence; each element in the current sequence corresponds to the hourly electricity consumption within the analysis interval for the current day; extract all historical analysis intervals that are at the same position as the current time in the past month, take the average hourly electricity consumption of all historical analysis intervals, and construct the historical baseline sequence in chronological order;

[0016] Calculate the ratio of the current sequence to the historical baseline sequence at all times, calculate the geometric mean of all ratios and perform a nonlinear mapping to obtain the user's time-period distribution characteristics, which are then used as the second feature.

[0017] Preferably, the process of obtaining the third feature includes:

[0018] Based on the time-of-use electricity consumption over the past six months at the current moment, a local electricity consumption sequence is generated. According to the preset pattern segmentation point, the local electricity consumption sequence is divided into multiple habitual time periods, each time period representing an electricity consumption habit. All habitual time periods are clustered to obtain multiple pattern classes. The average electricity consumption of all habitual time periods contained in any pattern class is sorted in chronological order to obtain the pattern class standard sequence.

[0019] When the current time is a sudden change, the power consumption sequence before the sudden change is traced back, and its duration is the same as that of any pattern class standard sequence. The root mean square error of the power consumption sequence at the sudden change time and any pattern class standard sequence is calculated, and the matching degree of the two sequences is obtained by exponential transformation. The maximum matching degree is taken as the matching degree of the power consumption pattern at the current time and marked as the third feature.

[0020] Preferably, the process of obtaining the second feature includes:

[0021] Using the current time as the baseline, the analysis interval for the day is determined to be from 00:00 to the current time. A current sequence and a historical baseline sequence are constructed. Each element in the current sequence corresponds to the hourly electricity consumption within the analysis interval of the day. The construction process of the historical baseline sequence is as follows: extract all historical analysis intervals that are at the same position as the current time in the past month, take the average hourly electricity consumption of all historical analysis intervals, and construct the historical baseline sequence in chronological order; calculate the Euclidean distance between the current sequence and the historical baseline sequence, divide the Euclidean distance by the norm of the historical baseline sequence to obtain the standardized distance, and map the standardized distance through an exponential function to obtain the user's time period distribution characteristics, which are used as the second feature.

[0022] Preferably, the optimization employs a grid search method.

[0023] Preferably, the setting of the alarm threshold includes:

[0024] In the optimization process using the grid search method, the x-coordinate of the intersection point of the curves of normal samples and abnormal samples is used as the alarm threshold.

[0025] Secondly, an electricity safety early warning system based on big data from electricity meters includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the electricity safety early warning method based on big data from electricity meters described in any one of the above claims is implemented.

[0026] The present invention has the following beneficial effects:

[0027] 1. By acquiring the rolling time-of-use electricity consumption data from past preset periods to construct an electricity consumption sequence, and extracting multi-dimensional features of electricity consumption patterns (first feature, second feature, and third feature) from different dimensions, the system considers the degree of consistency between electricity consumption and historical patterns, the consistency between electricity consumption time distribution and historical habits, and the similarity between sudden changes in electricity consumption and historical normal behavior. This allows for a more comprehensive and accurate assessment of user electricity consumption behavior and timely detection of potential electricity safety issues.

[0028] 2. The grid search method is used to optimize the weight combination and dynamically adjust the contribution ratio of each feature according to the actual data distribution, so that the comprehensive anomaly index can better reflect the characteristics of the current power consumption scenario and reduce false alarms and missed alarms.

[0029] 3. During the optimization process, the x-coordinate value of the intersection point of the normal sample curve and the abnormal sample curve is used as the alarm threshold, making the threshold setting more scientific and enabling a more comprehensive, accurate and scientific assessment of user electricity consumption behavior. Attached Figure Description

[0030] Figure 1This is a flowchart of steps S1-S4 in the electricity safety early warning method based on big data from electricity meters, according to an embodiment of the present invention. Detailed Implementation

[0031] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.

[0032] Reference Figure 1 The electricity safety early warning method based on big data from electricity meters includes steps S1-S4, as follows:

[0033] S1: Using the current time as the cutoff point, obtain the rolling time-of-use electricity consumption within the preset time period in the past, perform preprocessing, and construct the electricity consumption sequence according to the timestamp.

[0034] In one embodiment, smart energy meters are used to achieve high-precision real-time data collection on electricity consumption. The data collection targets various user scenarios, including residential households, small shops, and office spaces. Specifically, the sampling frequency is set to at least once per hour to ensure accurate capture of electricity consumption at every point in time. The collected data focuses on hourly electricity consumption data in kilowatt-hours (kWh), and the time span covered has a dynamic rolling characteristic—it not only includes the latest electricity consumption information at the current moment but also extends to all hourly data from at least the past year, constructing an electricity consumption sequence according to timestamps.

[0035] In another embodiment, for long-term data storage needs, the system will completely retain all historical electricity consumption records, with each record corresponding to one hour of electricity consumption details, thus constructing a comprehensive historical database. To facilitate subsequent analysis and research, this data will be meticulously categorized and labeled according to different dimensions: divided by seasonal changes, such as spring, summer, autumn, and winter; differentiated by workday type, clearly marking normal working hours from Monday to Friday and weekend rest periods; and also specifically marking special dates such as statutory holidays; furthermore, when special electricity consumption events occur, such as a surge in electricity consumption due to large family gatherings, or abnormal electricity usage patterns due to equipment malfunctions or repairs, the system will automatically identify and record the specific details of these events and their corresponding time periods.

[0036] The electricity consumption data collected above may contain missing data, so linear interpolation is used to complete the data.

[0037] S2: Extract multi-dimensional features of user's electricity consumption patterns based on electricity consumption sequences. These multi-dimensional features include: first feature, second feature, and third feature.

[0038] User electricity consumption behavior exhibits certain regularities and patterns. In the long term, daily electricity consumption is typically influenced by cyclical factors (such as weekdays, weekends, and seasonal changes), and the total 24-hour electricity consumption often follows a certain pattern. Significant deviations from historical patterns may indicate anomalies, such as equipment malfunctions or illegal use. In the short term, users' electricity consumption patterns also vary significantly across different time periods of the day. For example, electricity consumption habits differ between work and rest periods, and across different lifestyles. Sudden and significant deviations in electricity consumption at certain times may suggest unexpected abnormal behavior. Furthermore, users may experience abrupt events during their electricity consumption, which could be normal (such as appliances starting up) or abnormal. Judging solely by absolute electricity consumption values ​​can easily lead to misjudgments. By constructing a database of users' historical normal patterns and matching it with current electricity consumption patterns in real time, it is possible to effectively distinguish between sudden normal and abnormal behaviors, avoiding false alarms, and accurately capturing abnormal electricity consumption behaviors that consistently deviate from normal patterns.

[0039] Therefore, by analyzing users' overall electricity consumption trends, daily electricity consumption habits, and electricity consumption behaviors from three perspectives—long-term periodicity, time distribution, and abrupt change time—we can comprehensively monitor users' electricity consumption behaviors from multiple dimensions and more accurately identify abnormal electricity consumption behaviors.

[0040] In one embodiment, a sliding 24-hour window mechanism is used to detect in real time whether the total electricity consumption of users deviates from the historical normal fluctuation range, and to assess every hour whether the total electricity consumption in the past 24 hours is abnormal.

[0041] The current analysis window is determined by looking back 24 hours from the current time. For example, if the current time is Monday 09:00, then the current analysis window is from the previous day (Sunday) 09:00 to the current time (Monday 09:00). The total electricity consumption within this current analysis window is obtained, which represents the actual total electricity consumption of users in the current assessment period. From the above S1 electricity consumption sequence, the electricity consumption of historical time windows that are exactly the same as the current analysis window in the last 4 weeks is extracted. For example, if the current analysis window is from the previous day (Sunday) 09:00 to the current time (Monday 09:00), then the electricity consumption from 09:00 on the past 4 Sundays to 09:00 on Monday needs to be extracted. The mean and standard deviation of the electricity consumption in these 4 historical time windows are calculated. The mean electricity consumption reflects the average level of user electricity consumption in the same time period and serves as a reference benchmark for judging whether the current electricity consumption is normal. The standard deviation of the electricity consumption measures the degree of dispersion of electricity consumption relative to the mean, reflecting the normal fluctuation range of user electricity consumption at this specific time.

[0042] Furthermore, the absolute value of the difference between the total electricity consumption in the current analysis window and the average electricity consumption in the historical time window is calculated. When the absolute value of the difference is greater than or equal to the standard deviation of electricity consumption in the historical time window, it is determined that the user's electricity consumption in the current analysis window is seriously deviating from the normal fluctuation range in history, and the user's electricity consumption pattern matching index is directly defined as 0. When the absolute value of the difference is within the range of the standard deviation of electricity consumption in the historical time window, it indicates that the current electricity consumption is highly consistent with the historical pattern and the electricity consumption fluctuation is normal. In this case, the user's electricity consumption pattern matching index is defined as 1 minus the ratio of the absolute value of the difference to the standard deviation of electricity consumption in the historical time window.

[0043] In one embodiment, by capturing abnormal electricity consumption behavior of users at different times of the day, the deviation of the current electricity consumption distribution from the historical average electricity consumption distribution for the same period can be measured.

[0044] Using the current time as the benchmark, the analysis interval for the day is determined to be from 00:00 to the current time. The current sequence and the historical benchmark sequence are constructed. Each element in the current sequence corresponds to the hourly electricity consumption within the analysis interval of the day. The construction process of the historical benchmark sequence is as follows: extract all historical analysis intervals that are at the same position as the current time in the past month, take the average hourly electricity consumption of all historical analysis intervals, and construct the historical benchmark sequence in chronological order.

[0045] Calculate the ratio of the current sequence to the historical baseline sequence at all times, calculate the geometric mean of all ratios and perform a nonlinear mapping to obtain the user's time-period distribution characteristics, which are then used as the second feature.

[0046] For example, the above calculation of the geometric mean of all ratios and the nonlinear mapping can be expressed by the following relation:

[0047]

[0048] In the formula, This refers to the user's time-period distribution characteristics (i.e., the second characteristic). This is the geometric mean of the ratios of the current sequence to the historical baseline sequence at all times. This represents a logarithmic function with base e.

[0049] When the above The greater the deviation from 1 (whether greater than 1 or less than 1), the higher the degree of deviation between the current electricity consumption pattern and the historical pattern. The closer to 0; when When it approaches 1, A value close to 1 indicates that the current electricity consumption pattern is quite similar to the historical pattern.

[0050] In one embodiment, firstly, a local electricity consumption sequence is generated based on the time-of-use electricity consumption over the past six months at the current moment.

[0051] Then, the standard deviation of electricity consumption is calculated using a 4-hour sliding window as an example. If the standard deviation of a certain hour is three times the standard deviation of the previous 4 hours, then that time is determined to be the pattern split point. Based on the determined split point, the local electricity consumption sequence is divided into several habitual time periods. Each time period represents a stable electricity consumption habit, and each time period contains at least 2 hours of electricity consumption to avoid short-term random fluctuations being mistaken for a stable electricity consumption pattern.

[0052] Next, the average electricity consumption, number of hours, and scene label (i.e., the scene in which the electricity consumption pattern occurs, such as summer, weekend, etc.) are extracted for each time period. Based on the similarity of these features (average electricity consumption difference less than 0.1, overlapping time range, and consistent scene), all habitual time periods are clustered to form user-specific normal pattern classes. Each pattern class contains a standard sequence, which is constructed by sorting the average electricity consumption of all habitual time periods contained in any pattern class in chronological order.

[0053] Clustering allows us to group time periods with similar electricity consumption characteristics into a single category, and to summarize complex user electricity consumption behaviors into a few typical patterns. This enables us to quickly compare the current electricity consumption pattern with these known normal patterns during subsequent real-time monitoring, determining whether the current electricity consumption is normal and improving the efficiency and accuracy of anomaly detection.

[0054] Considering that the sudden change may be caused by normal electricity usage habits (such as turning on the air conditioner or using appliances in a concentrated manner) or abnormal electricity usage (such as appliance failure or illegal electricity use), further analysis and judgment are needed.

[0055] Furthermore, if the current electricity consumption is divided by the average electricity consumption of the previous 4 hours, and the ratio is greater than 2, it means that the current electricity consumption has increased by more than twice the average electricity consumption of the previous 4 hours. This is determined to be a sudden change moment, and then the sudden change moment is subjected to pattern matching.

[0056] When the current time is a sudden change, the power consumption sequence before the sudden change is traced back, and its duration is the same as that of any pattern class standard sequence. The root mean square error of the power consumption sequence at the sudden change time and any pattern class standard sequence is calculated, and the matching degree of the two sequences is obtained by exponential transformation. The maximum matching degree is taken as the matching degree of the power consumption pattern at the current time and marked as the third feature.

[0057] In another embodiment, a calculation process for the second feature is provided:

[0058] Using the current time as the benchmark, the analysis interval for the day is determined to be from 00:00 to the current time. The current sequence and the historical benchmark sequence are constructed. Each element in the current sequence corresponds to the hourly electricity consumption within the analysis interval of the day. The construction process of the historical benchmark sequence is as follows: extract all historical analysis intervals that are at the same position as the current time in the past month, take the average hourly electricity consumption of all historical analysis intervals, and construct the historical benchmark sequence in chronological order.

[0059] Calculate the Euclidean distance between the current sequence and the historical baseline sequence, divide the Euclidean distance by the norm of the historical baseline sequence to obtain the standardized distance, and map the standardized distance through an exponential function to obtain the user's time period distribution characteristics, which are then used as the second feature.

[0060] S3: Assign corresponding candidate weight combinations to the first feature, second feature, and third feature, and obtain the comprehensive anomaly index of the user at the current time by weighted summation; optimize the candidate weight combinations in the process of calculating the comprehensive anomaly index to obtain the optimal weight combination, and re-weight and sum the optimal weight combinations to obtain the final comprehensive anomaly index of the user at the current time.

[0061] After extracting the first, second, and third features in S2 above, since these three features may have different dimensions and numerical ranges, directly performing a comprehensive calculation could lead to some features having an excessive influence on the result due to their large values. Therefore, it is necessary to standardize them to eliminate the differences in dimensions and bring them within a comparable numerical range.

[0062] Next, we define each candidate weight combination w1, w2, and w3, which correspond to the weights of the first feature, the second feature, and the third feature, respectively, and satisfy that all weights are non-negative and their sum is 1.

[0063] For each candidate's weight combination, the first feature, second feature, and third feature are weighted and summed to obtain the user's comprehensive anomaly index at the current moment.

[0064] Among these steps, the candidate weight combinations are further optimized to find the optimal weight combination, thereby more accurately distinguishing between normal and abnormal electricity consumption.

[0065] In one embodiment, a grid search method is used to traverse all possible weight combinations. The grid search method is a systematic method for searching within a given parameter space. By setting a certain step size, each parameter is discretized, and then these parameter values ​​are combined to form multiple candidate combinations, which are evaluated one by one.

[0066] For each weight combination, calculate the comprehensive anomaly index value for each sample in the historical data. Since the comprehensive anomaly index value ranges from 0 to 1, divide the comprehensive anomaly index value into 100 sub-intervals with a step size of 0.01. Count the number of normal samples and the number of anomaly samples in each interval. Ideally, anomaly samples should be concentrated in the low comprehensive anomaly index range as much as possible, and normal samples should be distributed in the high comprehensive anomaly index range as much as possible. This can clearly distinguish between normal and anomaly samples.

[0067] Furthermore, the intersection point of the curves representing the distributions of abnormal and normal samples is located, and the corresponding ordinate is calculated. This intersection point reflects the boundary between normal and abnormal samples in the distribution of comprehensive abnormal index values, and the ordinate can measure the degree of separation between the two types of samples to some extent.

[0068] Iterate through all weight combinations within the grid space and select the weight combination that minimizes the ordinate as the optimal weight combination. Maximize the separation boundary between the two types of samples, that is, minimize the area formed by the curves of normal samples and abnormal samples, as well as the region formed by these two samples and the x-axis. This allows for a more accurate distinction between normal and abnormal power consumption.

[0069] S4: If the final comprehensive abnormal index is less than the preset alarm threshold, the user's current electricity consumption behavior is determined to be abnormal.

[0070] After generating the user's final comprehensive anomaly index based on the above S3 optimal weight combination, the x-coordinate of the curve intersection point recorded during the weight optimization process is taken as the alarm threshold. If the final comprehensive anomaly index is less than this alarm threshold, it indicates that the user's current power consumption is significantly different from the historical normal mode, triggering a safety alarm; otherwise, it is determined to be normal power consumption.

[0071] The system includes a processor and a memory. The memory stores computer program instructions. When the computer program instructions are executed by the processor, the method for early warning of electricity safety based on big data of electricity meters according to the first aspect of the present invention is implemented.

[0072] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.

[0073] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for early warning of electricity safety based on big data from electricity meters, characterized in that, include: Using the current moment as the cutoff point, obtain the rolling time-of-use electricity consumption within the preset time period in the past, perform preprocessing, and construct the electricity consumption sequence according to the timestamp; Based on the electricity consumption sequence, multidimensional features of users' electricity consumption patterns are extracted. These multidimensional features of electricity consumption patterns include: first feature, second feature and third feature; The process of obtaining the first feature is as follows: Starting from the current moment, look back 24 hours to determine the current analysis window. Obtain the total electricity consumption within this current analysis window. Extract the electricity consumption of historical time windows that are exactly the same as the current analysis window from the electricity consumption sequence over the past four weeks. Calculate the absolute value of the difference between the total electricity consumption of the current analysis window and the average electricity consumption of the historical time windows. When the absolute value of the difference is greater than or equal to the standard deviation of electricity consumption in the historical time windows, define the user's electricity consumption pattern matching index as 0. When the absolute value of the difference is within the range of the standard deviation of electricity consumption in the historical time windows, define the user's electricity consumption pattern matching index as 1 minus the ratio of the absolute value of the difference to the standard deviation of electricity consumption in the historical time windows. Use the calculated electricity consumption pattern matching index as the first feature. The process of obtaining the second feature is as follows: Taking the current time as the benchmark, the analysis interval for the day is determined to be from 00:00 to the current time. The current sequence and the historical benchmark sequence are constructed. Each element in the current sequence corresponds to the hourly electricity consumption within the analysis interval of the day. The construction process of the historical benchmark sequence is as follows: Extract all historical analysis intervals that are at the same position as the current time in the past month. Take the average hourly electricity consumption of all historical analysis intervals and construct the historical benchmark sequence in chronological order. Calculate the ratio of the current sequence to the historical benchmark sequence at all times. Calculate the geometric mean of all ratios and perform nonlinear mapping to obtain the user's time period distribution characteristics, which are used as the second feature. The process of obtaining the third feature is as follows: Based on the time-of-use electricity consumption of the past six months at the current moment, a local electricity consumption sequence is generated. According to the preset pattern segmentation point, the local electricity consumption sequence is divided into multiple habitual time periods, each time period representing an electricity consumption habit. All habitual time periods are clustered to obtain multiple pattern classes. The average electricity consumption of all habitual time periods contained in any pattern class is sorted in chronological order to obtain the pattern class standard sequence. When the current moment is a sudden change moment, the electricity consumption sequence before the sudden change moment is traced back. Its duration is the same as the duration of any pattern class standard sequence. The root mean square error of the electricity consumption sequence at the sudden change moment and any pattern class standard sequence is calculated. The matching degree of the two sequences is obtained through exponential transformation. The maximum matching degree is taken as the matching degree of the electricity consumption pattern at the current moment and marked as the third feature. Assign corresponding candidate weight combinations to the first feature, second feature, and third feature, and obtain the comprehensive anomaly index of the user at the current time by weighted summation; optimize the candidate weight combinations during the calculation of the comprehensive anomaly index to obtain the optimal weight combination, and re-weight and sum the optimal weight combinations to obtain the final comprehensive anomaly index of the user at the current time. If the final comprehensive abnormal index is less than the preset alarm threshold, the user's current electricity consumption behavior is determined to be abnormal.

2. The electricity safety early warning method based on big data from electricity meters according to claim 1, characterized in that, The optimization employs a grid search method.

3. The electricity safety early warning method based on big data from electricity meters according to claim 2, characterized in that, The alarm threshold settings include: In the optimization process using the grid search method, the x-coordinate of the intersection point of the curves of normal samples and abnormal samples is used as the alarm threshold.

4. A power safety early warning system based on big data from electricity meters, characterized in that, include: The processor and memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for early warning of electricity safety based on big data of electricity meters as described in any one of claims 1-3 is implemented.