Non-intrusive load identification method, medium and equipment
By combining goodness of fit test and cluster analysis with improved U-I trajectory matrix and multi-head attention mechanism model, the problem of inaccurate identification of multi-state electrical equipment is solved, and a higher accuracy non-invasive load recognition is achieved.
Patent Information
- Application Number
- CN202510314145.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-07-18
AI Technical Summary
When facing multi-state electrical equipment, the existing non-invasive load recognition method is difficult to accurately distinguish the power consumption patterns, resulting in insufficient identification results.
Goodness of fit test is used to capture the change moments of the state of the power consumption equipment, multi-state equipment is screened through cluster analysis, and an improved U-I trajectory matrix and multi-head attention mechanism model is constructed to perform feature extraction and weighting to improve recognition accuracy.
Accurate identification of multi-state electrical equipment is achieved, and the accuracy and reliability of non-invasive load recognition is improved.
Smart Images

Figure CN120336728A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a non-intrusive load identification method, and specifically studies a non-intrusive load identification method, medium and device. Background Art
[0002] It is urgent to build a clean, low-carbon, safe and efficient energy system. Non-intrusive load monitoring (NILM) is a technology used to monitor and analyze the electricity consumption of various electrical devices in a power system. It does not require additional sensors or devices to be installed on the equipment, but instead analyzes the existing data in the power system (such as voltage, current, power, etc.) to identify and distinguish different electrical devices and analyze their electricity consumption patterns. This technology can analyze users' electrical devices and help residents formulate reasonable electricity consumption strategies to achieve "peak shaving and valley filling" of grid electricity consumption.
[0003] Currently, NILM mainly classifies loads by mining load characteristics and then combining classification algorithms such as deep learning and neural networks according to different load characteristics. In traditional identification processes, load characteristics mainly include voltage and current waveforms, active and reactive power, current harmonics, voltage-current trajectories (U-I trajectories), etc., among which U-I trajectories are widely used. With the update of electrical devices, there are significant differences in the electricity consumption patterns and load types of different electrical devices. According to the electricity consumption state, electrical devices can be divided into single-state and multi-state electrical devices. For multi-state electrical devices, the characteristics such as voltage, current, power, and U-I trajectories during their electricity consumption process are similar to those of single-state electrical devices, resulting in inaccurate non-intrusive identification results. To address the above problems, the present invention improves the traditional U-I trajectory matrix, integrates high-order harmonic current characteristics, and forms a hybrid feature matrix, which can correctly distinguish electrical devices with the same or similar U-I trajectory matrices. Summary of the Invention
[0004] A non-intrusive load identification method, device and storage medium proposed by the present invention can at least solve one of the technical problems in the background art.
[0005] To achieve the above object, the present invention adopts the following technical solutions:
[0006] A non-intrusive load identification method includes the following steps:
[0007] S1. Use the goodness-of-fit test to perform event detection on the electricity consumption device data of the gateway meter, accurately capture the moment when the state of the electricity consumption device changes, and extract the event characteristics at the moment of state change;
[0008] S2. Perform clustering analysis on the event characteristics at the moment of state change;
[0009] S3. Based on the results of the clustering analysis, complete the identification of single-state electrical equipment, and screen out the multi-state electrical equipment that has not been accurately identified;
[0010] S4. Perform batch normalization on the active power, reactive power, voltage, and current data characteristics of the multi-state electrical equipment that has not been accurately identified, and jointly form a feature dataset with the improved U-I trajectory matrix;
[0011] S5. Based on the fused feature dataset, establish a multi-head attention mechanism model, and weight the feature information according to the feature importance; after weighting, establish a pyramid pooling model containing 5 pooling blocks to extract features from the load data, output the identification results of the electrical equipment, and complete the load identification of the clustering group containing multi-state electrical equipment.
[0012] Furthermore, the method for extracting event features at the moment of state change in step S1 of the present invention includes:
[0013] S110. Perform real-time sampling on the voltage, current, active power, and reactive power power consumption data of the user gateway meter, and set different sampling periods according to the dynamic characteristics of the electrical equipment;
[0014] Taking 5ζ as a time window, where ζ is the time constant for the load to reach a stable state when starting and stopping, and each time window contains m data; for voltage and current power consumption data, m = 1200, that is, each time window contains 1200 voltage data and current data; for active power and reactive power power consumption data, m = 50, that is, each time window contains 50 active power and reactive power data;
[0015] For the active power data within a certain time window b Perform a goodness-of-fit test to obtain the test statistic of time window b:
[0016]
[0017] In the formula, is the test statistic of time window b, is the j-th data within time window b, is the j-th data in the previous time window b-1 before detection;
[0018] Let χ 2 be the reference statistic. If then it is determined that the state of the electrical equipment has changed within time window b; otherwise, it is determined that the state of the electrical equipment has not changed within time window b. The value range of χ 2 satisfies:
[0019] 0.3PN,min ≤χ 2 ≤0.5P N,min (21)
[0020] Where: P N,min is the rated power of the single electrical equipment with the smallest rated power among all electrical equipment;
[0021] S120. Assume that the state of the electrical equipment has changed within the time window i, and calculate the active power change ΔP within this time window e,i ;
[0022]
[0023] In the formula: P i j is the j-th data within the time window i, is the j-th data in the previous time window i - 1 before detection;
[0024] Let a detection period be 12 h. Assume that within a certain detection period, the state of the electrical equipment has changed k times. Calculate ΔP from formula (3) e,1 , ΔP e,2 ,..., ΔP e,i ,..., ΔP e,k , and form a set ΔP of active power changes that change with the state of the electrical equipment e ={ΔP e,1 , ΔP e,2 ,..., ΔP e,i ,..., ΔP e,k}
[0025] Similarly, calculate the set ΔQ of reactive power changes, the set ΔU of voltage changes, and the set ΔI of current changes that change with the state of the electrical equipment e , the set ΔU of voltage changes e , and the set ΔI of current changes e .
[0026] Furthermore, the clustering analysis method for the event characteristics at the state change moment in step S2 of the present invention includes:
[0027] S210. From the set ΔP of active power changes obtained in step S1 e , randomly select a data as the clustering center, denoted as R1. Without replacement, select the next data as the new clustering center R2. Repeat the without-replacement sampling step until f clustering centers are selected, denoted as R = {R1, R2,..., R s ,..., R f} The value of f is determined by the number of electrical equipment. Assume the number of electrical equipment is M. The value range of f generally satisfies:
[0028]
[0029] Denote the remaining (k - f) non-cluster center data as Calculate their distances from the f selected cluster centers respectively:
[0030]
[0031] In the formula, represents the active power change of the th non-cluster center, and R s represents the selected sth cluster center, The closest distance to the selected cluster center is:
[0032]
[0033] S220. Calculate ΔP e For each data point ΔP in e,i The probability g of being selected as the next cluster center i , the greater the distance, the greater the probability of being selected, and the selected data point is used as the new cluster center.
[0034]
[0035] S230. Repeat the calculation steps S210 and S220. After the initial optimization of the cluster centers, perform the standard K-means clustering, and cluster the data with large differences in active power changes into different groups K = [K1, K2,... Kf] to complete the load identification in the first stage.
[0036] Furthermore, in step S3 of the present invention, according to the results of the cluster analysis, the method for completing the identification of single-state electrical equipment and screening out the multi-state electrical equipment that has not been accurately identified includes:
[0037] S310. After the cluster identification, there are some electrical equipment that are clustered into the wrong cluster groups. For this part of the equipment, select the load data corresponding to the state change from the dataset in step S1, and normalize its voltage and current data to the range of [0, N]. The formula is as follows:
[0038]
[0039] In the formula: represents the jth normalized voltage data in the ith time window of the multi-state electrical equipment, represents the jth current data in the ith time window, j ∈ {1, 2,..., m}, and are the maximum and minimum values of the voltage within the \(i\)-th time window respectively, and are the maximum and minimum values of the current within the \(i\)-th time window respectively; \(N\) is the number of pixels of the improved \(U - I\) trajectory matrix, and considering the characteristics of the electrical equipment, the value range of \(N\) is \(25\leq N\leq64\);
[0040] Map the normalized voltage and current data to the improved \(U - I\) trajectory matrix \(B\) using the feature mapping model. The formula is as follows:
[0041]
[0042] In the formula: \(a\) and \(d\) are the row index and column index of matrix \(B\) respectively; is the floor symbol;
[0043] S320. Based on the load current data obtained in step S120, perform Fourier transform decomposition on the current data within the \(i\)-th time window to obtain the fundamental wave and 3rd harmonic 5th harmonic 7th harmonic 9th harmonic of the current and their amplitudes;
[0044]
[0045] In the formula: \(z\) is the harmonic order, \(z = 1,3,5,\cdots,h\); is the amplitude of the \(z\)-th harmonic of the current in the \(i\)-th time window; \(I\) i,j is the \(j\)-th current data point within the \(i\)-th time window, and the imaginary part \(im\) is the imaginary unit;
[0046] S330. Convert the calculated amplitudes of each harmonic into \(N\)-bit binary numbers using the decimal - to - binary method, and construct an \(N\times H\) two - dimensional feature matrix \(F\) as the supplementary feature matrix;
[0047] In the initial state, all elements of the matrix are 0. Use the following formula to fill each bit of the binary number into matrix \(F\);
[0048] \(F(\alpha,\beta)=\text{bin} β (\alpha)(30)
[0049] In the formula: \(\alpha\) is the binary bit index, with a range of \([1,N]\); \(F(\alpha,\beta)\) is the element value of the \(\alpha\)-th row and \(\beta\)-th column of the supplementary feature matrix \(F\), \(\beta=\{1,2,3,4,\cdots,H\}\); \(\text{bin}\) is the binary operation function, \(\text{bin} β (\alpha)\) is the \(\alpha\)-th bit of the binary eigenvalue of the amplitude of a certain harmonic;
[0050] Add the F matrix to the right side of the U-I trajectory matrix B to establish an improved U-I trajectory matrix W of order N×(N+H) that combines the amplitudes of the 3rd, 5th, 7th, and 9th order current harmonics e , W e Each element in it is denoted as x nv ;
[0051] Form a sample data set X with the calculated voltage, current, active power, and reactive power data of the electrical equipment e ={ΔP e , ΔQ e , ΔU e , ΔI e}.
[0052] Furthermore, the method for constructing the feature data set in step S4 of the present invention includes:
[0053] S410. Input the sample data set X e ={ΔP e , ΔQ e , ΔU e , ΔI e}, calculate the mean and standard deviation of the input data, taking the active power change as an example;
[0054]
[0055] In the formula, is the active power change in the i-th time window, is the number of detection events that are not accurately identified in the clustering group, and the data is batch-normalized according to the following formula;
[0056]
[0057] In the formula, ε is a very small value close to 0;
[0058] S420. Reconstruct the data obtained by batch normalization to obtain
[0059]
[0060] In the formula, γ is the scaling parameter and β is the offset parameter, which are automatically learned during training, and the normalized power data is output Since the data has been normalized during the construction of the improved U-I trajectory, batch normalization is performed on the current and voltage data to obtain the feature data set
[0061] Furthermore, the load identification method in step S5 of the present invention includes:
[0062] S510. Construct a pyramid pooling block. Each pooling block consists of an average pooling layer, a one-dimensional convolution layer, a rectified linear activation function, a BN layer, an upsampling layer, and an output layer to improve the calculation of the U-I trajectory matrix. Perform a convolution operation on the constructed digital matrix to obtain convolution features;
[0063]
[0064] In the formula, f(x) is the output after the convolution of the improved U-I trajectory matrix, F act represents the activation function of the convolution layer, usually a rectified linear function, θ n,v represents the elements in the convolution kernel, b represents the bias, and x nv represents the elements in matrix B. Similarly, perform convolution calculations on voltage, current, active power, and reactive power to output a feature map dataset
[0065] S520. Establish an attention mechanism model. Input the fused load feature output into multiple attention heads. Each attention head focuses on the active power, reactive power, voltage, current, and improved U-I trajectory feature data feature information of the electrical equipment;
[0066] Use the multi-head attention mechanism model to calculate the importance weights of each feature. Each feature will obtain a weight value, denoted as {ω1, ω2, ω3, ω4, ω5}. Sort the weight values in descending order to obtain a new weight sequence {ω'1, ω'2, ω'3, ω'4, ω'5}. According to the weights calculated by each attention head, weight each feature in the feature map dataset to highlight important feature information. The formula is as follows:
[0067] MultiHead<Q, K, V> = Concat<head1, head2, …, head5>W o (36)
[0068]
[0069] In the formula: MultiHead is the output of the multi-head self-attention mechanism, Concat is the concatenation function, and head bn is the attention head; the transformation matrices WO, W i Q 、W i K 、W i V are all learnable parameters in the network;
[0070] S530. Five pooling blocks are established to merge the load features at five different scales according to the obtained weight sequence. The global average pooling layer is used to extract global features, and the local convolutional layer is used to extract local features. The load feature information is fused with the load features, and the local and global information is fused together to obtain the final output of the load feature, that is
[0071]
[0072] Finally, f(Y) is input into the logical function model, and the new classification group of power consumption equipment data is finally output The accurate identification of multi-state power consumption equipment is completed.
[0073] On the other hand, the present invention also discloses a computer-readable storage medium storing a computer program, which when executed by a processor causes the processor to execute the steps of the above method.
[0074] On yet another aspect, the present invention also discloses a computer device, including a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the steps of the above method.
[0075] As can be seen from the above technical solutions, the present invention can accurately capture the moment of the change in the state of the power consumption equipment through the goodness-of-fit test, ensure the accuracy of event detection, cluster the event features, help distinguish different equipment states, lay a foundation for the identification of single-state equipment, and screen out the multi-state equipment that has not been accurately identified through the clustering results, improving the identification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 It is a schematic flowchart of the method of the present invention;
[0077] Figure 2 It is an improved U-I trajectory module of the present invention;
[0078] Figure 3 It is a pyramid pooling module of the present invention;
[0079] Figure 4 It is a pooling block structure of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0080] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.
[0081] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention.
[0082] As Figure 1 shown, a non-intrusive load identification method described in this embodiment includes the following steps:
[0083] S1. Use the goodness-of-fit test to perform event detection on the power consumption device data of the gateway meter, accurately capture the moment when the state of the power consumption device changes, and extract the event features at the moment of state change;
[0084] S2. Perform clustering analysis on the event features at the moment of state change;
[0085] S3. According to the results of the clustering analysis, complete the identification of single-state power consumption devices, and screen out multi-state power consumption devices that are not accurately identified;
[0086] S4. Perform batch normalization processing on the active power, reactive power, voltage, and current data features of the multi-state power consumption devices that are not accurately identified, and jointly form a feature dataset with the improved U-I trajectory matrix;
[0087] S5. Based on the fused feature dataset, establish a multi-head attention mechanism model, weight the feature information according to the feature importance; after weighting, establish a pyramid pooling model containing 5 pooling blocks to extract features from the load data, output the identification results of the power consumption devices, and complete the load identification of the multi-state power consumption device clustering group.
[0088] The following will explain each step in detail:
[0089] S1. Use the goodness-of-fit test to perform event detection on the power consumption device data of the gateway meter, accurately capture the moment when the state of the power consumption device changes, and extract the event features at the moment of state change;
[0090] The event features at the moment of state change mainly include data features such as load active power, reactive power, voltage, and current.
[0091] S110. Perform real-time sampling on the power consumption data such as voltage, current, active power, and reactive power of the user gateway meter, and set different sampling periods (or called time windows) according to the dynamic characteristics of the power consumption devices.
[0092] Taking 5ζ as a time window (ζ is the time constant to reach the steady state when the load starts and stops, which varies according to different load natures, generally taking 0.12s - 0.20s), each time window contains m data. For electricity consumption data such as voltage and current, m = 1200, that is, each time window contains 1200 voltage data and current data; for electricity consumption data such as active power and reactive power, m = 50, that is, each time window contains 50 active power and reactive power data.
[0093] For the active power data within a certain time window b perform a goodness-of-fit test to obtain the test statistic of time window b:
[0094]
[0095] In the formula, is the test statistic of time window b, is the j-th data within time window b, is the j-th data detected in the previous time window b - 1.
[0096] Let χ 2 be the reference statistic. If then it is determined that the state of the electrical equipment has changed within time window b. Otherwise, it is determined that the state of the electrical equipment has not changed at all within time window b. The value range of χ 2 satisfies:
[0097] 0.3P N,min ≤χ 2 ≤0.5P N,min (40)
[0098] where: P N,min is the rated power of the single electrical equipment with the smallest rated power among all electrical equipment.
[0099] S120. Assume that the state of the electrical equipment has changed within time window i, and calculate the change in active power ΔP within this time window e,i ;
[0100]
[0101] In the formula: P i j is the j-th data within time window i, is the j-th data detected in the previous time window i - 1.
[0102] Let a detection period be 12 h (which can be adjusted according to the characteristics of the electrical equipment). Suppose that within a certain detection period, the state of the electrical equipment has changed k times. The ΔP can be calculated from formula (3). e,1 , ΔP e,2 ,..., ΔP e,i ,..., ΔP e,k , and form a set ΔP of the active power change amounts that change with the state of the electrical equipment e = {ΔP e,1 , ΔP e,2 ,..., ΔP e,i ,..., ΔP e,k}
[0103] Similarly, the set ΔQ of the reactive power change amounts that change with the state of the electrical equipment, the set ΔU of the voltage change amounts, the set ΔI of the current change amounts, etc. can be calculated. e , the set ΔU of the voltage change amounts e , the set ΔI of the current change amounts e , etc.
[0104] S2. Perform clustering analysis on the event characteristics at the moment of state change;
[0105] Adopt the k-means clustering method with the initial optimized clustering centers to group various electrical equipment with obvious distinctions in active power.
[0106] S210. From the set ΔP of the active power change amounts obtained in step S1 e , randomly select a data as the clustering center, denoted as R1, and select the next data as the new clustering center R2 by sampling without replacement. Repeat the sampling without replacement step until f clustering centers are selected, denoted as R = {R1, R2,..., R s ,..., R f}. The value of f is determined by the number of electrical equipment. Suppose the number of electrical equipment is M. The value range of f generally satisfies:
[0107]
[0108] Denote the remaining (k - f) non-clustering center data as and calculate their distances from the f selected clustering centers respectively:
[0109]
[0110] In the formula, represents the active power change amount of the th non-clustering center, and R s represents the selected sth clustering center. The nearest distance to the selected clustering center is:
[0111]
[0112] S220. Calculate ΔP e For each data point ΔP e,i The probability g of being selected as the next cluster center i , the greater the distance, the greater the probability of being selected, and the selected data point is used as the new cluster center.
[0113]
[0114] S230. Repeat the calculation steps 2.1 and 2.2, and then perform the standard K-means clustering after the initial optimization of the cluster centers. Cluster the data with large differences in active power change amounts into different groups K = [K1, K2,... Kf] to complete the load identification in the first stage.
[0115] S3. According to the results of the cluster analysis, complete the identification of single-state electrical appliances, and screen out the multi-state electrical appliances that are not accurately identified;
[0116] As Figure 2 shown, perform harmonic analysis on the current data of such electrical appliances obtained in step S1, and construct an improved U-I trajectory matrix that integrates the amplitudes of high-order current harmonics such as 3, 5, 7, and 9.
[0117] S310. After the cluster identification, there may be some electrical appliances that are clustered into the wrong cluster groups. For these appliances, select the load data corresponding to the state change from the dataset in step S1, and normalize their voltage and current data to the range [0, N], and the formula is as follows:
[0118]
[0119] In the formula: where represents the j-th normalized voltage data in the i-th time window of the multi-state electrical appliance, represents the j-th current data in the i-th time window, j ∈ {1, 2,..., m}. and are the maximum and minimum values of the voltage in the i-th time window respectively, and are the maximum and minimum values of the current in the i-th time window respectively. N is the pixel of the improved U-I trajectory matrix, and the value range of N is generally 25 ≤ N ≤ 64 in combination with the characteristics of the electrical appliance.
[0120] Map the normalized voltage and current data to the improved U-I trajectory matrix B using the feature mapping model, and the formula is as follows.
[0121]
[0122] Where: a and d are the row index and column index of matrix B respectively; is the floor symbol.
[0123] S320. Based on the load current data obtained in step S120, perform Fourier transform decomposition on the current data within the i-th time window to obtain the fundamental wave and 3rd harmonic of the current data 5th harmonic 7th harmonic 9th harmonic and other high-order harmonics of the current and their amplitudes.
[0124]
[0125] Where: z is the harmonic order, z = 1, 3, 5,..., h; is the amplitude of the z-th harmonic of the current in the i-th time window; I i,j is the j-th current data point within the i-th time window, and the imaginary part im is the imaginary unit.
[0126] S330. Use the decimal-to-binary method to convert the calculated amplitudes of each harmonic into N-bit binary numbers. And construct an N×H-order two-dimensional feature matrix F as a supplementary feature matrix (H is the number of categories of high-order harmonics to be fused into matrix B).
[0127] In the initial state, all elements of the matrix are 0. Use the following formula to fill each bit of the binary number into matrix F.
[0128] F(α,β) = bin β (α) (49)
[0129] Where: α is the binary bit index, with a range of [1, N]; F(α,β) is the element value of the α-th row and β-th column of the supplementary feature matrix F, β = {1, 2, 3, 4,..., H}; bin is the binary operation function, that is, bin β (α) is the α-th bit of the binary feature value of a certain harmonic amplitude.
[0130] Add matrix F to the right side of the U-I trajectory matrix B to establish an improved U-I trajectory matrix W of order N×(N + H) that fuses the amplitudes of high-order harmonics such as 3, 5, 7, and 9 of the current e , W e Each element in it is denoted as x nv .
[0131] Form a sample data set X with the calculated data such as the voltage, current, active power, and reactive power of the electrical equipment e ={ΔPe , ΔQ e , ΔU e , ΔI e}。
[0132] S4. Batch normalize the active power, reactive power, voltage, and current data features of the multi-state electrical equipment that has not been accurately identified, and jointly constitute a feature dataset with the improved U-I trajectory matrix;
[0133] S410. Input the sample dataset X e ={ΔP e , ΔQ e , ΔU e , ΔI e}, calculate the mean and standard deviation of the input data, taking the active power change as an example for calculation.
[0134]
[0135] In the formula, is the active power change within the i-th time window, is the number of detection events that have not been accurately identified in the clustering group. Batch normalize the data according to the following formula.
[0136]
[0137] In the formula, ε is a very small value close to 0.
[0138] S420. Reconstruct the data obtained from the batch normalization process to obtain
[0139]
[0140] In the formula, γ is the scaling parameter and β is the offset parameter, which can be automatically learned during training, and output the normalized power data Since the data has been normalized when constructing the improved U-I trajectory previously, this step only needs to batch normalize the current and voltage data. Obtain the new dataset
[0141] S5. Based on the fused feature information, establish a multi-head attention mechanism model, and weight the feature information according to the feature importance; after weighting, establish a pyramid pooling model containing 5 pooling blocks to extract features from the load data, and output the recognition results of the electrical equipment, completing the load recognition of the clustering group containing multi-state electrical equipment.
[0142] S510. Construct as Figure 3 , Figure 4The shown pyramid pooling block, each pooling block consists of an average pooling layer, a one-dimensional convolution, a rectified linear activation function, a BN layer, an upsampling layer and an output layer. Taking the improved U-I trajectory matrix as an example for calculation, a convolution operation is performed on the constructed digital matrix to obtain convolution features.
[0143]
[0144] In the formula, f(x) is the output after convolution of the improved U-I trajectory matrix. F act represents the activation function of the convolutional layer, usually the rectified linear function, θ n,v represents the elements in the convolution kernel, b represents the bias, and x nv represents the elements in matrix B. Similarly, convolution calculations are performed on voltage, current, active power and reactive power, and the output feature map dataset is obtained
[0145] S520. Establish an attention mechanism model, input the fused load feature output into multiple attention heads, and each attention head focuses on data feature information such as the active power, reactive power, voltage, current, and improved U-I trajectory features of the electrical equipment.
[0146] Use the multi-head attention mechanism model to calculate the importance weights of each feature. Each feature will obtain a weight value, denoted as {ω1, ω2, ω3, ω4, ω5}, and the weight values are sorted in descending order to obtain a new weight sequence {ω'1, ω'2, ω'3, ω'4, ω'5}. According to the weights calculated by each attention head, each feature in the feature map dataset is weighted to highlight the important feature information. The formula is as follows.
[0147] MultiHead<Q, K, V> = Concat<head1, head2, …, head5>W o (55)
[0148]
[0149] In the formula: MultiHead is the output of the multi-head self-attention mechanism, Concat is the concatenation function, and head bn is the head of the attention; the transformation matrices WO, W i Q 、W i K 、W i V are all learnable parameters in the network.
[0150] S530. Establish 5 pooling blocks, and merge the load features at 5 different scales according to the obtained weight sequence. Use the global average pooling layer to extract global features, and use the local convolutional layer to extract local features. Fuse the load feature information with the load features, and integrate the local and global information together to obtain the final output of the load features, namely
[0151]
[0152] Finally, input f(Y) into the logic function model, and finally output a new classification group of electrical equipment data Complete the accurate identification of multi-state electrical equipment.
[0153] In summary, through the goodness-of-fit test, the present invention can accurately capture the moment of the change in the state of the electrical equipment, ensure the accuracy of event detection, cluster the event features, help to distinguish different equipment states, lay a foundation for the identification of single-state equipment, and screen out the multi-state equipment that has not been accurately identified through the clustering results, so as to improve the identification accuracy.
[0154] On the other hand, the present invention also discloses a computer-readable storage medium storing a computer program, which when executed by a processor causes the processor to execute the steps of the above method.
[0155] On yet another aspect, the present invention also discloses a computer device including a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the steps of the above method.
[0156] In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions, which when run on a computer causes the computer to execute any of the non-intrusive load identification methods in the above embodiments.
[0157] It can be understood that the system, device, and storage medium provided by the embodiments of the present invention correspond to the method provided by the embodiments of the present invention, and the explanations, examples, and beneficial effects of related content can refer to the corresponding parts in the above method.
[0158] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0159] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements that are not explicitly listed, or also includes elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device that includes the element.
[0160] Each embodiment in this specification is described in a related manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
[0161] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A non-intrusive load identification method, characterized in that It includes the following steps: S1. Use goodness-of-fit test to perform event detection on the power consumption equipment data of the gateway meter, capture the moment when the state of the power consumption equipment changes, and extract the event features at the moment of state change; S2. Perform cluster analysis on the event features at the moment of state change; S3. According to the results of the cluster analysis, complete the identification of single-state power consumption equipment, and screen out the multi-state power consumption equipment that is not accurately identified; S4. Perform batch normalization on the active power, reactive power, voltage, and current data features of the multi-state power consumption equipment that is not accurately identified, and jointly form a feature dataset with the improved U-I trajectory matrix; S5. Based on the fused feature dataset, establish a multi-head attention mechanism model, and weight the feature information according to the feature importance; after weighting, establish a pyramid pooling model containing 5 pooling blocks to extract features from the load data, output the identification results of the power consumption equipment, and complete the load identification of the cluster group containing multi-state power consumption equipment.
2. The non-intrusive load identification method according to claim 1, wherein The method for extracting the event features at the moment of state change in step S1 includes: S110. Perform real-time sampling on the voltage, current, active power, and reactive power power consumption data of the user gateway meter, and set different sampling periods according to the dynamic characteristics of the power consumption equipment; Taking 5ζ as a time window, where ζ is the time constant to reach the steady state when the load starts and stops, and each time window contains m data; for the active power data within a certain time window b perform a goodness-of-fit test to obtain the test statistic of the time window b: In the formula, is the test statistic of time window b, is the j-th data within time window b, is the j-th data detected in the previous time window b-1; Let χ 2 be the reference statistic. If then it is determined that the state of the electrical equipment has changed within the time window b; otherwise, it is determined that the state of the electrical equipment has not changed at all within the time window b. The value range of χ 2 satisfies: 0.3P N,min ≤ χ 2 ≤ 0.5P N,min (2) Where: P N,min is the rated power of the single electrical equipment with the smallest rated power among all electrical equipment; S120. Assume that the state of the electrical equipment has changed within the time window i, and calculate the change in active power ΔP within this time window e,i ; Where: P i j is the j-th data within the time window i, is to detect the j-th data within the previous time window i-1; Let a detection period be 12 h. Suppose that within a certain detection period, the state of the electrical equipment has changed k times, and ΔP is calculated by formula (3). e,1 , ΔP e,2 ,..., ΔP e,i ,..., ΔP e,k , and they form a set ΔP of the active power change amounts that change with the state of the electrical equipment e = {ΔP e,1 , ΔP e,2 ,..., ΔP e,i ,..., ΔP e,k} Similarly, a set ΔQ of reactive power changes resulting from changes in the state of the electrical equipment is calculated e , a set ΔU of voltage changes e , and a set ΔI of current changes e .
3. The non-intrusive load identification method according to claim 2, wherein The method for performing cluster analysis on the event features at the moment of state change in step S2 includes: S210. The set of active power change amounts ΔP obtained from step S1 e Randomly select a data as the clustering center, denoted as R1, and without replacement, select the next data as the new clustering center R2. Repeat the step of sampling without replacement until f clustering centers are selected, denoted as R = {R1, R2,..., R s ,..., R f}, where the value of f is determined by the number of electrical devices. Let the number of electrical devices be M, and the value range of f generally satisfies: Denote the remaining (k - f) non-cluster center data as Calculate their distances from the f selected cluster centers respectively: In the formula, represents the active power change of the th non-cluster center, and R s represents the selected sth cluster center, and the shortest distance to the selected cluster center is: S220. Calculate ΔP e For each data point ΔP e,i The probability g of being selected as the next cluster center i , the greater the distance, the greater the probability of being selected, and the selected data point is used as the new cluster center S230. Repeat the calculation steps S210 and S220. After initially optimizing the cluster center, perform standard K-means clustering, and cluster the data with large differences in active power change amounts into different groups K = [K1, K2,... Kf] to complete the load identification in the first stage.
4. The non-intrusive load identification method according to claim 3, wherein The method for completing the identification of single-state power consumption equipment and screening out the multi-state power consumption equipment that is not accurately identified according to the results of the cluster analysis in step S3 includes: S310. After cluster identification, some power consumption equipment is clustered into the wrong cluster group. For this part of the equipment, select the load data at the moment of state change corresponding to it from the dataset in step S1, and normalize its voltage and current data to the range of [0, N]. The formula is as follows: Wherein: represents the j-th normalized voltage data of the multi-state electrical equipment within the i-th time window, represents the j-th current data within the i-th time window, j ∈ {1, 2, …, m}, and are respectively the maximum and minimum values of the voltage within the i-th time window, and are respectively the maximum and minimum values of the current within the i-th time window; N is the number of pixels of the improved U-I trajectory matrix, and in combination with the characteristics of the electrical equipment, the value range of N is 25 ≤ N ≤ 64; Map the normalized voltage and current data to the improved U-I trajectory matrix B using the feature mapping model. The formula is as follows: where: a and d are the row index and column index of matrix B, respectively; is the floor symbol; S320. Based on the load current data obtained in step S120, perform Fourier transform decomposition on the current data within the \(i\)-th time window to obtain the fundamental wave and the 3rd harmonic of the current data 5th harmonic 7th harmonic 9th harmonic Higher-order current harmonics and amplitudes; where: z is the harmonic order, z = 1, 3, 5,..., h; is the amplitude of the z-th harmonic of the current in the i-th time window; I i,j is the j-th current data point in the i-th time window, and the imaginary part im is the imaginary unit; S330. Use the decimal-to-binary method to convert the calculated harmonic amplitudes of each order into N-bit binary numbers, and construct an N×H-order two-dimensional feature matrix F as a supplementary feature matrix; All elements of the matrix are 0 in the initial state. Use the following formula to fill each bit of the binary number into the matrix F; F(α,β) = bin β (α) (11) Where: α is the binary bit index, with a range of [1, N]; F(α, β) is the element value of the α-th row and β-th column of the supplementary feature matrix F, and β = {1, 2, 3, 4, …, H}; bin is the binary operation function, and bin β (α) is the α-th bit of the binary eigenvalue of the amplitude of a certain harmonic component; Add the F matrix to the right side of the U-I trajectory matrix B to establish an improved U-I trajectory matrix W of order N×(N+H) that fuses the amplitudes of the 3rd, 5th, 7th, and 9th current high-order harmonics e , W e Each element in it is denoted as x nv ; The calculated voltage, current, active power, and reactive power data of the electrical equipment are composed into a sample data set X e ={ΔP e ,ΔQ e ,ΔU e ,ΔI e}.
5. The non-intrusive load identification method according to claim 1, characterized in that The method for forming the feature dataset in step S4 includes: S410. Input the sample data set X e ={ΔP e , ΔQ e , ΔU e , ΔI e}, calculate the mean and standard deviation of the input data, taking the change in active power as an example for calculation; wherein, is the change in active power within the i-th time window, is the number of detection events that are not accurately identified in the clustering group, and the data is batch-normalized according to the following formula; In the formula, ε is a very small value close to 0; S420. Reconstruct the data obtained through batch normalization to obtain Where γ is the scaling parameter and β is the offset parameter, which are automatically learned during training, and the normalized power data is output Since the data has been normalized when constructing the improved U-I trajectory, the current and voltage data are batch-normalized to obtain a feature data set 6. The non-intrusive load identification method according to claim 1, wherein The load identification method in step S5 includes: S510. Construct a pyramid pooling block. Each pooling block consists of an average pooling layer, a one-dimensional convolution, a rectified linear activation function, a BN layer, an upsampling layer, and an output layer. Calculate using the improved U-I trajectory matrix, and perform convolution operations on the constructed digital matrix to obtain convolution features; Where, f(x) is the output after the convolution of the improved U-I trajectory matrix, and F act represents the activation function of the convolutional layer, and usually the rectified linear unit is selected. θ n,v represents the elements in the convolution kernel, b represents the bias, and x nv represents the elements in matrix B. Similarly, convolution calculations are performed on voltage and current, active power, and reactive power to output the feature map dataset S520. Establish an attention mechanism model, input the fused load feature output into multiple attention heads, and each attention head focuses on the active power, reactive power, voltage, current of the electrical equipment, and the feature information of the improved U-I trajectory feature data; Use the multi-head attention mechanism model to calculate the importance weights of each feature. Each feature will obtain a weight value, denoted as {ω1, ω2, ω3, ω4, ω5}. Sort the weight values in descending order to obtain a new weight sequence {ω1,, ω,2, ω3,, ω,4, ω5,}. According to the weights calculated by each attention head, weight each feature in the feature mapping dataset to highlight the important feature information. The formula is as follows: MultiHead<Q, K, V> = Concat<head1, head2, …, head5>W o (17) Where: MultiHead is the output of the multi-head self-attention mechanism, Concat is the concatenation function, and head bn is the head of the attention; the transformation matrices WO, W i Q 、W i K 、W i V are all learnable parameters in the network; S530. Establish 5 pooling blocks, merge the load features at 5 different scales according to the obtained weight sequence, use the global average pooling layer to extract global features, and use the local convolutional layer to extract local features. Fuse the load feature information with the load features, and fuse the local and global information together to obtain the final load feature output, that is Finally, f(Y) is input into the logic function model, and finally a new classification group of electrical equipment data is output. The accurate identification of multi-state electrical equipment is completed.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the processor is caused to execute the method according to any one of claims 1 to 6.
8. A computer device, comprising a memory and a processor, characterized in that, The memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the method according to any one of claims 1 to 6.
Citation Information
Cited By
Load identification method based on improved fuzzy algorithm
CN122262734A