Non-intrusive load identification method and system based on feature fusion and contrastive learning
The non-intrusive load identification method through feature fusion and contrastive learning, combined with steady-state and transient power sequences, uses feature fusion and convolution block attention mechanism to solve the inaccuracies in the existing technology in identifying unknown loads and identifying electrical appliances of different categories. It solves the problem of accuracy and achieves high-accuracy electrical appliance identification and robustness improvement.
Patent Information
- Application Number
- CN202410777471.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Existing non-intrusive load identification methods have low identification accuracy for unknown loads and cannot effectively identify electrical appliances of different categories but similar power. Moreover, methods based on low-frequency data have a method upper limit and cannot effectively obtain transient data, resulting in poor identification results. .
A non-invasive load identification method based on feature fusion and contrastive learning is used to collect current and voltage data, calculate steady-state and transient active power sequences, and combine the feature fusion attention mechanism and convolution block attention mechanism to extract electrical features and The model is trained through comparative learning methods to achieve accurate identification of different categories of electrical appliances.
It improves the identification accuracy of electrical appliances with similar power, enables identification of open collectors, improves the robustness of the model, and expands the application scenarios of non-intrusive load identification.
Smart Images

Figure CN118332457B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of non-intrusive load identification, and in particular relates to a non-intrusive load identification method and system based on feature fusion and contrast learning. Background Art
[0002] With the rapid development of society and the continuous advancement of science and technology, people's living standards have significantly improved, and the demand for power resources has increased year by year. In recent years, my country's total social electricity consumption and per capita electricity consumption have also increased year by year. How to manage electric energy in a refined manner is the key to achieving energy conservation and emission reduction. Against the background of increasing electric energy consumption, load identification technology has emerged. Intrusive load monitoring (ILM) uses low-end energy sensors connected to equipment to monitor equipment consumption. ILM can accurately monitor and control equipment, but it is not cost-effective. Non-intrusive load monitoring (NILM) or load decomposition is a method of estimating the energy consumption of a single appliance using total load measurements obtained from a single electric energy meter. This technology obtains the electricity consumption information of the total load at a single measurement point, including characteristic parameters such as current and voltage, and obtains the electricity consumption information of a single internal load by analyzing the total load information. The features used in NILM are mainly divided into steady-state features and transient features. The steady-state features are extracted from the steady state of the appliance operation, and the transient features are extracted from the short-term fluctuations of power or current during the state transition of the appliance.
[0003] The non-intrusive load method installs an embedded non-intrusive power identification module on the household electricity meter, and then uses the load identification algorithm to detect the load working status of the electrical appliance. Combined with effective power management, it can achieve power saving without affecting the user experience. The current non-intrusive load identification schemes can be mainly divided into two categories, namely, non-intrusive load identification schemes based on high-frequency data and non-intrusive load identification schemes based on low-frequency data. However, most studies have shown that non-intrusive load identification schemes based on low-frequency data have problems such as low method upper limit, inability to effectively obtain transient data, and poor load identification effect. High-frequency data carries a large amount of information, and the algorithm can more effectively extract the information of electrical appliances from high-frequency data to achieve better electrical appliance identification effect. Therefore, the non-intrusive load identification scheme based on high-frequency data has better effect and application value. However, the existing NILM method based on high-frequency data has low accuracy in identifying unknown loads and electrical appliances of different categories but similar power.
[0004] In the non-intrusive load identification scheme based on high-frequency data, the existing methods often use closed set learning, that is, training on known data, the model outputs the class label, and can only identify fixed classes. When given data outside the training (unknown class), the model will classify it as a known class, resulting in misidentification. In general household users, it is often necessary to add new electrical appliances, which are unknown (open set) to the trained non-intrusive load identification model, and the model cannot accurately identify the type of new appliances. In addition, most of the existing methods use a single transient feature or transient feature. The single use of transient features and steady-state features has a certain one-sidedness and cannot effectively identify different electrical appliances with similar power. Some technologies that use the fusion of transient features and steady-state features also find it difficult to extract good features from the fused features. The fused features extracted by the model often depend more on the steady-state features. Summary of the invention
[0005] In view of the problems of existing non-intrusive load identification schemes such as single features, limited types of electrical appliance identification, poor robustness, and inaccurate identification of electrical appliances of different categories but similar power, the present invention proposes a non-intrusive load identification method and system based on steady-state transient feature fusion and comparative learning, which can improve the identification effect of electrical appliances of different types but similar power, improve robustness, realize open collector identification, and expand the application scenarios of non-intrusive load identification.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0007] In a first aspect, the present invention discloses a non-intrusive load identification method based on feature fusion and contrastive learning, comprising:
[0008] Collect current and voltage data of electrical equipment, intercept the steady-state voltage and current before and after the switching event and the transient voltage and current during the electrical appliance state conversion process, and calculate the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence respectively;
[0009] The steady-state characteristics and transient characteristics are calculated according to the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence as the characteristics of the electrical equipment;
[0010] The electrical equipment features of the electrical appliance under test and the electrical equipment features of electrical appliances of known categories are combined into sample pairs. The non-intrusive load recognition model based on feature fusion attention mechanism and convolutional block attention mechanism is used to predict the similarity of the sample pairs, and the type of the electrical appliance under test is identified based on the similarity.
[0011] Furthermore, the lengths of the steady-state active power sequence and the nth harmonic transient active power sequence before and after the switching event are the same.
[0012] Furthermore, the steady-state characteristic is the absolute value of the difference between the steady-state active power sequences before and after the switching event, and the transient characteristic is the absolute value of the difference between the nth harmonic transient active power sequence and the steady-state active power sequence before the switching event.
[0013] Furthermore, the non-intrusive load identification model includes:
[0014] Feature fusion attention module, used to extract the embedding features of each sample in the sample pair;
[0015] A twin network module, used to extract a first feature and a second feature from the embedded features of each sample in the sample pair, and fuse the first feature and the second feature to obtain a third feature;
[0016] A convolutional block attention module is used to extract the fourth feature from the third feature of the sample pair;
[0017] The similarity output module is used to convert the fourth feature into a similarity value.
[0018] Furthermore, the feature fusion attention module adopts a feature fusion attention mechanism, including a local feature attention channel, a global feature attention channel, a first residual network, a second residual network and an activation function layer;
[0019] The steady-state features and transient features of each sample in the sample pair are concatenated. The concatenated features are respectively extracted through the local feature attention channel and the global feature attention channel. The local features and the global features are concatenated and the weights in the range of 0-1 are generated through the activation function layer.
[0020] The steady-state features and transient features of each sample in the sample pair are extracted through the first residual network and the second residual network respectively, and the steady-state residual features and transient residual features are weighted calculated according to the weights generated by the activation function layer to obtain the embedded features of each sample in the sample pair.
[0021] Furthermore, the global feature attention channel has one more global average pooling layer at the input end than the local feature attention channel.
[0022] Furthermore, the convolutional block attention module adopts a convolutional block attention mechanism, including a maximum pooling layer, an average pooling layer and a multi-layer perceptron;
[0023] The third feature of the sample pair is processed by the maximum pooling layer and the average pooling layer respectively to obtain two feature maps of different dimensions; the features of the two feature maps are extracted and concatenated using a multi-layer perceptron to generate the fourth feature.
[0024] Furthermore, the non-intrusive load identification model is trained by contrastive learning.
[0025] In a second aspect, the present invention discloses a non-intrusive load identification system based on feature fusion and contrastive learning, which is used to implement the above-mentioned non-intrusive load identification method based on feature fusion and contrastive learning.
[0026] In a third aspect, the present invention discloses an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned non-intrusive load identification method based on feature fusion and contrast learning.
[0027] In a fourth aspect, the present invention discloses a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, they are used to implement the above-mentioned non-intrusive load identification method based on feature fusion and contrast learning.
[0028] The beneficial effects of the present invention are:
[0029] The present invention performs non-intrusive load identification based on the fusion of transient active power and steady-state active power combined with comparative learning, thereby improving the recognition effect of electrical appliances with similar power, with high accuracy, and can realize the identification of split collectors; in addition, the model for non-intrusive load identification adopts a feature fusion attention mechanism and a convolutional block attention mechanism, which can enable the model to learn more important features, thereby improving the robustness of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 Schematic diagram of steady-state power and transient power of different electrical appliances shown in an embodiment of the present invention, wherein (a) steady-state power of a refrigerator, (b) steady-state power of a washing machine, (c) transient power of a refrigerator, and (d) transient power of a washing machine.
[0031] Figure 2 It is a schematic diagram of a feature fusion attention module shown in an embodiment of the present invention.
[0032] Figure 3 Schematic diagram of a convolutional block attention module shown in an embodiment of the present invention.
[0033] Figure 4 It is a framework diagram of a non-intrusive load identification model based on feature fusion and contrast learning shown in an embodiment of the present invention.
[0034] Figure 5 It is a flow chart of a non-intrusive load identification method based on feature fusion and contrast learning shown in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0037] The present invention proposes a non-invasive load identification method based on transient and steady-state feature fusion and comparative learning. In order to solve the problem of inaccurate identification of open collectors and appliances of different categories but similar power, the present invention first transforms the input transient power and steady-state power during identification, calculates the steady-state active power based on the high-frequency sampled steady-state current and steady-state voltage, and calculates the transient active power based on the transient current and transient voltage during the appliance working state conversion process, so that the model changes from learning the current waveform to learning the steady-state active power and transient active power. Due to the different working principles of different types of appliances, the transient active power waveforms they exhibit when performing their respective physical tasks are significantly different, such as Figure 1 As shown, Figure 1 (a) and (c) are the steady-state power and transient power of a certain brand of refrigerator, respectively. Figure 1 (b) and (d) in the figure are the steady-state power and transient power of a washing machine of a certain brand, respectively. It can be seen that the steady-state power of a refrigerator and a washing machine of a certain brand is similar, but there are obvious differences in the transient process. Secondly, a non-intrusive load recognition model based on contrastive learning is designed, and a feature fusion attention mechanism is introduced to realize the open set recognition of electrical appliances and improve the model's recognition ability for appliances of different categories but with similar power; finally, the non-intrusive load recognition model is trained through the mean square error loss function, so that the model can obtain the ability to extract electrical appliance features and realize load recognition.
[0038] refer to Figure 5 , the implementation process of the present invention includes the following steps:
[0039] S1, collect current and voltage data of electrical equipment, with a sampling rate of no less than 6.4KHz, collect steady-state voltage and current before and after the switch event and transient voltage and current during the electrical appliance state conversion process, process the current and voltage data, and convert them into steady-state active power and transient active power respectively to form a training data set. The specific process is as follows:
[0040] Step 1: Collect current and voltage data through smart meters, oscilloscopes and other electrical equipment data collection devices, with a sampling rate of no less than 6.4KHz, no less than 10 types of electrical appliances, no less than 400 data items for each electrical appliance, and the length of each data item is no less than 3 seconds. The collected current and voltage data of the electrical appliances are used as the initial training set. It should be noted that if the public data set also meets the above conditions, the public data set can also be added to the initial training set.
[0041] Step 2: Calculate steady-state active power And transient active power , and then the transient active power Converted into nth harmonic transient active power Taking the sampling rate of current and voltage data as 6.4KHz as an example, each cycle of the collected data contains data points, if the sampling rate is , the sampling time is , then after conversion to power data, the length of each data will be becomes , 50 represents the oscillation frequency of the power grid. The steady-state active power is calculated with each cycle as a unit. , the calculation formula is as follows:
[0042]
[0043] in, They represent the ith steady-state current and ith steady-state voltage data points in one cycle respectively.
[0044] Transient active power The calculation formula is the same as above. Since the steady-state current and voltage data points are obviously more than the transient current and voltage data points, the calculated steady-state active power sequence length is greater than the transient active power sequence length. The present invention improves this problem by calculating the nth harmonic of the transient active power. Assuming that the transient current and voltage data contain cycles, and each data point of the cycle corresponds to a calculated transient active power , the transient active power sequence after nth harmonic calculation is expressed as:
[0045] P t a n = [ P t a 1 ( 1 ) , . . . P t a 1 ( l ) , P t a 2 ( 1 ) , . . . P t a 2 ( l ) , . . . , P t a n ( l ) ]
[0046] in, Represents the nth harmonic transient active power sequence during the electrical state conversion process, Represents the first The transient active power of the nth harmonic of a cycle, Indicates the number of cycles contained in the transient current and voltage data.
[0047] Step 3: According to the steady-state active power And the nth harmonic transient active power Calculate transient characteristics and steady-state characteristics to construct a training data set. The transient characteristics and steady-state characteristics obtained by traditional difference calculation using current data will cause the current to contain noise from high-power electrical appliances. This noise is mainly caused by the current of the reactive part of the high-power electrical appliances. In the present invention, the steady-state active power before and after the switching event is used to calculate the transient characteristics and steady-state characteristics. and nth harmonic transient active power By calculating transient characteristics and steady-state characteristics, the influence of reactive power of high-power electrical appliances can be offset to a certain extent.
[0048] The calculation formulas for transient characteristics and steady-state characteristics are as follows:
[0049]
[0050]
[0051] in, , They represent transient characteristics and steady-state characteristics respectively.
[0052] Step 3: Construct a comparative learning data set. Use the training data set to construct positive sample pairs and negative sample pairs, and prepare the same number of positive sample pairs and negative sample pairs for training. Positive sample pairs refer to transient features and steady-state features corresponding to the same type of electrical appliances, and negative sample pairs refer to transient features and steady-state features corresponding to different types of electrical appliances. Each time, randomly select a sample from the training data set, and then randomly select another sample from the same type of electrical appliance sample set to form a positive sample pair, and set the label to 1, that is, the similarity is full marks. Each time, randomly select a sample from the training data set, and then randomly select another sample from the other type of electrical appliance sample set. This is a negative sample pair, and the label is set to 0, that is, the similarity is 0.
[0053] S2, constructs a feature fusion attention module, such as Figure 2 As shown in the figure, including the local feature attention channel, the global feature attention channel and two residual structures, the calculation of the feature fusion attention module mainly includes the following steps:
[0054] Step 1: First, concatenate the transient features and the steady-state features, and then input them into the local feature attention channel and the global feature attention channel of the feature fusion attention module respectively. The local feature attention channel is composed of a point-by-point convolution layer, an activation function layer and a point-by-point convolution layer, and the global feature attention channel is composed of a global average pooling layer, a point-by-point convolution layer, an activation function layer and a point-by-point convolution layer.
[0055] Assume that the concatenation dimension of transient features and steady-state features is [ C , L e n g t h , 1 ] , then the feature dimension obtained after the local feature attention channel is [ C , 1 , 1 ] , the feature dimension obtained after the global attention channel is [ C , L e n g t h , 1 ] . Where C represents the number of channels and Length represents the length of the feature.
[0056] Step 2: Add the two features obtained in Step 1. Note that the addition here requires a broadcast operation, which is equivalent to adding the feature dimension output by the local feature attention channel. [ C , 1 , 1 ] Expand to [ C , L e n g t h , 1 ] , the dimension of the two features added together is [ C , L e n g t h , 1 ] The feature vector of is activated by the Sigmod function, and the output value is between 0 and 1. The probability value is used to represent the weight of the transient feature and the steady-state feature. It is common knowledge in the art to add features of two different dimensions through the broadcast operation, and will not be repeated here.
[0057] Step 3: Input the transient features and steady-state features into the residual structure respectively, and perform weighted summation according to the Sigmoid result in Step 2. The specific operation formula is as follows.
[0058]
[0059] in, , represent transient characteristics and steady-state characteristics respectively, Represents a splicing operation, represents the multiplication operation, Indicates that , After splicing, the results are respectively passed through the local feature attention channel, the global attention channel and the Sigmod activation function. , Respectively indicate , The result after the residual structure, Z represents the embedded features obtained after the input data passes through the feature fusion attention module. The above residual structure is common knowledge in the field, and its structure can be designed according to actual needs. The residual structure used in this embodiment is composed of a convolution block, a Relu activation function, and a convolution block. Each convolution block includes three convolution layers. The two residual structure parameters used here to process transient features and steady-state features are independent of each other.
[0060] S3, build a twin network.
[0061] In a specific implementation of the present invention, a twin network is constructed based on Resnet50, and its construction and data processing process mainly includes the following steps:
[0062] Step 1: The input of the twin network is a sample pair ( , ),in , The two samples are embedded with features obtained after the feature fusion attention module. Resnet50 is used to perform First, we will and Input Resnet50 network for feature extraction and get the first feature And the second feature It should be noted that the and The Resnet50 networks of the features belong to the same network with parameter sharing.
[0063] Step 2: Then the first feature And the second feature Perform a splicing operation to obtain a mixed feature, which is recorded as the third feature; the splicing formula is as follows.
[0064]
[0065] in, express and The mixed features after splicing are the third features.
[0066] S4, build the convolutional block attention module, such as Figure 3 As shown in Figure 1, it includes a global maximum pooling layer, a global average pooling layer, and a multi-layer perceptron network with weight sharing. The calculation process of the convolutional block attention module is as follows:
[0067] First, the Perform global maximum pooling and global average pooling respectively, that is, compress the feature map based on two dimensions to obtain two feature maps of different dimensions. The pooled feature maps share a multi-layer perceptron network. In this embodiment, the multi-layer perceptron network uses two fully connected layers. The number of channels is first reduced through a fully connected layer, and then the number of channels is restored through another fully connected layer. The two output results of the multi-layer perceptron network are spliced to obtain the convolution block attention output result.
[0068] S5, construct the similarity output module.
[0069] In a specific implementation of the present invention, a Sigmoid activation function is used as a similarity output module to process the convolution block attention output result obtained in step S4, and output a probability of size 0-1, which is used to represent and The similarity.
[0070] S6, set the mean square error loss function to train the model. The triplet loss function is as follows:
[0071]
[0072] in, is the number of sample pairs, is the predicted value of the i-th sample pair, is the true value of the i-th sample pair. If the sample pair is a positive sample pair, then , if the sample pair is a negative sample pair, then By training the model with this loss function, the model can continuously learn the similarities between input sample pairs, thereby achieving the purpose of increasing the similarity between samples of the same type of electrical appliances and reducing the similarity between samples of different types of electrical appliances.
[0073] S7, model training.
[0074] Step 1: Connect the modules constructed in steps S2 to S5 in series to obtain a non-intrusive load identification model based on multi-channel data, such as Figure 4 As shown in the figure, the model is mainly composed of a feature fusion attention module, a twin network, a convolutional block attention module and a similarity output module.
[0075] Step 2: Train the model using the loss function of step S6 and the training data of step S1. When the loss function converges to a certain value and no longer decreases significantly, the model training ends.
[0076] S8, reasoning process.
[0077] The current and voltage data of electrical equipment are collected and processed into transient characteristics and steady-state characteristics to be tested. The transient characteristics and steady-state characteristics are regarded as samples to be tested. They are combined with the transient characteristics and steady-state characteristics of other existing categories of electrical appliances to form sample pairs, and the trained model is used to generate prediction results.
[0078] In a specific implementation of the present invention, the process is as follows Figure 5 As shown, the specific steps are as follows:
[0079] Step 1: Obtain the time of the switching event of the current and voltage data through the switching event detection algorithm. The switching event detection algorithm is not within the scope of discussion of the present invention. This technology is common knowledge in the field and will not be described in detail.
[0080] Step 2: intercept the voltage and current data before and after the switch event and during the conversion of the working state of the electrical appliance, and obtain the transient characteristics and steady-state characteristics according to Step 2-Step 3 in step S1, and regard the transient characteristics and steady-state characteristics as samples to be tested, and form sample pairs with samples of other existing categories of electrical appliances. In this embodiment, the sample to be tested and n samples of each category of electrical appliances are respectively formed into sample pairs;
[0081] Step 3: Use the trained model to predict the similarity of each sample pair, take the average similarity of n samples of each category of electrical appliances as the similarity value of that category of electrical appliances, take the maximum similarity value from the similarity values of all existing categories of electrical appliances, and determine whether the maximum similarity value is greater than the threshold. If so, the electrical appliance category corresponding to the maximum similarity value is used as the recognition result, otherwise the sample to be tested is marked as a new category sample, the type is manually identified and added to the training set, and the model is updated regularly using the updated training set.
[0082] In this embodiment, a non-intrusive load identification system based on feature fusion and contrast learning is also provided, including:
[0083] The power equipment data acquisition module is used to collect the current and voltage data of the power equipment, intercept the steady-state voltage and current before and after the switching event and the transient voltage and current during the electrical appliance state conversion process, and calculate the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence;
[0084] A data extraction module, which is used to calculate steady-state characteristics and transient characteristics based on the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence as the characteristics of the electrical equipment;
[0085] The non-intrusive load identification module is used to form sample pairs with the electrical equipment features of the electrical appliance under test and the electrical equipment features of electrical appliances of known categories, and use a non-intrusive load identification model based on feature fusion attention mechanism and convolution block attention mechanism to predict the similarity of sample pairs, and identify the type of electrical appliance under test based on the similarity.
[0086] For the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment, and the implementation methods of the remaining modules will not be repeated here. The system embodiment described above is only 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 the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0087] The embodiments of the system of the present invention can be applied to any device with data processing capabilities, and the device with data processing capabilities can be a device or apparatus such as a computer. The system embodiments can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, the corresponding computer program instructions in the non-volatile memory are read into the memory by the processor of any device with data processing capabilities and run.
[0088] An embodiment of the present invention further provides an electronic device, including a memory and a processor;
[0089] The memory is used to store computer programs;
[0090] The processor is used to implement the above-mentioned non-intrusive load identification method based on feature fusion and contrast learning when executing the computer program.
[0091] An embodiment of the present invention further provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned non-intrusive load identification method based on feature fusion and contrast learning is implemented.
[0092] The computer-readable storage medium may be an internal storage unit of any device with data processing capability described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium may also be an external storage device of any device with data processing capability, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capability. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capability, and may also be used to temporarily store data that has been output or is to be output.
[0093] Obviously, the above-described embodiments and drawings are only some examples of the present application. For those of ordinary skill in the art, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that, although the work done in this development process may be complicated and lengthy, for those of ordinary skill in the art, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application. Without departing from the concept of the present application, several variations and improvements can also be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A non-intrusive load identification method based on feature fusion and contrastive learning, It is characterized in that include: Collect current and voltage data of electrical equipment, intercept the steady-state voltage and current before and after the switching event and the transient voltage and current during the electrical appliance state conversion process, and calculate the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence respectively; the lengths of the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence are the same; Calculate steady-state characteristics and transient characteristics according to the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence as the characteristics of the electrical equipment; the steady-state characteristic is the absolute value of the difference between the steady-state active power sequence before and after the switching event, and the transient characteristic is the absolute value of the difference between the nth harmonic transient active power sequence and the steady-state active power sequence before the switching event; The electrical equipment features of the tested electrical appliance and the electrical equipment features of known categories of electrical appliances are combined into sample pairs, and the non-intrusive load recognition model based on feature fusion attention mechanism and convolutional block attention mechanism is used to predict the similarity of the sample pairs, and the type of the tested electrical appliance is identified based on the similarity; The non-intrusive load identification model includes: A feature fusion attention module is used to extract the embedded features of each sample in the sample pair; the feature fusion attention module adopts a feature fusion attention mechanism, including a local feature attention channel, a global feature attention channel, a first residual network, a second residual network and an activation function layer; the steady-state features and transient features of each sample in the sample pair are spliced, the spliced features are respectively extracted from the local feature attention channel and the global feature attention channel, the local features and the global features are spliced and a weight in the range of 0-1 is generated through the activation function layer; the steady-state features and transient features of each sample in the sample pair are respectively extracted from the first residual network and the second residual network, and the steady-state residual features and the transient residual features are weightedly calculated according to the weights generated by the activation function layer to obtain the embedded features of each sample in the sample pair; A twin network module, used to extract a first feature and a second feature from the embedded features of each sample in the sample pair, and fuse the first feature and the second feature to obtain a third feature; A convolutional block attention module is used to extract the fourth feature from the third feature of the sample pair; A similarity output module, used for converting the fourth feature into a similarity value; The non-intrusive load identification model is trained by contrastive learning.
2. According to claim 1, the non-intrusive load identification method based on feature fusion and contrastive learning, It is characterized in that The convolutional block attention module adopts a convolutional block attention mechanism, including a maximum pooling layer, an average pooling layer and a multi-layer perceptron; The third feature of the sample pair is processed by the maximum pooling layer and the average pooling layer respectively to obtain two feature maps of different dimensions; the features of the two feature maps are extracted and concatenated using a multi-layer perceptron to generate the fourth feature.
3. A non-intrusive load identification system based on feature fusion and contrastive learning, It is characterized in that include: An electrical equipment data acquisition module, which is used to collect current and voltage data of electrical equipment, intercept the steady-state voltage and current before and after the switching event and the transient voltage and current during the electrical equipment state conversion process, and calculate the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence respectively; the lengths of the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence are the same; A data extraction module, which is used to calculate steady-state characteristics and transient characteristics according to the steady-state active power sequence before and after the switching event and the nth harmonic transient active power sequence as the characteristics of the electrical equipment; the steady-state characteristic is the absolute value of the difference between the steady-state active power sequence before and after the switching event, and the transient characteristic is the absolute value of the difference between the nth harmonic transient active power sequence and the steady-state active power sequence before the switching event; A non-intrusive load identification module is used to combine the electrical equipment features of the electrical appliance to be tested with the electrical equipment features of electrical appliances of known categories into sample pairs, and use a non-intrusive load identification model based on feature fusion attention mechanism and convolutional block attention mechanism to predict the similarity of the sample pairs, and identify the type of the electrical appliance to be tested based on the similarity; The non-intrusive load identification model includes: A feature fusion attention module is used to extract the embedded features of each sample in the sample pair; the feature fusion attention module adopts a feature fusion attention mechanism, including a local feature attention channel, a global feature attention channel, a first residual network, a second residual network and an activation function layer; the steady-state features and transient features of each sample in the sample pair are spliced, the spliced features are respectively extracted from the local feature attention channel and the global feature attention channel, the local features and the global features are spliced and a weight in the range of 0-1 is generated through the activation function layer; the steady-state features and transient features of each sample in the sample pair are respectively extracted from the first residual network and the second residual network, and the steady-state residual features and the transient residual features are weightedly calculated according to the weights generated by the activation function layer to obtain the embedded features of each sample in the sample pair; A twin network module, used to extract a first feature and a second feature from the embedded features of each sample in the sample pair, and fuse the first feature and the second feature to obtain a third feature; A convolutional block attention module is used to extract the fourth feature from the third feature of the sample pair; A similarity output module, used for converting the fourth feature into a similarity value; The non-intrusive load identification model is trained by contrastive learning.
4. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the non-intrusive load identification method based on feature fusion and contrast learning as described in claim 1 or 2.
5. A machine-readable storage medium, It is characterized in that The machine-readable storage medium stores machine-executable instructions, which, when called and executed by a processor, are used to implement the non-intrusive load identification method based on feature fusion and contrastive learning as described in claim 1 or 2.
Citation Information
Patent Citations
Non-intrusive load identification method fusing transient and steady state characteristics
CN114709926A
Non-intrusive load identification method and system based on multi-strategy learning
CN116610922A
Non-intrusive load identification method and system based on multi-head attention mechanism
CN116910658A
Multi-input distributed non-intrusive load decomposition method
CN117909720A
Electric power system safety and stability analysis method considering space-time law of wind turbine generator
CN117937607A
