Load decomposition method and device, electronic equipment and storage medium

By using feature extraction models and multi-head self-attention mechanism to process the total power data sequence in the load decomposition method, the time-consuming and cost-effective problems in the traditional method are solved, and efficient load decomposition is achieved.

CN119813174APending Publication Date: 2025-04-11GUANGDONG POWER GRID CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411866182.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The traditional load decomposition method requires the installation of sensors on each load for data acquisition, which is time-consuming, cost-effective and inflexible.

Method used

By obtaining the total power data sequence of all power consumption devices, input it into the preset feature extraction model, extracting power feature information, and generating feature vectors based on the timestamp information, multi-head self-attention mechanism processing, and finally decomposing the total power data sequence to obtain the equipment power data sequence of each power consumption device.

Benefits of technology

There is no need to install sensors on each load, and only the total power data sequence is collected to achieve load decomposition, which significantly improves the efficiency of load decomposition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119813174A_ABST
    Figure CN119813174A_ABST
Patent Text Reader

Abstract

The invention discloses a load decomposition method and device, electronic equipment and a storage medium, and the method comprises the steps: inputting a total power data sequence of all electric equipment into a preset feature extraction model, and outputting the power data features of the total power data sequence; extracting timestamp information in the total power data sequence, generating a time feature corresponding to the total power data sequence, and splicing the time feature and the power data feature to generate a corresponding feature vector; performing multi-head self-attention mechanism processing on the feature vector, and converting the processed feature vector into a feature data sequence consistent with the length of the total power data sequence as a predicted power data sequence of all electric equipment; and according to the predicted power data sequence and the total power data sequence, decomposing the total power data sequence to obtain a device power data sequence corresponding to each electric device. According to the invention, the load decomposition efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric load monitoring, and in particular to a load decomposition method, device, electronic equipment and storage medium. Background Art

[0002] With the large-scale access to new energy sources such as solar photovoltaic power generation, wind power generation, and electric vehicle charging stations, the power system has become more complex, and energy efficiency optimization and load management have become important tasks in the power system. In terms of load management, accurate decomposition of loads has become increasingly important. Traditional load decomposition methods usually require the use of sensors installed on each load for data collection to obtain the power usage of each load. This method is time-consuming, costly, and extremely inflexible, and is severely limited in practical applications. Summary of the invention

[0003] The present invention provides a load decomposition method, device, electronic device and storage medium to solve the technical problems that the traditional load decomposition method needs to use sensors installed on each load to collect data to obtain the power usage of each load, which is time-consuming, costly and extremely inflexible.

[0004] In order to solve the above technical problems, an embodiment of the present invention provides a load decomposition method, including:

[0005] Obtain the total power data sequence of all electrical devices;

[0006] Inputting the total power data sequence into a preset feature extraction model, so that the feature extraction model extracts power feature information of the total power data sequence and outputs power data features of the total power data sequence;

[0007] Extracting timestamp information from the total power data sequence, generating a time feature corresponding to the total power data sequence according to the timestamp information, and concatenating the time feature with the power data feature to generate a corresponding feature vector;

[0008] Processing the feature vectors with a multi-head self-attention mechanism, converting the processed feature vectors into feature data sequences with the same length as the total power data sequence, and then using the feature data sequence as the predicted power data sequence of all electrical devices;

[0009] Decomposing the total power data sequence according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device;

[0010] The feature extraction model is obtained by training a preset multi-scale spatiotemporal convolutional network model with the historical total power data sequence of all electrical equipment as input and the historical equipment power data sequence corresponding to each electrical equipment as output.

[0011] As a preferred solution, the feature extraction model includes: a number of TCN modules;

[0012] The extracting the power characteristic information of the total power data sequence and outputting the power data characteristics of the total power data sequence includes:

[0013] Extracting power feature information of different scales in the total power data sequence according to different TCN modules to obtain local power data features of different scales;

[0014] The local power data features are spliced ​​to obtain the comprehensive power data features of the total power data sequence and output them.

[0015] As a preferred solution, the multi-head self-attention mechanism processing of the feature vector includes:

[0016] Calculate the attention weight of each time step in the feature vector according to the preset weight scoring function of the multi-head self-attention mechanism;

[0017] The feature vector is weightedly summed with the attention weight to obtain the feature vector processed by the multi-head self-attention mechanism.

[0018] As a preferred solution, the total power data sequence is decomposed according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device, including:

[0019] According to the predicted power data sequence and the total power data sequence, the total power data sequence is used as a dependent variable, and the device power data sequence corresponding to each electrical device is used as an independent variable, and a corresponding regression model is obtained by fitting;

[0020] The total power data sequence is decomposed according to the regression model to obtain a device power data sequence corresponding to each electrical device.

