Event detection method, system, device and storage medium for periodic multi-state electrical appliances
Through the improved CUSUM algorithm and waveform matching technology, combined with the clustering method, the problem of low accuracy of periodic multi-state electrical event detection in the prior art is solved, and higher recognition accuracy and feature extraction accuracy are achieved.
Patent Information
- Application Number
- CN202110847311.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-27
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-07-27
AI Technical Summary
When the existing event detection method based on probability model is used to detect events on periodic multi-state electrical appliances, the detection accuracy is low, and it is prone to missed detection and miscalculation, which affects the load decomposition results.
The improved CUSUM algorithm is used to detect the start and stop waveform on the current data and match it with the standard waveform in the periodic waveform database. The waveform with the highest similarity is filtered through the DTW distance, and the waveform database is constructed and updated in combination with the clustering method to improve the Detection accuracy.
It effectively reduces the probability of missed detection of start and stop events, improves the recognition accuracy of event detection, and ensures the accuracy of subsequent feature extraction.
Smart Images

Figure CN113642421B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of non-intrusive load identification, and in particular to an event detection method and system, device, and computer-readable storage medium for periodic multi-state electrical appliances. Background Art
[0002] At present, load monitoring is divided into two types: non-intrusive and intrusive. Non-intrusive load monitoring (NILM) is designed to monitor the opening and closing operations of equipment, working hours and other related information. NILM decomposes the total power consumption into the power consumption of a single device. Compared with intrusive load monitoring, it has the advantages of low cost, easy installation, disassembly and maintenance. NILM mainly includes three steps, namely event detection, feature extraction and load identification. Both feature extraction and load identification are based on event detection. Therefore, ensuring the accuracy of event detection is the key to NILM monitoring.
[0003] At present, event detection methods are mainly divided into two categories: heuristic methods and probability model methods. Heuristic methods are based on intuition or experience, formulate rules to detect the moment of signal mutation, detect events in the total active power signal by calculating the absolute value of the difference between two consecutive sample points, and then compare it with the predefined threshold. Due to the diversity and differences of event detection, the missed detection rate and false detection rate of the detection results obtained by intuitive experience are high, so heuristic methods are less used. The event detection method based on probability model detects the moment when a change occurs in the distribution of elements or distribution parameters in a sequence, which is essentially a problem of statistical judgment hypothesis. In the context of NILM, there are four main methods for detecting changes in electrical quantity signals: generalized likelihood ratio (GLRT), chi-square goodness of fit, Bayesian information criterion (BIC) and cumulative sum (CUSUM) method. Among them, GLRT detects the occurrence of new events by deriving a decision function from the logarithmic probability distribution ratio before and after the potential change of the mean value. Since the logarithmic probability distribution ratio is calculated based on the potential change of the mean value, the change of the current characteristic value is not obvious, and the detection effect is poor; the chi-square goodness of fit detects events by judging whether two adjacent windows share the same distribution. The window distribution is affected by the window setting, which can easily lead to errors in the results; BIC divides the observed random sample sequence into uniform segments and uses the likelihood criterion function with model complexity penalty to make event judgments; the CUSUM algorithm detects events by judging whether the cumulative sum exceeds the threshold. When periodic electrical appliances are started, there may be missed detections for small current changes.
[0004] However, when the above four event detection methods based on probability models are used to detect events on periodic multi-state appliances, since the load changes of periodic multi-state appliances within a cycle are more complex, such as washing machines, induction cookers, microwave ovens and other multi-state appliances, especially when multiple loads with periodic waveforms change state at the same time, it is more difficult to distinguish and identify, and the recognition accuracy needs to be improved. It is easy to miss or misdetect, and the load characteristics are more difficult to extract, which seriously affects the results of load decomposition. Summary of the invention
[0005] The present invention provides an event detection method and system, device, and computer-readable storage medium for a periodic multi-state electrical appliance to solve the technical problem that the detection accuracy of the existing event detection method based on probability model needs to be improved when performing event detection on a periodic multi-state electrical appliance.
[0006] According to one aspect of the present invention, there is provided a method for detecting an event of a periodic multi-state electrical appliance, comprising the following contents:
[0007] Acquire total load current data, wherein the total load current data is a current effective value time series;
[0008] Using an improved CUSUM algorithm to detect the start-stop waveform on the current effective value time series;
[0009] The obtained start-stop waveform is matched with the standard waveform in the periodic waveform database, which stores standard waveforms based on the start and stop of various periodic multi-state electrical appliances. If multiple consecutive waveform matches are with the same electrical appliance, it is considered that the appliance has started and stopped.
[0010] Furthermore, the process of waveform matching the obtained start-stop waveform with the standard waveform in the periodic waveform database includes the following contents:
[0011] The DTW distance between the obtained start-stop waveform and each standard waveform in the periodic waveform database is calculated in turn, and the one with the smallest DTW distance value is screened out. The minimum DTW distance value is less than or equal to the preset threshold. At this time, the similarity between the start-stop waveform and the standard waveform is the highest, and the waveform matching result is the electrical appliance category corresponding to the standard waveform.
[0012] Furthermore, the process of waveform matching the obtained start-stop waveform with the standard waveform in the periodic waveform database also includes the following contents:
[0013] When the calculated DTW distance values between the start-stop waveform and each standard waveform in the periodic waveform database are greater than the preset threshold, the start-stop waveform is temporarily added to the periodic waveform database as a newly appeared waveform category, and the next waveform is matched. If multiple waveform matching results appear continuously and are all newly appeared waveform categories, it is determined that a new periodic multi-state electrical appliance is put into use, and the newly appeared waveform category is permanently added to the periodic waveform database as a new standard waveform. Otherwise, the newly appeared waveform category is deleted from the periodic waveform database.
[0014] Furthermore, the following contents are also included:
[0015] After the electrical appliance category is identified, the periodic waveform of the electrical appliance category in the start-stop waveform is deleted, and the remaining fragments are reconnected into a new time series. The improved CUSUM algorithm is used again to re-detect the start-stop waveform on the new time series, and the clustering method is used to cluster the obtained start-stop waveforms. The periodic waveform curve corresponding to the cluster center is permanently added to the periodic waveform database as a new standard waveform.
[0016] Furthermore, the periodic waveform database is constructed by the following process:
[0017] Obtain historical waveform data of various periodic multi-state electrical appliances starting and stopping;
[0018] The K-means clustering method is used to cluster the historical waveform data, where the clustering error sum of squares is calculated as: Among them, C i are all samples of the i-th class, m i is the cluster center of the ith class, It represents the sum of the DTW distances of all samples of the i-th class to the cluster center. The smaller the value, the higher the similarity of the samples in this class and the better the clustering effect.
[0019] The standard waveform of each periodic multi-state electrical appliance is obtained according to the clustering results.
[0020] Furthermore, the process of detecting the start-stop waveform on the current effective value time series using the improved CUSUM algorithm includes the following contents:
[0021] Three continuous sliding windows are defined on the obtained current effective value time series, which are arranged in the sliding direction as a mean value calculation window, a transient detection window and a variance calculation window;
[0022] The calculation formulas for defining the cumulative sum of electrical appliance input events and the cumulative sum of electrical appliance cut-off events are as follows:
[0023]
[0024]
[0025] in, is the cumulative sum of electrical appliance input events at the kth calculation, is the cumulative sum of electrical appliance input events at the k-1th calculation, is the cumulative sum of electrical appliance cut-out events during the kth calculation, is the cumulative sum of electrical appliance cut-out events during the k-1th calculation, M m is the mean current effective value of the mean calculation window during the kth calculation, M d is the mean value of the effective value of the current in the transient detection window at the kth calculation, β is the noise parameter, d is the time delay factor, δ is the weight parameter, and V is the variance value of the effective value of the current in the variance calculation window at the kth calculation;
[0026] Set the initial value of the cumulative sum of the appliance input event and the initial value of the cumulative sum of the appliance cut-off event to 0, and preset the variance threshold Δ min , determine the cumulative sum threshold H1 for the occurrence of the input event, and determine the cumulative sum threshold H2 for the occurrence of the cut-out event;
[0027] Three sliding windows are used to continuously and synchronously slide on the current effective value time series, and each time the sliding windows are used, the current effective value means in the mean calculation window, the transient detection window and the variance calculation window are calculated, and the variance value V of the current effective value in the variance calculation window is calculated;
[0028] Based on the calculation result of each window sliding, the cumulative sum of the electrical appliance input events and the cumulative sum of the electrical appliance cut-off events are analyzed to determine whether there is an electrical appliance input event and / or an electrical appliance cut-off event, thereby obtaining a start-stop waveform.
[0029] Further, in the process of analyzing the cumulative sum of electrical appliance input events and the cumulative sum of electrical appliance switch-off events based on the calculation result of each window sliding to determine whether there is a load input event and / or a load switch-off event:
[0030] When M d >M m +β, the electrical appliance input events are accumulated and calculated until When the electrical appliance input event occurs, it is determined; when M d <M m +β, the electrical appliance cut-out events are accumulated and calculated until It is determined that the electrical appliance cut-out event occurs.
[0031] In addition, the present invention also provides an event detection system for a periodic multi-state electrical appliance, comprising:
[0032] A data acquisition module is used to obtain total load current data, wherein the total load current data is a current effective value time series;
[0033] A start-stop waveform detection module, used for detecting the start-stop waveform on the current effective value time series by using an improved CUSUM algorithm;
[0034] The identification module is used to match the obtained start-stop waveform with the standard waveform in the periodic waveform database. The periodic waveform database stores standard waveforms based on the start and stop correspondence of various periodic multi-state electrical appliances. If three consecutive waveform matches are with the same electrical appliance, it is considered that the electrical appliance has started and stopped.
[0035] In addition, the present invention also provides a device, including a processor and a memory, wherein the memory stores a computer program, and the processor is used to execute the steps of the above method by calling the computer program stored in the memory.
[0036] In addition, the present invention also provides a computer-readable storage medium for storing a computer program for performing event detection on a periodic multi-state electrical appliance, wherein the computer program executes the steps of the above-mentioned method when running on a computer.
[0037] The present invention has the following effects:
[0038] The event detection method of the periodic multi-state electrical appliance of the present invention first detects the start-stop waveform on the current data through the improved CUSUM algorithm, which can accurately identify the input / cut-out event of the periodic multi-state electrical appliance, and effectively reduce the probability of missed detection of the start-stop event. Then, the obtained start-stop waveform is matched with the standard waveform in the periodic waveform database, and the periodic waveform database stores standard waveforms based on the start and stop correspondence of various types of periodic multi-state electrical appliances. If multiple consecutive waveform matches are all for the same electrical appliance, it is considered that the electrical appliance has started and stopped. By establishing a periodic waveform database, and matching the obtained start-stop waveform with the standard waveform stored in the periodic waveform database, the missed detection and misdetection of event detection can be effectively reduced, the recognition accuracy is improved, and the accuracy of subsequent feature extraction is guaranteed.
[0039] In addition, the event detection system, device, and computer-readable storage medium of the periodic multi-state electrical appliance of the present invention also have the above advantages.
[0040] In addition to the above-described objects, features and advantages, the present invention has other objects, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0042] Figure 1 It is a flow chart of an event detection method for a periodic multi-state electrical appliance according to a preferred embodiment of the present invention.
[0043] Figure 2 yes Figure 1 Schematic diagram of the sub-process of step S2 in FIG.
[0044] Figure 3 It is a schematic diagram of various stages of the occurrence of a sliding window sliding over an input event according to a preferred embodiment of the present invention.
[0045] Figure 4 It is a schematic diagram of the accumulation and comparison between the improved CUSUM algorithm in the present invention and the existing CUSUM algorithm.
[0046] Figure 5 It is a schematic diagram of the shapeDTW algorithm in the present invention for finding the minimum value of the local shape distance.
[0047] Figure 6 yes Figure 1 Schematic diagram of the sub-process of step S3 in FIG.
[0048] Figure 7 It is a schematic diagram of the unit structure of an event detection system for a periodic multi-state electrical appliance according to another embodiment of the present invention. DETAILED DESCRIPTION
[0049] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. However, the present invention can be implemented in many different ways as defined and covered below.
[0050] like Figure 1 As shown, a preferred embodiment of the present invention provides an event detection method for a periodic multi-state electrical appliance, comprising the following contents:
[0051] Step S1: Acquire total load current data, where the total load current data is a current effective value time series;
[0052] Step S2: using an improved CUSUM algorithm to detect the start-stop waveform on the current effective value time series;
[0053] Step S3: Match the obtained start-stop waveform with the standard waveform in the periodic waveform database. The periodic waveform database stores standard waveforms based on the start and stop of various periodic multi-state electrical appliances. If multiple consecutive waveform matches are for the same electrical appliance, it is considered that the electrical appliance has started and stopped.
[0054] It can be understood that the event detection method of the periodic multi-state electrical appliance of the present embodiment first detects the start-stop waveform on the current data through the improved CUSUM algorithm, which can accurately identify the input / output events of the periodic multi-state electrical appliance, effectively reducing the probability of missed detection of the start-stop event. Then, the obtained start-stop waveform is matched with the standard waveform in the periodic waveform database, and the periodic waveform database stores standard waveforms based on the start and stop correspondence of various periodic multi-state electrical appliances. If multiple consecutive waveform matches are the same electrical appliance, it is considered that the electrical appliance has started and stopped. By establishing a periodic waveform database and matching the obtained start-stop waveform with the standard waveform stored in the periodic waveform database, the missed detection and misdetection of event detection can be effectively reduced, the recognition accuracy is improved, and the accuracy of subsequent feature extraction is guaranteed.
[0055] It can be understood that the load variation of the periodic multi-state appliances in the present invention within one cycle is very complex, but the load variation of the previous and next cycles is basically the same. Typical appliances are washing machines, televisions, kettles in a heat preservation state, etc.
[0056] It can be understood that in step S1, time monitoring usually considers current and power characteristics. Since current data is more stable, the present invention takes current as the electrical quantity to be detected. By collecting the total load current at the inlet, the current effective value (abbreviated as current I) time series Wherein, I(j) represents the j-th current effective value in the current effective value time series I.
[0057] It is understandable that Figure 2 As shown, the step S2 specifically includes the following contents:
[0058] Step S21: defining three continuous sliding windows on the obtained current effective value time series, which are arranged in the sliding direction as a mean value calculation window, a transient detection window and a variance calculation window;
[0059] Step S22: Define the calculation formula for the cumulative sum of the appliance input events and the cumulative sum of the appliance switch-off events as follows:
[0060]
[0061]
[0062] in, is the cumulative sum of electrical appliance input events at the kth calculation, is the cumulative sum of electrical appliance input events at the k-1th calculation, is the cumulative sum of electrical appliance cut-out events during the kth calculation, is the cumulative sum of electrical appliance cut-out events during the k-1th calculation, M m is the mean current effective value of the mean calculation window during the kth calculation, M d is the mean value of the effective value of the current in the transient detection window at the kth calculation, β is the noise parameter, d is the time delay factor, δ is the weight parameter, and V is the variance value of the effective value of the current in the variance calculation window at the kth calculation;
[0063] Step S23: Set the initial value of the cumulative sum of the appliance input events and the initial value of the cumulative sum of the appliance cut-off events to 0, and preset the variance threshold Δ min , determine the cumulative sum threshold H1 for the occurrence of the input event, and determine the cumulative sum threshold H2 for the occurrence of the cut-out event;
[0064] Step S24: using three sliding windows to continuously and synchronously slide on the current effective value time series, and calculating the mean of the current effective value in the mean calculation window, the transient detection window and the variance calculation window respectively each time sliding, and calculating the variance value V of the current effective value in the variance calculation window;
[0065] Step S25: Analyze the cumulative sum of the appliance input events and the cumulative sum of the appliance cut-off events based on the calculation results of each window sliding, and determine whether there is an appliance input event and / or an appliance cut-off event, thereby obtaining a start-stop waveform. It can be understood that the start-stop waveform obtained at this time simultaneously includes the start-stop waveforms of multiple periodic multi-state appliances, and it is necessary to identify which type of periodic multi-state appliance each start-stop waveform belongs to from the total start-stop waveform.
[0066] It can be understood that the improved CUSUM algorithm in this embodiment, by defining the mean calculation window, the transient detection window and the variance calculation window in sequence on the current effective value time series, not only adds a variance calculation window to judge the fluctuation level of the sequence compared to the existing CUSUM algorithm, but also compares the variance value in the variance calculation window with the preset variance threshold. When the calculated variance value is less than the variance threshold, the coefficient (1+δd) is added to the calculation of the cumulative sum. For periodic multi-state electrical appliances with small current fluctuations, especially small current electrical appliances, such as washing machines, the cumulative sum of the input / output events of the periodic multi-state electrical appliances can be significantly improved, which is conducive to accurately identifying the input / output events of the periodic multi-state electrical appliances, and the start-stop waveform can be accurately obtained, which effectively reduces the probability of missed detection of periodic multi-state electrical appliance events.
[0067] It can be understood that the step S25 is specifically as follows:
[0068] When M d >M m +β, the electrical appliance input events are accumulated and calculated until When the electrical appliance input event occurs, it is determined; when Md <M m +β, the electrical appliance cut-out events are accumulated and calculated until It is determined that the electrical appliance cut-out event occurs.
[0069] In the calculation results of each window sliding, when the mean current effective value M of the transient detection window d The current RMS mean value M greater than the mean calculation window m When the sum of the current load data and the noise parameter β is calculated, it proves that the current load data is increasing, and there may be electrical appliances being put into operation. Therefore, the electrical appliances are accumulated and calculated until Conversely, if the mean current effective value M in the transient detection window is d The current effective value M that is less than the mean value calculation window m When the sum of the noise parameter β and the noise parameter β, there may be an electrical appliance cut-out, so the electrical appliance cut-out event accumulation and calculation are performed until It is determined that the electrical appliance cut-out event occurs.
[0070] It can be understood that the detection principle of the input event is the same as the detection principle of the cut-out event, so the subsequent description of the present invention uses the detection of the input event as an exemplary description, and the detection of the cut-out event is not repeated.
[0071] First, three continuous sliding windows are defined on the current effective value time series I, which are arranged in the sliding direction as the mean calculation window W m , transient detection window W d and variance calculation window W v , where the mean calculation window W m The window length is m, and the transient detection window W d The window length is n, and the variance calculation window is W v The window length is v.
[0072] In order to detect the switching on and off of electrical appliances, define the cumulative sum of electrical appliance switching events. for:
[0073]
[0074] The above formula can effectively improve the cumulative sum of periodic multi-state appliances with small current fluctuations. Moreover, for appliances with smaller current fluctuations, the larger the value of the weight parameter δ is, the more The greater the proportion of the current statistical value in The accumulated ability will be stronger.
[0075] In addition, the weight parameter δ can be optimized according to the actual detection effect. Detection effect = number of correct detections / total number*100%, where total number = number of correct detections + number of false detections + number of missed detections. The weight parameter δ with the best detection effect can be obtained based on a large number of training results.
[0076] In addition, the variance threshold Δ min Determined by the following process:
[0077] The steady-state operation data of the periodic multi-state electrical appliance is analyzed by using the steady-state time window, and the variance of the effective value of the current when the periodic multi-state electrical appliance is in steady-state operation is calculated. Then, the variance threshold value should be greater than the variance value when the periodic multi-state electrical appliance is in steady-state operation. Among them, the length of the window is preferably 50 points. Of course, in other embodiments of the present invention, the length of the window can also be selected from other values, such as 60 points, 100 points, etc., which are not specifically limited here. In addition, in other embodiments of the present invention, the size of the sliding window can be set according to the size of the load characteristics, because the size of the sliding window will affect the sensitivity of the CUSUM detection. A large window can effectively avoid the influence of the peak, but it is not sensitive enough to the sample point. The window accumulates and decreases, which easily leads to missed detection. As a preferred method, the window size can be set according to the size of the current data. The larger the current, the smaller the window, and the smaller the current, the larger the window.
[0078] Then, set the initial value of the cumulative sum of the electrical appliance input events is 0, and the variance threshold Δ is preset min And determine the cumulative sum threshold H1 for the input event. Use three sliding windows to slide synchronously on the current effective value time series I. Each sliding needs to calculate the mean current effective value in the mean calculation window, transient detection window and variance calculation window, and calculate the variance value V of the current effective value in the variance calculation window. The specific calculation formula is as follows:
[0079]
[0080]
[0081]
[0082]
[0083] Among them, M d is the mean current effective value in the transient detection window, M m is the mean value of the effective current in the mean calculation window, M v is the mean value of the effective current value in the variance calculation window, V is the variance value of the effective current value in the variance calculation window, and k is the first sampling point of the mean calculation window.
[0084] When the current mean value M in the transient detection window d > Current mean value M within the mean calculation window m When the sum of the noise parameter β is The value starts to accumulate from 0. When , it means that there is a possibility that the electrical appliance input event occurs, but the cumulative sum has not yet reached the level to determine the occurrence of the electrical appliance input event. At this time, the time delay factor d is introduced and its initial value is set to 0. When d=d+1, the variance value V in the variance calculation window and the variance threshold Δ are determined. min When the variance value V ≤ the variance threshold Δ min When M d -(M m +β) will be multiplied by the coefficient (1+δd) to calculate Until The time when the electrical appliance is switched on is determined, and the time of occurrence can be obtained by the inverse transformation of t = kd. In order to avoid the misdetection of switching on or switching off events caused by sequence oscillation, after the time delay factor d is introduced, every time the time delay factor increases by 1, and For comparison, if It is considered that the current change is caused by a fluctuation rather than an event, and This avoids multiple identification events caused by data fluctuations.
[0085] It is understandable that Figure 3 As shown, after a power-on event of a periodic multi-state electrical appliance with small current fluctuation occurs, the sliding window of the present invention can be divided into five stages when it slides over the occurrence moment of a power-on event.
[0086] (1) Stage 1: Variance calculation window W v Before sliding to the time when the input event occurs, the current mean values of the three windows remain unchanged. At this time, M d -M m =0, then
[0087] (2) Stage 2: The event occurs in the variance calculation window W v The variance calculation window M v and V are constantly changing, while the M of the mean calculation window and the transient detection window m and M d remains unchanged, then M d -M m =0,
[0088] (3) Stage 3: The event occurs within the transient detection window W d In the example, t1 is the time when the device is put into operation. Let I1 = I0 + ΔI, where I1 is the current value after the device is put into operation, I0 is the current value before the device is put into operation, ΔI is the current difference before and after the device is put into operation, and t d =t-t1, in this stage, 1≤t d ≤n, n is the transient detection window W d The window length of each moment is M d and M m for:
[0089]
[0090] M m =I0
[0091]
[0092]
[0093] There are three situations at this time:
[0094] 1) Case 1: Variance calculation window W v Has entered steady state, transient detection window M d Constantly changing, the mean calculation window and the variance calculation window M m 、M v , V remains unchanged. If Then when t d =n,
[0095] 2) Case 2: Part of the variance calculation window is still in the transient process, and the variance calculation window M v and V keep changing until all variance calculation windows enter a steady state. but
[0096]
[0097] at this time, Greater than case 1. When t d =n,
[0098]
[0099] 3) Case 3: When t d >n0(1<n0<n) before it is satisfied at this time Between case 1 and case 2.
[0100] (4) Stage 4: When 1≤t d-n≤m-1, the M corresponding to each moment d and M m for:
[0101] M d =I1,
[0102] During this stage d The corresponding moments are:
[0103]
[0104] So the cumulative sum in this stage As shown below:
[0105]
[0106] Likewise, there are three situations:
[0107] 1) Case 1: If but
[0108]
[0109] When t d =m+n-1, the cumulative sum is calculated as
[0110] 2) Case 2: If but
[0111]
[0112] When t d =m+n-1,
[0113] 3) Case 3: If t d >n0 is satisfied Then at this time Between case 1 and case 2.
[0114] (5) Stage 5: All three windows are in the steady-state stage, and the cumulative sum no longer changes.
[0115] In summary, the improved CUSUM algorithm of the present invention and the existing CUSUM algorithm are respectively adopted. The change curve of Figure 4 shown.
[0116] It can be understood that the load identification algorithm based on transient characteristics must not only determine the load startup time, but also determine when the load enters a steady state, because most loads, such as microwave ovens and induction cookers, do not enter a stable working state immediately after startup. The existing CUSUM algorithm cannot accurately identify the time of entering a steady state. Preferably, the step S2 further includes the following content after determining that an input event or a cut-out event occurs:
[0117] Step S26: Continue sliding the window and calculating the cumulative sum until the cumulative sum no longer increases, and at this time the variance value in the variance calculation window is less than the variance threshold, then it is determined that the current effective value time series enters a steady state.
[0118] After the window detects an event, the cumulative sum will continue to increase until t = t s1 At this moment, the cumulative sum no longer increases, and the variance V of the variance calculation window is less than the variance threshold Δ min That is, when the event occurs, if at t s1 to s1 When the cumulative sum of +m+n+v remains unchanged and the current fluctuation is small, that is, the current reaches stability, then t s1 The time is the time of entering the steady state.
[0119] The variance value V of the variance calculation window represents the fluctuation level of the current time series, so the improved CUSUM algorithm of the present invention can accurately determine the time of entering the steady state. When , it means that it is possible to enter a steady state, but the current in the variance calculation window is not stable yet. Let k = k + 1 and calculate and V k , until And V k ≤Δ min When the steady state is reached, it is considered that s is k.
[0120] The existing CUSUM algorithm cannot correctly detect the moment when the input event / cut-out event enters the steady state, and it is easy to mistakenly identify the transient process as the steady state. The improved CUSUM algorithm of the present invention can correctly detect the moment when the input event / cut-out event enters the steady state. Correctly detecting the steady state moment is the basis for correctly extracting steady-state and transient features, and is also the guarantee of the effectiveness of the extracted features, which indirectly improves the training effect of the recognition algorithm.
[0121] It can be understood that the process of waveform matching the obtained start-stop waveform with the standard waveform in the periodic waveform database in step S3 is specifically as follows:
[0122] The DTW distance between the obtained start-stop waveform and each standard waveform in the periodic waveform database is calculated in turn, and the one with the smallest DTW distance value is screened out. The minimum DTW distance value is less than or equal to the preset threshold. At this time, the similarity between the start-stop waveform and the standard waveform is the highest, and the waveform matching result is the electrical appliance category corresponding to the standard waveform.
[0123] The process of calculating the DTW distance in step S3 specifically includes the following contents:
[0124] Assume that the time series of the start-stop waveform is X, and the time series of the standard waveform in the periodic waveform database is Y, X = {x1, x2, ..., x M ,},Y={y1,y2,...,y N}, construct the pairwise distance cost matrix Where C(i,j) is x i and i The distance d ij =||y j -x i ||2, ||·||2 represents the L2 norm, i=1,2,...,M, j=1,2,...,N, i and j are the time points of two time series;
[0125] Assume that the time bending path between X and Y is: P = (p1, p2, ..., p k ), where p k =(i k ,j k )∈{1,2,...,i}×{1,2,...,j};
[0126] The shapeDTW algorithm is used to find an optimal matching path between the starting point (1,1) and the end point (M,N) of the cost matrix, and the corresponding minimum cumulative distance D(i,j) is calculated. The cumulative distance calculation formula is as follows:
[0127] D(i,j)=C(i,j)+min{D(i-1,j),D(i-1,j-1),D(i,j-1)}. When searching for the optimal matching path, the three principles of boundary, continuity and monotonicity need to be met, as shown in the following formula:
[0128]
[0129] Then the DTW distance between X and Y is calculated: DTW(X,Y)=D(i,j) / L, where L represents the length of the optimal matching path.
[0130] It can be understood that the smaller the DTW distance value is, the closer the distance between the two sequences is, the higher the similarity of the two sequences is, and it is determined that the electrical appliance category to which the start-stop waveform X belongs is likely to be the electrical appliance category corresponding to the standard waveform Y. If the results of waveform matching for multiple consecutive times (for example, 3 times) are the same electrical appliance, it is considered that the electrical appliance has started and stopped.
[0131] It can be understood that the shapeDTW algorithm in this embodiment first uses part of the preceding and succeeding data of each time series data point to extract its local morphological feature sequence, and then combines the local shape information (i.e., feature sequence) around each point into the dynamic programming matching process, thereby producing a more correct alignment result, that is, points with similar local shapes tend to be matched, while points with dissimilar areas are less likely to be matched. Compared to the standard DTW algorithm that only focuses on the global optimal solution, the shapeDTW algorithm of the present invention pays more attention to the matching length of the time series in the local morphological features. It can be seen that the shapeDTW algorithm can utilize local morphological features to avoid the problem of misjudgment caused by excessive stretching and scaling to a large extent. Figure 5 As shown in the figure, assuming that the time series length of the local morphological feature sequence is 3, it is divided into three intervals of equal length. The minimum value of the local shape distance is found according to X and Y, which is the optimal solution.
[0132] It is understandable that Figure 6 As shown, the periodic waveform database is constructed through the following process:
[0133] Step S31: Acquire historical waveform data of various periodic multi-state electrical appliances starting and stopping;
[0134] Step S32: clustering the historical waveform data using the K-means clustering method, wherein the clustering error sum of squares is calculated as: Among them, C i are all samples of the i-th class, m i is the cluster center of the ith class, It represents the sum of the DTW distances of all samples of the i-th class to the cluster center. The smaller the value, the higher the similarity of the samples in this class and the better the clustering effect.
[0135] Step S33: Obtaining the standard waveform of each periodic multi-state electrical appliance according to the clustering result.
[0136] Specifically, we first collect historical waveform data of various types of periodic multi-state electrical appliances starting and stopping, and then use the k-means clustering method to cluster different periodic waveforms. Considering that the clustering object is a time series, the time series may have different lengths. Therefore, shapeDTW distance is used instead of Euclidean distance as the similarity metric between samples. The closer the shapeDTW distance between two sequences, the higher the similarity of the two sequences, and the higher the possibility of being classified into the same class. Otherwise, the lower the similarity, the lower the possibility of being classified into the same class. Let the sample set to be clustered be Z = {z i |i=1,2,...,n}, the actual number of classes of the sample set to be clustered is K, and the sum of squares of clustering errors is as follows:
[0137]
[0138] Among them, C i are all samples of the i-th class, m i is the cluster center of the ith class, It represents the sum of the DTW distances of all samples of the i-th class to the cluster center. The smaller the value, the higher the similarity of samples of this class and the better the clustering effect.
[0139] Finally, a periodic waveform database is constructed based on the clustering results, which is universal and adaptive for most independent users. In the clustering method, the classification conditions are set according to the operating characteristics of the periodic load, thereby realizing the unsupervised classification problem of periodic waveforms.
[0140] In addition, it can be understood that the process of waveform matching the obtained start-stop waveform with the standard waveform in the periodic waveform database in step S3 also includes the following contents:
[0141] When the calculated DTW distance values between the start-stop waveform and each standard waveform in the periodic waveform database are greater than the preset threshold, the start-stop waveform is temporarily added to the periodic waveform database as a newly appeared waveform category, and the next waveform is matched. If multiple waveform matching results appear continuously and are all newly appeared waveform categories, it is determined that a new periodic multi-state electrical appliance is put into use, and the newly appeared waveform category is permanently added to the periodic waveform database as a new standard waveform. Otherwise, the newly appeared waveform category is deleted from the periodic waveform database.
[0142] If the DTW distance between the start-stop waveform and each standard waveform is greater than the preset threshold, it means that the start-stop waveform has a low similarity with the standard waveform in the database, and it may be a start-stop waveform of a newly put into use periodic multi-state electrical appliance. In this case, the start-stop waveform is temporarily regarded as a newly appeared waveform category Z. newAdd to the periodic waveform database. Continue to match the next start-stop waveform. If multiple waveform matching results appear continuously (for example, 3 times), they are all new waveform category Z. new , it is determined that a new periodic multi-state electrical appliance is put into use, and the newly appeared waveform category is permanently added to the periodic waveform database as a new standard waveform; otherwise, the newly appeared waveform category is deleted from the periodic waveform database.
[0143] It can be understood that the event detection method of the periodic multi-state electrical appliance also includes the following contents:
[0144] After the appliance category is identified, the periodic waveform of the appliance category in the start-stop waveform is deleted, that is, the data between the continuously detected start-stop positions are stripped, and the remaining fragments are reconnected into a new time series. The improved CUSUM algorithm is used again to re-detect the start-stop waveform on the new time series, and the clustering method is used to cluster the obtained start-stop waveforms. The periodic waveform curve corresponding to the cluster center is permanently added to the periodic waveform database as a new standard waveform.
[0145] By deleting the periodic waveforms of the successfully identified start-stop waveforms, the remaining ones are the unidentified start-stop waveforms, which correspond to new periodic multi-state electrical appliances. The improved CUSUM algorithm is used to detect the start-stop waveforms again for the new time series, and the k-means algorithm is used for clustering to find the appropriate clustering center, so as to obtain the standard waveform corresponding to the new periodic multi-state electrical appliance, and add it to the periodic waveform database, thereby realizing the identification of unknown periodic loads and continuously expanding the database.
[0146] In addition, the four existing event detection methods based on probability models need to be carried out on the basis of the assumption that "at most only one load changes state at a time", which is called the switch continuity principle SCP, but SCP is related to factors such as the number of load users, the number of loads, and the sampling frequency of the user content. However, for the operation of periodic multi-state electrical appliances, sometimes there are two or more loads of electrical appliances that change state at the same time. At this time, the accuracy of the event detection results of the four existing event detection methods based on probability models is worse. In the present invention, the standard waveforms of two or more periodic multi-state electrical appliances can also be superimposed in the periodic waveform database to obtain multiple composite standard waveforms. When the start-stop waveform collected in the step S2 is the start-stop waveform of two or more periodic multi-state electrical appliances, the DTW distance between the start-stop waveform and each standard waveform is calculated based on the above-mentioned shapeDTW algorithm, and the minimum of the DTW distance value is selected, and the composite standard waveform corresponding to the minimum DTW distance value is successfully matched with the start-stop waveform, and the start-stop waveform can be identified to which two periodic multi-state electrical appliances the start-stop superposition corresponds.
[0147] It can be understood that in order to verify the effect of the event detection algorithm of the present invention, the inventor of the present application conducted a comparison experiment on the event detection algorithm of the present invention and the existing CUSUM algorithm and GLR algorithm, and the obtained detection effect comparison results are shown in Table 1.
[0148] Table 1. Comparison of experimental results of the event detection algorithm of the present invention with the existing CUSUM and GLR
[0149]
[0150] It can be seen from the above table that the detection accuracy of the event detection algorithm of the present invention is better than that of the existing CUSUM algorithm and GLR algorithm, both in terms of the number of false detections and the number of missed detections.
[0151] In addition, if Figure 7 As shown, another embodiment of the present invention further provides an event detection system for a periodic multi-state electrical appliance, using the event detection method as described above, the system includes
[0152] A data acquisition module is used to obtain total load current data, wherein the total load current data is a current effective value time series;
[0153] A start-stop waveform detection module, used for detecting the start-stop waveform on the current effective value time series by using an improved CUSUM algorithm;
[0154] The identification module is used to match the obtained start-stop waveform with the standard waveform in the periodic waveform database. The periodic waveform database stores standard waveforms based on the start and stop correspondence of various periodic multi-state electrical appliances. If three consecutive waveform matches are with the same electrical appliance, it is considered that the electrical appliance has started and stopped.
[0155] It can be understood that the event detection system of the periodic multi-state electrical appliance of the present embodiment first detects the start-stop waveform on the current data through the improved CUSUM algorithm, which can accurately identify the input / output events of the periodic multi-state electrical appliance, effectively reducing the probability of missed detection of the start-stop event. Then, the obtained start-stop waveform is matched with the standard waveform in the periodic waveform database, and the periodic waveform database stores standard waveforms based on the start and stop correspondence of various periodic multi-state electrical appliances. If multiple consecutive waveform matches are all for the same electrical appliance, it is considered that the electrical appliance has started and stopped. By establishing a periodic waveform database and matching the obtained start-stop waveform with the standard waveform stored in the periodic waveform database, the missed detection and misdetection of event detection can be effectively reduced, the recognition accuracy is improved, and the accuracy of subsequent feature extraction is guaranteed.
[0156] It can be understood that each module in the system of this embodiment corresponds to the content of each step of the above method embodiment, so the working principle of each module will not be repeated here, and reference can be made to the above method embodiment.
[0157] In addition, another embodiment of the present invention further provides a device, including a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the above method by calling the computer program stored in the memory.
[0158] In addition, another embodiment of the present invention further provides a computer-readable storage medium for storing a computer program for performing event detection on a periodic multi-state electrical appliance, wherein the computer program executes the steps of the above-mentioned method when running on a computer.
[0159] The general form of computer readable media includes: floppy disk, flexible disk, hard disk, magnetic tape, any other magnetic media, CD-ROM, any other optical media, punch cards, paper tape, any other physical media with a pattern of holes, random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), flash erasable programmable read-only memory (FLASH-EPROM), any other memory chip or cartridge, or any other medium that can be read by a computer. The instructions can further be transmitted or received by a transmission medium. The term transmission medium can include any tangible or intangible medium that can be used to store, encode or carry instructions for execution by a machine, and includes digital or analog communication signals or other intangible media that facilitate the communication of the above instructions. Transmission media include coaxial cables, copper wire and optical fiber, which include the wires of a bus used to transmit a computer data signal.
[0160] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for detecting an event of a periodic multi-state electrical appliance, characterized in that: Includes the following: Acquire total load current data, wherein the total load current data is a current effective value time series; Using an improved CUSUM algorithm to detect the start-stop waveform on the current effective value time series; The obtained start-stop waveform is matched with the standard waveform in the periodic waveform database, wherein the periodic waveform database stores standard waveforms corresponding to the start and stop of various periodic multi-state electrical appliances. If multiple consecutive waveform matches are all for the same electrical appliance, it is considered that the electrical appliance has started and stopped; The process of detecting the start-stop waveform on the current effective value time series by using the improved CUSUM algorithm includes the following contents: Three continuous sliding windows are defined on the obtained current effective value time series, which are arranged in the sliding direction as a mean value calculation window, a transient detection window and a variance calculation window; The calculation formulas for defining the cumulative sum of electrical appliance input events and the cumulative sum of electrical appliance cut-off events are as follows: in, is the cumulative sum of electrical appliance input events at the kth calculation, is the cumulative sum of electrical appliance input events at the k-1th calculation, is the cumulative sum of electrical appliance cut-out events during the kth calculation, is the cumulative sum of electrical appliance cut-out events during the k-1th calculation, M m is the mean current effective value of the mean calculation window during the kth calculation, M d is the mean value of the effective current value in the transient detection window at the kth calculation, β is the noise parameter, d is the time delay factor, δ is the weight parameter, and V is the variance value of the effective current value in the variance calculation window at the kth calculation; Set the initial value of the cumulative sum of the appliance input event and the initial value of the cumulative sum of the appliance cut-off event to 0, and preset the variance threshold Δ min , determine the cumulative sum threshold H1 for the occurrence of the input event, and determine the cumulative sum threshold H2 for the occurrence of the cut-out event; Three sliding windows are used to continuously and synchronously slide on the current effective value time series, and each time the sliding windows are used, the current effective value means in the mean calculation window, the transient detection window and the variance calculation window are calculated, and the variance value V of the current effective value in the variance calculation window is calculated; Based on the calculation result of each window sliding, the cumulative sum of the electrical appliance input events and the cumulative sum of the electrical appliance cut-off events are analyzed to determine whether there is an electrical appliance input event and / or an electrical appliance cut-off event, thereby obtaining a start-stop waveform.
2. The event detection method for a periodic multi-state electrical appliance according to claim 1, characterized in that: The process of waveform matching the obtained start-stop waveform with the standard waveform in the periodic waveform database includes the following contents: The DTW distance between the obtained start-stop waveform and each standard waveform in the periodic waveform database is calculated in turn, and the one with the smallest DTW distance value is screened out. The minimum DTW distance value is less than or equal to the preset threshold. At this time, the similarity between the start-stop waveform and the standard waveform is the highest, and the waveform matching result is the electrical appliance category corresponding to the standard waveform.
3. The event detection method for a periodic multi-state electrical appliance according to claim 2, characterized in that: The process of waveform matching the obtained start-stop waveform with the standard waveform in the periodic waveform database also includes the following contents: When the calculated DTW distance values between the start-stop waveform and each standard waveform in the periodic waveform database are greater than the preset threshold, the start-stop waveform is temporarily added to the periodic waveform database as a newly appeared waveform category, and the next waveform is matched. If multiple waveform matching results appear continuously and are all newly appeared waveform categories, it is determined that a new periodic multi-state electrical appliance is put into use, and the newly appeared waveform category is permanently added to the periodic waveform database as a new standard waveform. Otherwise, the newly appeared waveform category is deleted from the periodic waveform database.
4. The event detection method for a periodic multi-state electrical appliance according to claim 3, characterized in that: Also included are the following: After the electrical appliance category is identified, the periodic waveform of the electrical appliance category in the start-stop waveform is deleted, and the remaining fragments are reconnected into a new time series. The improved CUSUM algorithm is used again to re-detect the start-stop waveform on the new time series, and the clustering method is used to cluster the obtained start-stop waveforms. The periodic waveform curve corresponding to the cluster center is permanently added to the periodic waveform database as a new standard waveform.
5. The event detection method for a periodic multi-state electrical appliance according to claim 2, characterized in that: The periodic waveform database is constructed through the following process: Obtain historical waveform data of various periodic multi-state electrical appliances starting and stopping; The K-means clustering method is used to cluster the historical waveform data, where the clustering error sum of squares is calculated as: Among them, C i are all samples of the i-th class, m i is the cluster center of the ith class, It represents the sum of the DTW distances of all samples of the i-th class to the cluster center. The smaller the value, the higher the similarity of the samples in this class and the better the clustering effect. The standard waveform of each periodic multi-state electrical appliance is obtained according to the clustering results.
6. The event detection method for a periodic multi-state electrical appliance according to claim 1, characterized in that: In the process of analyzing the cumulative sum of electrical appliance input events and the cumulative sum of electrical appliance cut-off events based on the calculation result of each window sliding to determine whether there is a load input event and / or a load cut-off event: When M d >M m +β, the electrical appliance input events are accumulated and calculated until When the electrical appliance input event occurs, it is determined; when M d <M m +β, the electrical appliance cut-out events are accumulated and calculated until It is determined that the electrical appliance cut-out event occurs.
7. An event detection system for a periodic multi-state electrical appliance, using the event detection method according to any one of claims 1 to 6, characterized in that: include A data acquisition module is used to obtain total load current data, wherein the total load current data is a current effective value time series; A start-stop waveform detection module, used for detecting the start-stop waveform on the current effective value time series by using an improved CUSUM algorithm; The identification module is used to match the obtained start-stop waveform with the standard waveform in the periodic waveform database. The periodic waveform database stores standard waveforms based on the start and stop correspondence of various periodic multi-state electrical appliances. If three consecutive waveform matches are with the same electrical appliance, it is considered that the electrical appliance has started and stopped.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and the processor executes the steps of the method according to any one of claims 1 to 6 by calling the computer program stored in the memory.
9. A computer-readable storage medium for storing a computer program for event detection of a periodic multi-state electrical appliance, characterized in that: When the computer program is run on a computer, the steps of the method according to any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Non-intrusive household appliance load identification method based on bee colony algorithm
CN111160798A
Load event detection method and system and storage medium
CN111191908A
Non-invasive load identification method
CN111308185A
Method and system for identifying transformer area user-transformer relation based on load characteristics of starting and stopping of electric appliance
CN112234605A
Signal identification methods and systems
US20120197560A1
