A device power fingerprint recognition method and system based on real-time power consumption and machine learning
Through the equipment power fingerprint recognition method based on real-time power consumption and machine learning, the existing equipment load recognition methods are solved, and higher recognition accuracy and real-time performance are achieved.
Patent Information
- Application Number
- CN202311720773.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2043-12-14
AI Technical Summary
The existing equipment load recognition methods are inefficient and have poor real-time performance, poor data quality, single feature values, and cannot be run in real-time, which affects the recognition accuracy and real-time performance.
Using the equipment power fingerprint recognition method based on real-time power consumption and machine learning, multi-layer perceptron classifiers are designed to identify the power consumption change mode of the device in real time through data acquisition and preprocessing, feature extraction and model training.
The accuracy and real-time nature of device recognition are improved, and the recognition capabilities of the model are enhanced through noise filtering and multi-dimensional feature extraction, and faster response to device state changes is achieved.
Smart Images

Figure CN117789257B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power data processing, and relates to a device power fingerprint recognition method and system based on real-time power consumption and machine learning. Background Art
[0002] Power fingerprint recognition technology is developed from power load recognition technology and is an important part of power fingerprint technology. Power fingerprint recognition technology collects electrical data from electrical equipment and uses artificial intelligence technology and big data technology to mine the "power fingerprint" features that can characterize the characteristics of the equipment.
[0003] Most current equipment load identification research uses intercepting different signal characteristic values of AC power to generate data samples. These characteristic values are digitized by analog-to-digital converters and calculated and processed by microcontrollers. Usually, the equipment load identification device is installed at the entrance of the AC power supply, analyzes the total current, and then matches and analyzes the data in the industrial equipment power consumption characteristic database to identify the type and operating status of the industrial equipment. Its characteristics are low setup cost and simple setup.
[0004] At present, the existing technologies mainly have the following deficiencies: 1) Poor data quality: There is a lot of noise in the AC signal, and there is a lack of noise removal steps, resulting in low data quality and affecting subsequent identification and classification. 2) Single feature value: The feature value of the traditional AC signal uses a small number of signal features, resulting in the selection of signal feature values that is not comprehensive and effective, hindering the improvement of model recognition accuracy. 3) Poor real-time performance: The traditional equipment load identification solution cannot run in real time, and the complete information is accumulated and analyzed within a few minutes to a few hours. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a device power fingerprint identification method and system based on real-time power consumption and machine learning, which can solve the problems of low efficiency and poor real-time performance of traditional device load identification methods.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] A device power fingerprint recognition method based on real-time power consumption and machine learning, the method specifically comprising the following steps:
[0008] S1. Data collection and data processing: collect real-time power consumption data of the equipment and perform data preprocessing to filter out interference noise;
[0009] S2, feature extraction: divide the data set according to the sliding window and extract power fingerprint features from the time domain and frequency domain respectively;
[0010] S3. Model training and device identification: Design a multi-layer perceptron classifier to identify power consumption change patterns, thereby enabling identification of different devices.
[0011] Further, in step S1, it specifically includes:
[0012] S11, through the formula And the formula p m (t) = I*t to calculate the power consumption of the device, where P D Indicates the total power consumption of the device. represents the power consumption of the i-th module (such as sensor, Bluetooth, CPU, etc.) in the device, I represents the real-time current, t represents the time variable, and m represents the module currently represented; after measuring the power of the device, P (p1, p2, ..., p n ), which represents the power consumption of the device, where n represents the number of data points;
[0013] S12, use the Cumulative Distribution Function (CDF) based denoising step to eliminate obvious abnormal peaks, and then use the Exponential Moving Average (EMA) based filtering step to remove small abnormal fluctuations. After these two steps, the cleaned data S (s1, s2, …, s m ), where m represents the number of data points remaining after processing;
[0014] S13. Process the cleaned data using a sliding window to capture skeleton data of power consumption data fluctuations.
[0015] Further, in step S2, discriminative features are extracted from the preprocessed power consumption data to distinguish devices, 22 features are selected from the time domain, and 6 features are selected from the frequency domain, specifically including:
[0016] Features based on time domain:
[0017] 1) Average power consumption within the sliding window:
[0018]
[0019] 2) Standard deviation of power consumption within the sliding window:
[0020]
[0021] 3) Maximum and minimum power consumption values of the sliding window:
[0022] f3=max(R)
[0023] f4=min(R)
[0024] 4) Power consumption values at 30%, 60%, and 90% in the sliding window:
[0025]
[0026]
[0027] 5) Characteristics related to △W:
[0028]
[0029] 6) Characteristics related to △T:
[0030]
[0031] 7) Characteristics related to Re:
[0032]
[0033] Frequency domain based features:
[0034] 1) Root Mean Square:
[0035]
[0036] where d i is the original power consumption data i The value obtained after Fourier transformation;
[0037] 2) Spectral centroid:
[0038]
[0039] 3) Spectral entropy:
[0040]
[0041] 4) Spectral skewness:
[0042]
[0043] 5) Spectral peak state:
[0044]
[0045] 6) Spectral flatness:
[0046]
[0047] Further, in step S3, a multilayer perceptron is used to train a classifier based on the generated features, and a multilayer perceptron network with one hidden layer is constructed. Based on the number of features and classification labels, the network contains 20 neurons and uses the sigmoid function as the activation function of the network; through the multilayer perceptron, the corresponding device model predicted by the model through the power consumption data is obtained, thereby realizing the identification of different devices.
[0048] The present invention also provides a device power fingerprint recognition system based on real-time power consumption and machine learning.
[0049] The beneficial effects of the present invention are:
[0050] This solution solves the problems of low efficiency and poor real-time performance of traditional device load identification methods. Noise filtering in the data processing step helps improve quality and reduce the impact of noise and interference, thereby improving the accuracy of device identification; extracting power from the time domain and frequency domain can capture the characteristics of different devices, which allows the solution to analyze power data more comprehensively and improves the identity of identification; collecting real-time power consumption data, dynamically processing the data system and using sliding windows during data processing allow for rapid response to changes in device status, thereby achieving higher real-time performance, which is very important for certain applications that require rapid identification of device status changes.
[0051] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0053] Figure 1 It is a process framework diagram of the present invention. DETAILED DESCRIPTION
[0054] The technical solution of the present invention is described in detail below with reference to the accompanying drawings.
[0055] Figure 1This is a flowchart of the present invention. As shown in the figure, the scheme of the present invention includes five steps: power consumption data collection, data processing, feature extraction, model training and device identification. In the data collection part, smart meters and other devices are used to collect power consumption data of various electrical devices for subsequent processing and analysis; in the data processing part, because the collected original power consumption data contains noise (such as abnormal power consumption peaks caused by device temperature), these noises will have a negative impact on subsequent steps, so these noises need to be filtered out; in the feature extraction part, some features are extracted from the time domain and frequency domain based on the processed data; in the model training part, the classification model is trained according to the extracted features; in the final device identification part, a segment of power consumption data of a device can be given, and the trained classification model can be used to identify the specific type of the device.
[0056] In this embodiment, the specific scheme is as follows:
[0057] Data collection and data processing:
[0058] The device power consumption can be calculated by the formula And the formula p m (t) = I*t. Where P D Indicates the total power consumption of the device. Represents the power consumption of the i-th module (such as sensor, Bluetooth, CPU, etc.) in the device, I represents the real-time current, t represents the time variable, and m represents the module currently represented. This formula is used to calculate the total power consumption of the device, where the power consumption of each module of the device and the change of real-time current will affect the collection of power consumption data.
[0059] The collected raw power consumption data contains errors. For example, changes in battery temperature will affect the power consumption value. Therefore, the present invention first performs a cleaning operation on the raw power consumption data. The cleaning operation of the scheme of the present invention includes two methods commonly used in signal processing: the first method is based on the Cumulative Distribution Function (CDF), and the second method is based on the Exponential Moving Average (EMA). Specifically, the CDF-based method handles some obvious abnormal peaks, and the EMA-based method handles small abnormal fluctuations.
[0060] CDF is a statistical tool used to describe the probability distribution of a random variable. CDF represents the probability of observing the random variable before a certain value. It is the integral of the probability density function (PDF), where PDF describes the probability density of the random variable at different values. CDF can be expressed as F X(x=P(X≤x), where P(X≤x) represents the probability that the random variable X is equal to or less than x. In this solution, the CDF method is used to process the original power consumption data. The present invention deletes the power consumption data points whose CDF is not between 4.5% and 95.5% to eliminate obvious abnormal peaks.
[0061] EMA is a method of averaging time series data, particularly useful for smoothing data and capturing its trends. Moving Average (MA) is a method of evaluating data points by generating a series of average values of various subsets within the full data set. There are several types of MA methods, including Simple Moving Average (SMA), Weighted Moving Average (WMA), Exponential Moving Average (EMA), etc. Unlike other MA methods, EMA gives higher weight to recent data points and is therefore more sensitive to the latest data changes. EMA can be expressed as:
[0062]
[0063] Where Yt is the original data point before processing, S t is the data point after EMA filtering, a is a parameter with a value between 0 and 1, and is set to 0.8 in this scheme. Through EMA filtering, small fluctuation anomalies in the original data are also removed.
[0064] In general, after measuring the power of the device, we can get P(p1, p2, ..., p n ), which represents the power consumption of the device, where n represents the number of data points. In the preprocessing process, a CDF-based denoising step is first used to remove obvious abnormal peaks, and then an EMA-based filtering step is used to remove small abnormal fluctuations. After these two steps, the cleaned data S (s1, s2, …, s m ), where m represents the number of data points remaining after processing.
[0065] In order to facilitate the processing of power consumption data, this solution uses a sliding window to process the cleaned data. Assuming the length of the sliding window is Z and the offset factor is f, the cleaned data S (s1, s2, ..., s m ) is converted into a sample sequence R based on a sliding window i =(r (i-1)fZ+1 ,r (i-1)fZ+2 ,…,r (i-1)fZ+Z) ,in In this solution, the sliding window size is set to 20. Then for each sample R i Perform local maximum and minimum peak search to capture the skeleton data of power consumption data fluctuation. Specifically, assume that the sample is R(r1,r2,…,r Z ), for each measurement value r i , if the following requirements are met, the measurement value is selected as the local maximum (minimum) peak: first, its value is greater (smaller) than the previous and next measurement values, that is, r i ≥r i+1 And r i ≥r i-1 (r i ≤r i+1 And r i ≤r i-1 ); Second. Its value is at least greater (smaller) than α times the peak value of the previous local maximum (minimum), that is, pmax i ≥α·pmax -1 (pmin i ≤α·pmin i-1 ), in this scheme, α is set to σ, where σ is the standard deviation of the power consumption data of a given device.
[0066] After capturing all local maximum and minimum peaks, the skeleton data of power consumption data fluctuation is obtained. Specifically, the vector W = ((r1, t1),…, (r c ,t c ) contains information about the local maximum and minimum peaks, where r i is the measured value of the i-th local maximum (minimum) peak, t i is the corresponding timestamp, c is the total number of maximum (minimum) peaks. Vector U = (u1,…,u c ) is related to the vector W, when r j When u is a local maximum, j =1; when r j When u is a local minimum, j = -1. Finally, calculate △W, △T and Re vector to describe the local maximum and minimum peak changes. For i∈{1,…,c}, if u i u i+1 =-1, then |r i -r i+1 The value of | is recorded as an element of △W, and t i+1 -t i The value of is recorded as an element of △T. Then calculate Where L is the total number of Re.
[0067] Feature extraction:
[0068] It is necessary to extract discriminative features from the preprocessed power consumption data to distinguish devices. In the present invention, 22 features are selected from the time domain and 6 features are selected from the frequency domain.
[0069] For each sliding window-based power sample R(r1,r2,…,r Z ), we can extract a corresponding feature vector feature=(f1,f2,…,f K ), where K represents the total number of features. In this solution, K=29. These features are described in detail below:
[0070] Features based on time domain:
[0071] 1) Average power consumption within the sliding window:
[0072]
[0073] 2) Standard deviation of power consumption within the sliding window:
[0074]
[0075] 3) Maximum and minimum power consumption values of the sliding window:
[0076] f3=max(R)
[0077] f4=min(R)
[0078] 4) Power consumption values at 30%, 60%, and 90% in the sliding window:
[0079]
[0080] 5) Characteristics related to △W:
[0081]
[0082] 6) Characteristics related to △T:
[0083]
[0084] 7) Characteristics related to Re:
[0085]
[0086]
[0087] Frequency domain based features:
[0088] In order to extract the frequency domain features of the power consumption data, we first perform a sliding window analysis on the data R = (r1, r2, ..., r Z) is subjected to fast Fourier transform, and the vector D = (d1, d2, ..., d Z ). Then, seven frequency domain features were calculated, namely, RMS, spectrum centroid, spectrum entropy, spectrum diffusion, spectrum skewness, spectrum kurtosis, and spectrum flatness:
[0089] 1) Root Mean Square:
[0090]
[0091] where d i is the original power consumption data i The value obtained after Fourier transformation;
[0092] 2) Spectral centroid:
[0093]
[0094] 3) Spectral entropy:
[0095]
[0096] 4) Spectral skewness:
[0097]
[0098] 5) Spectral peak state:
[0099]
[0100] 6) Spectral flatness:
[0101]
[0102] Model training and device identification:
[0103] The present invention uses a multilayer perceptron to train a classifier based on the generated features. A multilayer perceptron (MLP) is a deep learning neural network model with a wide range of applications for solving problems such as classification, regression, and pattern recognition. A multilayer perceptron is a type of feedforward neural network, and its name "multilayer" comes from the fact that it contains multiple neural network layers.
[0104] The core components of a multilayer perceptron include input layer, hidden layer, and output layer. The input layer receives the raw data, and each input neuron corresponds to a feature or attribute of the data. These input features are weighted and passed to the hidden layer; the hidden layer is a key component of a multilayer perceptron, consisting of one or more layers, each of which contains multiple neurons. These neurons perform nonlinear transformations on the input data through activation functions to capture complex patterns and features in the data. The number of hidden layers and the number of neurons can be adjusted to adapt to the complexity of different problems; the output layer generates the final prediction or classification result of the multilayer perceptron. The number of neurons in the output layer usually depends on the type of problem. For example, for a binary classification problem, the output layer usually contains two neurons, each corresponding to the predicted probability of a category.
[0105] The training of the multilayer perceptron is achieved through the back-propagation algorithm. During the training process, the weights and biases of the network are gradually adjusted to reduce the prediction error of the model. The back-propagation algorithm calculates the error by comparing the predicted output of the network with the actual target and propagates the error information back to the hidden layer to update the weights and biases.
[0106] In this solution, a simple multi-layer perceptron network with one hidden layer is constructed. Based on the number of features and classification labels, the network contains 20 neurons and uses the sigmoid function as the activation function of the network. Through the multi-layer perceptron, the corresponding device model predicted by the model through power consumption data can be obtained.
[0107] After obtaining the device power consumption data, perform data processing and feature extraction steps on the power consumption data to obtain several feature instances. Use the trained classifier to test each instance and finally output the video label of the instance.
[0108] This solution solves the problems of low efficiency and poor real-time performance of traditional equipment load identification methods and has broad application prospects, including but not limited to the following fields:
[0109] (1) Device security and monitoring: By monitoring the power consumption characteristics of devices, it is possible to identify whether illegal devices are present and whether the devices are under malicious attacks or illegally used, which helps improve the security of devices and networks.
[0110] (2) Industrial equipment monitoring and maintenance: This solution can be used to identify various equipment in industrial production lines, including mechanical equipment, electronic equipment, and sensors. This helps improve production efficiency, perform equipment maintenance, and reduce downtime.
[0111] (3) Power system monitoring: This solution can be used to monitor the operating status of different equipment in the power system, such as transformers, motors, and generators, to improve the reliability and stability of the power system.
[0112] (4) Smart Home: This solution can be used to identify various electronic devices in the home, such as home appliances, lighting, and HVAC equipment, thereby achieving energy saving and intelligent control. It can also monitor whether there are illegal devices in the home to ensure home safety.
[0113] (5) Smart City: In smart city projects, this method can be used to monitor the status of urban facilities such as street lights, traffic lights, and public transportation equipment to improve the reliability and efficiency of urban facility infrastructure.
[0114] (6) Intelligent Manufacturing: In intelligent manufacturing, this method can be used to monitor various equipment on the production line to achieve intelligent scheduling and optimize production efficiency.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A device power fingerprint identification method based on real-time power consumption and machine learning, characterized by: The method specifically comprises the following steps: S1. Data collection and data processing: collect real-time power consumption data of the equipment and perform data preprocessing to filter out interference noise; S2, feature extraction: divide the data set according to the sliding window and extract power fingerprint features from the time domain and frequency domain respectively; S3. Model training and device identification: Design a multi-layer perceptron classifier to identify power consumption change patterns, thereby identifying different devices; In step S1, it specifically includes: S11, through the formula And the formula p m (t) = I*t to calculate the power consumption of the device, where P D Indicates the total power consumption of the device. represents the power consumption of the i-th module in the device, I represents the real-time current, t represents the time variable, and m represents the module currently represented; after measuring the power of the device, P(p1, p2, ..., p n ), which represents the power consumption of the device, where n represents the number of data points; S12, use the Cumulative Distribution Function (CDF) based denoising step to eliminate obvious abnormal peaks, and then use the Exponential Moving Average (EMA) based filtering step to remove small abnormal fluctuations. After these two steps, the cleaned data s (s1, s2, …, s m ), where m represents the number of data points remaining after processing; S13, processing the cleaned data using a sliding window to capture skeleton data of power consumption data fluctuations; In step S2, discriminative features are extracted from the preprocessed power consumption data to distinguish devices. 22 features are selected from the time domain and 6 features are selected from the frequency domain, including: Features based on time domain: 1) Average power consumption within the sliding window: Where Z is the number of data contained in the sliding window, r i is the i-th power consumption data in the window; 2) Standard deviation of power consumption within the sliding window: 3) Maximum and minimum power consumption values of the sliding window: f3=max(R) f4=min(R) Here R represents the set of all power consumption data in the window; 4) Power consumption values at 30%, 60%, and 90% in the sliding window: 5) Characteristics related to △W: Where △W(i) records the absolute value of the difference between the power consumption data of adjacent positions in the i-th sliding window, and L represents the number of sliding windows; 6) Characteristics related to △T: Here △T(i) represents the time difference between adjacent position data points in the i-th sliding window; 7) Characteristics related to Re: in Frequency domain based features: 1) Root Mean Square: where d i is the original power consumption data i The value obtained after Fourier transformation; 2) Spectral centroid: 3) Spectral entropy: 4) Spectral skewness: 5) Spectral peak state: 6) Spectral flatness:
2. According to claim 1, a device power fingerprint identification method based on real-time power consumption and machine learning is characterized in that: In step S3, a multilayer perceptron is used to train a classifier based on the generated features, and a multilayer perceptron network with one hidden layer is constructed. Based on the number of features and classification labels, the network contains 20 neurons and uses the sigmoid function as the activation function of the network; through the multilayer perceptron, the corresponding device model predicted by the model through the power consumption data is obtained, thereby realizing the identification of different devices.
3. A device power fingerprint recognition system based on real-time power consumption and machine learning, characterized by: The system adopts the method as claimed in any one of claims 1 to 2.
Citation Information
Patent Citations
Industrial power load identification method based on EO feature selection in combination with AdaBoost algorithm
CN116561569A