[0021] Based on the above embodiment, another embodiment of the present invention provides a load decomposition device, including: a total power data sequence acquisition module, a power data feature extraction module, a feature vector generation module, a feature vector conversion module and a total power data sequence decomposition module;

[0022] The total power data sequence acquisition module is used to acquire the total power data sequence of all electrical devices;

[0023] The power data feature extraction module is used to input the total power data sequence into a preset feature extraction model, so that the feature extraction model extracts the power feature information of the total power data sequence and outputs the power data features of the total power data sequence; wherein the feature extraction model is obtained by training a preset multi-scale spatiotemporal convolutional network model with the historical total power data sequence of all electrical devices as input and the historical device power data sequence corresponding to each electrical device as output;

[0024] The feature vector generation module is used to extract the timestamp information in the total power data sequence, generate the time feature corresponding to the total power data sequence according to the timestamp information, and splice the time feature with the power data feature to generate a corresponding feature vector;

[0025] The feature vector conversion module is used to perform multi-head self-attention mechanism processing on the feature vector, convert the processed feature vector into a feature data sequence with the same length as the total power data sequence, and then use the feature data sequence as the predicted power data sequence of all electrical devices;

[0026] The total power data sequence decomposition module is used to decompose the total power data sequence according to the predicted power data sequence and the total power data sequence, and decompose it to obtain the device power data sequence corresponding to each electrical device.

[0027] As a preferred solution, the feature extraction model includes: a number of TCN modules;

[0028] The extracting the power characteristic information of the total power data sequence and outputting the power data characteristics of the total power data sequence includes:

[0029] Extracting power feature information of different scales in the total power data sequence according to different TCN modules to obtain local power data features of different scales;

[0030] The local power data features are spliced ​​to obtain the comprehensive power data features of the total power data sequence and output them.

[0031] As a preferred solution, the multi-head self-attention mechanism processing of the feature vector includes:

[0032] Calculate the attention weight of each time step in the feature vector according to the preset weight scoring function of the multi-head self-attention mechanism;

[0033] The feature vector is weightedly summed with the attention weight to obtain the feature vector processed by the multi-head self-attention mechanism.

[0034] As a preferred solution, the total power data sequence is decomposed according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device, including:

[0035] According to the predicted power data sequence and the total power data sequence, the total power data sequence is used as a dependent variable, and the device power data sequence corresponding to each electrical device is used as an independent variable, and a corresponding regression model is obtained by fitting;

[0036] The total power data sequence is decomposed according to the regression model to obtain a device power data sequence corresponding to each electrical device.

[0037] Based on the above embodiments, another embodiment of the present invention provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the load decomposition method described in the above embodiments of the invention is implemented.

[0038] Based on the above embodiment, another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the load decomposition method described in the above invention embodiment.

[0039] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0040] The present invention provides a load decomposition method, which obtains the total power data sequence of all electrical equipment; inputs the total power data sequence into a preset feature extraction model so that the feature extraction model extracts the power feature information of the total power data sequence and outputs the power data feature of the total power data sequence; extracts the timestamp information in the total power data sequence, generates the time feature corresponding to the total power data sequence according to the timestamp information, and splices the time feature and the power data feature to generate a corresponding feature vector; performs multi-head self-attention mechanism processing on the feature vector, converts the processed feature vector into a feature data sequence consistent with the length of the total power data sequence, and then uses the feature data sequence as the predicted power data sequence of all electrical equipment; decomposes the total power data sequence according to the predicted power data sequence and the total power data sequence, and decomposes to obtain the device power data sequence corresponding to each electrical equipment. Through the present invention, there is no need to install sensors on each load for data collection, only the total power data sequence of all electrical equipment needs to be collected, and then the total power data sequence is decomposed to obtain the device power data sequence corresponding to each electrical equipment, which can greatly improve the efficiency of load decomposition. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a flow chart of a load decomposition method provided by an embodiment of the present invention;

[0042] Figure 2 This is the network architecture diagram of TCN;

[0043] Figure 3 It is the network structure diagram of multi-scale TCN;

[0044] Figure 4 It is a schematic diagram describing time information;

[0045] Figure 5 It is the network structure diagram of the multi-head self-attention mechanism;

[0046] Figure 6 It is a comparative analysis chart of the actual value and predicted value of the electrical appliance;

[0047] Figure 7 It is a structural schematic diagram of a load decomposition device provided by one embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0050] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0051] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0052] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0053] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0054] In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the embodiments of the present application can be understood according to the specific circumstances.

[0055] Embodiment 1

[0056] Please refer to Figure 1 , is a flow chart of a load decomposition method provided by an embodiment of the present invention, comprising the following specific steps:

[0057] S1. Obtain the total power data sequence of all electrical devices;

[0058] Specifically, the present invention provides a non-invasive load decomposition method based on multi-scale TCN and multi-head self-attention mechanism, and the specific process is as follows:

[0059] Step 1: Data preparation:

