An event detection and feature extraction method based on a bidirectional detection window CUSUM algorithm
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUNAN UNIV
- Filing Date
- 2025-05-07
- Publication Date
- 2026-07-03
AI Technical Summary
Traditional event detection and feature extraction methods suffer from high false alarm rates, false negative rates, feature redundancy, and low computational efficiency in complex power load data. They are particularly difficult to accurately identify equipment switching and fault events under conditions of multiple devices operating in parallel and noise interference.
An improved CUSUM bidirectional detection algorithm is adopted, which combines Fisher score and mRMR feature selection technology. Data is collected through multi-core modular meters, and data preprocessing and active power calculation are performed. Events are detected by combining sliding window and adaptive threshold. The Fisher score and mRMR methods are used to evaluate features and select the most discriminative features.
It effectively reduces false alarm and false negative rates, improves the accuracy of event detection and feature extraction, reduces feature redundancy, and enhances the real-time performance and reliability of the load identification system. It is suitable for smart grids and power monitoring systems.
Smart Images

Figure CN120508815B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of load identification technology, and more particularly to an event detection and feature extraction method based on the CUSUM (Cumulative Sum) algorithm with a bidirectional detection window (specifically, an event detection and feature extraction method based on an improved CUSUM algorithm). This method is used for load identification, abnormal event detection, and feature extraction in power systems. It can efficiently and accurately identify and extract the characteristic information of power loads, and is applicable to fields such as smart grids, power monitoring systems, and electricity consumption behavior analysis. Background Technology
[0002] With the development of smart grids and home energy management systems, non-intrusive load identification (NILM) technology has been widely used in power monitoring, energy-saving management, and anomaly detection. In these applications, effectively identifying and extracting key events (such as equipment switching and fault occurrences) and their characteristics from power load data has become one of the core technologies for improving the accuracy and efficiency of load identification.
[0003] Traditional event detection and feature extraction methods suffer from numerous shortcomings when dealing with complex power load data. Event detection methods typically rely on fixed thresholds or simple rules, making them susceptible to noise and load fluctuations, leading to high false alarm rates and missed alarms. Furthermore, these methods lack adaptability to complex load patterns, especially in power systems with multiple parallel devices or diverse load states. Traditional methods often fail to accurately distinguish between events and normal fluctuations and are not sensitive enough to sudden, subtle changes in events. Regarding feature extraction, traditional methods often extract incomplete features, relying solely on experience or fixed rules, resulting in features lacking sufficient discriminative power and affecting subsequent identification performance. Simultaneously, feature redundancy and low computational efficiency are also significant challenges for traditional methods. As the diversity and complexity of load data increase, traditional feature selection methods often fail to automatically identify the most discriminative features and exhibit high redundancy, impacting the accuracy and efficiency of the identification model.
[0004] Existing feature extraction and selection methods still face many challenges. In practical applications, load data features are often highly nonlinear and time-varying. How to accurately extract effective features reflecting changes in equipment status and reduce redundant information through reasonable feature selection methods is a major challenge in current load identification technology. Therefore, researching a highly accurate and low-redundancy event detection and feature extraction method, combined with advanced algorithms and data-driven feature selection techniques, becomes an effective way to solve the challenges faced by current load identification technology. Summary of the Invention
[0005] This invention provides an event detection and feature extraction method based on the CUSUM bidirectional detection algorithm. By improving the CUSUM algorithm and combining it with mRMR and Fisher Score feature selection techniques, this invention can effectively detect events in power load data and extract key features. The technical solution of this invention solves the technical problems of traditional methods, such as high false alarm rate, false negative rate, feature redundancy, and low computational efficiency. It can achieve more accurate and efficient load identification in complex power environments and is widely applicable to smart grids, power monitoring systems, and other fields.
[0006] The objective of this invention is achieved through the following technical solution:
[0007] Step S101: Use multi-core modular electricity meters to read user electricity voltage and current data, perform data parsing and dimension unification, and build a user-side electricity consumption sample database.
[0008] Step S102: An improved forward padding data repair method is introduced to preprocess the original load data and construct a dataset;
[0009] Step S103: Calculate the active power based on the collected discrete voltage and current signals;
[0010] Step S104: Perform event detection using the improved CUSUM algorithm based on active power, and obtain the accurate event occurrence time and termination time.
[0011] Step S105: Based on the event start and end times obtained in step S104, calculate the characteristics before and after the power load is connected, and obtain the electrical characteristics of a single device.
[0012] In step S106, the features extracted in step S105 are evaluated by combining Fisher scores and the mRMR (maximum relevance minimum redundancy) feature extraction method.
[0013] In step S101, the data collected by the smart meter is voltage and current data, and the sampling frequency is 128 points per cycle, i.e., 6.4kHz.
[0014] In step S102, an improved forward imputation method is used for missing values. For missing values, this invention utilizes the three most recent valid observations preceding the missing value. , , These values are assigned different weights, with larger weights indicating values closer to the missing values. A weighted average is then calculated to fill in the missing values. The calculation is as follows:
[0015]
[0016] (Formula 1)
[0017] In step S103, active power is first calculated based on the collected discrete voltage and current signals. The calculation is as follows:
[0018]
[0019] (Formula 2)
[0020] in: It is instantaneous voltage, It is instantaneous current. Number of sampling points per period Average active power per cycle This refers to the instantaneous active power.
[0021] In step S104, the mean and standard deviation of the active power within a sliding window are calculated for a period of time. An adaptive threshold is set based on the standard deviation of the window data. After the event detection ends, the reverse CUSUM algorithm is used to determine the period preceding the event. The specific calculation is as follows:
[0022]
[0023] (Formula 3)
[0024]
[0025] (Formula 4)
[0026] in: Indicates the first Active power at any given time Indicates window size. This represents the average value of the window data. This represents the standard deviation of active power. The mean and standard deviation are calculated at each time step using a sliding window method, with an adaptive threshold set. The calculation is as follows:
[0027]
[0028] (Formula 5)
[0029] in: This represents the average value of the window data. This is an empirical proportionality coefficient. The threshold is adaptive, and the unit is watts. For event detection, two cases are considered: device access and device removal, which are detected using upper and lower biases respectively. The specific calculations are as follows:
[0030]
[0031]
[0032] (Formula 6)
[0033] in: Indicates the first The upper deviation at time describes the degree to which the power value deviates from the threshold. This indicates the upper deviation from the previous time step. Indicates the first Active power at any given time Indicates the first The adaptive threshold at any given time. When the deviation... Exceeding the threshold ,Right now If so, it is determined that a device access event has occurred, and the current deviation is... Exceeding the threshold ,Right now If the event is determined to be a device disconnection event, then the event end time is calculated as follows to obtain the voltage and current signals after the device is connected:
[0034]
[0035] (Formula 7)
[0036] illustrate: It indicates the first Cumulative deviation at time, A value greater than the threshold indicates that the device is disconnected. A value greater than the threshold indicates a device connection. Since only the event time is considered here, therefore... This includes both disconnection and connection scenarios. and The maximum value.
[0037] in: This represents the threshold used to determine the end of an event. This indicates the end time of the event. Because sliding windows inherently have a lag, the CUSUM algorithm cannot accurately determine the event occurrence time. To overcome this difficulty, a method of adding a reverse event detection window is used. Using the reverse window as the starting point, the event start time is traced backward, and the steps are the same as for forward event detection. The event start time is calculated as follows:
[0038]
[0039] (Formula 8)
[0040] in: Indicates the end time of the event in reverse event detection. This indicates the event end time. To prevent false positives, a false positive prevention window is set up to "backtrack" and confirm events that have already occurred. If the event duration is less than a certain time, it is considered a false positive, calculated as follows:
[0041]
[0042] (Formula 9)
[0043] in, Indicates the duration of the event. Indicates the duration of time.
[0044] In step S105, based on the start and end times of the event calculated in step S104, electrical characteristics before and after the event are extracted. The extracted characteristics include RMS voltage, RMS current, active power, reactive power, apparent power, power factor, rated power, voltage distortion rate, current distortion rate, voltage harmonic group content, and current harmonic group content, calculated as follows:
[0045]
[0046]
[0047]
[0048]
[0049] (Formula 10)
[0050] in, This represents the discrete values of the collected voltage. This represents the discrete values of the collected current. Indicates the effective value of the voltage. Indicates the effective value of the current. Indicates active power. Indicates apparent power. Indicates reactive power. Indicates the power factor. Indicates the rated power. This represents the result calculated by performing a Fourier transform on the acquired discrete current signal. Secondary current harmonics This represents the result calculated by performing a Fourier transform on the acquired discrete voltage signal. Secondary current harmonics Indicates voltage distortion rate. Indicates the current distortion rate. Indicates the voltage harmonic group content. This represents the current harmonic group content. The electrical characteristics of the powered-on or powered-off equipment are calculated based on the electrical characteristics before and after the event, as follows:
[0051]
[0052]
[0053]
[0054] ,
[0055] ,
[0056] (Formula 11)
[0057] in, Indicates the effective value of the device voltage. Indicates the effective value of the device current. Indicates the active power of the equipment. Indicates the apparent power of the device. Indicates the reactive power of the equipment. Indicates the power factor of the device. Indicates the rated power of the equipment. This represents the result of Fourier transforming the current signal of the device. Secondary current harmonics This represents the voltage signal of the device calculated by performing a Fourier transform. Secondary current harmonics Indicates the voltage distortion rate of the device. Indicates the current distortion rate of the device. Indicates the harmonic group content of the equipment voltage. This indicates the harmonic group content of the equipment current.
[0058] In step S106, the features extracted in step S105 are evaluated by combining the Fisher score and the mRMR (maximum relevance minimum redundancy) feature extraction method. The Fisher score is calculated as follows:
[0059] ,
[0060]
[0061]
[0062] (Formula 12)
[0063] in, Indicates the first One characteristic, Indicates the first Categories Indicates the first Fisher scores for each feature.
[0064] The mRMR score is calculated as follows:
[0065]
[0066] (Formula 13)
[0067] in, Indicates the first One characteristic, Indicates the type of target equipment. Indicates the number of equipment types. Represents a feature group. This represents the feature score. To combine the Fisher score and mRMR score for a comprehensive feature evaluation, a comprehensive scoring mechanism is established. First, the Fisher score and mRMR score results are Max-Min normalized, calculated as follows:
[0068]
[0069] (Formula 14)
[0070] in, and These are the minimum and maximum scores among all feature scores. The overall score is calculated as follows:
[0071]
[0072] (Formula 15)
[0073] in, This represents the overall feature score. Features with an overall score less than 0.5 are discarded. The system ranks all features by comprehensive scores, selects the features with higher scores, and avoids the influence of redundant information.
[0074] The operation of each step in this method is based on solid theoretical foundations and scientific rationality. The CUSUM algorithm, based on bidirectional window detection, utilizes statistical change point detection theory and the principle of cumulative deviation to efficiently identify abrupt changes in power curves while maintaining statistical significance, accurately capturing load change events. Through the principle of circuit superposition and load decomposition theory, combined with transient and steady-state feature analysis, it effectively extracts the electrical characteristics of individual devices. The application of Fisher discriminant analysis and the information-theoretic mRMR method mathematically guarantees the optimality of feature selection while adhering to Occam's razor principle to avoid the curse of dimensionality, thus improving system generalization ability and computational efficiency. These steps are built upon the theoretical foundation of interdisciplinary research in power system analysis, statistical signal processing, and pattern recognition. They are scientific methods validated through academic research and engineering practice, effectively supporting the accurate identification and analysis of electrical equipment characteristics.
[0075] Beneficial effects:
[0076] This invention relates to an event detection and feature extraction method based on the CUSUM bidirectional detection algorithm, comprising: step S101, using a multi-core modular meter to read user electricity voltage and current data, performing data parsing and dimensional unification, and constructing a user-side electricity sample database; step S102, introducing an improved forward padding data repair method to preprocess the original load data and construct a dataset; step S103, calculating active power based on the collected discrete voltage and current signals; step S104, performing event detection based on the improved CUSUM algorithm using active power, and obtaining the precise event occurrence time and termination time; step S105, calculating the characteristics before and after the power load is connected, and obtaining the electrical characteristics of a single device; step S106, combining Fisher score and mRMR (maximum correlation minimum redundancy) feature extraction method to evaluate the features extracted in step S105, ranking all features by comprehensive score, selecting features with higher scores, avoiding the influence of redundant information, and outputting optimized feature data.
[0077] This invention provides an event detection and feature extraction method based on the CUSUM bidirectional detection algorithm, which has significant advantages, especially in event detection and feature extraction of power load data. Compared with traditional methods, this invention can effectively reduce the high false alarm rate and false negative rate, and solves the problem that traditional algorithms cannot accurately detect sudden events and subtle changes in complex power environments. By introducing an improved CUSUM algorithm, combined with Fisher scores and mRMR feature selection methods, efficient and accurate event identification and feature extraction can be achieved, thereby improving the accuracy and computational efficiency of load identification. Its efficient and accurate feature extraction and selection method not only enhances the real-time performance and reliability of the load identification system, but also provides strong technical support for the optimized operation of power systems, abnormal event monitoring, and equipment condition assessment, possessing significant theoretical value and broad application prospects.
[0078] As can be seen from the above technical solution of the present invention, the present invention has the following technical effects:
[0079] First, this invention proposes an event detection and feature extraction method based on the CUSUM bidirectional detection algorithm, which can achieve accurate event detection and feature extraction in complex power load data. By improving the CUSUM algorithm and introducing adaptive threshold technology, the false alarm rate and false negative rate can be effectively reduced, thereby improving the accuracy of event detection. This method has higher sensitivity for real-time monitoring of equipment connection and disconnection in power systems, and is particularly suitable for complex environments where multiple devices operate in parallel.
[0080] Secondly, this invention combines Fisher scoring and mRMR feature selection techniques to accurately evaluate extracted power load features, effectively reducing feature redundancy and improving the recognition accuracy of subsequent models. By using a comprehensive scoring mechanism to select the most discriminative features, the computational efficiency and accuracy of the load identification system are improved, ensuring accurate reflection of equipment status changes in a dynamic power environment. Attached Figure Description
[0081] Figure 1 This is a flowchart illustrating the implementation of the present invention.
[0082] Figure 2 A schematic diagram for improving the CUSUM algorithm.
[0083] Figure 3 To improve the event detection performance of the CUSUM algorithm
[0084] Figure 4 The result diagram using the comprehensive feature evaluation algorithm Detailed Implementation
[0085] The following will combine Figures 1-4 The technical solution of the present invention will be further described in detail below.
[0086] Example 1
[0087] This invention addresses the challenges of event detection and feature extraction from power load data. Traditional methods are prone to high false alarm and false negative rates under conditions of multiple devices operating in parallel and noise interference. By introducing an improved CUSUM algorithm and adaptive thresholding technology, the accuracy of event detection can be effectively improved. Combining Fisher scores and mRMR feature selection methods, this invention optimizes feature extraction, reduces redundancy, and improves recognition accuracy, making it widely applicable to smart grids and power monitoring systems. A method for event detection and feature extraction based on the CUSUM bidirectional detection algorithm is proposed, effectively solving the problems in existing technologies.
[0088] An event detection and feature extraction method based on the CUSUM bidirectional detection algorithm is as follows: Figure 1 As shown, firstly, multi-core modular meters are used to read user voltage and current data. Data parsing and dimensional unification are performed to construct a user-side electricity consumption sample database. An improved forward-filling data repair method is introduced to preprocess the original load data, constructing a dataset. Active power is calculated based on the collected discrete voltage and current signals. Then, an improved CUSUM algorithm based on active power is used for event detection, obtaining precise event occurrence and termination times. The characteristics before and after power load access are calculated, and the electrical characteristics of individual devices are obtained. The extracted features are evaluated by combining Fisher scores and mRMR (maximum correlation minimum redundancy) feature extraction methods. All features are ranked by comprehensive scores, and features with higher scores are selected. At the same time, the influence of redundant information is avoided, and the optimized feature data is output.
[0089] The specific implementation steps of the event detection and feature extraction method based on the CUSUM bidirectional detection algorithm are as follows:
[0090] Step S101: Use multi-core modular electricity meters to read user electricity voltage and current data, perform data parsing and dimension unification, and build a user-side electricity consumption sample database.
[0091] Step S102: An improved forward padding data repair method is introduced to preprocess the original load data and construct a dataset;
[0092] Step S103: Calculate the active power based on the collected discrete voltage and current signals;
[0093] Step S104: Perform event detection using the improved CUSUM algorithm based on active power, and obtain the accurate event occurrence time and termination time.
[0094] Step S105: Based on the event start and end times obtained in step S104, calculate the characteristics before and after the power load is connected, and obtain the electrical characteristics of a single device.
[0095] In step S106, the features extracted in step S105 are evaluated by combining Fisher scores and the mRMR (maximum relevance minimum redundancy) feature extraction method.
[0096] In step S101, the data collected by the smart meter is voltage and current data, with a sampling frequency of 128 points per cycle, i.e., 6.4kHz. The types of devices are shown in the table below:
[0097] Table 1. Types of Power Equipment Collected by Smart Meters
[0098] Equipment types Equipment Brand Inverter air conditioner Brand A, Brand B Fixed frequency air conditioner Brand A, Brand B water heater Brand C kettle Brand d, Brand b rice cooker Brand e electric oven Brand F, Brand G electric heater Brand A Hair dryer Brand h water dispenser Brand i
[0099] In step S102, an improved forward imputation method is used for missing values. For missing values, this invention utilizes the three most recent valid observations preceding the missing value. , , These values are assigned different weights, with larger weights indicating values closer to the missing values. A weighted average is then calculated to fill in the missing values. The calculation is as follows:
[0100]
[0101] (Formula 1)
[0102] In step S103, active power is first calculated based on the collected discrete voltage and current signals. The calculation is as follows:
[0103]
[0104] (Formula 2)
[0105] in: It is instantaneous voltage, It is instantaneous current. Number of sampling points per period Average active power per cycle This refers to the instantaneous active power.
[0106] In step S104, the mean and standard deviation of the active power within a sliding window are calculated for a period of time. An adaptive threshold is set based on the standard deviation of the window data. After the event detection ends, the reverse CUSUM algorithm is used to determine the period preceding the event. The specific process is illustrated below. Figure 2 As shown. The specific calculation is as follows:
[0107]
[0108] (Formula 3)
[0109]
[0110] (Formula 4)
[0111] in: Indicates the first Active power at any given time Indicates window size. This represents the average value of the window data. This represents the standard deviation of active power. The mean and standard deviation are calculated at each time step using a sliding window method, with an adaptive threshold set. The calculation is as follows:
[0112]
[0113] (Formula 5)
[0114] in: This represents the average value of the window data. This is an empirical proportionality coefficient. The threshold is adaptive, and the unit is watts. For event detection, two cases are considered: device access and device removal, which are detected using upper and lower biases respectively. The specific calculations are as follows:
[0115]
[0116]
[0117] (Formula 6)
[0118] in: Indicates the first The upper deviation at time describes the degree to which the power value deviates from the threshold. This indicates the upper deviation from the previous time step. Indicates the first Active power at any given time Indicates the first The adaptive threshold at any given time. When the deviation... Exceeding the threshold ,Right now If so, it is determined that a device access event has occurred, and the current deviation is... Exceeding the threshold ,Right now If the event is determined to be a device disconnection event, then the event end time is calculated as follows to obtain the voltage and current signals after the device is connected:
[0119]
[0120] (Formula 7)
[0121] in: This represents the threshold used to determine the end of an event. This indicates the end time of the event. Because sliding windows inherently have a lag, the CUSUM algorithm cannot accurately determine the event occurrence time. To overcome this difficulty, a method of adding a reverse event detection window is used. Using the reverse window as the starting point, the event start time is traced backward, and the steps are the same as for forward event detection. The event start time is calculated as follows:
[0122]
[0123] (Formula 8)
[0124] in: Indicates the end time of the event in reverse event detection. This indicates the event end time. To prevent false positives, a false positive prevention window is set up to "backtrack" and confirm events that have already occurred. If the event duration is less than a certain time, it is considered a false positive, calculated as follows:
[0125]
[0126] (Formula 9)
[0127] in, Indicates the duration of the event. Indicates the duration of time, by Figure 3 The results show that the invented algorithm can accurately capture the moment an event occurs.
[0128] In step S105, based on the start and end times of the event calculated in step S104, electrical characteristics before and after the event are extracted. The extracted characteristics include RMS voltage, RMS current, active power, reactive power, apparent power, power factor, rated power, voltage distortion rate, current distortion rate, voltage harmonic group content, and current harmonic group content, calculated as follows:
[0129]
[0130]
[0131]
[0132]
[0133] (Formula 10)
[0134] in, This represents the discrete values of the collected voltage. This represents the discrete values of the collected current. Indicates the effective value of the voltage. Indicates the effective value of the current. Indicates active power. Indicates apparent power. Indicates reactive power. Indicates the power factor. Indicates the rated power. This represents the result calculated by performing a Fourier transform on the acquired discrete current signal. Secondary current harmonics This represents the result calculated by performing a Fourier transform on the acquired discrete voltage signal. Secondary current harmonics Indicates voltage distortion rate. Indicates the current distortion rate. Indicates the voltage harmonic group content. This indicates the content of current harmonic groups.
[0135] The specific feature calculation results are shown below:
[0136] Feature categories Feature value at the start of the event Feature value at the end of the event RMS voltage (V) 225.77 224.40 RMS current (A) 0.78 9.56 Active power (W) 50.66 2156.89 Reactive power (Var) 169.82 432.63 Apparent power (VA) 176.1 2248.4 Power factor 0.29 0.96 Rated power (W) 49.37 2114.60 Voltage distortion rate (%) 2.27 1.70 Current distortion rate (%) 49.3 8.98 Voltage harmonic group content (V) 5.13 4.08 Current harmonic group content (A) 0.17 0.94
[0137] The electrical characteristics of the powered-on or powered-off equipment are calculated based on the electrical characteristics before and after the event, as follows:
[0138]
[0139]
[0140]
[0141] ,
[0142] ,
[0143] (Formula 11)
[0144] Among them, among them, This represents the current measured at the start of the event. This represents the current measured at the end of the event. This represents the active power measured at the start of the event. This represents the active power measured at the end of the event. This represents the reactive power measured at the start of the event. This represents the reactive power measured at the end of the event. This represents the apparent power measured at the start of the event. This represents the apparent power measured at the end of the event. This indicates the change in the effective value of the voltage before and after the equipment is put into operation. This indicates the change in the effective value of the current before and after the equipment is put into operation. This indicates the change in active power before and after the equipment is put into operation. This indicates the change in apparent power before and after the equipment is put into operation. This indicates the change in reactive power before and after the equipment is put into operation. This indicates the change in power factor before and after the equipment is put into operation. This indicates the change in rated power before and after the equipment is put into operation. This represents the result of Fourier transform calculation of the current signal before and after equipment operation. The change in the secondary current harmonics. This represents the voltage signal before and after the equipment is operated, calculated using a Fourier transform. The change in the secondary current harmonics. This indicates the change in voltage distortion rate before and after the equipment is put into operation. This indicates the change in current distortion rate before and after the equipment is put into operation. This indicates the change in voltage harmonic group content before and after equipment operation. This indicates the change in the content of current harmonic groups before and after the equipment is put into operation.
[0145] The specific feature results are calculated as follows:
[0146] Feature categories Changes in characteristic values caused by equipment operation RMS voltage -1.37 RMS value of current 8.78 Active power 2055.57 reactive power 262.81 Apparent power 2072.30 Power factor 0.99 Rated power 1975.75 Voltage distortion rate 1.70 Current distortion rate 8.98 Voltage harmonic group content 3.82 Current harmonic group content 0.83
[0147] In step S106, the features of multiple devices extracted in step S105 are evaluated by combining Fisher scores and mRMR (maximum relevance minimum redundancy) feature extraction methods. The Fisher scores, mRMR scores, and comprehensive evaluation scores are as follows: Figure 4 As shown. The Fisher score is calculated as follows:
[0148]
[0149]
[0150]
[0151] (Formula 12)
[0152] in, Indicates the first One characteristic, Indicates the first Categories Indicates the first Fisher scores for each feature.
[0153] The scores for each feature are calculated based on the Fisher score as follows:
[0154] Feature categories Fisher normalized scores for each feature RMS voltage 0.01 RMS value of current 0.41 Active power 1 reactive power 0.69 Apparent power 0.62 Power factor 0.69 Rated power 0.61 Voltage distortion rate 0.02 Current distortion rate 0.34 Voltage harmonic group content 0.14 Current harmonic group content 0.60
[0155] The mRMR score is calculated as follows:
[0156]
[0157] (Formula 13)
[0158] in, Indicates the first One characteristic, Indicates the type of target equipment. Indicates the number of equipment types. Represents a feature group. This indicates the feature score.
[0159] The scores for each feature are calculated based on the mRMR score as follows:
[0160] Feature categories mRMR scores for each feature RMS voltage 0.22 RMS value of current 0.87 Active power 0.98 reactive power 0.98 Apparent power 0.98 Power factor 0.98 Rated power 1 Voltage distortion rate 0.87 Current distortion rate 0.87 Voltage harmonic group content 0.86 Current harmonic group content 0.88
[0161] To combine the Fisher score and mRMR score for comprehensive feature evaluation, a comprehensive scoring mechanism is established. First, the Fisher score and mRMR score results are Max-Min normalized, calculated as follows:
[0162]
[0163] (Formula 14)
[0164] in, and These are the minimum and maximum scores among all feature scores. The overall score is calculated as follows:
[0165]
[0166] (Formula 15)
[0167] Max-Min normalization was performed on the Fisher score and mRMR score results, and the Fisher score and mRMR score were combined for output. The scores of each feature are as follows:
[0168] Feature categories Comprehensive score of each feature RMS voltage 0.12 RMS value of current 0.64 Active power 0.99 reactive power 0.84 Apparent power 0.8 Power factor 0.85 Rated power 0.81 Voltage distortion rate 0.45 Current distortion rate 0.61 Voltage harmonic group content 0.5 Current harmonic group content 0.74
[0169] in, This represents the overall feature score. Features with an overall score less than 0.7 are discarded. All features are ranked by comprehensive scores, and features with higher scores, such as active power and power factor, are selected instead of features such as voltage RMS value, voltage harmonic group content, voltage distortion rate, current distortion rate, and current RMS value, to avoid the influence of redundant information.
Claims
1. An event detection and feature extraction method based on the CUSUM bidirectional detection algorithm, comprising the following steps: Step S101: Data acquisition and establishment of user-side electricity consumption sample database. By using multi-core modular meters to read users’ electricity voltage and current data, performing data analysis and dimension unification, a user-side electricity consumption sample database is constructed. Step S102, Data preprocessing, constructing the dataset An improved forward imputation method was used to preprocess the original payload data to address missing values, and a dataset was constructed. Step S103, Active power calculation Active power is calculated based on the collected discrete voltage and current signals; Step S104: Determine the start and end times of the event through event detection. Perform event detection using the CUSUM algorithm based on active power and obtain accurate event start and end times; Step S105: Obtain the electrical characteristics of a single device. Based on the event start and end times obtained in step S104, calculate the characteristics before and after the power load is connected, and obtain the electrical characteristics of a single device. Step S106, Feature Evaluation and Selection By combining Fisher score and mRMR feature extraction method, the features extracted in step S105 are evaluated, features below the threshold are deleted, and features above the threshold are retained. In step S104, the mean and standard deviation of the active power within a window are calculated by using a sliding window method, and an adaptive threshold is set based on the standard deviation of the window data. The CUSUM algorithm continuously monitors changes in the mean and standard deviation of the power signal. Once it detects a change exceeding a set adaptive threshold, it considers an event to have occurred. When CUSUM detects that the signal has returned to a steady state, it considers the event to have ended. After the event is detected and concluded, the reverse CUSUM algorithm is used to determine the voltage cycle preceding the event: the calculation is as follows: (Formula 3) (Formula 4) in: Indicates the first Active power at any given time This indicates the window size, set to 6. This represents the average value of the window data. Indicates the standard deviation of active power; The mean and standard deviation at each time point are calculated using a sliding window approach, with an adaptive threshold set as follows: (Formula 5) in: This represents the average value of the window data. This is an empirical proportionality coefficient, with a value of 0.
5. The threshold is adaptive, and the unit is watts. For event detection, there are two scenarios: device access and device removal, which are detected using upper and lower bias respectively. The calculation is as follows: (Formula 6) in: Indicates the first The upper deviation at time describes the degree to which the power value deviates from the threshold. Indicates the first Downward deviation of time, Indicates the first Active power at any given time Indicates the first Adaptive threshold at time; when the upper deviation Exceeding the threshold , Take 20, the unit is watts, that is If so, it is determined that a device access event has occurred, and the current deviation is... Exceeding the threshold ,Right now If the event is determined to be a device disconnection event, the event end time is calculated as follows to obtain the voltage and current signals after the device is connected: (Formula 7) in: Indicates the first The cumulative deviation at time is and The maximum value, This represents the threshold used to determine the end of an event, set to 10, with the unit being watts. Indicates the end time of the event; Because sliding windows inherently exhibit lag, the CUSUM algorithm cannot accurately determine the timing of events. To overcome this difficulty, a method of adding a reverse event detection window is employed. Using the reverse window as the starting point, the event start time is traced backward, and the steps are the same as for forward event detection. The event start time is calculated as follows: (Formula 8) Note: Here It indicates the first The cumulative deviation at time points, since only the time of events is considered here, This includes both disconnection and connection scenarios. and The maximum value; in: Indicates the end time of the event in reverse event detection. This indicates the start time of the event. To prevent false positives, a false positive prevention window is set up to "backtrack" and confirm events that have already occurred. If the duration of the event is less than a certain time, it is considered a false positive, calculated as follows: (Formula 9) in, Indicates the duration of the event. Indicates duration.
2. The event detection and feature extraction method based on the CUSUM bidirectional detection algorithm according to claim 1, characterized in that, In step S101, the data collected by the smart meter is voltage and current data, and the sampling frequency is 128 points per cycle, i.e., 6.4kHz.
3. The event detection and feature extraction method based on the CUSUM bidirectional detection algorithm according to claim 1, characterized in that, In step S102, for missing values, the three most recent valid observations preceding the missing value will be used. , , These values are assigned different weights, with larger weights indicating values closer to the missing values. A weighted average is then calculated to fill in the missing values; the calculation is as follows: (Formula 1) in: These are the observations at the corresponding time points, and the specific weight values are usually [values to be filled in]. , , .
4. The event detection and feature extraction method based on the CUSUM bidirectional detection algorithm according to claim 1, characterized in that, In step S103, active power is calculated based on the collected discrete voltage and current signals; the calculation formula is as follows: ; (Formula 2) in: The instantaneous voltage at the current moment. The instantaneous current at the current moment, The instantaneous power at the current moment, The number of sampling points per cycle is 128. This represents the active power for the current cycle.
5. The event detection and feature extraction method based on the CUSUM bidirectional detection algorithm according to claim 4, characterized in that, In step S105, based on the start and end times of the event calculated in step S104, electrical characteristics before and after the event are extracted. The extracted characteristics include RMS voltage, RMS current, active power, reactive power, apparent power, power factor, rated power, voltage distortion rate, current distortion rate, voltage harmonic group content, and current harmonic group content, calculated as follows: Indicates the effective value of the voltage: ;in, This represents the discrete values of the collected voltage. ; in, This represents the discrete values of the collected current. Indicates the effective value of the current; ; ; ; ; ; Indicates active power. Indicates apparent power. Indicates reactive power. Indicates the power factor. Indicates rated power; ; ; ; ; (Formula 10) In the formula, This represents the result calculated by performing a Fourier transform on the acquired discrete current signal. Secondary current harmonics This represents the result calculated by performing a Fourier transform on the acquired discrete voltage signal. Secondary current harmonics; Indicates voltage distortion rate. Indicates the current distortion rate. Indicates the voltage harmonic group content. Indicates the content of current harmonic groups; The electrical characteristics of the powered-on or powered-off equipment are calculated based on the electrical characteristics before and after the event, as follows: ; ; ; ; ; ; ; ; ; ; ; (Formula 11) in, This represents the current measured at the start of the event. This represents the current measured at the end of the event. This represents the active power measured at the start of the event. This represents the active power measured at the end of the event. This represents the reactive power measured at the start of the event. This represents the reactive power measured at the end of the event. This represents the apparent power measured at the start of the event. This represents the apparent power measured at the end of the event. This indicates the change in the effective value of the voltage before and after the equipment is put into operation. This indicates the change in the effective value of the current before and after the equipment is put into operation. This indicates the change in active power before and after the equipment is put into operation. This indicates the change in apparent power before and after the equipment is put into operation. This indicates the change in reactive power before and after the equipment is put into operation. This indicates the change in power factor before and after the equipment is put into operation. This indicates the change in rated power before and after the equipment is put into operation. This represents the result of Fourier transform calculation of the current signal before and after equipment operation. The change in the secondary current harmonics. This represents the voltage signal before and after the equipment is operated, calculated using a Fourier transform. The change in the secondary current harmonics. This indicates the change in voltage distortion rate before and after the equipment is put into operation. This indicates the change in current distortion rate before and after the equipment is put into operation. This indicates the change in voltage harmonic group content before and after equipment operation. This indicates the change in the content of current harmonic groups before and after the equipment is put into operation.
6. The event detection and feature extraction method based on the CUSUM bidirectional detection algorithm according to claim 1, characterized in that, In step S106, the features extracted in step S105 are evaluated by combining Fisher scores and mRMR feature extraction methods. Fisher score is calculated as follows: ; ; (Formula 12) in, Indicates the first One characteristic, Indicates the first Categories Indicates category Chinese characteristics The mean, This represents the mean of all features. Indicates the difference between means. Indicates category Chinese characteristics within-category variance Indicates the first Fisher scores for each feature; The mRMR score is calculated as follows: ; (Formula 13) in, Indicates the first One characteristic, Indicates the type of target equipment. Indicates the number of equipment types. Represents a feature group. Indicates feature score; To combine the Fisher score and mRMR score for comprehensive feature evaluation, a comprehensive scoring mechanism is established. First, the Fisher score and mRMR score results are Max-Min normalized, calculated as follows: (Formula 14) in, and These are the minimum and maximum scores among all feature scores; the overall score is calculated as follows: (Official 15) in, This represents the overall feature score; features with an overall score less than 0.5 are discarded. The system ranks all features by comprehensive scores, selects the features with higher scores, and avoids the influence of redundant information.