Low-frequency data commercial power consumption behavior detection method based on non-intrusive load monitoring
Patent Information
- Application Number
- CN202611236630.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-10-30
AI Technical Summary
部分商户利用夜间闭店时段进行“民电商用”违规用电,或存在夜间违规住人并使用大功率电器的安全隐患
(1)根据电能累计值序列获取电能增量序列,根据电能增量序列获取完整的平均功率序列;本发明通过针对低频数据的差值-滤波-转换预处理顺序,即采用“先计算电能增量、再执行中值滤波、最后转换为平均功率”的处理顺序,其依据在于数据噪声主要源于电能计量环节,先在源头剔除异常值可避免其污染后续功率计算结果;若调换中值滤波与功率转换的顺序,异常值将先参与功率计算并污染功率序列,即使后续再滤波也无法修正已受污染的数据,实现了对低频数据的有效处理以便于后续商超用电行为的检测精度;
Smart Images

Figure CN123015208A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power load monitoring and electricity consumption behavior analysis, and in particular to a method for detecting electricity consumption behavior in supermarkets based on low-frequency data from non-intrusive load monitoring. Background Technology
[0002] Non-intrusive load monitoring technology collects electricity consumption data at the user's main power inlet and uses algorithms to analyze the operating status and power consumption of various internal electrical appliances. It eliminates the need to install sensors on each device, offering advantages such as low cost, simple construction, and high user acceptance. Since its introduction by Professor Hart in the 1980s, this technology has developed over decades and has become an important research direction in the field of smart electricity management.
[0003] Currently, NILM technology has achieved good application results in home scenarios. Domestic and international scholars have proposed numerous load decomposition methods based on Hidden Markov Models, deep learning, and combinatorial optimization to effectively identify the operating status of household appliances such as refrigerators, washing machines, and air conditioners. Some studies have successfully applied convolutional neural networks and sequence-to-sequence models to load decomposition of residential electricity consumption data, achieving high recognition accuracy on publicly available datasets.
[0004] In the commercial building sector, a few studies have attempted to apply NILM technology to load monitoring. Some literature proposes load decomposition methods for commercial buildings based on high-frequency sampling data, achieving equipment-level power consumption monitoring by collecting voltage and current waveform data. In engineering applications, existing patents disclose fault diagnosis methods for industrial and commercial equipment based on non-intrusive load monitoring, as well as non-intrusive monitoring systems for identifying illegal power consumption in commercial premises. These solutions typically rely on high-frequency data acquisition equipment or dedicated monitoring terminals installed on the user side.
[0005] The application of NILM in commercial user scenarios still faces many challenges, and existing technical solutions mainly have the following shortcomings: Firstly, existing NILM methods largely rely on high-frequency sampling data. Numerous studies use voltage and current waveform data at the second or even millisecond level for load identification, placing high demands on the sampling frequency and computational power of the data acquisition hardware, requiring the deployment of dedicated acquisition equipment. However, the smart meters commonly deployed in supermarkets and shopping malls typically record accumulated energy values at intervals of 15 minutes or even longer. This massive amount of low-frequency data has not yet been effectively utilized in current technologies.
[0006] Secondly, there are fundamental differences between commercial and residential loads. Commercial buildings contain a wide variety of equipment with varying power levels. Lighting systems, air conditioning units, refrigerated display cases, elevators, and other equipment operate simultaneously, resulting in overlapping load characteristics that are far more difficult to decompose than in residential scenarios. Existing methods often directly apply NILM schemes for residential scenarios without fully considering the unique characteristics of commercial loads, leading to lower recognition accuracy.
[0007] Third, commercial loads exhibit strong temporal correlations. Multiple electrical devices in supermarkets and shopping malls may start and stop simultaneously according to fixed procedures or business hours. For example, lighting systems, POS systems, and air conditioning units are typically started up before opening, whereas residential loads usually do not have this characteristic. Existing methods generally assume that each device operates independently, failing to fully utilize this temporal correlation for modeling, resulting in decreased decomposition accuracy in scenarios where multiple devices start and stop simultaneously.
[0008] Fourth, there is a lack of effective technical means to monitor nighttime electricity consumption in shopping malls and supermarkets. Some merchants use the nighttime closing hours for illegal "residential electricity consumption," or there are safety hazards such as people staying at night and using high-power appliances. Traditional electricity meters can only record total electricity consumption and cannot provide equipment-level evidence of electricity consumption behavior, resulting in a lack of accurate clues for on-site inspections. Existing NILM solutions also have few specific designs for abnormal nighttime electricity consumption scenarios.
[0009] In summary, there is an urgent need for an electricity consumption behavior assessment method that can utilize existing low-frequency electricity meter data in supermarkets and shopping malls, fully consider the special characteristics and time-series correlation of commercial loads, and has practical deployment feasibility. This method would fill the technological gap in NILM applications in commercial scenarios and provide reliable technical support for the investigation of illegal electricity consumption and equipment safety management. Summary of the Invention
[0010] This invention provides a method for detecting the electricity consumption behavior of supermarkets based on low-frequency data using non-intrusive load monitoring, in order to overcome the above-mentioned technical problems.
[0011] To achieve the above objectives, the technical solution of the present invention is as follows: A method for detecting electricity consumption behavior in supermarkets based on low-frequency data from non-intrusive load monitoring, specifically including the following steps: S1: Acquire low-frequency data from the smart meter at the main power inlet of the supermarket at a preset interval; and the low-frequency data includes a sequence of cumulative energy values, three-phase current data, and power factor data; S2: Obtain the energy increment sequence from the energy accumulation sequence; obtain the complete average power sequence from the energy increment sequence; S3: Extract the nighttime average power sequence of the supermarket during the preset nighttime period from the average power sequence obtained in S2; construct the judgment baseline interval based on the nighttime average power sequence, and use a sliding window mechanism to dynamically update the judgment baseline interval to obtain the real-time judgment baseline interval; S4: Based on the real-time determination baseline interval, perform abnormal event determination on the real-time acquired power data to obtain abnormal events; and by combining the three-phase current data and power factor data, perform feature extraction on the abnormal events to obtain multi-dimensional electrical feature vectors. Furthermore, the multi-dimensional electrical feature vector includes active power increment, power factor change, A-phase current change, C-phase current change, encoding of the event occurrence time period, and event duration. S5: Construct a device feature matrix based on the multi-dimensional electrical feature vector; perform cluster analysis on abnormal events based on the feature matrix, obtain abnormal event clusters, and configure abnormal device type labels; S6: Based on step S1, real-time acquisition of test event data for electricity consumption behavior detection is performed, and corresponding test electrical feature vectors are obtained according to steps S2 to S4; based on the Euclidean distance between the test electrical feature vector and the center of each cluster in the abnormal event cluster, the test events are assigned to the nearest abnormal event cluster to output the corresponding abnormal equipment type label, thereby realizing low-frequency data supermarket electricity consumption behavior detection based on non-intrusive load monitoring.
[0012] Furthermore, step S2 specifically includes the following steps: S21: Based on the cumulative energy value sequence and Obtaining the power increment sequence The corresponding expression is:
[0013] In the formula: Represents the difference in cumulative electrical energy values at adjacent times and ; Indicates the first The cumulative electrical energy value corresponding to each interval period; Indicates the first The cumulative electrical energy value corresponding to each interval period; S22: For the electrical energy increment sequence Median filtering is performed to obtain the filtered energy increment sequence. ; S23: Based on the filtered power increment sequence Obtain the complete average power sequence and The corresponding expression is:
[0014] In the formula: Indicates the first The average power corresponding to each interval period; Indicates the duration of the sampling interval.
[0015] Furthermore, step S3 specifically includes the following steps: S31: Extract the nighttime average power sequence for the preset nighttime period of the supermarket based on step S2. According to the nighttime average power sequence Obtain the ordered sequence at night and and ; Indicates the first Nighttime power during each nighttime period; S32: Confirm the nighttime ordered sequence Does it follow a normal distribution? If so, then construct the determination baseline interval as follows: ; This represents the mean of the ordered sequence at night; The standard deviation of an ordered sequence at night; Indicate design parameters; If not, then the interquartile range method is used to construct the determination baseline interval. Q1 represents the first quartile; Q3 represents the third quartile. Indicates interquartile range and ; S33: A sliding window mechanism is used to dynamically update the judgment baseline interval to obtain the real-time judgment baseline interval; and the sliding window mechanism specifically involves: dividing the judgment baseline interval based on a preset time window length L to obtain a window dataset; performing the following operations when each preset update cycle arrives: adding the nighttime power data of the latest complete update cycle to the window dataset, while removing the nighttime power data of the earliest update cycle within the window, and simultaneously keeping the total amount of the window dataset constant L to obtain the updated window dataset; based on the updated window dataset, repeating step S32, and updating the judgment baseline interval when it is confirmed that it follows a normal distribution, or recalculating the first quartile Q1, the third quartile Q3, and the interquartile range IQR when it is confirmed that it does not follow a normal distribution, thereby updating the judgment baseline interval.
[0016] Furthermore, step S4 specifically includes the following steps: S41: Based on the real-time determination baseline interval, perform anomaly event determination on the real-time acquired power data to obtain anomaly events, specifically including: The real-time power data is compared with the established judgment baseline interval; If the real-time power is higher than the upper bound of the real-time judgment baseline interval, then the corresponding event is judged as a high-abnormal event. If the real-time power is lower than the lower bound of the real-time judgment baseline interval, then the corresponding event is judged as a low-abnormal event. If the real-time power is within the real-time determination baseline range, then the corresponding event is determined as a normal background load event. S42: Define the high-abnormal events and low-abnormal events uniformly as abnormal events; Furthermore, by combining three-phase current data and power factor data, feature extraction is performed on the abnormal event to obtain a multi-dimensional electrical feature vector. and Furthermore, the multi-dimensional electrical feature vector includes active power increments. Power factor change Change in phase A current Change in C-phase current Encoding of the time period of the event and duration of the event Its expression is:
[0017]
[0018]
[0019]
[0020]
[0021] In the formula: This represents the power at time t when the abnormal event occurs; The power factor at time t represents the time when the abnormal event occurs; This represents the A-phase current at time t when the abnormal event occurs; This represents the C-phase current at time t when the abnormal event occurs; This represents the steady-state mean value of phase A current before time t when the event occurs; This represents the steady-state mean value of the C-phase current before time t when the event occurs; Indicates the reference value for the power factor; Indicates the power reference value; This represents the time from the moment t when the event first exceeds the baseline interval to the moment when the power falls back into the baseline interval. The duration up to that point.
[0022] Furthermore, S5 specifically includes the following steps: S51: Arrange the multi-dimensional electrical feature vectors of the M abnormal events by row to obtain M 6. Equipment feature matrix; S52: The device feature matrix is normalized using Z-score standardization to obtain the normalized device feature matrix; S53: Determine the optimal number of clusters K for the K-means clustering algorithm based on the elbow rule and the normalized device feature matrix; S54: The K-means++ algorithm is used to perform cluster analysis on the normalized device feature matrix to obtain abnormal event clusters; S55: Obtain the cluster label of the abnormal event cluster to which each abnormal event belongs, and the feature vector of the cluster center of each abnormal event cluster in the normalized space; the cluster label is the abnormal device type label; S56: Restore the centers of each cluster from the normalized space to the original dimensional space to obtain the interpretable center feature vectors of each anomalous event cluster. S57: Based on the interpretable central feature vector, configure abnormal device type labels for each abnormal event cluster.
[0023] Furthermore, step S6 specifically includes the following steps: S61: Based on the test event data collected in real time in step S1 for detecting electricity consumption behavior, and according to steps S2 to S4, obtain the corresponding test electrical feature vectors. The distance between the test electrical feature vector and the center of each cluster in the abnormal event cluster is Euclidean distance; and the Euclidean distance is calculated using the following formula:
[0024] In the formula: This represents the event feature vector, i.e., the test electrical feature vector. Dimensional components; The first term represents the cluster center vector in the cluster of anomalous events. Dimensional components; S62: Based on the Euclidean distance between each test event and the center of each abnormal event cluster calculated in step S61, assign the test event to the nearest abnormal event cluster, and use the abnormal device type label corresponding to the cluster as the classification result of the test event; S63: Based on the acquired classification results, generate early warning information according to preset structured fields; and the structured fields include, in sequence, the event occurrence time, the event duration, the power increment value, the type of equipment to be judged, and the judgment basis; thereby realizing the detection and early warning of low-frequency data supermarket electricity consumption behavior based on non-intrusive load monitoring.
[0025] This invention provides a method for detecting low-frequency data on electricity consumption behavior in supermarkets based on non-intrusive load monitoring, with the following advantages: (1) Obtain the power increment sequence based on the power cumulative value sequence, and obtain the complete average power sequence based on the power increment sequence; This invention adopts the difference-filter-conversion preprocessing order for low frequency data, that is, the processing order of "first calculate the power increment, then perform median filtering, and finally convert to average power". The basis is that the data noise mainly comes from the power metering link. Removing outliers at the source can avoid them from polluting the subsequent power calculation results. If the order of median filtering and power conversion is changed, outliers will participate in the power calculation first and pollute the power sequence. Even if they are filtered again later, they cannot correct the polluted data. This realizes the effective processing of low frequency data to improve the detection accuracy of subsequent supermarket electricity consumption behavior. (2) Construct a judgment baseline interval based on the nighttime average power sequence, and use a sliding window mechanism to dynamically update the judgment baseline interval to obtain the real-time judgment baseline interval; This invention can achieve dynamic adaptive updating of the judgment baseline interval by using the IQR non-parametric baseline in conjunction with the sliding window dynamic update mechanism, effectively reducing false alarms and false negatives. (3) Extract features from abnormal events to obtain multi-dimensional electrical feature vectors; perform cluster analysis based on multi-dimensional electrical feature vectors to obtain abnormal event clusters and configure abnormal equipment type labels; the present invention can perform multi-dimensional feature fusion through multi-dimensional incremental extraction of pre-event steady-state benchmark and cluster rule solidification method to realize equipment-level power consumption behavior identification. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 The flowchart shows the low-frequency data method for detecting supermarket electricity consumption behavior based on non-intrusive load monitoring according to the present invention. Figure 2 This is a schematic diagram of the low-frequency data supermarket electricity consumption behavior assessment system based on non-intrusive load monitoring in this embodiment; Figure 3 This is a core technology block diagram of the low-frequency data supermarket electricity consumption behavior detection method based on non-intrusive load monitoring in this embodiment. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] This embodiment provides a method for detecting low-frequency data in supermarkets based on non-intrusive load monitoring. It utilizes existing 15-minute interval meter data from supermarkets and, through a data preprocessing, background load modeling, abnormal event detection, and multi-dimensional feature device identification process tailored to the supermarket scenario, achieves refined assessment and anomaly identification of supermarket electricity consumption behavior. Figure 1 As shown, the specific steps include: S1: Acquire low-frequency data from the smart meter at the main power inlet of the supermarket at a preset interval; and the low-frequency data includes a sequence of cumulative energy values, three-phase current data, and power factor data; Specifically, the sequence of accumulated electricity values recorded by the smart meters at the main power inlet of the supermarket is obtained at 15-minute intervals. The unit is kWh; three-phase voltage, three-phase current and power factor data are collected simultaneously, and the sampling interval is consistent with the cumulative energy value, which is one data point recorded every 15 minutes.
[0030] S2: Obtain the energy increment sequence from the cumulative energy value sequence; obtain the complete average power sequence from the energy increment sequence, specifically including the following steps: S21: Based on the cumulative energy value sequence and Obtaining the power increment sequence This involves calculating the difference in accumulated electrical energy values between adjacent time points to obtain the actual electrical energy consumption within each 15-minute time interval. The corresponding expression is:
[0031] In the formula: Represents the difference in cumulative electrical energy values at adjacent times and ; Indicates the first The cumulative electrical energy value corresponding to each interval period; Indicates the first The cumulative electrical energy value corresponding to each interval period; in this embodiment The unit is kWh; if If a negative value or an abnormal zero value is found, it will be removed in the subsequent median filtering step; S22: For the electrical energy increment sequence Median filtering is performed to obtain the filtered energy increment sequence. ; Specifically, in this embodiment, the power increment sequence Median filtering is performed: the filter window width is set according to the data sampling frequency, preferably 3 or 5. Specifically, for each data point in the energy increment sequence, take the data points preceding and following it (a total of [window width] data points), sort these data points by value, and then take the median. This median replaces the original value of that point. This step is used to eliminate isolated noise points caused by metering errors, instantaneous fluctuations in the power grid, or data transmission errors, while retaining the true power step characteristics generated by equipment start-up and shutdown. The filtered energy increment sequence is denoted as... .
[0032] S23: Based on the filtered power increment sequence Obtain the complete average power sequence The average power sequence for each time period is obtained by dividing each filtered power increment by the sampling interval of 0.25 hours. The corresponding expression is:
[0033] In the formula: Indicates the first The average power corresponding to each interval period; Indicates the sampling interval duration and =0.25; The unit is kW. In this embodiment, after the above steps, a complete average power time series is obtained. Furthermore, the processing sequence in step S2—"first calculate the energy increment, then perform median filtering, and finally convert to average power"—is based on the fact that data noise mainly originates from the energy metering stage. Removing outliers at the source prevents them from contaminating subsequent power calculation results. If the order of median filtering and power conversion is reversed, outliers will participate in power calculation first and contaminate the power sequence. Even subsequent filtering cannot correct the contaminated data. Therefore, the above processing sequence is irreversible.
[0034] S3: Extract the nighttime average power sequence for the preset nighttime period of the supermarket from the average power sequence obtained in S2; construct a judgment baseline interval based on the nighttime average power sequence, and dynamically update the judgment baseline interval using a sliding window mechanism to obtain the real-time judgment baseline interval. Specific steps include: S31: Based on the actual operating hours of the supermarket, extract the nighttime average power sequence for the preset nighttime period of the supermarket based on step S2. The nighttime period is defined as the period from when the supermarket closes until it opens the next day, preferably from 0:00 to 5:00 a.m. During this period, the lighting system, air conditioning system and other business-related equipment are basically turned off, and the total power is mainly contributed by the 24-hour continuous operation load of cold chain equipment, security system and other equipment.
[0035] Based on nighttime average power sequence Obtain the ordered sequence at night and and ; Indicates the first The nighttime power of each nighttime period; in this embodiment, the duration of historical data is selected as follows: the length of the data used to establish the initial baseline is preferably no less than a full natural year, i.e., 365 days, to cover the impact of seasonal temperature changes on the power consumption of cold chain equipment.
[0036] S32: Confirm the nighttime ordered sequence Does it follow a normal distribution? If so, then construct the determination baseline interval as follows: ; This represents the mean of the ordered sequence at night; The standard deviation of an ordered sequence at night; This represents the design parameters; specifically, in this embodiment, if the nighttime power data is confirmed to follow a normal distribution by the Shapiro-Wilk test or the Kolmogorov-Smirnov test, the mean can be used. and standard deviation Constructing baseline intervals Where n is preferably 2 or 3; this scheme serves as an alternative to the IQR method when the data satisfies the normal distribution assumption. If not, then the interquartile range method is used to construct the determination baseline interval. Q1 represents the first quartile; Q3 represents the third quartile. Indicates interquartile range and ; Specifically, this embodiment uses the interquartile range method: determine the first quartile Q1, i.e., the 25th quartile, and calculate the position. ,like If the value is an integer, the value at that position is directly taken (average power from 0:00 to 5:00 AM). If it is not an integer, the weighted average of two adjacent positions is taken (i.e., the nighttime power value corresponding to that quantile is calculated by weighting the distance between two adjacent values after sorting using Python programming); determine the third quartile Q3, which is the 75th quartile, and calculate the position. The method of value selection is the same as above; calculate the interquartile range. In this embodiment, the normal fluctuation range is set, which is the baseline for determination. The coefficient 1.5 is the default constant in the standard IQR method. According to statistical theory, this range can cover the normal fluctuations of the main part of the data.
[0037] S33: A sliding window mechanism is used to dynamically update the judgment baseline interval to obtain a real-time judgment baseline interval. Specifically, the sliding window mechanism involves dividing the judgment baseline interval based on a preset time window length L, preferably 30 days or 90 days, to obtain a window dataset. At the arrival of each preset update cycle, the following operations are performed: the nighttime power data of the latest complete update cycle is added to the window dataset, while the nighttime power data of the earliest update cycle (i.e., a natural day) within the window is removed, and the total amount of the window dataset is kept constant L to obtain an updated window dataset. Based on the updated window dataset, step S32 is repeated, and if a normal distribution is confirmed, the judgment baseline interval is updated; or if a non-normal distribution is confirmed, the first quartile Q1, the third quartile Q3, and the interquartile range (IQR) are recalculated to update the judgment baseline interval. In this embodiment, the update cycle is preferably set once daily, executed after the nighttime data collection of the previous day is completed in the early morning of each day. The sliding window mechanism enables the baseline to track seasonal changes in supermarket electricity load and long-term drift caused by equipment aging.
[0038] S4: Based on the real-time judgment baseline interval, abnormal events are judged and obtained from the real-time acquired power data; and by combining the three-phase current data and power factor data, feature extraction is performed on the abnormal events to obtain multi-dimensional electrical feature vectors, specifically including the following steps: S41: Based on the real-time determination baseline interval, perform anomaly event determination on the real-time acquired power data to obtain anomaly events, specifically including: The real-time acquired power data is compared with the established judgment baseline interval, and the comparison rules are as follows: If the real-time power is higher than the upper limit of the real-time judgment baseline interval, such as Q3 + 1.5×IQR, then the corresponding event is judged as a high-abnormal event. At this time, based on empirical values, the additional equipment corresponding to this type of event will be put into operation or the original load power will be increased. If the real-time power is lower than the lower bound of the real-time determination baseline interval, for example, Q1 If the value is 1.5 × IQR, the corresponding event will be classified as a low-probability event. At this time, based on the experience value, the equipment corresponding to this type of event (cold chain equipment that operates 24 hours a day) will be shut down, its power reduced, or the equipment will be shut down due to failure. If the real-time power is within the real-time determination baseline range, for example, Q1 If 1.5 × IQR ≤ P ≤ Q3 + 1.5 × IQR, then the corresponding event is classified as a normal background load event; in this case, no exception flag is triggered. In this embodiment, for the moment that is determined to be a high-abnormal event or a low-abnormal event, the occurrence time is recorded, and the power data segments before and after that moment are marked and stored as the analysis objects for subsequent steps.
[0039] S42: Define the high-abnormal events and low-abnormal events uniformly as abnormal events; and extract multi-dimensional electrical feature vectors by combining three-phase current data and power factor data. and Furthermore, the multi-dimensional electrical feature vector includes active power increments. Power factor change Change in phase A current Change in C-phase current Encoding the time period of an event based on empirical values and duration of the event In this embodiment, for each event determined to be an abnormal event, the following feature extraction operation is performed: Determine the time t when the event occurs, i.e., the time when the power first exceeds the baseline; Calculate the baseline value before the event occurs: take the average of 2 to 3 sampling points before time t as the baseline value. Specifically, the power baseline value... (When there are 3 sampling points); Power factor reference value Take the average value of corresponding values within the same time period; current reference value. and Similarly; Let the starting point of time be t0, and take the average of the three sampling points before t0 as the steady-state baseline value: ;in Representing P, PF, and I respectively A ,I C The corresponding expression is:
[0040]
[0041]
[0042]
[0043]
[0044] In the formula: This represents the power at time t when the abnormal event occurs; The power factor at time t represents the time when the abnormal event occurs; This represents the A-phase current at time t when the abnormal event occurs; This represents the C-phase current at time t when the abnormal event occurs; This represents the steady-state mean value of phase A current before time t when the event occurs; This represents the steady-state mean value of the C-phase current before time t when the event occurs; Indicates the reference value for the power factor; Indicates the power reference value; This represents the time from the moment t when the event first exceeds the baseline interval to the moment when the power falls back into the baseline interval. The duration up to this point is measured in terms of the number of sampling points. In this embodiment, the event occurrence time period code T is extracted: the 24 hours of a day are encoded by hour, and T is the number of hours corresponding to the time of the event (e.g., 8:00-9:00 is encoded as 8). S5: Construct a device feature matrix based on the multi-dimensional electrical feature vector; perform cluster analysis on abnormal events based on the feature matrix, obtain abnormal event clusters, and configure abnormal device type labels; in this embodiment, the training set is defined as data from earlier time periods divided in chronological order, preferably the first 9 months of the announced historical data, specifically including the following steps: S51: Arrange the multi-dimensional electrical feature vectors of the M abnormal events by row to obtain M 6. Device feature matrix X; S52: Z-score standardization is used to normalize the device feature matrix to obtain a normalized device feature matrix; specifically, Z-score standardization is used to normalize the feature matrix to eliminate the influence of different units on the clustering results; the standardization formula is as follows: ;in This represents the mean of the feature on the training set; This represents the standard deviation of the feature on the training set; after standardization, the mean of each feature is 0 and the standard deviation is 1. S53: Based on the Elbow Method, determine the optimal number of clusters K for the K-means clustering algorithm according to the normalized device feature matrix; the specific operation is as follows: let K take values from 2 to 8, run K-means clustering for each K value and calculate the sum of squared errors between clusters SSE, plot the curve of SSE changing with K value, and take the K value corresponding to the inflection point of the curve as the optimal number of clusters. S54: The K-means++ algorithm is used to perform cluster analysis on the normalized device feature matrix to obtain abnormal event clusters; specifically, the K-means++ algorithm is used for clustering, which improves the stability of the clustering results by optimizing the initial centroid selection strategy; setting That is, the algorithm runs with 10 different random seeds and selects the optimal result; S55: Obtain the cluster label of the abnormal event cluster to which each abnormal event belongs, and the feature vector of the cluster center of each abnormal event cluster in the normalized space; the cluster label is the abnormal device type label; S56: Restore the cluster centers from the normalized space to the original dimensional space to obtain the interpretable center feature vector of each anomalous event cluster; wherein, the vector contains the typical values of each cluster event in each feature dimension; S57: Based on the interpretable central feature vector, configure abnormal equipment type labels for each abnormal event cluster. Specifically, based on the physical meaning of the central feature vector of each cluster, combined with the prior knowledge of electricity consumption of typical supermarket equipment, label each cluster with equipment type. The labeling criteria include the magnitude of the power increment (high power corresponds to air conditioning units, medium power corresponds to lighting systems), the direction and magnitude of the power factor change (significant decrease in power factor corresponds to motor equipment, no significant change corresponds to resistive loads), the phase of the current change (all three phases change corresponds to three-phase equipment, single-phase change corresponds to single-phase equipment), and the regularity of the occurrence time. After labeling, a feature library of supermarket electrical equipment is formed, which contains standard feature templates for each equipment type. This embodiment also includes converting the clustering results into interpretable judgment rules as the basis for automatic classification of subsequent test sets. Example rules are as follows: If and If so, it is determined to be an air conditioner main unit event; if and If the event occurs during the nighttime period (0:00-5:00) and..., it is classified as a lighting system event; if the event occurs during the nighttime period (0:00-5:00) and... If the single-phase current change is significant, it is determined to be a suspected abnormal power consumption event; S6: Based on the real-time acquisition of test event data for electricity consumption behavior detection in step S1, and according to steps S2 to S4, obtain the corresponding test electrical feature vectors to achieve low-frequency data-based detection of supermarket electricity consumption behavior based on non-intrusive load monitoring. In this embodiment, the test set is defined as data from later time periods divided in chronological order, preferably the last 3 months of all historical data. The test set data does not participate in any parameter calculations during the training process in step S6 to ensure the objectivity of the verification results. Specifically, the steps include: S61: Based on the test event data collected in real time in step S1 for detecting electricity consumption behavior, and according to steps S2 to S4, obtain the test electrical feature vector corresponding to each abnormal event on the test set. The distance between the test electrical feature vector and the center of each cluster in the abnormal event cluster is Euclidean distance; and the Euclidean distance is calculated using the following formula:
[0045] In the formula: This represents the event feature vector, i.e., the test electrical feature vector. Dimensional components; The first term represents the cluster center vector in the cluster of anomalous events. Dimensional components; S62: Based on the Euclidean distance between each test event and the center of each abnormal event cluster calculated in step S61, the test event is assigned to the nearest abnormal event cluster, and the abnormal device type label corresponding to the cluster is used as the classification result of the test event; this embodiment also includes statistical classification results: calculating evaluation indicators such as accuracy (number of correctly classified events / total number of events) and recall (number of correctly detected events in each category / actual number of events in that category) to evaluate the generalization ability of the method described in this embodiment on data in unknown time periods; S63: Based on the acquired classification results, early warning information is generated according to preset structured fields; and the structured fields sequentially include the event occurrence time, event duration, power increment value, determination device type, and determination basis; thereby realizing low-frequency data-based detection and early warning of supermarket electricity consumption behavior based on non-intrusive load monitoring. In this embodiment, the early warning information is output in a structured data format, which can be used to support subsequent management actions such as on-site inspections by the power supply company and maintenance and inspection of supermarket equipment.
[0046] Based on the same inventive concept as the method described in this embodiment, this embodiment also includes a low-frequency data-based supermarket electricity consumption behavior assessment system based on non-intrusive load monitoring, such as... Figure 2 It includes, as shown: The data acquisition module is located at the main power distribution cabinet of the supermarket and is connected to the data interface of the existing smart meters in the supermarket. It is used to collect the cumulative value of electricity, three-phase voltage, three-phase current and power factor data every 15 minutes and transmit the data to the system master station through the communication network. The data preprocessing module, connected to the data acquisition module, is used to receive raw power data, calculate the difference between the cumulative power values at adjacent times to obtain the power increment sequence, perform median filtering on the power increment sequence to remove isolated noise points, and divide the filtered power increment by the sampling interval to convert it into an average power sequence. The baseline modeling module, connected to the data preprocessing module, is used to extract data for a preset nighttime period from the average power sequence. It calculates the first quartile Q1, the third quartile Q3, and the interquartile range IQR using the interquartile range method, and sets the determination baseline interval [Q1]. [1.5×IQR, Q3 + 1.5×IQR], and recalculate the baseline parameters when the preset update cycle is reached through a sliding window mechanism; The event detection module, connected to the baseline modeling module, is used to receive real-time power data and compare it with the judgment baseline. If the real-time power is higher than the upper limit of the baseline, it is judged as a high abnormal event; if it is lower than the lower limit of the baseline, it is judged as a low abnormal event; if it is within the range, it is regarded as normal background load, and the event occurrence and power data fragments are recorded. The feature extraction module, connected to the time detection module, is used to extract a multi-dimensional electrical feature vector for each abnormal event. This feature vector contains six dimensions: active power increment, power factor change, phase current change, event occurrence time encoding, and event duration. The clustering analysis module, connected to the feature extraction module, is used to perform Z-score standardization on the feature vector matrix of all events on the training set, use the K-means++ algorithm to perform clustering and determine the optimal number of clusters K through the elbow rule, obtain the cluster center feature vector of each cluster, and label the equipment type with the prior knowledge of electricity consumption of typical equipment in supermarkets, forming a feature library of electricity consumption equipment in supermarkets. The device identification module is connected to the feature extraction module and the clustering analysis module respectively. It is used to calculate the Euclidean distance between the feature vector of each event and each coarse center in the device feature library on the test set, assign the event to the nearest cluster and output the corresponding device type label. The early warning output module, connected to the device identification module, is used to generate and output structured early warning information based on the detection results of events judged as abnormal power consumption or equipment failure times. The early warning information includes fields such as the event occurrence, duration, power increment, device type, and judgment basis.
[0047] The method described in this embodiment is as follows: Figure 3 As shown, this falls under the intersection of smart electricity consumption and electricity demand-side management technologies. It can be widely applied to business areas such as refined electricity consumption management for commercial users, investigation of electricity violations, and monitoring of equipment operation status. Examples of its applications include: Application Example 1: Nighttime Background Load Modeling and Anomaly Detection in Supermarkets Using a central supermarket as an example, electricity meter data for 365 days, from January 1, 2024 to December 31, 2024, was obtained. Phase B of the supermarket had no load connected; actual electricity consumption was concentrated on phases A and C. The supermarket was closed from 0:00 to 5:00 daily, and its main operating equipment included refrigerated display cases, cold chain equipment, and security systems, which operated continuously 24 hours a day. Step S2 processed the cumulative electricity data for all 12 months: first, the difference every 15 minutes was calculated to obtain the electricity increment sequence; then, a median filter with a window size of 3 was used to denoise the electricity increment sequence; finally, the filtered electricity increment was divided by 0.25 hours to convert it into an average power sequence. The processed data showed that the supermarket's average nighttime power fluctuated between 4kW and 6kW. Step S3 extracted the data sequence for the entire year from 0:00 to 5:00 nighttime. The nighttime data from 365 days were sorted in ascending order of numerical value, and Q1=4.2kW, Q3=5.8kW, and IQR=1.6kW were calculated. The baseline range was determined to be [1.8kW, 8.2kW]. That is, the supermarket's nighttime power consumption within the range of 1.8kW to 8.2kW was considered normal background load, and power values exceeding this range were considered abnormal events. Data from January to September was used as the training set, and data from October to December was used as the test set. Event detection was performed according to step S4. A total of 156 abnormal events were detected on the training set, including 132 power increase events above the upper limit and 24 power decrease events below the lower limit. Feature extraction and cluster analysis were performed on the 156 events in the training set according to step S6. Using the elbow rule, the final number of clusters was determined to be K=4, resulting in four clusters. The cluster centers were labeled according to the physical meaning of their feature vectors: the central feature of cluster 0 was... The simultaneous increase in three-phase current is labeled as an air conditioning unit type event; the central characteristic of cluster 1 is... The three-phase current balance change is labeled as a lighting system event; the central feature of cluster 2 is... Only the three-phase current changes are significant, which is labeled as a single-phase high-power equipment event. The central feature of cluster 3 is... The simultaneous decrease in three-phase current was labeled as an equipment shutdown event. Following step S7, the clustering results were applied to the test set. From October to December, the test set detected 41 abnormal events. After matching with the feature library, the classification results were: 38 correctly classified, 3 incorrectly classified, with a classification accuracy of 92.7%.
[0048] Application Example 2: Identification and On-site Verification of Illegal Electricity Use at Night In the early morning of July 15, 2024, the system detected a highly abnormal event during event detection at a supermarket according to step S4. The event occurred at 2:00 AM and lasted for approximately 2.5 hours (before subsiding at 4:30 AM). At the time of the event, the implemented power surged from 5.4kW to 18.7kW. The power factor decreased from 0.94 to 0.78. The phase A current increased from 22A to 58A, while the phase C current showed no significant change. Following step S4, the feature vector for this event was extracted as F=[13.5,0.16,36,1.5,2,10], where... , The time period code T=2 (corresponding to 2:00 AM) and the duration D=10 sampling points (2.5 hours). Step S6 matches the event feature vector with the equipment feature library. The feature library contains four cluster centers: air conditioning unit cluster [66,0.20,85,82,8,13], lighting system cluster [33,0.03,42,41,8,32], single-phase equipment cluster [14,0.17,19,0.8,2.5,4], and equipment shutdown cluster [-8,0.02,-10,-9.5,3.5,6]. After calculating the Euclidean distance, the event has the smallest distance to the single-phase equipment cluster, thus classifying it as a single-phase high-power equipment event. Based on a comprehensive assessment of business rules: the event occurred during the nighttime closing period, with a significant decrease in power factor (indicating an inductive load such as a motor), and only phase A current increased (indicating a single-phase device connection). These three factors combined do not conform to the normal nighttime equipment operation mode of supermarkets. Therefore, step S8 is triggered, generating the following warning information: "Event Time: July 15, 2024, 02:00-4:30; Power Increment: 13.5kW; Equipment Type: Single-phase high-power motor; Judgment Basis: Nighttime period, power factor decrease of 0.16, only phase A current increase; Recommended Action: On-site verification of any illegal electricity usage." Following an on-site inspection by the power company's inspectors the following day, it was confirmed that the shop had used a single-phase high-power appliance for non-commercial activities after closing time, constituting a breach of "residential commercial electricity usage" regulations. The system output was consistent with the on-site inspection results.
[0049] Application Example 3: Cold Chain Equipment Fault Early Warning and Cargo Damage Preservation At 3:00 AM on August 3, 2024, the system detected a low-level anomaly event. Real-time power decreased from the normal nighttime power of 5.6kW to 3.2kW. The power factor changed from 0.92 to 0.9. The current in phase A increased from 24A to 15A, and the current in phase C increased from 23A to 14A, with all three phases decreasing synchronously. The feature vector of this event is F=[-2.4,0.02,-9,-9,3,4]. After matching with the equipment feature library, it is closest to the equipment shutdown cluster and is determined to be an equipment shutdown event. Step S8 generates a warning message: "Event time: August 3, 2024, 03:00; Power change: -2.4kW; Equipment type: Equipment shutdown / fault; Suggested action: Check the operating status of cold chain equipment." After receiving the warning, the supermarket manager checked when opening the store that morning and confirmed that a compressor failure in a freezer caused the freezer to stop operating. Because the problem was discovered in time, the frozen food stored in the freezer had not yet thawed and was all transferred to other freezers for storage, avoiding spoilage and loss of goods due to prolonged equipment shutdown. This system is several hours ahead of the traditional manual inspection method in terms of the timeliness of equipment failure, demonstrating the practical application value of this invention.
[0050] This embodiment also includes a comparative example: a comparison between the traditional threshold method and the method described in this embodiment. To illustrate the technical effectiveness of the method described in this embodiment, a comparative experiment was conducted on the same dataset using the traditional fixed threshold method and the method described in this embodiment. The traditional fixed threshold method uses 1.2 times the average nighttime power throughout the year as the upper bound for fixed judgment and 0.8 times the average as the lower bound for fixed judgment.
[0051] The experimental dataset consisted of the entire 2024 data from a medium-sized supermarket mentioned above. The results showed that the traditional fixed threshold method had a high false alarm rate during the summer months (June to August) due to generally higher nighttime loads, generating 47 false alarms; and a high missed alarm rate during the winter months (December to February of the following year) due to generally lower nighttime loads, resulting in 23 missed alarms. The method described in this embodiment uses an IQR baseline combined with a 30-day sliding window for dynamic updates. The upper limit of the summer baseline was automatically adjusted to approximately 9.0 kW, and the upper limit of the winter baseline was automatically adjusted to approximately 7.5 kW, resulting in 6 false alarms and 3 missed alarms throughout the year.
[0052] Comparative experimental results show that, compared with the fixed threshold method, the method described in this embodiment reduces the false alarm rate by about 87.2% and the false negative rate by about 87.0%, which fully demonstrates the superiority and necessity of the sliding window dynamic baseline mechanism in the scenario of seasonal load changes in supermarkets.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting low-frequency data on supermarket electricity consumption behavior based on non-intrusive load monitoring, characterized in that, Specifically, the following steps are included: S1: Acquire low-frequency data from the smart meter at the main power inlet of the supermarket at a preset interval; and the low-frequency data includes a sequence of cumulative energy values, three-phase current data, and power factor data; S2: Obtain the energy increment sequence from the energy accumulation sequence; obtain the complete average power sequence from the energy increment sequence; S3: Extract the nighttime average power sequence of the supermarket during the preset nighttime period from the average power sequence obtained in S2; construct the judgment baseline interval based on the nighttime average power sequence, and use a sliding window mechanism to dynamically update the judgment baseline interval to obtain the real-time judgment baseline interval; S4: Based on the real-time determination baseline interval, perform anomaly event determination on the real-time acquired power data to obtain anomaly events; Furthermore, by combining three-phase current data and power factor data, feature extraction is performed on the abnormal event to obtain a multi-dimensional electrical feature vector; Furthermore, the multi-dimensional electrical feature vector includes active power increment, power factor change, A-phase current change, C-phase current change, encoding of the event occurrence time period, and event duration. S5: Construct a device feature matrix based on the multi-dimensional electrical feature vector; perform cluster analysis on abnormal events based on the feature matrix, obtain abnormal event clusters, and configure abnormal device type labels; S6: Based on step S1, collect test event data of the behavior detection of the electrical equipment in real time, and obtain the corresponding test electrical feature vector according to steps S2 to S4; Based on the Euclidean distance between the test electrical feature vector and the center of each cluster in the abnormal event cluster, the test event is assigned to the nearest abnormal event cluster to output the corresponding abnormal equipment type label, thereby realizing the detection of low-frequency data supermarket electricity consumption behavior based on non-intrusive load monitoring.
2. The method for detecting low-frequency data of supermarket electricity consumption behavior based on non-intrusive load monitoring according to claim 1, characterized in that, S2 specifically includes the following steps: S21: Based on the cumulative energy value sequence and Obtaining the power increment sequence The corresponding expression is: In the formula: Represents the difference in cumulative electrical energy values at adjacent times and ; Indicates the first The cumulative electrical energy value corresponding to each interval period; Indicates the first The cumulative electrical energy value corresponding to each interval period; S22: For the electrical energy increment sequence Median filtering is performed to obtain the filtered energy increment sequence. ; S23: Based on the filtered power increment sequence Obtain the complete average power sequence and The corresponding expression is: In the formula: Indicates the first The average power corresponding to each interval period; Indicates the duration of the sampling interval.
3. The method for detecting low-frequency data of supermarket electricity consumption behavior based on non-intrusive load monitoring according to claim 2, characterized in that, S3 specifically includes the following steps: S31: Extract the nighttime average power sequence for the preset nighttime period of the supermarket based on step S2. According to the nighttime average power sequence Obtain the ordered sequence at night and and ; Indicates the first Nighttime power during each nighttime period; S32: Confirm the nighttime ordered sequence Does it follow a normal distribution? If so, then construct the determination baseline interval as follows: ; This represents the mean of the ordered sequence at night; The standard deviation of an ordered sequence at night; Indicate design parameters; If not, then the interquartile range method is used to construct the determination baseline interval. Q1 represents the first quartile; Q3 represents the third quartile. Indicates interquartile range and ; S33: A sliding window mechanism is used to dynamically update the judgment baseline interval to obtain the real-time judgment baseline interval; and the sliding window mechanism specifically involves: dividing the judgment baseline interval based on a preset time window length L to obtain a window dataset; performing the following operations when each preset update cycle arrives: adding the nighttime power data of the latest complete update cycle to the window dataset, while removing the nighttime power data of the earliest update cycle within the window, and simultaneously keeping the total amount of the window dataset constant L to obtain the updated window dataset; based on the updated window dataset, repeating step S32, and updating the judgment baseline interval when it is confirmed that it follows a normal distribution, or recalculating the first quartile Q1, the third quartile Q3, and the interquartile range IQR when it is confirmed that it does not follow a normal distribution, thereby updating the judgment baseline interval.
4. The method for detecting low-frequency data of supermarket electricity consumption behavior based on non-intrusive load monitoring according to claim 3, characterized in that, S4 specifically includes step: S41: Based on the real-time determination baseline interval, perform anomaly event determination on the real-time acquired power data to obtain anomaly events, specifically including: The real-time power data is compared with the established judgment baseline interval; If the real-time power is higher than the upper bound of the real-time judgment baseline interval, then the corresponding event is judged as a high-abnormal event. If the real-time power is lower than the lower bound of the real-time judgment baseline interval, then the corresponding event is judged as a low-abnormal event. If the real-time power is within the real-time determination baseline range, then the corresponding event is determined as a normal background load event. S42: Define the high-abnormal events and low-abnormal events uniformly as abnormal events; Furthermore, by combining three-phase current data and power factor data, feature extraction is performed on the abnormal event to obtain a multi-dimensional electrical feature vector. and Furthermore, the multi-dimensional electrical feature vector includes active power increments. Power factor change Change in phase A current Change in C-phase current Encoding of the time period of the event and duration of the event Its expression is: In the formula: This represents the power at time t when the abnormal event occurs; The power factor at time t represents the time when the abnormal event occurs; This represents the A-phase current at time t when the abnormal event occurs; This represents the C-phase current at time t when the abnormal event occurs; This represents the steady-state mean value of phase A current before time t when the event occurs; This represents the steady-state mean value of the C-phase current before time t when the event occurs; Indicates the reference value for the power factor; Indicates the power reference value; This represents the time from the moment t when the event first exceeds the baseline interval to the moment when the power falls back into the baseline interval. The duration up to that point.
5. The method for detecting low-frequency data of supermarket electricity consumption behavior based on non-intrusive load monitoring according to claim 4, characterized in that, S5 specifically includes the following steps: S51: Arrange the multi-dimensional electrical feature vectors of the M abnormal events by row to obtain M 6. Equipment feature matrix; S52: The device feature matrix is normalized using Z-score standardization to obtain the normalized device feature matrix; S53: Determine the optimal number of clusters K for the K-means clustering algorithm based on the elbow rule and the normalized device feature matrix; S54: The K-means++ algorithm is used to perform cluster analysis on the normalized device feature matrix to obtain abnormal event clusters; S55: Obtain the cluster label of the abnormal event cluster to which each abnormal event belongs, and the feature vector of the cluster center of each abnormal event cluster in the normalized space; the cluster label is the abnormal device type label; S56: Restore the centers of each cluster from the normalized space to the original dimensional space to obtain the interpretable center feature vectors of each anomalous event cluster. S57: Based on the interpretable central feature vector, configure abnormal device type labels for each abnormal event cluster.
6. The method for detecting low-frequency data of supermarket electricity consumption behavior based on non-intrusive load monitoring according to claim 5, characterized in that, S6 specifically includes the following steps: S61: Based on the test event data collected in real time in step S1 for detecting electricity consumption behavior, and according to steps S2 to S4, obtain the corresponding test electrical feature vectors. The distance between the test electrical feature vector and the center of each cluster in the abnormal event cluster is Euclidean distance; and the Euclidean distance is calculated using the following formula: In the formula: This represents the event feature vector, i.e., the test electrical feature vector. Dimensional components; The first term represents the cluster center vector in the cluster of anomalous events. Dimensional components; S62: Based on the Euclidean distance between each test event and the center of each abnormal event cluster calculated in step S61, assign the test event to the nearest abnormal event cluster, and use the abnormal device type label corresponding to the cluster as the classification result of the test event; S63: Based on the acquired classification results, generate early warning information according to preset structured fields; and the structured fields include, in sequence, the event occurrence time, the event duration, the power increment value, the type of equipment to be judged, and the judgment basis; thereby realizing the detection and early warning of low-frequency data supermarket electricity consumption behavior based on non-intrusive load monitoring.