[0060] (1) Collect data and obtain time series data required for load decomposition, such as power load data, temperature data, etc.

[0061] (2) Preprocess the data, including removing outliers and filling missing values.

[0062] (3) The data is standardized to ensure that the numerical ranges of each feature are similar.

[0063] (4) The total power data (power load data) sequence is used as the input of the following multi-scale TCN model for feature learning and extraction. The total power data sequence is a part of the time series data, and the power load data includes power data; the total power data sequence is one of the main input data of the multi-scale TCN model.

[0064] S2, inputting the total power data sequence into a preset feature extraction model, so that the feature extraction model extracts power feature information of the total power data sequence and outputs power data features of the total power data sequence;

[0065] The feature extraction model is obtained by training a preset multi-scale spatiotemporal convolutional network model with the historical total power data sequence of all electrical devices as input and the historical device power data sequence corresponding to each electrical device as output;

[0066] Preferably, the feature extraction model includes: several TCN modules; the power feature information of the total power data sequence is extracted and the power data features of the total power data sequence are output, including: extracting power feature information of different scales in the total power data sequence according to different TCN modules to obtain local power data features of different scales; splicing the local power data features to obtain and output the comprehensive power data features of the total power data sequence.

[0067] Step 2: Build a multi-scale TCN model:

[0068] Use a multi-scale spatiotemporal convolutional network (TCN) to extract features and decompose time series data. Through the multi-scale TCN model's multiple convolutional layers of different scales, patterns and trends at different time scales can be captured. Please refer to Figure 2 , is the network architecture diagram of TCN, which consists of 1 input layer, 1 output layer and 2 hidden layers.

[0069] (1) Design and build three sets of parallel TCN modules, each with a different convolution kernel size. The three sets of parallel convolution kernels are (16, 1), (32, 1), and (64, 1), respectively. Please refer to Figure 3 , which is the network structure diagram of multi-scale TCN.

[0070] (2) Each TCN module identifies feature information of different scales, thereby enhancing the model's ability to process temporal data.

[0071] (3) In each TCN module, the feature information in the sequence is learned through convolution operations and activation functions. The combination of convolution operations and activation functions is the core mechanism of convolutional neural network (CNN) learning features. In the TCN model (spatiotemporal convolutional network), these operations are used to capture local patterns and long-term dependencies in time series data. The details are as follows:

[0072] The convolution operation extracts local features of the data by weighted summing the input data through a sliding window. Specifically, the input data is usually a multidimensional time series with a size of N×D, where N represents the time step (e.g., power load data every minute or every hour) and D represents the input feature dimension (e.g., power load, temperature, humidity, etc.). The convolution kernel is a small filter whose size (e.g., 16×1, 32×1, or 64×1) and weights need to be learned through training. The convolution kernel performs a dot multiplication operation with the input data to generate a feature map, thereby capturing local patterns in the data, such as short-term fluctuations or long-term trends. The feature vector generated by each convolution kernel during the sliding process represents the pattern extracted in that local area. In order to introduce nonlinearity, an activation function (e.g., ReLU or Leaky ReLU) is applied to the result of the convolution operation. The ReLU function sets negative values ​​to zero and keeps positive values ​​unchanged, thereby enhancing the nonlinear expression ability of the model and enabling it to capture more complex patterns. Through the convolution operation, TCN can effectively extract local time features, while the activation function increases the complexity of the model and improves the ability to learn complex patterns.

[0073] (4) Extract features through pooling or stride operations so that the model can capture feature information at different scales. The details are as follows:

[0074] The pooling operation downsamples the local area of ​​the convolution result, aiming to retain key information and reduce the dimension of the feature. Max pooling and average pooling can be used. Max pooling retains the most significant features by selecting the maximum value in each local area (such as 2×2 or 3×3), which helps to extract more abstract representations and reduce sensitivity to local noise; while average pooling selects the average value of the area, which is relatively smooth and suitable for tasks that require smooth features. The stride operation refers to the step size of each sliding of the convolution kernel during the convolution process. A smaller stride (such as a stride of 1) can capture local features more finely and generate a larger feature map; while a larger stride (such as a stride of 2) causes the feature map size to become smaller and the amount of information to decrease, which plays a role of downsampling.

[0075] The features extracted by convolution and activation functions are mainly local and fine-grained, emphasizing the learning of short-term fluctuations; while pooling and stride operations help extract more abstract, high-level features, remove redundant information by reducing the size of feature maps, and retain important patterns or trends.

[0076] (5) The power data features extracted by each TCN module are spliced ​​to integrate feature information of different scales. The specific operation steps are as follows:

