A bilateral sliding window event detection method
Through the event detection method of bilateral sliding window, high-frequency electrical data acquisition equipment is used to perform data preprocessing and window data calculation, which solves the problem of poor recognition effect of low-power equipment and nonlinear equipment in the prior art, and achieves efficient identification and stability improvement of load events.
Patent Information
- Application Number
- CN202210626702.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-05
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-06-05
AI Technical Summary
The existing non-invasive load monitoring technology has poor recognition effect when identifying equipment with small power differences and nonlinear devices, especially when multiple devices are turned on and off at the same time or at intervals, the recognition resolution is insufficient.
The event detection method of a bilateral sliding window is adopted, and the current and voltage data are obtained through the high-frequency electrical data acquisition device, data preprocessing and window data calculation are performed, and the active power average difference and difference sequence of the transient judgment window, event detection is used for event detection.
It realizes effective identification of instantaneous load characteristics under high-frequency sampling data, can distinguish between the transient and steady-state areas of the device turn-on and off events, improves the recognition ability of the same power equipment, and has anti-interference ability, and enhances the stability of low-power load event detection.
Smart Images

Figure CN115219783B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of non-intrusive load identification, and in particular relates to an event detection method of a bilateral sliding window. Background Art
[0002] Power load monitoring is divided into direct invasive monitoring and non-invasive methods. The direct invasive monitoring method uses new appliances or smart sockets with IoT functions to obtain the power consumption information of the equipment by connecting to the power interface of the equipment. The implementation cost is high, and if there is no new equipment, new monitoring equipment needs to be added, which is very cumbersome. Non-invasive load monitoring (NILM) installs a collector at the entrance of the power supply to collect power signal characteristics such as current, voltage, and power, perform load identification and power measurement, and realize accurate acquisition of user power consumption. It not only has the advantage of not disturbing users, but also is easy to install later and has low cost.
[0003] With the continuous development of science and technology, electrical data acquisition equipment has been continuously improved. Now there are many electrical data acquisition equipment with high-precision sampling. The electrical data collected thousands or even tens of thousands of times per second allows us to obtain more useful information about the circuit. In practical applications, previous algorithms mostly focus on load decomposition and the identification of low-frequency electrical data, and the identification effect on some devices with small power differences is poor. In addition, when multiple nonlinear electrical appliances are turned on and off at the same time or at close intervals, how to improve the identification resolution is a difficulty in this type of research. Therefore, the present invention proposes a bilateral sliding window event detection method, which uses high-frequency electrical data to perform online real-time detection of load events. It has a fast response speed and can distinguish between the transient and steady-state areas of events. The more information in high-frequency data makes it possible to identify devices with the same power. At the same time, it has outstanding anti-interference ability for the complex current waveform identification of some nonlinear devices. Summary of the invention
[0004] The purpose of the present invention is to provide an event detection method of a bilateral sliding window, which is used to identify instantaneous load characteristics under high-frequency sampling data and can effectively identify the situation of complex equipment state changes.
[0005] The event detection method of the bilateral sliding window provided by the present invention has the following specific steps.
[0006] Step 1: Electrical data acquisition;
[0007] Connect the high-frequency electrical data acquisition device to the entrance of the circuit to be tested. The acquisition device can collect the current and voltage data in the circuit at a sampling frequency of 1000Hz. After the acquisition device is turned on, all the collected data will be completely saved. The data collected every second includes 1000 <current value V, voltage value C> data pairs; from the beginning of monitoring, every second of data is entered into the cache as a group of electrical data, and a total of four groups of data D[V t ,C t ], 0≤t<4000 and then go to the next step, t represents the time, the unit is milliseconds; after that, each time a group of data is obtained and enters the cache, the data window slides back one group, that is, the first group of data is moved out of the window, the original second group of data becomes the first group of window data, the original third group of data becomes the second group of window data, the original fourth group of data becomes the third group of window data, and the newly obtained group of data becomes the fourth group of window data.
[0008] Step 2: Data preprocessing;
[0009] Step 2.1: Based on step 1, the four sets of data D obtained are divided into four window data D[0≤t<1000], D[1000≤t<2000], D[2000≤t<3000] and D[3000≤t<4000] as shown in Table 1 below. Each window has a set of data, which are respectively recorded as transient judgment window (TW), event detection window (EW), steady-state judgment window 1 (SW1) and steady-state judgment window 2 (SW2);
[0010] Table 1, bilateral sliding window
[0011] Transient judgment window (TW) Event Detection Window (EW) Steady state judgment window 1 (SW1) Steady state judgment window 2 (SW2)
[0012] Step 2.2: Preprocess the window data divided in step 2.1. The preprocessing operation includes three parts. First, multiply the current and voltage data to obtain the instantaneous power at each moment. At the same time, fill 10 data 0s at the beginning and end of the time series data list to ensure that the active power data of the same length as the original time series data can be calculated with a 20ms segment of data. The active power calculation method at each moment is as follows, where P t 、V t and C t Respectively represent the active power, instantaneous voltage and instantaneous current at time t:
[0013]
[0014] Therefore, the active power sequence of the four windows can be obtained as follows:
[0015] P TW =[P0,P1,…,P 999 ], (2)
[0016] P EW =[P 1000 ,P 1001 ,…,P1 999 ], (3)
[0017] P SW1 =[P 2000 ,P 2001 ,…,P 2999 ], (4)
[0018] P SW2 =[P 3000 ,P 3001 ,…,P 3999 ], (5).
[0019] Step 3: Window data calculation;
[0020] Step 3.1: Based on the active power sequence P of the four windows obtained in step 2 TW , P EW , P SW1 and P SW2 , first calculate the average value of their active power Mp TW 、Mp EW 、Mp SW1 and Mp SW2 , the calculation method is as follows, where sum represents the sum calculation:
[0021] Mp TW =sum(P0,P1,…,P 999 ) / 1000, (6)
[0022] Mp EW =sum(P 1000 ,P 1001 ,…,P1 999 ) / 1000, (7)
[0023] Mp SW1 =sum(P 2000 ,P 2001 ,…,P 2999 ) / 1000, (8)
[0024] Mp SW2 =sum(P 3000 ,P 3001 ,…,P 3999 ) / 1000, (9)
[0025] Step 3.2: Based on the average active power value obtained in step 3.1, calculate the relevant parameters required for event detection, which are the absolute value G1 of the difference between the average active power values of the transient judgment window and the event detection window, the absolute value G2 of the difference between the average active power values of the steady-state judgment window 1 and the steady-state judgment window 2, and the difference sequence TG of the active power between the transient judgment window and the steady-state judgment window 2. The calculation method is as follows, where abs represents absolute value calculation:
[0026] G1=abs(Mp TW -Mp EW ), (10)
[0027] G2=abs(Mp SW1 -Mp SW2 ), (11)
[0028] TG=[P 3000 -P0,P 3001 -P1,…,P 3999 -P 999 ], (12).
[0029] Step 4: Event detection;
[0030] According to the relevant parameters obtained in step 3, event detection can be judged. First, whether an event may occur is judged based on G1 and G2. If G2 <max(Mp SW1 , Mp SW2 ), and G1>1 / 2*Mp EW , indicating that a device startup event may occur, G1>1 / 2*Mp TW , indicating that a device shutdown event may occur, where max represents a calculation operation to obtain the maximum value from two values. If the above judgment conditions are not met, it can be determined that no relevant event has been detected in the current detection window;
[0031] When a possible event is detected, it is necessary to further compare the average active power of the four windows. If a possible device startup event occurs, if min(Mp SW1 , Mp SW2 )>Mp TW +γ, it means that the device power-on event is successfully detected. If there is a possibility that the device is turned off, if min(Mp SW1 , Mp SW2 ) <Mp TW +γ, it means that the device shutdown event is successfully detected, where the γ value can be determined by collecting the device operation data in advance, and the active power change is statistically calculated for the collected operation data, where the minimum active power change is the γ value.
[0032] Step 5: Return the test results;
[0033] If the detection result obtained in step 4 is an event that a device is turned on or off, the difference sequence TG calculated in step 3 is compared with the electrical operation data of the device by calculating the hash distance. The device with the smallest hash distance is the target device, and the final detection result is obtained and returned;
[0034] If the detection result obtained in step 4 is that there is no device turning on or off event, the entire detection process has not yet ended, and the process returns to step 1 to detect the data of the next second.
[0035] The bilateral sliding window event detection method provided by the present invention is a detection method for device opening and closing events for electrical data under high-frequency sampling; specifically, by connecting an electrical data acquisition device in a circuit, high-frequency current and voltage data are acquired at a sampling frequency of 1000 times per second, and 4 groups of electrical data are acquired each time; after data preprocessing, each group of data is used as a window data, and operations such as calculation and comparison are performed to achieve the recognition of the operating status of the device. The present invention uses the effective value of power for detection based on a large number of tests on the data (the effective value of power not only delays the mutation process of the data, but also takes into account the data of the previous and next segments), effectively enhancing the stability of the detection of small power load events and improving the anti-interference ability. Compared with some methods that only look at the difference between the previous and next segments of data to determine the occurrence of an event, the present invention uses a bilateral window to obtain more information from the data timing direction, and has obvious advantages in the event detection of non-invasive loads. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 The figure is a flow chart of the bilateral sliding window event detection method of the present invention. DETAILED DESCRIPTION
[0037] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and embodiments.
[0038] Example
[0039] The event detection method of the bilateral sliding window proposed by the present invention has a flow chart as shown in FIG. Figure 1 As shown, it can be divided into the following steps:
[0040] Step 1: Electrical data acquisition;
[0041] Step 2: Data preprocessing;
[0042] Step 3: Window data calculation;
[0043] Step 4: Event detection;
[0044] Step 5: Return the test results;
[0045] Each step is further described below.
[0046] Step 1, electrical data acquisition;
[0047] Connect the high-frequency electrical data acquisition device to the entrance of the circuit to be tested. The acquisition device can collect the current and voltage data in the circuit at a sampling frequency of 1000Hz. After the acquisition device is turned on, all the collected data will be completely saved. Each second of data includes 1000 <current value V, voltage value C> data pairs. After the monitoring starts, each second of data is cached as a group of electrical data. After obtaining a total of four groups of data D[V t ,C t ], 0≤t<4000, then go to the next step, t represents the time, in milliseconds. After that, each time a set of data is obtained and entered into the cache, the data window slides back one set, that is, the first set of data is moved out of the window, the original second set of data becomes the first set of window data, the original third set of data becomes the second set of window data, the original fourth set of data becomes the third set of window data, and the newly obtained set of data becomes the fourth set of window data.
[0048] Step 2, data preprocessing;
[0049] Step 2.1: Based on step 1, the four sets of data D obtained are divided into four window data D[0≤t<1000], D[1000≤t<2000], D[2000≤t<3000] and D[3000≤t<4000] as shown in Table 1 below. Each window has a set of data, which are respectively recorded as transient judgment window (TW), event detection window (EW), steady-state judgment window 1 (SW1) and steady-state judgment window 2 (SW2);
[0050] Table 1 Bilateral sliding window
[0051] Transient judgment window (TW) Event Detection Window (EW) Steady state judgment window 1 (SW1) Steady state judgment window 2 (SW2)
[0052] Step 2.2: Preprocess the window data divided in step 2.1. The preprocessing operation includes three parts. First, multiply the current and voltage data to obtain the instantaneous power at each moment. At the same time, fill 10 data 0s at the beginning and end of the time series data list to ensure that the active power data of the same length as the original time series data can be calculated with a 20ms segment of data. The active power calculation method at each moment is as follows, where P t 、V t and C t Respectively represent the active power, instantaneous voltage and instantaneous current at time t:
[0053]
[0054] Therefore, the active power sequence of the four windows can be obtained as follows:
[0055] P TW =[P0,P1,…,P 999 ],
[0056] P EW =[P 1000 ,P 1001 ,…,P1 999 ],
[0057] P SW1 =[P 2000 ,P 2001 ,…,P 2999 ],
[0058] P SW2 =[P 3000 ,P 3001 ,…,P 3999 ].
[0059] Step 3: Window data calculation;
[0060] Step 3.1: Based on the active power sequence P of the four windows obtained in step 2 TW , P EW , P SW1 and P SW2 , first calculate the average value of their active power Mp TW 、Mp EW 、Mp SW1 and Mp SW2 , the calculation method is as follows, where sum represents the sum calculation;
[0061] Mp TW =sum(P0,P1,…,P 999 ) / 1000
[0062] Mp EW =sum(P 1000 ,P 1001 ,…,P1 999 ) / 1000
[0063] Mp SW1 =sum(P 2000 ,P 2001 ,…,P 2999 ) / 1000
[0064] Mp SW2 =sum(P 3000 ,P 3001 ,…,P 3999 ) / 1000
[0065] Step 3.2: Based on the average active power value obtained in step 3.1, calculate the relevant parameters required for event detection, which are the absolute value G1 of the difference between the average active power values of the transient judgment window and the event detection window, the absolute value G2 of the difference between the average active power values of the steady-state judgment window 1 and the steady-state judgment window 2, and the difference sequence TG of the active power between the transient judgment window and the steady-state judgment window 2. The calculation method is as follows, where abs represents absolute value calculation:
[0066] G1=abs(Mp TW -Mp EW )
[0067] G2=abs(Mp SW1 -Mp SW2 )
[0068] TG=[P 3000 -P0,P 3001 -P1,…,P 3999 -P 999 ].
[0069] Step 4: Event detection;
[0070] According to the relevant parameters obtained in step 3, event detection can be judged. First, whether an event may occur is judged based on G1 and G2. If G2 <max(Mp SW1 , Mp SW2 ), and G1>1 / 2*Mp EW Indicates that a device startup event may occur, G1>1 / 2*Mp TW Indicates that a device shutdown event may occur, where max indicates a calculation operation to obtain the maximum value from two values. If the above judgment conditions are not met, it can be determined that no relevant event has been detected in the current detection window.
[0071] When a possible event is detected, it is necessary to further compare the average active power of the four windows. If a possible device startup event occurs, if min(Mp SW1 , Mp SW2 )>Mp TW +γ indicates that the device power-on event is successfully detected. If there is a possibility that the device power-off event may occur, if min(Mp SW1 , Mp SW2 ) <Mp TW+γ indicates that the device shutdown event is successfully detected, wherein the γ value can be determined by collecting the device operation data in advance, and the collected operation data is statistically calculated to obtain the active power change, wherein the minimum active power change is the γ value. In this embodiment, the event detection experiment of operation data is mainly conducted on 6 devices with the same power (400W), hair dryer, vacuum cleaner, hair dryer, hot air blower, electric iron and small electric cooker, and 4 nonlinear devices with different powers, notebook, refrigerator, microwave oven and display screen. The minimum active power change obtained by data collection is not the notebook startup operation, and the minimum value γ is 10.
[0072] Step 5: Return the test results;
[0073] If the detection result obtained in step 4 detects an event of device opening or closing, the difference sequence TG calculated in step 3 is compared with the electrical operation data of the device. The comparison method is to calculate the hash distance. The device with the smallest hash distance is the target device, and the final detection result can be obtained and returned. If the detection result obtained in step 4 is that no device opening or closing event is detected, the entire detection process is not yet completed and returns to step 1 to detect the next second of data.
[0074] In this case, this method was used to detect 5,000 state switching events of 10 types of devices in real time. The experimental results are shown in the following table. The event recognition accuracy is as high as 97% when the state of a single device switches, and the recognition accuracy is also 92% when multiple devices switch states.
[0075] Table 2 Experimental results
[0076] State switching event monitoring accuracy Single device state switching events (3000 times) 97% Multiple device status switching events (2000 times) 92% .
Claims
1. A bilateral sliding window event detection method, characterized in that: The specific steps are: Step 1: Electrical data acquisition; Connect the high-frequency electrical data acquisition device to the entrance of the circuit to be tested. The acquisition device collects the current and voltage data in the circuit at a sampling frequency of 1000 Hz; save all the collected data, and each second of data is entered into the cache as a group of electrical data. After obtaining a total of four groups of data D[V t , C t ], 0≤t<4000, then go to the next step, t represents the time, the unit is milliseconds; after that, each time a group of data is obtained and enters the cache, the data window slides back one group, that is, the first group of data is moved out of the window, the original second group of data becomes the first group of window data, the original third group of data becomes the second group of window data, the original fourth group of data becomes the third group of window data, and the newly obtained group of data becomes the fourth group of window data; Step 2: Data preprocessing; Step 2.1: The four sets of data D obtained in step 1 are divided into four window data D[0≤t<1000], D[1000≤t<2000], D[2000≤t<3000] and D[3000≤t<4000], each window has a set of data, namely transient judgment window, event detection window, steady-state judgment window 1 and steady-state judgment window 2, respectively denoted as TW, EW, SW1 and SW2; Step 2.2: Preprocess the window data divided in step 2.
1. The preprocessing operation includes three parts. First, multiply the current and voltage data to obtain the instantaneous power at each moment. At the same time, fill 10 data 0s at the beginning and end of the time series data list to ensure that the active power data of the same length as the original time series data can be calculated with a 20ms segment of data. The active power calculation method at each moment is as follows: Among them, P t 、V t and C t They represent the active power, instantaneous voltage and instantaneous current at time t respectively; thus, the active power sequences of the four windows are as follows: P TW =[P0, P1,..., P 999 ], (2) P EW =[P 1000 ,P 1001 ,...,P1 999 ], (3) P SW1 =[P 2000 ,P 2001 ,...,P 2999 ], (4) P SW2 =[P 3000 ,P 3001 ,...,P 3999 ], (5) Step 3: Window data calculation; Step 3.1: Based on the active power sequence P of the four windows obtained in step 2 TW , P EW , P SW1 and P SW2 , first calculate the average value of their active power Mp TW 、Mp EW 、Mp SW1 and Mp SW2 , calculated as follows: Mp TW =sum(P0,P1,...,P 999 ) / 1000, (6) Mp EW =sum(P 1000 ,P 1001 ,...,P1 999 ) / 1000, (7) Mp SW1 =sum(P 2000 ,P 2001 ,...,P 2999 ) / 1000, (8) Mp SW2 =sum(P 3000 ,P 3001 ,...,P 3999 ) / 1000, (9) Among them, sum represents sum calculation; Step 3.2: Based on the average active power value obtained in step 3.1, calculate the relevant parameters required for event detection, which are the absolute value G1 of the difference between the average active power values of the transient judgment window and the event detection window, the absolute value G2 of the difference between the average active power values of the steady-state judgment window 1 and the steady-state judgment window 2, and the difference sequence TG of the active power of the transient judgment window and the steady-state judgment window 2. The calculation method is as follows: G1=abs(Mp TW -Mp EW ), (10) G2=abs(Mp SW1 -Mp SW2 ), (11) TG=[P 3000 -P0,P 3001 -P1,...,P 3999 -P 999 ], (12) Among them, abs represents absolute value calculation; Step 4: Event detection; Determine event detection based on the relevant parameters obtained in step 3; First, determine whether an event may occur based on G1 and G2; If G2<max(Mp SW1 , Mp SW2 ), and G1>1 / 2*Mp EW , indicating that a device startup event may occur; If G1>1 / 2*Mp TW , indicating that a device shutdown event may occur, where max represents a calculation operation to obtain the maximum value from two values; If the above judgment conditions are not met, it can be determined that no relevant event has been detected in the current detection window; When a possible event is detected, the average values of the active power in the four windows need to be further compared; If there is a possibility that a device start event may occur, if min(Mp SW1 , Mp SW2 )>Mp TW +γ, it means that the device power-on event is successfully detected; If a device shutdown event may occur, if min(Mp SW1 , Mp SW2 )<Mp TW +γ, it means that the device shutdown event is successfully detected; The γ value is determined by collecting the equipment operation data in advance, and the active power change is statistically calculated based on the collected operation data, wherein the minimum active power change is the γ value; Step 5: Return the test results; If the detection result obtained in step 4 is an event that a device is turned on or off, the difference sequence TG calculated in step 3 is compared with the electrical operation data of the device by calculating the hash distance. The device with the smallest hash distance is the target device, and the final detection result is obtained and returned; If the detection result obtained in step 4 is that there is no device turning on or off event, then return to step 1 to detect the data of the next second.
Citation Information
Patent Citations
Transient load start-stop event rapid capturing method based on sliding window technology
CN112782465A
Transient event detection method based on composite sliding window and bilateral correction
CN114298223A