A non-intrusive load decomposition method and system based on multi-scale features
By using multi-scale feature extraction technology and self-attention mechanism encoder in the load decomposition method, the problem of insufficient accuracy of load decomposition in the existing technology is solved, more efficient load decomposition is achieved, and the accuracy of load power consumption information is improved, and support for the construction of smart power grids is provided.
Patent Information
- Application Number
- CN202510258605.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art lacks mining of multi-time scale features of load data, resulting in a decrease in the accuracy of load decomposition.
A non-invasive load decomposition method based on multi-scale features is adopted. By obtaining the load data on the user-side bus, it is divided into effective samples, and using multi-scale feature extraction technology in multiple feature extraction network layers, the one-dimensional feature vector is converted into a two-dimensional tensor, and after passing through the convolution network, it is converted into a one-dimensional feature vector again, and after splicing, the electric equipment feature vector is output. These feature vectors are encoded by the encoder and spliced, and the load decomposition results are output through the fully connected layer.
By deeply mining the multi-time scale characteristics of load data, the accuracy of load decomposition is significantly improved, and load power consumption information can be obtained more accurately, which is of guiding significance for the construction of smart grids and the efficient utilization of energy.
Smart Images

Figure CN119761658A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart grid technology, and in particular to a non-invasive load decomposition method and system based on multi-scale features. Background Art
[0002] As the core driving force for the continuous progress of human society, the development and rational use of energy has become a key factor in the rapid development of the global economy and society. However, with the continuous growth of energy consumption, the problem of energy shortage has become increasingly prominent, prompting the power industry to gradually transform towards an economic and green direction. The promotion of smart grid technology will help achieve the economy and sustainability of power supply. The rapid growth of energy consumption has put forward higher requirements on the efficiency and stability of the power system. Existing research shows that in order to reduce building energy consumption, energy management can reduce operating costs by 10%-15%.
[0003] In the construction of energy management, it is crucial to obtain accurate load power consumption information. For users, real-time feedback of power usage information provides a strong basis for decision-making, allowing users to adjust their power consumption habits more accurately and reduce energy waste; for power grid companies, accurate load data provides technical support for power consumption analysis, reduces the risk of economic losses, and helps power grid companies further optimize their related businesses.
[0004] In order to achieve accurate monitoring of electricity consumption behavior, non-intrusive load monitoring methods have attracted people's attention and achieved rapid development. Currently, non-intrusive load monitoring mainly includes two research directions: non-intrusive load identification based on high-frequency data and event detection, and load decomposition based on long-term steady-state data. The former includes two key issues, namely event detection to detect whether there is a change in load status and load type identification based on feature extraction; the latter is based on low-frequency data, and a regression model is established according to long-term steady-state data to achieve the decomposition of aggregated data to device-level data, without the need for event detection.
[0005] Load decomposition technology can decompose the total power load into the power load of each specific electrical equipment, so that users and managers can clearly understand the power consumption of each electrical equipment, including its usage time, usage frequency, power consumption, etc., which helps to more deeply analyze the user's power consumption behavior patterns and realize refined power consumption monitoring.
[0006] Domestic and foreign scholars have conducted a lot of research on load decomposition technology based on low-frequency data and not relying on event detection. Common methods mainly include methods based on hidden Markov models, methods based on deep learning, and methods based on transfer learning in the case of insufficient samples. However, the above methods often only focus on the intra-sequence characteristics of load data, while time series data often have periodicity, and changes between cycles are also important characteristics of data changes. The existing technology lacks mining of multi-time scale characteristics of load data, resulting in a decrease in the accuracy of load decomposition.
[0007] In view of this, it is urgent to carry out research on the multi-scale characteristics of load data, deeply explore the multi-time scale characteristics of the periodicity of load data, and further improve the accuracy of load decomposition. Summary of the invention
[0008] To this end, the technical problem to be solved by the present invention is to overcome the problem in the prior art that the accuracy of load decomposition is reduced due to the lack of mining of multi-time scale characteristics of load data.
[0009] In order to solve the above technical problems, the present invention provides a non-intrusive load decomposition method based on multi-scale features, comprising: Obtain load data of multiple types of electrical equipment on the user-side bus; Taking one operation cycle of a type of power supply equipment as a valid sample, the load data after removing invalid data is divided into multiple valid samples; After each valid sample passes through multiple feature extraction network layers, k electrical equipment feature vectors are output, including: In each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors. The k two-dimensional tensors are converted into k one-dimensional feature vectors again after passing through the convolution network, and the concatenated ones are used as the output of the current feature extraction network layer. Among them, the input of the first feature extraction network layer is the one-dimensional time series of the valid sample. Output the k one-dimensional feature vectors obtained by the last feature extraction network layer as the electrical equipment feature vectors of the valid samples; The k electrical equipment feature vectors of each valid sample are encoded by the encoder and concatenated to obtain the target feature vector; the target feature vector passes through the fully connected layer and outputs the load decomposition result of each valid sample.
[0010] Preferably, the get_activations() function in the toolkit NILMTK is used to remove invalid data from the load data, and an operation cycle of a type of power supply equipment is used as a valid sample to divide the load data after the invalid data is removed to obtain multiple valid samples.
[0011] Preferably, in each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors, including: Convert a one-dimensional feature vector from the time domain to the frequency domain; calculate the amplitude corresponding to each frequency in the one-dimensional feature vector; select k frequencies with the largest amplitudes, and calculate the number of cycles corresponding to the k frequencies respectively; construct k two-dimensional tensors using the k frequencies and their corresponding number of cycles as the first dimension and the second dimension respectively.
[0012] Preferably, a fast Fourier transform is used to transform the one-dimensional feature vector from the time domain to the frequency domain, and the formula is expressed as: ; in, Represents the complex value transformed from the effective sample to the frequency domain, represents a one-dimensional feature vector, represents the number of variables, represents the imaginary unit, Indicates frequency; Calculate the amplitude corresponding to each frequency in the one-dimensional eigenvector. The formula is expressed as: ; ; in, Indicates frequency The corresponding amplitude, express The real part of express The imaginary part of Select the k frequencies with the largest amplitude, and the formula is expressed as: ; in, Indicates the frequency corresponding to the largest k amplitudes. represents the selected k frequencies; The number of cycles corresponding to the k frequencies is calculated, and the formula is expressed as: ; in, represents the number of cycles corresponding to the i-th frequency, represents the cycle length, represents the i-th frequency; With the k frequencies and their corresponding period numbers as the first dimension and the second dimension respectively, k two-dimensional tensors are constructed, and the formula is expressed as follows: ; in, represents the filling operation, represents a shape transformation operation, Indicated by frequency and number of cycles Perform shape transformation operations as the first and second dimensions respectively; Represents the i-th two-dimensional tensor.
[0013] Preferably, the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer is converted into k two-dimensional tensors of the current feature extraction network layer, and the formula is expressed as: ; in, Represents the one-dimensional feature vector of the valid samples output by the previous feature extraction network layer, Represents the i-th two-dimensional tensor of the current feature extraction network layer; The k two-dimensional tensors of the current feature extraction network layer are converted into k one-dimensional feature vectors again after passing through the convolutional network. The formula is expressed as: ; ; in, represents the convolution operation, Indicates data length truncation operation, Represents the i-th two-dimensional tensor of the current feature extraction network layer, Represents the i-th two-dimensional tensor of the current feature extraction network layer after the convolution network, Represents the i-th one-dimensional feature vector after conversion of the current feature extraction network layer; Represents the index value of the feature extraction network layer.
[0014] Preferably, the k electrical equipment feature vectors of each valid sample are respectively encoded by an encoder and then concatenated to obtain a target feature vector, including: The encoder includes a plurality of encoding layers, each encoding layer including an attention block, a one-dimensional convolution layer, an activation function and a maximum pooling layer connected in sequence; The formula for each electrical equipment feature vector in the encoding layer is expressed as: ; in, and They represent the output features of the electrical equipment feature vector at the a-th layer and the a+1-th layer encoder respectively; represents the attention block, represents a one-dimensional convolutional layer, represents the ELU activation function, represents the maximum pooling layer; The output features of the last encoding layer of the k electrical equipment feature vectors in the encoder are concatenated to obtain the target feature vector of the valid sample.
[0015] Preferably, the attention block comprises: Map the input features of the attention block into query matrix, key matrix and value matrix, and calculate the sparsity measure of each query vector in the query matrix; Select u query vectors with the largest sparsity metric value to form a new query matrix; The attention score is calculated using the new query matrix, and the input features of the attention block are weighted summed using the attention score to obtain the output features of the attention block.
[0016] Preferably, the sparsity measure of each query vector in the query matrix is calculated as follows: ; in, represents the nth query vector in the query matrix, represents the key matrix, represents the sparsity measure of the nth query vector, represents the number of key vectors in the key matrix, represents the mth key vector, represents the transpose of the mth key vector, Indicates the dimension of the key vector.
[0017] Preferably, the attention score is calculated with the new query matrix as follows: ; in, represents the attention score, represents the new query matrix, represents the key matrix, represents the value matrix, represents the softmax function, Indicates the dimension of the key vector.
[0018] The present invention also provides a non-intrusive load decomposition system based on multi-scale features, comprising: A data acquisition module is used to acquire load data of multiple types of electrical equipment on the user-side bus; The valid sample acquisition module is used to take one operation cycle of a type of power supply equipment as a valid sample and divide the load data after removing invalid data into multiple valid samples; The feature extraction module is used to output k electrical equipment feature vectors after each valid sample passes through multiple feature extraction network layers, including: In each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors. The k two-dimensional tensors are converted into k one-dimensional feature vectors again after passing through the convolution network, and the concatenated ones are used as the output of the current feature extraction network layer. Among them, the input of the first feature extraction network layer is the one-dimensional time series of the valid sample. Output the k one-dimensional feature vectors obtained by the last feature extraction network layer as the electrical equipment feature vectors of the valid samples; The load decomposition module is used to encode the k electrical equipment feature vectors of each valid sample through the encoder and then concatenate them to obtain the target feature vector; the target feature vector passes through the fully connected layer and outputs the load decomposition result of each valid sample.
[0019] The above technical solution of the present invention has the following beneficial effects compared with the prior art: The present invention discloses a non-invasive load decomposition method based on multi-scale features, which extracts effective samples from one operation cycle of a type of power supply equipment, converts the one-dimensional time series of the effective samples into a two-dimensional tensor, and then uses a convolutional network to extract multi-scale features on a time scale, and outputs multiple power-consuming equipment feature vectors of each effective sample after passing through multiple feature extraction network layers; then the power-consuming equipment feature vectors are input into an encoder containing an efficient self-attention mechanism, and the load decomposition result is obtained based on multi-scale feature calculation, and more efficient load decomposition is achieved through attention allocation at different time scales, thereby improving the accuracy of load decomposition. The present invention can further improve the accuracy of load decomposition, can obtain accurate load power consumption information, and has guiding significance for the construction of smart grids and the efficient use of energy. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein: Figure 1 It is a flow chart of a non-intrusive load decomposition method based on multi-scale features of the present invention; Figure 2 It is a structural diagram of the load decomposition model of the present invention. DETAILED DESCRIPTION
[0021] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention. Embodiment 1
[0022] Reference Figure 1As shown, the present invention provides a non-intrusive load decomposition method based on multi-scale features, comprising: S1: Obtain load data of multiple types of electrical equipment on the user-side bus.
[0023] S2: Taking one operation cycle of a type of power supply equipment as a valid sample, the load data after eliminating invalid data is divided into multiple valid samples.
[0024] This embodiment removes invalid data from the load data and obtains valid samples by calling the get_activations() function in the non-intrusive load monitoring toolkit NILMTK. This function extracts valid data of equipment operation and returns each operation cycle of each type of equipment.
[0025] The valid samples are input into the load decomposition model. The structure of the load decomposition model refers to Figure 2 shown.
[0026] S3: In the load decomposition model, each valid sample passes through multiple feature extraction network layers and outputs k electrical equipment feature vectors, including: In each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors. The k two-dimensional tensors are converted into k one-dimensional feature vectors again after passing through the convolution network, and the concatenated ones are used as the output of the current feature extraction network layer. Among them, the input of the first feature extraction network layer is the one-dimensional time series of the valid sample. The k one-dimensional feature vectors obtained by the last feature extraction network layer are output as the electrical equipment feature vectors of the valid samples.
[0027] The S3 specifically includes the following steps: S301: In each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors, including: S301-1: Use fast Fourier transform to convert the one-dimensional feature vector from the time domain to the frequency domain. The formula is: ; in, Represents the complex value transformed from the effective sample to the frequency domain, represents a one-dimensional feature vector, represents the number of variables, represents the imaginary unit, Indicates frequency.
[0028] S301-2: Calculate the amplitude corresponding to each frequency in the one-dimensional feature vector. The formula is: ; ; in, Indicates frequency The corresponding amplitude, express The real part of express The imaginary part of .
[0029] S301-3: Select k frequencies with the largest amplitudes. The formula is: ; in, Indicates the frequency corresponding to the largest k amplitudes. represents the selected k frequencies. Figure 2 Frequency 1, frequency 2, and frequency 3 respectively represent the selection of the top k frequencies according to the amplitude, where frequency 1 is the frequency corresponding to the largest amplitude, frequency 2 is the frequency corresponding to the second largest amplitude, and frequency 3 is the frequency corresponding to the third largest amplitude.
[0030] S301-4: Calculate the number of cycles corresponding to the k frequencies respectively, and the formula is expressed as: ; in, represents the number of cycles corresponding to the i-th frequency, represents the cycle length, represents the i-th frequency.
[0031] S301-5: Using the k frequencies and their corresponding period numbers as the first dimension and the second dimension respectively, construct k two-dimensional tensors, which are expressed as follows: ; in, represents the filling operation, represents a shape transformation operation, Indicated by frequency and number of cycles Perform shape transformation operations as the first and second dimensions respectively; Represents the i-th two-dimensional tensor.
[0032] S302: Convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors of the current feature extraction network layer. The formula is expressed as: ; in, Represents the one-dimensional feature vector of the valid samples output by the previous feature extraction network layer, Represents the i-th two-dimensional tensor of the current feature extraction network layer; Represents the index value of the feature extraction network layer.
[0033] S303: The k two-dimensional tensors of the current feature extraction network layer are converted into k one-dimensional feature vectors again after passing through the convolution network. The formula is expressed as: ; ; in, represents the convolution operation, Indicates data length truncation operation. Represents the i-th two-dimensional tensor of the current feature extraction network layer, Represents the dimension of the feature extraction network layer; Represents the i-th two-dimensional tensor of the current feature extraction network layer after the convolution network, Represents the i-th one-dimensional feature vector after conversion by the current feature extraction network layer.
[0034] S304: concatenate the k one-dimensional feature vectors converted by the current feature extraction network layer and use them as the output of the current feature extraction network layer.
[0035] In this embodiment, the input of the first feature extraction network layer is a one-dimensional time series of valid samples.
[0036] S305: Output k one-dimensional feature vectors obtained by the last feature extraction network layer as the electrical equipment feature vectors of the valid samples.
[0037] Considering that the switching of equipment has a certain periodic regularity, for example, office workers may have the habit of turning on the TV to watch after get off work every night, or running the washing machine to wash clothes on weekends. Therefore, fully mining the multi-scale features of electricity consumption data can effectively improve the recognition effect of electrical appliances. In order to fully mine the multi-scale features of input electricity consumption data, the present invention designs an encoder with a self-attention mechanism based on the above-mentioned electrical equipment feature vector with multi-scale features to prompt the model to pay attention to more valuable scale features, so as to capture data periodicity and achieve more accurate load recognition.
[0038] S4: The k electrical equipment feature vectors of each valid sample are encoded by the encoder and concatenated to obtain the target feature vector; the target feature vector passes through the fully connected layer and outputs the load decomposition result of each valid sample.
[0039] Specifically, the encoder includes multiple encoding layers, each encoding layer includes an attention block, a one-dimensional convolution layer, an activation function and a maximum pooling layer connected in sequence.
[0040] The formula for each electrical equipment feature vector in the encoding layer is expressed as: ; in, and They represent the output features of the electrical equipment feature vector at the a-th layer and the a+1-th layer encoder respectively; represents the attention block, Represents a one-dimensional convolutional layer with a kernel width of 3; represents the ELU activation function, Represents a maximum pooling layer.
[0041] The output features of the last encoding layer of the k electrical equipment feature vectors in the encoder are concatenated to obtain the target feature vector of the valid sample.
[0042] Preferably, considering the real-time requirements of load identification in actual application scenarios and the square time complexity of the ordinary attention mechanism, the present invention introduces a sparse attention mechanism to effectively reduce the computational complexity while maintaining performance. The operations in the attention block include: S401: Map the input features of the attention block into a query matrix, a key matrix, and a value matrix, and calculate the sparsity measure of each query vector in the query matrix. The formula is: ; in, represents the nth query vector in the query matrix, represents the key matrix, represents the sparsity measure of the nth query vector, represents the number of key vectors in the key matrix, represents the mth key vector, represents the transpose of the mth key vector, Indicates the dimension of the key vector.
[0043] S402: Select u query vectors with the largest sparsity metric values to form a new query matrix.
[0044] S403: Calculate the attention score using the new query matrix. The formula is: ; in, represents the attention score, represents the new query matrix, represents the key matrix, represents the value matrix, Represents the softmax function.
[0045] S404: Weighted sum of the input features of the attention block using the attention score to obtain the output features of the attention block. Embodiment 2
[0046] In order to more effectively illustrate the effectiveness of the non-invasive load decomposition method based on multi-scale features described in Example 1, the above method is analyzed through specific examples below.
[0047] This embodiment is based on the public data sets UK-DALE and REDD. The UK-DALE data set records the electricity consumption data of 5 British households with one data point every 6 seconds. This embodiment selects five electrical appliances, namely kettles, microwave ovens, refrigerators, dishwashers and washing machines, as the objects to be decomposed, takes the washing machine of household No. 2 and other electrical appliances of household No. 5 as the test set, and the remaining data as the training set; the REDD data set records the power data of multiple types of electrical appliances and power supply of 6 households in the United States with a collection frequency of one data point every 3 seconds and 1 second respectively. This embodiment selects four electrical appliances, namely microwave ovens, refrigerators, dishwashers and washing machines, as the identification objects, takes the data of room No. 3 as the test set, and the data of the remaining rooms as the training set.
[0048] Based on the two public data sets obtained, the get_activations() function in the non-intrusive load monitoring toolkit NILMTK is first called to extract the effective data of equipment operation and obtain valid samples. The parameter settings of the function are shown in Table 1, and the number of samples obtained for each device is shown in Tables 2 and 3, where the underline represents the test set samples.
[0049] Table 1, get_activations() parameter size settings Kettle Micro-wave oven refrigerator dishwasher washing machine Window length 599 599 599 599 599 Maximum Power 3948 3138 2572 3230 3962 Start Threshold 2000 200 50 10 20 Average operating power 700 500 200 700 400 Operating power standard deviation 1000 800 400 1000 700 Table 2. Number of valid samples of each UK-DALE device obtained family Kettle Micro-wave oven washing machine dishwasher refrigerator 1 7578 7757 1360 670 39386 2 788 439 <![CDATA[ 57 ]]> 106 3825 3 64 0 0 0 0 4 756 0 0 0 4825 5 <![CDATA[ 194 ]]> <![CDATA[ 37 ]]> 52 <![CDATA[ 26 ]]> <![CDATA[ 1621 ]]> Training set 9186 8196 1412 776 48036 Test Set 194 37 57 26 1621 Table 3. Number of valid samples of each REDD device obtained family Micro-wave oven washing machine dishwasher refrigerator 1 311 15 18 639 2 56 0 5 355 3 <![CDATA[ 54 ]]> <![CDATA[ 11 ]]> <![CDATA[ 4 ]]> <![CDATA[ 690 ]]> 4 1 0 1 81 5 0 0 0 261 6 0 0 0 355 Training set 368 15 24 1336 Test Set 54 11 4 690 Based on the obtained valid samples, they are first input into the first feature extraction network layer, and the one-dimensional time series of the valid samples is converted to the frequency domain through fast Fourier transform, and then the corresponding amplitude of each frequency is calculated, and the k frequencies with the largest amplitude are selected to calculate the corresponding number of cycles, and k two-dimensional tensors are constructed; the k two-dimensional tensors are converted into k one-dimensional feature vectors again after passing through the convolution network, and then spliced and input into the next feature extraction network layer, until the last feature extraction network layer obtains k one-dimensional feature vectors, which are output as the electrical equipment feature vectors of the valid samples. The k electrical equipment feature vectors of each valid sample are respectively encoded by the encoder and spliced to obtain the target feature vector; the target feature vector passes through the fully connected layer, and the load decomposition result of each valid sample is output.
[0050] The results obtained in this example are shown in Table 4. Table 4 Load decomposition results of UK-DALE and REDD Dataset Accuracy UK-DALE 0.998 REDD 0.986 It can be seen from Table 4 that the non-intrusive load decomposition method based on multi-scale features and attention mechanism proposed in the present invention can effectively realize load decomposition and meet actual production needs. Embodiment 3
[0051] Based on the non-intrusive load decomposition method based on multi-scale features described in Embodiment 1, this embodiment provides a non-intrusive load decomposition system based on multi-scale features, including: A data acquisition module is used to acquire load data of multiple types of electrical equipment on the user-side bus; The valid sample acquisition module is used to take one operation cycle of a type of power supply equipment as a valid sample and divide the load data after removing invalid data into multiple valid samples; The feature extraction module is used to output k electrical equipment feature vectors after each valid sample passes through multiple feature extraction network layers, including: In each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors. The k two-dimensional tensors are converted into k one-dimensional feature vectors again after passing through the convolution network, and the concatenated ones are used as the output of the current feature extraction network layer. Among them, the input of the first feature extraction network layer is the one-dimensional time series of the valid sample. Output the k one-dimensional feature vectors obtained by the last feature extraction network layer as the electrical equipment feature vectors of the valid samples; The load decomposition module is used to encode the k electrical equipment feature vectors of each valid sample through the encoder and then concatenate them to obtain the target feature vector; the target feature vector passes through the fully connected layer and outputs the load decomposition result of each valid sample.
[0052] In summary, the present invention describes a non-invasive load decomposition method based on multi-scale features, extracts effective samples from an operating cycle of a type of power supply equipment, converts the one-dimensional time series of the effective samples into a two-dimensional tensor, and then uses a convolutional network to extract multi-scale features on a time scale, and outputs multiple power-consuming equipment feature vectors for each effective sample after passing through multiple feature extraction network layers; then the power-consuming equipment feature vectors are input into an encoder containing an efficient self-attention mechanism, and the load decomposition result is obtained based on multi-scale feature calculations, and more efficient load decomposition is achieved through attention allocation at different time scales, thereby improving the accuracy of load decomposition. The present invention can further improve the accuracy of load decomposition, and has guiding significance for the construction of smart grids and the efficient use of energy.
[0053] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0054] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0055] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0056] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0057] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.
Claims
1. A non-intrusive load decomposition method based on multi-scale features, characterized in that: include: Obtain load data of multiple types of electrical equipment on the user-side bus; Taking one operation cycle of a type of power supply equipment as a valid sample, the load data after removing invalid data is divided into multiple valid samples; After each valid sample passes through multiple feature extraction network layers, k electrical equipment feature vectors are output, including: In each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors. The k two-dimensional tensors are converted into k one-dimensional feature vectors again after passing through the convolution network, and the concatenated ones are used as the output of the current feature extraction network layer. Among them, the input of the first feature extraction network layer is the one-dimensional time series of the valid sample. Output the k one-dimensional feature vectors obtained by the last feature extraction network layer as the electrical equipment feature vectors of the valid samples; The k electrical equipment feature vectors of each valid sample are encoded by the encoder and concatenated to obtain the target feature vector; the target feature vector passes through the fully connected layer and outputs the load decomposition result of each valid sample.
2. The non-intrusive load decomposition method based on multi-scale features according to claim 1 is characterized in that: The get_activations() function in the toolkit NILMTK is used to remove invalid data from the load data. An operation cycle of a type of power supply equipment is used as a valid sample to divide the load data after removing the invalid data, and multiple valid samples are obtained.
3. The non-intrusive load decomposition method based on multi-scale features according to claim 1 is characterized in that: In each feature extraction network layer, multi-scale feature extraction technology is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors, including: Convert a one-dimensional feature vector from the time domain to the frequency domain; calculate the amplitude corresponding to each frequency in the one-dimensional feature vector; select k frequencies with the largest amplitudes, and calculate the number of cycles corresponding to the k frequencies respectively; construct k two-dimensional tensors using the k frequencies and their corresponding number of cycles as the first dimension and the second dimension respectively.
4. The non-intrusive load decomposition method based on multi-scale features according to claim 3 is characterized in that: Fast Fourier transform is used to transform the one-dimensional feature vector from the time domain to the frequency domain. The formula is expressed as: ; in, Represents the complex value transformed from the effective sample to the frequency domain, represents a one-dimensional feature vector, represents the number of variables, represents the imaginary unit, Indicates frequency; Calculate the amplitude corresponding to each frequency in the one-dimensional eigenvector. The formula is expressed as: ; ; in, Indicates frequency The corresponding amplitude, express The real part of express The imaginary part of Select the k frequencies with the largest amplitude, and the formula is expressed as: ; in, Indicates the frequency corresponding to the largest k amplitudes. represents the selected k frequencies; The number of cycles corresponding to the k frequencies is calculated, and the formula is expressed as: ; in, represents the number of cycles corresponding to the i-th frequency, represents the cycle length, represents the i-th frequency; With the k frequencies and their corresponding period numbers as the first dimension and the second dimension respectively, k two-dimensional tensors are constructed, and the formula is expressed as follows: ; in, represents a filling operation, represents a shape transformation operation, Indicated by frequency and number of cycles Perform shape transformation operations as the first and second dimensions respectively; Represents the i-th two-dimensional tensor.
5. The non-intrusive load decomposition method based on multi-scale features according to claim 4 is characterized in that: The one-dimensional feature vector of the valid sample output by the previous feature extraction network layer is converted into k two-dimensional tensors of the current feature extraction network layer. The formula is expressed as: ; in, Represents the one-dimensional feature vector of the valid samples output by the previous feature extraction network layer, Represents the i-th two-dimensional tensor of the current feature extraction network layer; The k two-dimensional tensors of the current feature extraction network layer are converted into k one-dimensional feature vectors again after passing through the convolutional network. The formula is expressed as: ; ; in, represents the convolution operation, Indicates data length truncation operation, Represents the i-th two-dimensional tensor of the current feature extraction network layer, Represents the i-th two-dimensional tensor of the current feature extraction network layer after the convolution network, Represents the i-th one-dimensional feature vector after conversion of the current feature extraction network layer; Represents the index value of the feature extraction network layer.
6. The non-intrusive load decomposition method based on multi-scale features according to claim 1, characterized in that: The k electrical equipment feature vectors of each valid sample are encoded by the encoder and concatenated to obtain the target feature vector, including: The encoder includes a plurality of encoding layers, each encoding layer including an attention block, a one-dimensional convolution layer, an activation function and a maximum pooling layer connected in sequence; The formula for each electrical equipment feature vector in the encoding layer is expressed as: ; in, and They represent the output features of the electrical equipment feature vector at the a-th layer and the a+1-th layer encoder respectively; represents the attention block, represents a one-dimensional convolutional layer, represents the ELU activation function, represents the maximum pooling layer; The output features of the last encoding layer of the k electrical equipment feature vectors in the encoder are concatenated to obtain the target feature vector of the valid sample.
7. The non-intrusive load decomposition method based on multi-scale features according to claim 6 is characterized in that: The attention block includes: Map the input features of the attention block into query matrix, key matrix and value matrix, and calculate the sparsity measure of each query vector in the query matrix; Select u query vectors with the largest sparsity metric value to form a new query matrix; The attention score is calculated using the new query matrix, and the input features of the attention block are weighted summed using the attention score to obtain the output features of the attention block.
8. The non-intrusive load decomposition method based on multi-scale features according to claim 7, characterized in that: Calculate the sparsity measure of each query vector in the query matrix using the formula: ; in, represents the nth query vector in the query matrix, represents the key matrix, represents the sparsity measure of the nth query vector, represents the number of key vectors in the key matrix, represents the mth key vector, represents the transpose of the mth key vector, Indicates the dimension of the key vector.
9. The non-intrusive load decomposition method based on multi-scale features according to claim 7, characterized in that: The attention score is calculated using the new query matrix as follows: ; in, represents the attention score, represents the new query matrix, represents the key matrix, represents the value matrix, represents the softmax function, Indicates the dimension of the key vector.
10. A non-intrusive load decomposition system based on multi-scale features, characterized in that: include: A data acquisition module is used to acquire load data of multiple types of electrical equipment on the user-side bus; The valid sample acquisition module is used to take one operation cycle of a type of power supply equipment as a valid sample and divide the load data after removing invalid data into multiple valid samples; The feature extraction module is used to output k electrical equipment feature vectors after each valid sample passes through multiple feature extraction network layers, including: In each feature extraction network layer, a multi-scale feature extraction technique is used to convert the one-dimensional feature vector of the valid sample output by the previous feature extraction network layer into k two-dimensional tensors. The k two-dimensional tensors are converted into k one-dimensional feature vectors again after passing through the convolution network, and the concatenated ones are used as the output of the current feature extraction network layer. Among them, the input of the first feature extraction network layer is the one-dimensional time series of the valid sample. Output the k one-dimensional feature vectors obtained by the last feature extraction network layer as the electrical equipment feature vectors of the valid samples; The load decomposition module is used to encode the k electrical equipment feature vectors of each valid sample through the encoder and then concatenate them to obtain the target feature vector; the target feature vector passes through the fully connected layer and outputs the load decomposition result of each valid sample.
Citation Information
Patent Citations
Non-intrusive load decomposition method based on BERT and GCNN hybrid network
CN114493925A
Non-intrusive load decomposition method based on wavelet decomposition and improved neural network
CN115545447A
Power consumption data decomposition method and device, storage medium and processor
CN116010843A
Attention mechanism-based aircraft trajectory prediction method, storage medium and equipment
CN116258252A
Unsupervised model vibration anomaly detection method based on sparse self-attention and VAE
CN117633686A