[0077] Extract features from each TCN module: Assume that the model contains three parallel TCN modules, each using convolution kernels of different sizes (e.g., 16×1, 32×1, and 64×1). Each module extracts a set of feature vectors. For example, the feature vector extracted by TCN module 1 (convolution kernel is 16) is f1, the feature vector extracted by TCN module 2 (convolution kernel is 32) is f2, and the feature vector extracted by TCN module 3 (convolution kernel is 64) is f3. These three feature vectors f1, f2, and f3 are concatenated together by column (or by feature dimension) to form a comprehensive feature vector. For example, if the dimension of f1 is (N, 16), the dimension of f2 is (N, 32), and the dimension of f3 is (N, 64), then the concatenated feature vector will be (N, 16+32+64) = (N, 112).

[0078] Through this concatenation operation, the model can simultaneously obtain feature information from different scales. For example, a module with a convolution kernel of 16 may mainly capture short-term fluctuations in power load, while a module with a convolution kernel of 64 can learn long-term trends. The concatenated feature vector contains patterns of different scales, which can help the model more comprehensively understand the various changes in time series data.

[0079] (6) Generate a comprehensive feature vector for subsequent processing and analysis.

[0080] S3, extracting the timestamp information in the total power data sequence, generating a time feature corresponding to the total power data sequence according to the timestamp information, and concatenating the time feature with the power data feature to generate a corresponding feature vector;

[0081] Step 3: Embed time information:

[0082] Please refer to Figure 4 , is a schematic diagram of time information. Time features are effectively embedded into the model to help the model better understand and utilize the time dependency of time series data. In the load decomposition task, time information embedding can be used to provide information about the time before and after, so as to better understand the regularity of household users' electricity consumption. The description method of time information is as follows Figure 4 shown.

[0083] (1) Perform timestamp extraction to extract timestamp information from the original data, such as year, month, day, hour, etc.

[0084] (2) Time feature representation: For each time tag, key features such as hour, week and month are extracted and linearly encoded into values ​​in the interval [-0.5, 0.5]. For example, for the time tag of 2011-04-18 13:22:12, the hour, week and month are 13, 1 and 4 respectively, so [0.065 2, -0.500 0, -0.3261] is given as the representation.

[0085] (3) Concatenate the linearly encoded time features with the power data features to form a new input feature vector.

[0086] (4) Embed time information into the model to enhance the model’s sensitivity to electricity consumption patterns.

[0087] S4, performing multi-head self-attention mechanism processing on the feature vector, converting the processed feature vector into a feature data sequence with the same length as the total power data sequence, and then using the feature data sequence as the predicted power data sequence of all electrical devices;

[0088] Preferably, the multi-head self-attention mechanism processing of the feature vector includes: calculating the attention weight of each time step in the feature vector according to a preset weight scoring function of the multi-head self-attention mechanism; and weighted summing the feature vector and the attention weight to obtain the feature vector processed by the multi-head self-attention mechanism.

[0089] Step 4: Introduce multi-head self-attention mechanism:

[0090] The input feature vector obtained by concatenation in the third step contains the power data features and time features, forming a comprehensive representation. This vector will be used for query, key and value calculation of the self-attention mechanism.

[0091] (1) Design and construct a multi-head self-attention mechanism, including parallel superposition and scaling of the attention structure of each layer of the attention calculation layer. The parallel superposition and scaling are as follows: for each input feature vector, the model calculates multiple "attention heads" through multiple sets of different weight matrices. The outputs of these heads are concatenated together and then processed through a linear layer; divided by a scaling factor where d k is the dimension of the key vector. This operation can keep the value of the dot product within a reasonable range, thereby avoiding gradient explosion or disappearance during training. Assuming the query vector is Q and the key vector is K, when calculating the dot product, the dot product should be divided by (d k is the dimension of the key vector) to scale, as shown in formula (1), please refer to Figure 5 , which is the network structure diagram of the multi-head self-attention mechanism.

[0092] (2) According to the weight scoring function of the self-attention mechanism, the attention weight of each position is calculated. Specifically:

[0093] Each position refers to the features of each element or time step in the input feature vector. These features can be the feature values ​​at a specific time point in the time series data. For example, in the load decomposition task, it may be a combination of power load data and time information at each time step. The self-attention mechanism obtains the attention weight of each position by calculating the similarity between the query and the key.

[0094] (3) The target data, query, key, value, and the number of attention heads are considered through weight calculation, as shown in Equations (1) and (2). "Target data" refers to the input feature data, or "query data". In the load decomposition task, these target data are mainly the power data features extracted by multi-scale TCN and the time information embedded in the concatenated feature vector. The self-attention mechanism determines the importance of each position by matching the query with the key, thereby generating weighted features.

[0095]

[0096]

[0097] MAS(Q,K,V)=concat(H1,H2,...,H h )W0 (2)

[0098] Among them, (Q), (K), and (V) represent query, key, and value matrices respectively. T is the dot product of the query and the key, divided by In order to scale the result of the dot product to make the gradient more stable, d k The scaled dot product is then operated to get the attention weights, and finally these weights are multiplied by the value matrix V.

