Electrical equipment load identification method and device, power equipment, readable storage medium and program product
By converting the total load data of electrical equipment into spectrum data and using a multi-layer attention autoencoder neural network to identify generic features, the problem of poor accuracy of electrical equipment load recognition in the prior art is solved, and more accurate and fast load recognition of electrical equipment is achieved.
Patent Information
- Application Number
- CN202510118212.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, the accuracy of load identification of electrical equipment is poor, especially when multiple electrical appliances work at the same time, the recognition effect may be poor.
By obtaining the total load data of the electrical equipment, converting it into frequency data and converting it into spectrum data based on the Mel spectrum, inputting the pre-trained multi-layer attention autoencoder neural network to identify whether there are generic characteristics of the corresponding electrical equipment in the spectrum data.
It improves the accuracy of load recognition of electrical equipment, reduces interference when directly identifying the total load data, and facilitates the subsequent identification of whether there are generic features from the spectrum data.
Smart Images

Figure CN120048283A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric power, and particularly to a method and device for identifying the load of electrical equipment, a power equipment, a computer-readable storage medium, and a computer program product. Background Art
[0002] Through the identification of the load of electrical equipment, the energy consumption of various electrical equipment can be detected, providing a decision-making basis for energy-saving management. However, at present, the accuracy of the identification of the load of electrical equipment is not good. Summary of the Invention
[0003] Based on this, in view of the above technical problems, it is necessary to provide a method and device for identifying the load of electrical equipment, a power equipment, a computer-readable storage medium, and a computer program product to improve the accuracy of the identification of the load of electrical equipment.
[0004] In a first aspect, the present application provides a method for identifying the load of electrical equipment, the method comprising:
[0005] Obtaining the total load data corresponding to two or more electrical equipment;
[0006] Converting the total load data into frequency data; and converting the frequency data into spectral data based on the Mel spectrum;
[0007] Inputting the spectral data into two or more pre-trained multi-layer attention autoencoder neural networks; each multi-layer attention autoencoder neural network corresponds to the equipment category to which each electrical equipment belongs; the multi-layer attention autoencoder neural network is trained based on pre-labeled load identification training samples and is used to identify whether there is a class feature corresponding to the electrical equipment in the spectral data and output an identification result; the load identification training samples are based on the annotation of the presence or absence of electrical equipment in the spectral data samples;
[0008] Determining the electrical equipment existing in the total load data according to the identification results corresponding to each multi-layer attention autoencoder neural network.
[0009] In one of the embodiments, the above method further comprises:
[0010] Determining reconstructed data based on a pre-constructed decoding network corresponding to the multi-layer attention autoencoder neural network;
[0011] And determining the effectiveness of the class feature according to the reconstructed data;
[0012] Inputting the spectral data into the trained multi-layer attention autoencoder neural network includes: inputting the spectral data into the trained multi-layer attention autoencoder neural network when it is determined that the class feature is valid.
[0013] In one embodiment, the total load data is one-dimensional total load data based on time series; converting the total load data into frequency data includes: based on the fast Fourier transform, converting the one-dimensional total load data into two-dimensional frequency data.
[0014] In one embodiment, the method further includes: determining the number of electrical appliances actually installed on the user side corresponding to each device category;
[0015] Determining the electrical appliances existing in the total load data includes: when the number of electrical appliances is 1, determining whether the corresponding electrical appliance exists in the total load data.
[0016] In a second aspect, the present application further provides a training method for a multi-layer attention autoencoder neural network, and the multi-layer attention autoencoder neural network corresponds to the device category to which the electrical appliance belongs; the method includes:
[0017] Converting the total load data samples corresponding to two or more electrical appliances into frequency data samples; and based on the Mel spectrum, converting the frequency data samples into spectrum data samples;
[0018] Based on labeling whether the electrical appliances exist in the spectrum data samples, obtaining load recognition training samples;
[0019] Based on the load recognition training samples, training the multi-layer attention autoencoder neural network to extract generic features corresponding to the device category, and obtaining the trained multi-layer attention autoencoder neural network.
[0020] In one embodiment, training the multi-layer attention autoencoder neural network based on the load recognition training samples to extract generic features corresponding to the device category includes:
[0021] Determining the cosine similarity between the feature vectors in the load recognition training samples;
[0022] Based on the cosine similarity and the normalized exponential function, determining the attention coefficient;
[0023] Based on the attention coefficient, extracting generic features corresponding to the device category.
[0024] In a third aspect, the present application further provides an electrical appliance load recognition device, and the device includes:
[0025] A data processing module, configured to obtain the total load data corresponding to two or more electrical appliances; convert the total load data into frequency data; and based on the Mel spectrum, convert the frequency data into spectrum data;
[0026] The first recognition module is used to input spectrum data into two or more pre-trained multi-layer attention autoencoder neural networks; each multi-layer attention autoencoder neural network corresponds to a device category to which each electrical device belongs; the multi-layer attention autoencoder neural network is trained based on pre-labeled load recognition training samples and is used to recognize whether there are class features of the corresponding electrical device in the spectrum data and output a recognition result; the load recognition training samples are based on the labeling of the presence or absence of electrical devices in the spectrum data samples.
[0027] The second recognition module is used to determine the electrical devices existing in the total load data according to the recognition results corresponding to each multi-layer attention autoencoder neural network.
[0028] In a fourth aspect, the present application further provides a power device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the electrical device load recognition method in the first aspect, and / or the steps of the training method of the multi-layer attention autoencoder neural network in the second aspect.
[0029] In a fifth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the electrical device load recognition method in the first aspect, and / or the steps of the training method of the multi-layer attention autoencoder neural network in the second aspect.
[0030] In a sixth aspect, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the steps of the electrical device load recognition method in the first aspect, and / or the steps of the training method of the multi-layer attention autoencoder neural network in the second aspect.
[0031] For the above electrical device load recognition method, device, power device, computer-readable storage medium and computer program product, since the total load data is converted into frequency data, and the spectrum data is obtained by using the Mel spectrum, and based on the analysis of the spectrum data, the electrical devices existing in the total load data are determined, avoiding the interference existing when directly recognizing the total load data, which helps to improve the accuracy of electrical device load recognition and also facilitates subsequent recognition of whether there are class features in the spectrum data; at the same time, by constructing a corresponding multi-layer attention autoencoder neural network for each type of electrical device, it is recognized whether the class features corresponding to each type of electrical device exist in the spectrum data, thus helping to more accurately and quickly determine the electrical devices existing in the total load data. Description of the Drawings
[0032] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments of the present application or related technologies. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related accompanying drawings can also be obtained based on these drawings.
[0033] Figure 1 It is a schematic flowchart of a method for identifying electrical equipment loads in an embodiment.
[0034] Figure 2 It is a schematic flowchart of a training method for a multi-layer attention autoencoder neural network in an embodiment.
[0035] Figure 3 It is another schematic flowchart of a method for identifying electrical equipment loads in an embodiment.
[0036] Figure 4 It is a schematic diagram of the principle of a possible neural network model structure in an embodiment.
[0037] Figure 5 It is a structural block diagram of an electrical equipment load identification device in an embodiment.
[0038] Figure 6 It is an internal structure diagram of a power equipment in an embodiment. Detailed implementation manners
[0039] In order to make the objectives, technical solutions and advantages of the present application clearer, the following further details the present application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. As used herein, the term "multiple" refers to two and / or more than two unless otherwise specified.
[0040] Non-Intrusive Load Monitoring (NILM) is a technology based on power data analysis. It infers the operating status and energy consumption of individual electrical appliances by measuring the total power consumption of a building or household. With the rapid development of smart grids and smart homes, non-intrusive load monitoring technology is playing an increasingly important role in energy management and energy conservation and emission reduction. By accurately monitoring the energy consumption of various household appliances, NILM technology can help users understand the usage patterns of electrical appliances, identify high-energy-consuming and inefficient devices, and thus take energy-saving measures, such as adjusting the device usage time or replacing high-energy-consuming electrical appliances. NILM can achieve intelligent monitoring and automated management of household appliances. For example, according to the operating status of different electrical appliances, the system can automatically adjust temperature control devices (such as air conditioners and heaters), or control the on / off status of household appliances through smart sockets, thereby optimizing power usage. NILM can provide detailed load data of users for power companies, helping to optimize grid dispatching, especially reducing power load through demand response mechanisms during peak hours to avoid grid overload. Traditional load monitoring methods require installing separate sensors on each device, which is costly and complex. NILM can significantly reduce hardware costs, simplify system deployment, and reduce maintenance difficulties by collecting the total power signal.
[0041] The NILM method does not require installing separate sensors on each electrical appliance. Instead, it relies only on the measurement of the total power consumption and analyzes the power signal with the help of intelligent algorithms to monitor and identify the energy consumption of various loads (such as air conditioners, refrigerators, washing machines, etc.). The key to NILM technology lies in how to "decompose" the working modes of different devices from the total power consumption signal and accurately identify the operating conditions of each load.
[0042] Non-intrusive load identification methods usually rely on technologies such as signal processing, machine learning, and deep learning, and mainly complete load identification through feature extraction and classification recognition of power consumption signals. The current mainstream methods include:
[0043] First, traditional methods based on feature engineering. Early NILM methods mainly focused on feature extraction of power signals and used these features to distinguish different electrical appliances. Common features include power fluctuations (such as instantaneous power, power factor, frequency spectrum, etc.), switching features of devices (such as sudden changes in current when starting up), etc. Although this method is relatively mature and has certain application value, it is sensitive to noise and interference in power signals, and the identification effect may be poor when multiple electrical appliances are working simultaneously.
[0044] Second, modern methods based on deep learning. With the maturity of deep learning technology, NILM methods based on deep learning have been widely used in recent years. Models such as deep neural networks (DNNs), convolutional neural networks (CNNs), and long short-term memory networks (LSTMs) have been widely applied to load identification. These methods have stronger feature learning capabilities and better classification performance compared to traditional methods.
[0045] Third, methods based on multi-sensor fusion. Some studies have also attempted to enhance the accuracy of non-intrusive load identification by combining multiple sensors (such as current sensors, voltage sensors, and smart meters). By fusing data from different sensors, the changing characteristics of electrical signals can be captured more comprehensively, improving the identification accuracy.
[0046] Although NILM technology has achieved certain results in practice, it still faces some challenges, and the accuracy of electrical appliance load identification remains to be improved. For example, there is a wide variety of modern household appliances with complex functions. Especially in a large-scale deployment environment, there may be a lot of noise in the electrical signals. How to remove the noise and extract effective features is a major difficulty for NILM technology.
[0047] Based on the above analysis, this application provides a method for identifying the load of electrical appliances. This method takes into account that each electrical appliance has its own load change pattern when it is working. This load change pattern can be regarded as the exclusive feature of each electrical appliance (hereinafter referred to as the generic feature). Therefore, the problem of identifying load data is transformed into the problem of extracting and modeling the generic features of each common electrical appliance + the problem of matching the generic features in the total load data, thereby alleviating the problems of noise in electrical signals and modeling the electrical characteristics of household devices, and thus achieving more accurate identification of the load of electrical appliances.
[0048] The method for identifying the load of electrical appliances provided by this application will be described in more detail below by way of embodiments.
[0049] In one embodiment, a method for identifying the load of electrical appliances is provided. This embodiment takes the application of this method to a power system as an example. The power system can be a system based on the electricity consumption of one or more households, or a system based on one or more regions, etc. At the same time, it can be understood that the execution subject of this method can also be other subjects, such as the server or device corresponding to the power system, or a device dedicated to identifying the load of electrical appliances, as long as it can achieve the identification of the load of electrical appliances. As Figure 1 shown, this method may include the following steps S102 to step S108:
[0050] Step S102, obtain the total load data corresponding to two or more electrical appliances.
[0051] Among them, the total load data can be data representing the overall power usage of two or more electrical devices. For example, for user A, the electrical devices that need to use power include electrical device B, electrical device C, and electrical device D. Thus, the corresponding total load data can be data reflecting the overall power usage of these three electrical devices B, C, and D, such as the total power.
[0052] Exemplarily, the total load data can be obtained based on a non-invasive method.
[0053] In some embodiments, the total load data can be load data over a period of time or real-time load data.
[0054] Step S104: Convert the total load data into frequency data; and based on the Mel spectrum, convert the frequency data into spectral data.
[0055] Exemplarily, the total load data can be time-sequential, and thus, based on the fast Fourier transform, the total load data can be converted to obtain frequency data.
[0056] Step S106: Input the spectral data into two or more pre-trained multi-layer attention autoencoder neural networks to identify whether there are generic features in the spectral data and obtain an identification result; each multi-layer attention autoencoder neural network corresponds one-to-one to the device category to which each electrical device belongs; the multi-layer attention autoencoder neural network is trained by extracting generic features corresponding to the device category from pre-labeled load identification training samples, and is used to identify whether there are generic features of the corresponding electrical device in the spectral data and output an identification result; the load identification training samples are based on the annotation of the presence or absence of electrical devices in the spectral data samples.
[0057] In some embodiments, the classification criteria for device categories can be flexibly adjusted according to actual needs. For example, it can be divided according to the power size, usage frequency, and time of electrical devices. Another example is that it can also be combined with different electricity-consuming entities. For example, for residential electricity consumption based on households, the device categories can be divided.
[0058] Exemplarily, since electrical devices can have different categories, such as air conditioners, refrigerators, induction cookers, etc., and different categories of electrical devices have different power usage situations. As described above, different categories of electrical devices have their own generic features. Thus, for each category of electrical device, a corresponding multi-layer attention autoencoder neural network can be constructed to identify whether the generic features of this category of electrical device exist in the spectral data.
[0059] In some embodiments, the pre-labeled load identification training samples can be used to train the multi-layer attention autoencoder neural network to extract generic features.
[0060] Step S108: Determine the electrical appliances existing in the total load data according to the recognition results corresponding to each multi-layer attention autoencoder neural network.
[0061] Exemplarily, as described above, since one multi-layer attention autoencoder neural network corresponds to one device category, multiple recognition results can be obtained. The multiple recognition results can be combined to determine the electrical appliances existing in the total load data.
[0062] In the above electrical appliance load recognition method, since the total load data is converted into frequency data, and the spectral data is obtained by using the Mel spectrum, and based on the analysis of the spectral data to determine the electrical appliances existing in the total load data, it avoids the interference existing when directly recognizing the total load data, which helps to improve the accuracy of electrical appliance load recognition and is also convenient for subsequently identifying whether there are generic features in the spectral data. At the same time, by constructing a corresponding multi-layer attention autoencoder neural network for each type of electrical appliance, it is recognized whether the generic features corresponding to each type of electrical appliance exist in the spectral data, which helps to more accurately and quickly determine the electrical appliances existing in the total load data.
[0063] In one embodiment, the electrical appliance load recognition method in the foregoing embodiment may further include: determining the reconstructed data based on the pre-constructed decoding network corresponding to the multi-layer attention autoencoder neural network; and determining the effectiveness of the generic features according to the reconstructed data. The "inputting the spectral data into the trained multi-layer attention autoencoder neural network" in the foregoing embodiment may include: inputting the spectral data into the trained multi-layer attention autoencoder neural network when it is determined that the generic features are effective.
[0064] In some embodiments, for the generic features, a corresponding decoding network can be designed for each multi-layer attention autoencoder neural network. The decoding network can use multiple attention layers to calculate the reconstructed data and make the reconstructed data as consistent with the input data as possible. Exemplarily, the input data can be the pre-labeled load recognition training samples input.
[0065] In some embodiments, the effectiveness of the generic features can be determined according to whether the reconstructed data is consistent with the input data. For example, if the reconstructed data is consistent with the input data, the generic features can be considered effective, otherwise ineffective.
[0066] The reconstructed data is obtained through the pre-constructed decoding network corresponding to the multi-layer attention autoencoder neural network, and the effectiveness of the generic features is ensured according to the reconstructed data, so as to guarantee the accuracy of subsequently using the trained multi-layer attention autoencoder neural network to recognize whether there are generic features in the spectral data.
[0067] In one of the embodiments, the total load data in the foregoing embodiment is one-dimensional total load data based on time series; the "converting the total load data into frequency data" in the foregoing embodiment may include: converting the one-dimensional total load data into two-dimensional frequency data based on the fast Fourier transform.
[0068] Among them, the fast Fourier transform (FFT) is an efficient algorithm for the discrete Fourier transform (DFT).
[0069] Exemplarily, the total load data may be one-dimensional total load data based on time series, that is, the data may change with time. Therefore, the FFT can be used to process the total load data to achieve the conversion of data from the time domain to the frequency domain.
[0070] Since the total load data is one-dimensional total load data based on time series, the fast Fourier transform can be used to obtain two-dimensional frequency data. This can avoid the interference with accuracy in directly identifying the total load data, and identifying the electrical equipment load based on the frequency data helps to improve the accuracy of identification.
[0071] In one of the embodiments, the electrical equipment load identification method in the foregoing embodiment may further include: determining the number of electrical equipment actually installed on the user side corresponding to each equipment category; the "determining the electrical equipment existing in the total load data" in the foregoing embodiment may include: when the number of electrical equipment is 1, determining whether the corresponding electrical equipment exists in the total load data.
[0072] In some embodiments, since the generic feature is for the equipment category of the electrical equipment, a multi-layer attention autoencoder neural network can identify whether the generic feature corresponding to an equipment category exists in the spectrum data, so as to determine whether the electrical equipment corresponding to an equipment category exists in the total load data.
[0073] Among them, the user side can be compared with the power energy supply side. It can be the side of the entity with power usage requirements, such as household electricity. Correspondingly, the number of electrical equipment actually installed on the user side can be based on the total load data.
[0074] In some embodiments, for the same device category, the number of electrical devices actually installed on the user side can be greater than or equal to the number of electrical devices present in the total load data. In other words, the electrical devices actually installed on the user side can consume electrical energy either in whole or in part. For example, for a household electricity user, the device category is air conditioners, and the number of actually installed air conditioners is three, but only one air conditioner is in the power - consuming state. The number of electrical devices in the air conditioner category corresponding to the total load data of this household is 1.
[0075] Exemplarily, the number of electrical devices corresponding to a device category can be multiple or one. Thus, if it is determined that the number of electrical devices actually installed on the user side corresponding to one or more device categories is 1, then if a corresponding generic feature is identified in the spectrum data, it indicates that the corresponding device category exists in the total load data. Since the number of corresponding electrical devices is 1, when the device category exists, the existence of the corresponding electrical device can be directly determined; conversely, the non - existence of the corresponding electrical device can be directly determined.
[0076] By determining the number of electrical devices actually installed on the user side corresponding to each device category and determining whether the corresponding electrical device exists in the total load data when the number of electrical devices is 1, this can achieve the identification of the load of a specific electrical device and further improve the accuracy of electrical device load identification.
[0077] In the above - mentioned multiple embodiments, it is mentioned that a multi - layer attention auto - encoder neural network is used to determine whether there is a generic feature in the spectrum data, so as to achieve electrical device load identification. Next, the corresponding training method of the multi - layer attention auto - encoder neural network will be explained.
[0078] In one embodiment, a training method of a multi - layer attention auto - encoder neural network is provided. The multi - layer attention auto - encoder neural network corresponds to the device category to which the electrical device belongs; as Figure 2 shown, this method includes steps S201 to S203:
[0079] Step S201, convert the total load data samples corresponding to two or more electrical devices into frequency data samples; and based on the Mel spectrum, convert the frequency data samples into spectrum data samples.
[0080] Step S202, obtain load - identification training samples based on the annotation of the existence or non - existence of electrical devices in the spectrum data samples.
[0081] Step S203, train the multi - layer attention auto - encoder neural network based on the load - identification training samples to extract generic features corresponding to the device category, and obtain a trained multi - layer attention auto - encoder neural network.
[0082] In one embodiment, "identifying training samples based on the load, training a multi-layer attention autoencoder neural network to extract generic features corresponding to the device category" in the foregoing embodiment may include: determining the cosine similarity between feature vectors in the load identification training samples; determining attention coefficients based on the cosine similarity and the normalization exponential function; and extracting generic features corresponding to the device category based on the attention coefficients.
[0083] By using the cosine similarity and the normalization exponential function, attention coefficients are determined; the multi-layer attention autoencoder neural network extracts generic features through the attention coefficients. This helps to obtain more accurate generic features.
[0084] Since there are a wide variety of electrical devices, the load changes of each device from startup to stable operation are different and the load has a certain regularity during stable operation. How to find and model this regularity is the core issue for improving the effectiveness of NILM. Based on this, in one embodiment, a method for identifying the load of electrical devices is provided. From the perspective of machine learning, an autoencoder structure is constructed for each type of device to extract the generic features of each electrical device, and then it is detected whether the generic features of the device exist in the user load data, thereby solving the NILM problem. Specifically, the method first converts the load data from the time domain to the frequency domain to construct a two-dimensional spectrogram of the load data; then constructs a multi-layer attention neural autoencoder network for each type of device. This network uses the autoencoder structure to extract the load change features of the current device, and then designs a classifier based on this feature to detect whether the device exists in the spectrogram; finally, combines the detection results corresponding to each device to obtain the result of device detection. As Figure 3 shown, the method may include the following steps:
[0085] Step S302: Construct a two-dimensional load spectrogram.
[0086] Since the load data is the superposition of the operation results of multiple devices, the load of each device not only has its own regularity, but at the same time, the loads of different devices also have differences in magnitude. For example, there are significant differences in the load sizes between a table lamp and a hair dryer. And this difference in magnitude may cause one type of device to be masked numerically when the two types of devices are operating together. The change of the device load is not only reflected in the numerical quantity, but also in the change frequency and change amplitude. Therefore, in this application, the one-dimensional time-series load data (corresponding to the foregoing total load data) is two-dimensionally expanded. First, for the time-series load data, the fast Fourier transform is used to convert it into frequency data:
[0087] Feature = FFT(load_t),
[0088] Among them, FFT represents the Fast Fourier Transform, load_t represents the load data of the time series, and Feature represents the extracted two-dimensional frequency features. On this basis, in order to construct two-dimensional spectrum data with reasonable numerical amplitude (corresponding to the aforementioned spectrum data), the present application converts the frequency domain information into a mel spectrum:
[0089] F_mel = MEL(Feature),
[0090] where F_mel represents the obtained two-dimensional mel spectrum, and MEL represents the mel spectrum mapping function taking the logarithm. Thus, the frequency domain features corresponding to the load data are constructed.
[0091] In some embodiments, simply from the perspective of time series data, when multiple electrical devices work together, the load data of the time series generated is the superposition of the load data of multiple devices, and it is very difficult to separate this superposition on the time series signal. To solve this problem, a two-dimensional mapping of the signal is performed. The two-dimensional data includes the time domain and the frequency domain. The frequencies of load changes are different when different devices are running, so there will be a large difference in the frequency domain. By mapping the signal into a two-dimensional form, the superimposed signal is separated from both the frequency domain and the time domain perspectives, and the effect of identifying the electrical device load is better accordingly.
[0092] Step S304: Construct a neural network.
[0093] For the obtained two-dimensional spectrum data, the present application constructs a generic multi-layer attention neural autoencoder network for each device category to be identified to extract the generic features of the device and perform detection and identification. For a given device, there are only two possibilities in the current load data. One is that the current load includes the device running, and the other is that the current load data does not include the device running. Therefore, device identification based on generic features is a binary classification problem for each device. Based on this, the present application constructs a generic multi-layer attention neural autoencoder network (corresponding to the aforementioned multi-layer attention autoencoder neural network). For device i, the present application constructs the corresponding generic multi-layer attention autoencoder neural network Matt_i. Matt_i includes three components: a cosine similarity function, an attention coefficient, and multi-layer attention features, which are specifically described as follows:
[0094] First is the cosine similarity function, which uses the cosine function to determine the similarity between two node features. Specifically, the cosine similarity quantifies the similarity between two input vectors by analyzing the cosine value of the angle between them.
[0095]
[0096] Among them, the subscript i represents the i-th component, and a and b are two vectors. To express the different impacts caused by the similarity between different entities and adjust the similarity impact of a specific task, this application defines the cosine similarity.
[0097] Similarity ij∈adj_1 = Sigmoid(W × cosine(HF i , HF j ))
[0098] Among them, W and H are learnable weights, and F i is the i-th word vector, and F j is the j-th feature vector. adj_1 is the scale of attention. Based on the defined cosine similarity function, we define the attention coefficient:
[0099]
[0100] Among them, α ij is the attention coefficient between word vectors i and j; exp is the natural exponential function, that is, the exponential function with the real number e (e≈2.71828) as the base;
[0101] According to the attention coefficient, the attention feature h i of the current node i can be expressed as:
[0102] h i = sigmoid(∑ j α ij∈adj_1 PF j )
[0103] Among them, F is the feature, and P is a parameter matrix used for feature mapping, which is trained together with the BP algorithm (backpropagation algorithm). Combining h i results in the generic feature extracted by Matt_i.
[0104] On this basis, to ensure the effectiveness of the extracted features, this application designs a generic decoding network for the multi-layer attention neural autoencoder based on this feature. The network uses multiple attention layers to calculate the reconstructed data and makes the reconstructed data as consistent with the input data as possible. Finally, the generic feature is combined with a fully connected layer to achieve binary classification for detecting whether the device exists.
[0105] Step S306: Train the neural network; complete the recognition with the combined result.
[0106] To implement training, a complete data set (corresponding to the pre-annotated load recognition training samples described above) is required. This data set includes time-series load data (corresponding to the total load data samples described above) and the device labels corresponding to the load data at each time slice.
[0107] In some embodiments, the time-series load data in the above data set can be processed, such as being converted into frequency data samples, and based on the Mel spectrum, the frequency data samples are converted into spectral data samples.
[0108] In some embodiments, the data set can be split into two parts: a training data set and a test data set. Exemplarily, the neural network model can be trained based on the training data set, and the training effect can be detected based on the test data set.
[0109] In some embodiments, the number of devices to be detected in the current load data, denoted as K, can be determined first. Then, the load data is converted into a two-dimensional spectrum, and the training data set is processed to construct K subsets. Each subset is the training data set corresponding to a device, and this subset is binary-class labeled, indicating the presence or absence of the device. Next, K generic multi-layer attention autoencoder neural networks are constructed, and each network is used to train and extract the generic features of the corresponding device and implement the detection of the device. Finally, the detection results of the K networks are combined to achieve the recognition of the K devices. When training each network, the cross-entropy loss function and the reconstruction loss function are used to construct the loss:
[0110] Loss_i = CorssEntropy(Output_i, Label_i) + MSE(Input_i, Reconstruction_i),
[0111] where CorssEntropy represents the cross-entropy, Output_i represents the output of the generic multi-layer attention neural network of device i, Label_i represents the label indicating the presence or absence of the device. MSE represents the mean squared error loss function, Input_i represents the input data of the network, and Reconstruction_i represents the reconstructed data of the generic multi-layer attention autoencoder. As Figure 4 shown, a schematic diagram of the principle of a possible neural network model structure is provided.
[0112] The above-mentioned electrical equipment load identification method will identify equipment by constructing the generic characteristics of each device to be detected and performing equipment identification based on such characteristics, transforming the equipment identification problem in the load data containing multiple devices into the encoding extraction problem of the generic characteristics of each common electrical appliance and the existence detection problem of the generic characteristics of the device in the superimposed total load data; the load data is transformed from the time domain to the frequency domain to construct a two-dimensional spectrogram of the load data; then, a multi-layer attention autoencoder neural network is constructed for each device to encode the data features, and then it is detected whether the device exists in the spectrogram according to the encoded features; finally, the detection results of each device are combined to obtain the device detection result, thereby alleviating the noise problem in the power signal and the modeling problem of the electrical characteristics of household devices, and thus improving the accuracy of electrical equipment load identification.
[0113] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0114] Based on the same inventive concept, the embodiments of the present application also provide an electrical equipment load identification device for implementing the above-mentioned electrical equipment load identification method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the electrical equipment load identification device provided below can refer to the limitations on the electrical equipment load identification method in the above text, and will not be repeated here.
[0115] In one embodiment, as Figure 5 shown, an electrical equipment load identification device 500 is provided, including:
[0116] A data processing module 501, configured to obtain total load data corresponding to two or more electrical equipment; convert the total load data into frequency data; and convert the frequency data into spectral data based on the Mel spectrogram;
[0117] The first recognition module 502 is configured to input spectrum data into two or more pre-trained multi-layer attention autoencoder neural networks; each multi-layer attention autoencoder neural network corresponds to a device category to which each electrical device belongs; the multi-layer attention autoencoder neural network is trained based on pre-labeled load recognition training samples and is used to recognize whether there are generic features of the corresponding electrical device in the spectrum data and output a recognition result; the load recognition training samples are based on the labeling of the presence or absence of electrical devices in the spectrum data samples.
[0118] The second recognition module 503 is configured to determine the electrical devices existing in the total load data according to the recognition results corresponding to the multi-layer attention autoencoder neural networks.
[0119] In one embodiment, the first recognition module 502 is further configured to determine reconstructed data based on a decoding network corresponding to the multi-layer attention autoencoder neural network constructed in advance; and determine the effectiveness of the generic features according to the reconstructed data; inputting the spectrum data into the trained multi-layer attention autoencoder neural network includes: inputting the spectrum data into the trained multi-layer attention autoencoder neural network when it is determined that the generic features are effective.
[0120] In one embodiment, the data processing module 501 is further configured to the total load data is one-dimensional total load data based on time series; convert the total load data into frequency data, including: converting the one-dimensional total load data into two-dimensional frequency data based on fast Fourier transform.
[0121] In one embodiment, the second recognition module 503 is further configured to determine the number of electrical devices actually installed on the user side corresponding to each device category; determining the electrical devices existing in the total load data includes: when the number of electrical devices is 1, determining whether the corresponding electrical device exists in the total load data.
[0122] Each module in the above electrical device load recognition device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in or independent of the processor in the power device in the form of hardware, or stored in the memory of the power device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0123] In an exemplary embodiment, a power device is provided. The power device can be a server, and its internal structure diagram can be as Figure 6As shown. The power device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the power device is used to provide computing and control capabilities. The memory of the power device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the power device is used to store the data required to execute the electrical device load identification method, for example, total load data. The input / output interface of the power device is used to exchange information between the processor and external devices. The communication interface of the power device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an electrical device load identification method.
[0124] Those skilled in the art can understand that Figure 6 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the power device to which the solution of this application is applied. The specific power device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0125] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the steps in the above method embodiments are implemented.
[0126] In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0127] In an embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0128] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0129] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.
[0130] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for identifying load of electrical equipment, characterized in that: The method comprises: Obtain the total load data corresponding to two or more electrical devices; Converting the total load data into frequency data; and converting the frequency data into spectrum data based on the Mel spectrum; Input the spectrum data into two or more pre-trained multi-layer attention autoencoder neural networks; each of the multi-layer attention autoencoder neural networks corresponds to the device category to which each of the electrical devices belongs; the multi-layer attention autoencoder neural networks are trained based on pre-labeled load recognition training samples, and are used to identify whether there are category features of corresponding electrical devices in the spectrum data, and output recognition results; the load recognition training samples are based on the labeling of the presence or absence of electrical devices in the spectrum data samples; The electrical equipment present in the total load data is determined based on the recognition results corresponding to each of the multi-layer attention autoencoder neural networks.
2. The method according to claim 1, characterized in that The method further comprises: Determining reconstructed data based on a pre-constructed decoding network corresponding to the multi-layer attention autoencoder neural network; and determining the validity of the generic feature based on the reconstructed data; The step of inputting the spectral data into the trained multi-layer attention autoencoder neural network includes: when it is determined that the category feature is valid, inputting the spectral data into the trained multi-layer attention autoencoder neural network.
3. The method according to claim 1, characterized in that The total load data is one-dimensional total load data based on time series; The converting the total load data into frequency data comprises: Based on fast Fourier transform, the one-dimensional total load data is converted into two-dimensional frequency data.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Determine the number of electrical devices actually installed on the user side corresponding to each of the equipment categories; The step of determining the electrical equipment present in the total load data comprises: When the number of the electrical devices is 1, it is determined from the total load data whether the corresponding electrical device exists.
5. A method for training a multi-layer attention autoencoder neural network, characterized in that: The multi-layer attention autoencoder neural network corresponds to the device category to which the electrical device belongs; the method comprises: Converting total load data samples corresponding to two or more electrical devices into frequency data samples; and converting the frequency data samples into spectrum data samples based on the Mel spectrum; Obtaining a load identification training sample based on marking the presence or absence of electrical equipment in the spectrum data sample; Based on the load identification training samples, the multi-layer attention autoencoder neural network is trained to extract the category features corresponding to the device category to obtain the trained multi-layer attention autoencoder neural network.
6. The method according to claim 5, characterized in that The step of training the multi-layer attention autoencoder neural network based on the load identification training sample to extract the generic features corresponding to the device category includes: Determining the cosine similarity between the feature vectors in the load identification training sample; Determining an attention coefficient based on the cosine similarity and the normalized exponential function; Based on the attention coefficient, a generic feature corresponding to the device category is extracted.
7. An electrical equipment load identification device, characterized in that: The device comprises: A data processing module, used for obtaining total load data corresponding to two or more electrical devices; converting the total load data into frequency data; and converting the frequency data into spectrum data based on Mel spectrum; The first recognition module is used to input the spectrum data into two or more pre-trained multi-layer attention autoencoder neural networks; each of the multi-layer attention autoencoder neural networks corresponds to the device category to which each of the electrical devices belongs; the multi-layer attention autoencoder neural network is trained based on pre-labeled load recognition training samples, and is used to identify whether there are category features of corresponding electrical devices in the spectrum data, and output recognition results; the load recognition training samples are based on the labeling of the presence or absence of electrical devices in the spectrum data samples; The second recognition module is used to determine the electrical equipment present in the total load data according to the recognition results corresponding to each of the multi-layer attention autoencoder neural networks.
8. An electric power device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.