NILM event detection method based on sliding window fusion MK test and iterative fitting

CN117609760BActive Publication Date: 2026-10-27ZHEJIANG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311494555.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-10
Publication Date
2026-10-27
Estimated Expiration
2043-11-10

AI Technical Summary

Technical Problem

[0006]为了解决现有非侵入式负荷识别事件检测方法,容易将负荷信号数据的持续波动误检为有事件发生,以及确定事件发生时刻和负载进入稳态时刻准确率较低的问题,本发明提出了一种基于滑动窗融合MK检验和迭代拟合的NILM事件检测方法

Benefits of technology

[0041]1)本发明可以避免由数据波动导致的多识别事件;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117609760B_ABST
    Figure CN117609760B_ABST
Patent Text Reader

Abstract

The application relates to the field of non-intrusive load identification, and particularly discloses a NILM event detection method based on a sliding window fusion MK test and iterative fitting, which comprises the following steps: collecting high-frequency current data, storing real-time current data in a cyclic queue mode, forming a sliding window through the cyclic queue, and assembling a sliding window current effective value sequence in the queue; dividing the data in the sliding window into L sections, performing linear fitting on each section, performing MK test on the current effective value sequence I after linear fitting, judging whether the sequence I has a significant monotonic trend, and if yes, indicating that an event occurs in the sliding window; for the sliding window in which the event occurs, performing iterative linear fitting on the current effective value sequence I to find the time when the event occurs and the time when the steady state is entered; and performing load identification. The application can avoid multiple identification events caused by data fluctuations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-invasive load identification, specifically a NILM event detection method based on sliding window fusion MK test and iterative fitting. Background Technology

[0002] Based on whether the switching status of the electrical load needs to be detected beforehand, non-intrusive load identification technologies can be divided into event-based and event-free types. Event-free non-intrusive load identification technology does not require detection of electrical load switching events; it directly separates the signals of different electrical devices from the aggregated signal. Furthermore, event-free non-intrusive load identification technology has no time requirement for load identification and can perform load identification at any time. Event-based non-intrusive load identification technology, on the other hand, requires extracting features when an electrical load switching event occurs before performing load identification.

[0003] The typical workflow of event-based non-invasive load identification technology consists of four main steps: data acquisition, event detection, feature extraction, and load identification. Among these, event detection is the foundation for feature extraction and load identification; therefore, improving the accuracy and performance of event detection can significantly improve the accuracy of load identification.

[0004] Non-intrusive load identification event detection methods fall into two categories: template matching-based and probabilistic models. Template matching-based methods are susceptible to errors because the signal characteristics of the same type of equipment often change, affecting the event identification results. Currently, probabilistic model-based event detection methods are widely used, with common methods including generalized likelihood ratio, chi-square goodness of fit, Bayesian information criterion, and cumulative sum (CUSUM). However, these methods also have certain drawbacks. For example, the CUSUM algorithm is prone to falsely detecting continuous fluctuations in load power as events, and the accuracy of these algorithms in determining the timing of events and when the load enters a steady state is relatively low.

[0005] To address the aforementioned issues, the applicant proposes a NILM event detection method based on sliding window fusion of MK test and iterative fitting. This method can avoid multiple event identifications caused by data fluctuations and improve the accuracy of determining the event occurrence time and the steady-state time through iterative fitting. Summary of the Invention

[0006] To address the problems of existing non-intrusive load identification event detection methods, which are prone to misdetecting continuous fluctuations in load signal data as events and have low accuracy in determining the timing of events and the moment when the load enters a steady state, this invention proposes a NILM event detection method based on sliding window fusion of MK test and iterative fitting.

[0007] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0008] A NILM event detection method based on sliding window fusion of MK test and iterative fitting, the method comprising the following steps:

[0009] Step 1: Collect high-frequency current data and store the real-time current data using a circular queue. The circular queue forms a sliding window, and the queue contains a sequence of effective current values ​​for the sliding window. In the formula, n is the starting position of the sliding window in the current effective value sequence I, N is the length of the sliding window, and t is the time;

[0010] Step 2: Divide the data in the sliding window into L segments, perform linear fitting on each segment, and then perform the MK (Mann-Kendall) test on the current effective value sequence I after linear fitting to determine whether the current effective value sequence I has a significant monotonic trend. If there is a significant monotonic trend, it indicates that an event has occurred in this sliding window.