[0099] is the calculation process of the ith attention head, Hi represents the output of the ith attention head, and is obtained by multiplying the query, key, and value matrices by the corresponding weight matrices MAS(Q,K,V)=concat(H1,H2,...,H h )W0 is the final output of the multi-head self-attention mechanism, where concat(H1,H2,...,H h) is to concatenate the outputs of all attention heads into a large feature vector, and W0 is a linear transformation matrix used to map the concatenated feature vector to the final output space.

[0100] (4) Perform weighted feature summation, and perform weighted summation of the feature vector of each layer of the attention mechanism and the attention weight to obtain the final network output feature vector. The feature vector of each layer of the attention mechanism is the output calculated by the self-attention mechanism. Specifically, these feature vectors represent how the feature vectors of each time step are weighted to obtain comprehensive features. The self-attention mechanism weights the input features of each time step to generate the output features of each layer. In addition, the input feature vector obtained in the third step (the power feature and time feature are concatenated) is the input data entering the self-attention mechanism.

[0101] Step 5: Output layer mapping:

[0102] The output layer maps the power features extracted by the core decomposition layer into a single power sequence with the same length as the total power sequence, and the two fully connected layers convert the feature matrix into one-dimensional data of length L. The previous steps are all about feature learning and representation. The core purpose of these steps is to obtain a suitable feature vector that can better capture the dynamic change trend, time dependency and other potential laws of the power load. The fifth step maps the features extracted from the previous steps to a final prediction result, that is, the final predicted power.

[0103] (1) Design and construct a fully connected layer to convert the feature matrix into one-dimensional data with the same length as the total power sequence. Here, the feature matrix refers to the output feature vector obtained after processing by the multi-head self-attention mechanism. After processing by the self-attention layer, the original input features (i.e., the concatenation of the total power load data and the time features) will be converted into a new feature representation. This output feature vector can better capture the complex relationship in the time series data. The total power sequence length refers to the length of the time series of the total power load obtained through data collection in the first step. This sequence length LL is the output target of the model, and the output predicted power sequence will be consistent with this length. The predicted power at each time step represents the power consumption of different household appliances at that moment.

[0104] (2) Adjust the output value according to the reasonable power range of each electrical appliance to ensure that the output is consistent with the actual situation.

[0105] In load forecasting, each appliance has a reasonable range of power consumption (for example, the power range of a refrigerator may be between 100W and 200W). In order to ensure that the output power value conforms to the actual situation, adjustments can be made through power range constraints, physical constraints, etc., as follows:

[0106] For each appliance, a reasonable range can be set based on its maximum and minimum power. If the power value output by the model exceeds this range, it can be corrected, such as clipping the out-of-range value to the upper and lower limits. In addition to simple numerical clipping, the power value output by the model can be further corrected based on actual physical factors such as the working status of the appliance and environmental restrictions. For example, the power of some appliances may be affected by factors such as voltage fluctuations and device status (on or off), which can be adjusted as external constraints.

[0107] (3) The adjusted output value is used as the final predicted power sequence for load decomposition and analysis.

[0108] S5. Decompose the total power data sequence according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device.

[0109] Preferably, the total power data sequence is decomposed according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device, including: according to the predicted power data sequence and the total power data sequence, the total power data sequence is used as the dependent variable, and the device power data sequence corresponding to each electrical device is used as the independent variable, and a corresponding regression model is fitted; the total power data sequence is decomposed according to the regression model to obtain a device power data sequence corresponding to each electrical device.

[0110] The specific steps of load decomposition are:

[0111] The load is decomposed based on the power prediction value and actual data of each appliance output by the model. The model may decompose the total power into independent load contributions of multiple appliances through time series prediction. For example, the total power load sequence is decomposed into separate power sequences of multiple devices (such as refrigerators, air conditioners, lamps, etc.) through regression methods. The specific decomposition process is as follows:

[0112] Use the fully connected layer designed in step 5 to convert the feature matrix into one-dimensional data with the same length as the total power sequence. This data is the power sequence predicted by the model, which can be compared and analyzed with the actual power data. Use a linear regression or nonlinear regression model, with the total power sequence as the dependent variable and the power sequence of each appliance as the independent variable, to fit the power contribution of each appliance.

[0113] By analyzing the predicted power series of each appliance, the energy consumption pattern of each appliance in different time periods can be obtained. For example, a refrigerator may consume more power at night, while an air conditioner may consume more power during the day. Load analysis can help home or industrial users understand the power consumption trend in different time periods, thereby optimizing power consumption patterns and reducing energy waste.

[0114] In a specific embodiment, the above method is verified and analyzed by examples:

[0115] Python 3.7 (64-bit), TensorFlow-gpu 2.5.0, and keras 2.5.0r0 deep learning frameworks were built on the Windows 10 operating system, and the integrated development environment was PyCharm Professional 2021.3. The experimental development environment is based on the open source NILMTK toolkit. The Pytorch deep learning framework was used on the Python programming platform to train and test the model in the present invention.

[0116] This embodiment provides a non-invasive load decomposition method based on multi-scale TCN and multi-head self-attention mechanism, using the Reference Energy Disaggregation Data Set (REDD) and the UK Domestic Appliance-Level Electricity (UKDALE) as experimental data sets for analysis. Among them, REDD is the first and most widely used public data set in the field of non-invasive load decomposition. It includes the total electricity meters and load sub-meters of 6 American households, with a recording time of about 4 months. UKDALE is an open data set released by Imperial College London in 2014. Its data is very large and includes the horizontal electricity consumption data of British households.

[0117] The present invention selects microwave ovens, washing machines, dishwashers and refrigerators as research objects in the REDD dataset, and selects microwave ovens, washing machines, kettles and refrigerators as research objects in the UKDALE dataset for cross-household training and testing. As shown in Table 1, the training set and the test set are divided.

[0118] Dataset Training set room number Test set room number REDD 2, 3, 4, 5, 6 1 UKDALE 1, 3, 4, 5 as shown 2

[0119] Table 1. Training and test set division of REDD dataset

[0120] Add status marks to the data set. Set according to the basic parameters of the appliance shown in Table 2. If the power of the appliance is within a reasonable operating power range and the running time is greater than the minimum duration, the device is considered to be in the on state and the status value is marked as 1, otherwise it is marked as 0. Table 2 is shown below.

[0121]

[0122]

[0123] Table 2 Basic parameter settings of the instrument

[0124] Note: λ is the weight of the loss term

[0125] The power data is standardized according to formula (3) and used as the evaluation standard:

[0126]

[0127] Where y is the original power data, y* is the normalized power data, μ is the sample mean, and σ is the sample variance.

[0128] The network parameters and loss function are constructed. The number, size and stride of the input layer convolution kernel are 50, 5 and 1 respectively; the number of convolution layers in TCN is 3, the number of filters is 50, the size of the convolution kernel is 5, and the expansion factor is set to 1, 2, and 4 respectively. The number of neurons in the fully connected layer is 128 and 1 respectively.

[0129] During the training process, the batch size (Batch_size) is set to 128, the number of training iterations is 50, the network parameter optimizer selects the adaptive moment estimation (Adam), and the loss function uses the mean square error (MSE) function, as shown in formula (4).

[0130]

[0131] Where: T is the number of sampling points of the power sequence; is the decomposed power value of device i at time t; x it Indicates the actual power value of device i at time t.

[0132] A classification performance evaluation index is constructed to evaluate the algorithm's ability to identify the state of electrical switches, where NTP means the device is actually on and the decomposition result is actually on; NTN means the device is actually off and the decomposition result is actually off; NFP means the device is actually off and the decomposition result is actually on; NFN means the device is actually on and the decomposition result is actually off; NP and NN represent the number of points where the device is actually on and off, respectively. (A) represents accuracy, which measures the proportion of all correctly classified samples.

[0133] (R) stands for Recall, also known as the True Positive Rate, which measures how many samples that are actually positive examples are successfully predicted as positive examples.

[0134] (P) stands for precision, which measures how many of the samples predicted to be positive are actually positive.

[0135] (F) is an indicator that comprehensively considers precision and recall, where (β) is a parameter that weighs the importance of precision and recall.

[0136] (F1) is a special case of the (F) metric when (β=1), which is usually used to balance the impact of precision and recall.

[0137]

[0138] Constructing regression performance evaluation indicators, in order to evaluate the effect of the model on reducing load power consumption, the mean absolute error (MAE) and relative absolute error (MRE) commonly used in regression problems are used to measure the decomposition performance of the algorithm. MAE and MRE are expressed in E MA and E MR It is represented by formula (6).

[0139]

[0140] The algorithm in the present invention is experimentally compared with the factorial hidden Markov model (FHMM), the bidirectional LSTM model, and the BERT4NILM model based on the Transformer framework. The performance indicators of the two classification indicators, accuracy and F1 score, and the two regression indicators, MAE and MRE, are compared on the REDD and UKDALE datasets, as shown in Tables 3 and 4.

[0141]

[0142] Table 3

[0143]

[0144]

[0145] Table 4

[0146] As shown in Tables 3 and 4, on both data sets, the NILM method based on the deep learning model is generally better than the FHMM method. For most electrical appliances, the method of the present invention also has better comprehensive performance in load decomposition.