[0011] Step 3: For the sliding window where an event has occurred, iteratively fit a straight line to the effective current value sequence I to find the time when the event occurs and the time when it enters steady state.

[0012] Step 4: Extract transient and steady-state features based on the time of the event occurrence and the time of entering steady state, form a feature vector, and use machine learning methods to identify the load.

[0013] Furthermore, step 1 also includes: calculating Δi in the effective current value sequence I of the sliding window. n+N-1 =i n+N -i n+N-1 If Δi n+N-1 <γ, where γ is the steady-state threshold, indicates that the data at the end of the sliding window has not reached a steady state. In this case, the sliding window length is increased, N' = N + ΔN, where N is the original length of the sliding window, ΔN is the extended length, and N' is the extended sliding window length. A new sequence of effective current values ​​is constructed within the extended sliding window.

[0014] The definition of ΔN is as follows:

[0015] Let ΔN = β, where β is the average number of data sampling points for the switching event of the electrical load at the sampling frequency fs.

[0016] Furthermore, in step 2, the data within the sliding window is divided into L segments. The calculation formula for L is as follows:

[0017]

[0018] In the formula, K is the average number of data sampling points for fluctuation events of electrical load at sampling frequency fs, and σ is a user-defined weight.

[0019] Furthermore, in step 2, the process of dividing the data within the sliding window into L segments, performing linear fitting on each segment, and then performing the MK test on the current effective value sequence I after linear fitting includes: dividing the current effective value sequence i within the sliding window into L segments. n i n+1 i n+2 i n+3 ,…,i n+N-1 Divide into L segments, forming a segment sequence S = {s} j |j=1,2,3,…,L}, where the length of each segment is σK, and for each segment s j ={i 1+σk·(j-1) i 2+σk·(j-1) i 3+σk·(j-1) ,…i σk+σk·(j-1) The least squares method is used for linear fitting. Let the sequence s be... j The expression for the fitted straight line is:

[0020]

[0021] In the formula, m is the index of the effective current value data point within the sliding window, and i is the effective current value data corresponding to the index m. Let i be the average value. The average value of m. For the linear expression, k j To fit a straight line The slope, b j To fit a straight line The intercept.

[0022] Furthermore, the process of determining whether the current effective value sequence I has a significant monotonic trend in step 2, and indicating that an event has occurred within this sliding window if there is a significant monotonic trend, includes:

[0023] Substitute m = σk + σk·(j-1) into the expression for the fitted line. A new effective current value sequence I = i is formed within the sliding window. n ,i” n+1 ,i” n+2 ,i” n+3 ,…,i” n+L-1 Based on the Mann-Kendall algorithm, the calculation is performed. i" o -i” p The difference function F(i”) o -i” p The formula is as follows:

[0024]

[0025] In the formula, i” o ,i” p The effective current value in the current effective value sequence I;

[0026] Calculate the value of S. The formula for calculating S is:

[0027]

[0028] The variance of S is calculated using the following formula:

[0029]

[0030] In the formula, VAR(S) is the variance of S, L is the number of data points in I”, μ is the number of repeated data sets in I”, and Q k This represents the number of repetitions of the k-th number;

[0031] Calculate the statistic Z mk The value of is calculated using the following formula:

[0032]

[0033] When |Z mk |>Z 1-α / 2 When |Z mk | Less than Z 1-α / 2 If so, it indicates that the event was a false alarm.

[0034] The Z 1-α / 2 The specific definitions are as follows:

[0035] Based on the characteristics of the effective current change at the switching state of electrical equipment under the current environment, a significance level α is selected such that h min <Z 1-α / 2 <h max Z 1-α / 2 The detection threshold, h, is obtained from the standard normal distribution table. min Z refers to the value calculated when the current change is most significant under the current environment, assuming no electrical equipment is switched on or off. mk h max Z refers to the value calculated when the current change is most significant at the moment when the electrical equipment is switched on or off under the current environment. mk .

[0036] Further, step 3 includes: iteratively segmenting the sequence; after each segmentation, calculating the two data intervals with the largest absolute value of the slope difference; and through iterative fitting, finding two abrupt change points within the two intervals, denoted as i. αwith i β , if |i α+1 -i α |>|i α -i α-1 |and|i β+1 -i β |<|i β -i β-1 |, then i α The point represents the moment the event occurs, i β The point represents the moment when the state enters steady state; conversely, if i > 0, then i > 0. β The point represents the moment the event occurs, i α The point represents the moment when the state reaches steady state.

[0037] Furthermore, the specific process of the iterative fitting method in step 3 is as follows:

[0038] Based on each segment s in the segment sequence S obtained in step 2 j The slopes k1, k2, k2, ... k L Calculate the maximum absolute value of the slope difference between adjacent segments, μ = MAX(|k n+1 -k n |), 1≤n≤L-1, if μ=|k m+1 -k m |,1≤m≤L-1, then it indicates that the effective value of the current within the sliding window is within (i 1+σk·(m-1) i σk+σk·(m-1) There are abrupt changes within the interval; suppose that in the first segmentation of step 2, each segment s in the segment sequence S... j The number of data points is l1 = σK. Continue dividing the interval (i... 1+σk·(m-1) i σk+σk·(m-1) The data is divided into segments, and after each segment, the number of data points in each segment becomes l. λ =ceil(l1 / λ), where λ represents the nth segmentation. After each segmentation, each segment is fitted again using the linear fitting method in step 2, until l1 / λ2 is reached. λ =2, at this point, the number of data points contained in the two fitted straight lines with the largest absolute value of the slope difference is 3, and the midpoint is the effective value sequence of the sliding window current. The mutation point.

[0039] Further, step 4 specifically includes: based on the switching events obtained in the sliding window of step 2 and the event occurrence time and steady-state entry time obtained in step 3, recording the mean value of current effective value change, the range of current effective value, the second harmonic content of current, and the third harmonic content of current, forming an event feature vector, and using this feature vector to identify the load through the Stacking heterogeneous integration method to obtain the event type.

[0040] Compared with the prior art, the beneficial effects of the present invention are:

[0041] 1) This invention can avoid multiple recognition events caused by data fluctuations;

[0042] 2) This invention can improve the accuracy of determining the time of event occurrence and the time of entering steady state. Attached Figure Description

[0043] Figure 1 This is a flowchart of an NILM event detection method based on sliding window fusion of MK test and iterative fitting according to the present invention;

[0044] Figure 2 This is a flowchart of step 3 in the NILM event detection method based on sliding window fusion MK test and iterative fitting of the present invention. Detailed Implementation

[0045] The invention will now be further described with reference to the accompanying drawings.

[0046] Reference Figure 1 and Figure 2 A NILM event detection method based on sliding window fusion of MK test and iterative fitting includes the following steps:

[0047] Step 1: Collect 100Hz current data and store the real-time current data in a circular queue to form a sliding window. The sliding window contains a sequence of effective current values. In the formula, n is the starting position of the sliding window in the current effective value sequence I, and N is the length of the sliding window. The formula calculates Δi in the current effective value sequence within the sliding window. n+N-1 =i n+N -i n+N-1 If Δi n+N-1 <γ, where γ is the steady-state threshold, indicates that the data at the end of the sliding window has not reached a steady state. In this case, the sliding window length is increased, N' = N + ΔN, where N is the original length of the sliding window, ΔN is the extended length, and N' is the extended sliding window length. A new sequence of effective current values ​​is constructed within the extended sliding window.

[0048] Step 2: Divide the data within the sliding window into L segments. The formula for calculating L is as follows:

[0049]

[0050] In the formula, K is the number of average data sampling points for fluctuation events of electrical load at sampling frequency fs, and N is the length of the sliding window.

[0051] The sequence of effective current values ​​within the sliding window i n in+1 i n+2 i n+3 ,…,i n+N-1 Divide into L segments, forming a segment sequence S = {s} j |j=1,2,3,…,L}, where the length of each segment is σK, and for each segment s j ={i 1+σk·(j-1) i 2+σk·(j-1) i 3+σk·(j-1) ,…i σk+σk·(j-1) The least squares method is used for linear fitting. Let the sequence s be... j The expression for the fitted straight line is:

[0052]

[0053] In the formula, m is the index of the effective current value data point within the sliding window, and i is the effective current value data corresponding to the index m. Let i be the average value. Let m be the average value.

[0054] Substitute m = σk + σk·(j-1) into the expression for the fitted line. A new effective current value sequence I” = i” is formed within the sliding window. n ,i” n+1 ,i” n+2 ,i” n+3 ,…,i” n+L-1 Based on the Mann-Kendall algorithm, the calculation is performed. i" o -i” p The difference function F(i”) o -i” p The formula is as follows:

[0055]

[0056] The value of S is calculated using the following formula:

[0057]

[0058] The variance of S is calculated using the following formula:

[0059]

[0060] In the formula, L is the number of data points in I”, p is the number of sets of repeated data in I”, and Q k This represents the number of repetitions of the k-th number.

[0061] Calculate the statistic Z mk The value of is calculated using the following formula:

[0062]

[0063] When |Z mk |>Z 1-α / 2 When |Z mk | Less than Z 1-α / 2 If the time frame is correct, it indicates that the event is a false alarm.

[0064] Step 3: Based on the real events obtained in Step 2, extract each segment s from the segment sequence S in Step 2. j The slopes k1, k2, k2, ... k L Calculate the two terms with the largest absolute values ​​of the slope difference between adjacent segments: μ1 = MAX1(|k n+1 -k n |), μ2=MAX2(|k n+1 -k n |), 1≤n≤L-1, if μ=|k m+1 -k m |,1≤m≤L-1, then it indicates that the effective value of the current within the sliding window is within (i 1+σk·(m-1) i σk+σk·(m-1) There are abrupt changes within the interval. Suppose that in the first segmentation of step 2, each segment s in the segment sequence S... j The number of data points is l1 = σK. Continue dividing the interval (i... 1+σk·(m-1) i σk+σk·(m-1) The data is divided into segments, and after each segment, the number of data points in each segment becomes l. n =ceil(l1 / n), where n represents the nth segmentation. After each segmentation, each segment is fitted again using the linear fitting method in step 2, until l1 / n is reached. n =2, at this time the fitted line contains 3 data points, the midpoint of which is the effective value sequence of the sliding window current. Find the mutation points, and denote two mutation points within two intervals as i. α with i β , if |i α+1 -i α |>|i α -i α-1 |and|i β+1 -i β |<|i β -i β-1 |, then i α The point represents the moment the event occurs, i β The point represents the moment when the state enters steady state; conversely, if i > 0, then i > 0. β The point represents the moment the event occurs, i α The point represents the moment when the state reaches steady state.

[0065] Step 4: Based on the switching events obtained in the sliding window in Step 2 and the event occurrence time and steady-state entry time obtained in Step 3, record the mean value of current effective value change, the range of current effective value, the second harmonic content of current, and the third harmonic content of current to form an event feature vector. Use this feature vector to identify the load through the Stacking heterogeneous integration method to obtain the event type.

[0066] Finally, it should be noted that in this embodiment, ΔN, N, and K are determined according to the data sampling frequency fs. In this patent, fs = 100 Hz, ΔN = 200, N = 400, σ = 2.4, K = 15, and γ = 1.

[0067] 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 NILM event detection method based on sliding window fusion of MK test and iterative fitting, characterized in that, The method includes the following steps: Step 1: Collect high-frequency current data and store the real-time current data using a circular queue. The circular queue forms a sliding window, and the queue contains a sequence of effective current values ​​for the sliding window. In the formula, n is the starting position of the sliding window in the current effective value sequence I, N is the length of the sliding window, and t is the time; Step 2: Divide the data in the sliding window into L segments, perform linear fitting on each segment, and then perform MK test on the current effective value sequence I after linear fitting to determine whether the current effective value sequence I has a significant monotonic trend. If there is a significant monotonic trend, it indicates that an event has occurred in this sliding window. Step 3: For the sliding window where an event has occurred, iteratively fit a straight line to the current RMS value sequence I to find the time when the event occurs and the time when it enters steady state. Step 3 includes: iteratively segmenting the sequence; after each segmentation, calculating the two data intervals with the largest absolute value of the slope difference; and finding two abrupt change points within the two intervals through iterative fitting, denoted as i. α with i β ,like and , then i α The point represents the moment the event occurs, i β The point represents the moment when the state enters steady state; conversely, if i > 0, then i > 0. β The point represents the moment the event occurs, i α The point represents the moment when the state reaches steady state; The specific process of the iterative fitting method is as follows: Based on each segment in the segment sequence S obtained in step 2 slope Calculate the maximum absolute value of the slope difference between adjacent segments. , ,like This indicates that the effective value of the current within the sliding window is... There are abrupt changes within the interval; suppose that in the first segmentation in step 2, each segment in the segment sequence S... The number of data points is Continue to divide the interval After each partitioning, the number of data points in each segment becomes... ,in, This represents the nth segmentation. After each segmentation, each segment is fitted again using the linear fitting method from step 2, until... At this point, the two fitted straight lines with the largest absolute values ​​of slope difference contain 3 data points, and the midpoint is the effective value sequence of the sliding window current. The mutation point; Step 4: Extract transient and steady-state features based on the time of the event occurrence and the time of entering steady state, form a feature vector, and use machine learning methods to identify the load.

2. The NILM event detection method based on sliding window fusion of MK test and iterative fitting as described in claim 1, characterized in that, Step 1 further includes: calculating the effective current value sequence I of the sliding window. ,like In the formula, γ is the steady-state threshold, which indicates that the data at the end of the sliding window has not reached a steady state. In this case, the length of the sliding window is increased. Where N is the original length of the sliding window, and ΔN is the extended length. To determine the extended sliding window length, a new sequence of effective current values ​​is constructed within the extended sliding window. ; The definition of △N is as follows: Let ΔN = β, where β is the average number of data sampling points for the switching event of the electrical load at the sampling frequency fs.

3. The NILM event detection method based on sliding window fusion of MK test and iterative fitting as described in claim 1, characterized in that, In step 2, the data within the sliding window is divided into L segments. The formula for calculating L is as follows: In the formula, K is the average number of data sampling points for fluctuation events of electrical load at sampling frequency fs, and σ is a user-defined weight.

4. The NILM event detection method based on sliding window fusion of MK test and iterative fitting as described in claim 3, characterized in that, Step 2, which involves dividing the data within the sliding window into L segments, performing linear fitting on each segment, and then performing the MK test on the current RMS value sequence I after linear fitting, includes: dividing the current RMS value sequence within the sliding window into L segments; performing linear fitting on each segment; and then performing the MK test on the current RMS value sequence I after linear fitting. Divide into L segments to form a segment sequence The length of each data segment is σK. For each segment... Linear fitting is performed using the least squares method, assuming the sequence s j The expression for the fitted straight line is: , In the formula, m is the index of the effective current value data point within the sliding window, and i is the effective current value data corresponding to the index m. Let i be the average value. The average value of m. For the linear expression, k j To fit a straight line The slope, b j To fit a straight line The intercept.

5. The NILM event detection method based on sliding window fusion of MK test and iterative fitting as described in claim 4, characterized in that, The process of determining whether the current effective value sequence I has a significant monotonic trend in step 2, and indicating that an event has occurred within this sliding window if there is a significant monotonic trend, includes: Bundle Substitute into the fitted line expression A new sequence of effective current values ​​is formed within the sliding window. Based on the Mann-Kendall algorithm, the calculation is performed. indivual difference function The formula is as follows: , In the formula, , For the effective value sequence of current The effective value of the current in the middle; Calculate the value of S. The formula for calculating S is: , The variance of S is calculated using the following formula: , In the formula, VAR(S) is the variance of S, and L is... Number of data points for The number of sets of repeated data, Q k This represents the number of repetitions of the k-th number; Calculate the statistic Z mk The value of is calculated using the following formula: , when When this occurs, it indicates that a load switching event has occurred within the current sliding window. Less than If so, it indicates that the event was a false alarm. The The specific definitions are as follows: Based on the characteristics of current effective value changes at the switching states of electrical equipment under the current environment, a significance level α is selected, such that... ,in The detection threshold, h, is obtained from the standard normal distribution table. min Z refers to the value calculated when the current change is most significant under the current environment, assuming no electrical equipment is switched on or off. mk h max Z refers to the value calculated when the current change is most significant at the moment when the electrical equipment is switched on or off under the current environment. mk .

6. The NILM event detection method based on sliding window fusion of MK test and iterative fitting as described in claim 1, characterized in that, Step 4 specifically includes: based on the switching events obtained in the sliding window of step 2 and the event occurrence time and steady-state entry time obtained in step 3, recording the mean value of current effective value change, the range of current effective value, the second harmonic content of current, and the third harmonic content of current, forming an event feature vector, and using this feature vector to identify the load through the Stacking heterogeneous integration method to obtain the event type.