[0147] Please refer to Figure 6 , which is a comparative analysis chart of the actual value and predicted value of the appliance. The FHMM algorithm has poor decomposition performance for washing machines with complex operating conditions. Although the proposed partial decomposition method has certain deviations in the partial operating time, compared with other load decomposition methods, the proposed model can better decompose the power changes of appliances. In equipment with more complex operating conditions such as washing machines, the proposed model can better reflect the operating laws of the equipment. For appliances such as microwave ovens, refrigerators, and dishwashers, the power change trend tracking effect is better, and the decomposed power value is more accurate. From Figure 6 It can be seen that for appliances with multiple operating states like refrigerators, the proposed model has better decomposition effect than other models; in microwave ovens, kettles, and dishwashers with few switching states and short operating time, the decomposed power values ​​can better reach the actual peak value, reflecting the actual operating conditions of the electrical equipment.

[0148] It can be seen that the present invention provides a load decomposition method. On the basis of the traditional decomposition method, a novel load decomposition method is proposed, which effectively solves the problem that under the background of rapid development of new energy, due to the complexity of the distribution network, it is no longer possible to provide an optimal solution for the load decomposition of the power grid. The traditional decomposition method is compared with the decomposition method in the present invention. The results show that the method in the present invention can improve the accuracy of load decomposition, making the decomposition result more accurate and reliable, and is not limited by a specific load mode, and has strong adaptability. The present invention is both efficient and accurate, and can effectively solve the problems existing in the traditional method in load decomposition.

[0149] In summary, the non-invasive load decomposition method based on multi-scale TCN and multi-head self-attention mechanism provided by the present invention performs outstandingly in the face of complex power system load decomposition. It can effectively solve the problems existing in traditional methods in load decomposition while ensuring higher decomposition accuracy, stronger adaptability and stronger timing characteristic capture ability. It brings new ideas and methods to the research and application of load decomposition. Therefore, this method is expected to be widely used in future power systems.

[0150] Embodiment 2

[0151] Please refer to Figure 7 , is a structural schematic diagram of a load decomposition device provided by an embodiment of the present invention, the device comprising: a total power data sequence acquisition module, a power data feature extraction module, a feature vector generation module, a feature vector conversion module and a total power data sequence decomposition module;

[0152] The total power data sequence acquisition module is used to acquire the total power data sequence of all electrical devices;

[0153] The power data feature extraction module is used to input the total power data sequence into a preset feature extraction model, so that the feature extraction model extracts the power feature information of the total power data sequence and outputs the power data features of the total power data sequence; wherein the feature extraction model is obtained by training a preset multi-scale spatiotemporal convolutional network model with the historical total power data sequence of all electrical devices as input and the historical device power data sequence corresponding to each electrical device as output;

[0154] The feature vector generation module is used to extract the timestamp information in the total power data sequence, generate the time feature corresponding to the total power data sequence according to the timestamp information, and splice the time feature with the power data feature to generate a corresponding feature vector;

[0155] The feature vector conversion module is used to perform multi-head self-attention mechanism processing on the feature vector, convert the processed feature vector into a feature data sequence with the same length as the total power data sequence, and then use the feature data sequence as the predicted power data sequence of all electrical devices;

[0156] The total power data sequence decomposition module is used to decompose the total power data sequence according to the predicted power data sequence and the total power data sequence, and decompose it to obtain the device power data sequence corresponding to each electrical device.

[0157] Preferably, the feature extraction model includes: several TCN modules; the power feature information of the total power data sequence is extracted and the power data features of the total power data sequence are output, including: extracting power feature information of different scales in the total power data sequence according to different TCN modules to obtain local power data features of different scales; splicing the local power data features to obtain and output the comprehensive power data features of the total power data sequence.

[0158] Preferably, the multi-head self-attention mechanism processing of the feature vector includes: calculating the attention weight of each time step in the feature vector according to a preset weight scoring function of the multi-head self-attention mechanism; and weighted summing the feature vector and the attention weight to obtain the feature vector processed by the multi-head self-attention mechanism.

[0159] Preferably, the total power data sequence is decomposed according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device, including: according to the predicted power data sequence and the total power data sequence, the total power data sequence is used as the dependent variable, and the device power data sequence corresponding to each electrical device is used as the independent variable, and a corresponding regression model is fitted; the total power data sequence is decomposed according to the regression model to obtain a device power data sequence corresponding to each electrical device.

[0160] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0161] Those skilled in the art can clearly understand that for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0162] Embodiment 3

[0163] Accordingly, an embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the load decomposition method described in the above embodiment of the invention when executing the computer program.

[0164] The electronic device may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The device may include, but is not limited to, a processor and a memory.

[0165] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the device, and various interfaces and lines are used to connect various parts of the entire device.

[0166] Embodiment 4

[0167] Accordingly, an embodiment of the present invention provides a storage medium, wherein the storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the load decomposition method described in the above embodiment of the invention.

[0168] The memory can be used to store the computer program, and the processor realizes various functions of the device by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0169] The storage medium is a computer-readable storage medium, and the computer program is stored in the computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0170] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A load decomposition method, characterized in that: include: Obtain the total power data sequence of all electrical devices; Inputting the total power data sequence into a preset feature extraction model, so that the feature extraction model extracts power feature information of the total power data sequence and outputs power data features of the total power data sequence; Extracting timestamp information from the total power data sequence, generating a time feature corresponding to the total power data sequence according to the timestamp information, and concatenating the time feature with the power data feature to generate a corresponding feature vector; Processing the feature vectors with a multi-head self-attention mechanism, converting the processed feature vectors into feature data sequences with the same length as the total power data sequence, and then using the feature data sequence as the predicted power data sequence of all electrical devices; Decomposing the total power data sequence according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device; The feature extraction model is obtained by training a preset multi-scale spatiotemporal convolutional network model with the historical total power data sequence of all electrical equipment as input and the historical equipment power data sequence corresponding to each electrical equipment as output.

2. The load decomposition method according to claim 1, characterized in that: The feature extraction model includes: a number of TCN modules; The extracting the power characteristic information of the total power data sequence and outputting the power data characteristics of the total power data sequence includes: Extracting power feature information of different scales in the total power data sequence according to different TCN modules to obtain local power data features of different scales; The local power data features are spliced ​​to obtain the comprehensive power data features of the total power data sequence and output them.

3. The load decomposition method according to claim 1, characterized in that: The performing multi-head self-attention mechanism processing on the feature vector includes: Calculate the attention weight of each time step in the feature vector according to the preset weight scoring function of the multi-head self-attention mechanism; The feature vector is weightedly summed with the attention weight to obtain the feature vector processed by the multi-head self-attention mechanism.

4. The load decomposition method according to claim 1, characterized in that: The step of decomposing the total power data sequence according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device includes: According to the predicted power data sequence and the total power data sequence, the total power data sequence is used as a dependent variable, and the device power data sequence corresponding to each electrical device is used as an independent variable, and a corresponding regression model is obtained by fitting; The total power data sequence is decomposed according to the regression model to obtain a device power data sequence corresponding to each electrical device.

5. A load decomposition device, characterized in that: include: A total power data sequence acquisition module, a power data feature extraction module, a feature vector generation module, a feature vector conversion module and a total power data sequence decomposition module; The total power data sequence acquisition module is used to acquire the total power data sequence of all electrical devices; The power data feature extraction module is used to input the total power data sequence into a preset feature extraction model, so that the feature extraction model extracts the power feature information of the total power data sequence and outputs the power data features of the total power data sequence; wherein the feature extraction model is obtained by training a preset multi-scale spatiotemporal convolutional network model with the historical total power data sequence of all electrical devices as input and the historical device power data sequence corresponding to each electrical device as output; The feature vector generation module is used to extract the timestamp information in the total power data sequence, generate the time feature corresponding to the total power data sequence according to the timestamp information, and splice the time feature with the power data feature to generate a corresponding feature vector; The feature vector conversion module is used to perform multi-head self-attention mechanism processing on the feature vector, convert the processed feature vector into a feature data sequence with the same length as the total power data sequence, and then use the feature data sequence as the predicted power data sequence of all electrical devices; The total power data sequence decomposition module is used to decompose the total power data sequence according to the predicted power data sequence and the total power data sequence, and decompose it to obtain the device power data sequence corresponding to each electrical device.

6. The load decomposition device according to claim 5, characterized in that: The feature extraction model includes: a number of TCN modules; The extracting the power characteristic information of the total power data sequence and outputting the power data characteristics of the total power data sequence includes: Extracting power feature information of different scales in the total power data sequence according to different TCN modules to obtain local power data features of different scales; The local power data features are spliced ​​to obtain the comprehensive power data features of the total power data sequence and output them.

7. The load decomposition device according to claim 5, characterized in that: The performing multi-head self-attention mechanism processing on the feature vector includes: Calculate the attention weight of each time step in the feature vector according to the preset weight scoring function of the multi-head self-attention mechanism; The feature vector is weightedly summed with the attention weight to obtain the feature vector processed by the multi-head self-attention mechanism.

8. The load decomposition device according to claim 5, characterized in that: The step of decomposing the total power data sequence according to the predicted power data sequence and the total power data sequence to obtain a device power data sequence corresponding to each electrical device includes: According to the predicted power data sequence and the total power data sequence, the total power data sequence is used as a dependent variable, and the device power data sequence corresponding to each electrical device is used as an independent variable, and a corresponding regression model is obtained by fitting; The total power data sequence is decomposed according to the regression model to obtain a device power data sequence corresponding to each electrical device.

9. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the load decomposition method according to any one of claims 1 to 4 when executing the computer program.

10. A storage medium, characterized in that: The storage medium includes a stored computer program, wherein when the computer program is executed, the device where the storage medium is located is controlled to execute the load decomposition method according to any one of claims 1 to 4.