Malicious load identification method, malicious load identification device and computer storage medium
By extracting the electrical characteristics of electrical appliances and combining load recognition models and clustering technology, the problem of misidentification of electric vehicles' charging behavior in the room is solved, and a malignant load recognition method with high recognition rate and low error recognition rate is realized.
Patent Information
- Application Number
- CN202411212895.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-30
AI Technical Summary
The prior art is difficult to effectively identify the charging behavior of electric vehicles entering the room, especially when the electrical characteristics of electrical appliances are similar, resulting in a high misidentification rate.
Electrical features are extracted by electrical appliance-based voltage and current data, and load recognition models are input to obtain load types. Combined with clustering technology and deep neural networks, the identification of malignant loads is achieved.
It improves the recognition accuracy of malignant loads, reduces the false recognition rate, and can effectively identify electrical appliances that are not trained or lack sample data.
Smart Images

Figure CN118708947B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electrical load identification, and in particular to a malicious load identification method, a malicious load identification device, and a computer storage medium. Background Art
[0002] At present, fire incidents caused by illegal use of heating appliances and charging of electric vehicles indoors continue to occur. These illegal behaviors pose a threat to the safety of electricity use in colleges, industrial parks, and old residential areas. Studies have shown that for the illegal use of heating appliances, load identification technology solutions can have a good effect, because the power consumption characteristics of resistive devices are obvious enough.
[0003] For the behavior of electric vehicles charging indoors, the load identification technology solution currently does not have a good recognition effect. This is because most electric vehicles and some other devices have a high degree of similarity in power usage (such as: mobile phones that support high-power fast charging, some brands of electric fans, etc.), so these appliances are very easy to be misidentified.
[0004] In this regard, the current mainstream solution is still at the stage of using visual recognition to identify electric vehicles entering the room (for example, the camera in the elevator has an electric vehicle recognition function); but with the popularization of electric vehicles with removable batteries, the efficiency of the visual method will be greatly reduced. Summary of the invention
[0005] In order to solve the above technical problems, the present application proposes a malicious load identification method, a malicious load identification device and a computer storage medium.
[0006] In order to solve the above technical problems, the present application proposes a method for identifying a malicious load, which includes:
[0007] Extracting electrical characteristics of the electrical appliance based on voltage and current data of the electrical appliance;
[0008] Inputting the electrical characteristics into a load identification model to obtain a first load type identified by the load identification model;
[0009] In response to the first load type being a preset malignant load, clustering the electrical features and the preprocessed clustering feature sample set;
[0010] According to the clustering result, obtaining a second load type of the electrical appliance;
[0011] In response to the second load type being a preset vicious load, outputting a load type indicating that the electrical appliance is a vicious load.
[0012] Wherein, the electrical characteristics include one or more of active power, reactive power, apparent power, and distortion power;
[0013] After extracting the electrical characteristics of the electrical appliance, the malicious load identification method further includes:
[0014] The electrical features are subjected to dimensionality reduction.
[0015] Wherein, the preprocessed cluster feature sample set includes a number of centroids obtained by clustering the training set;
[0016] The step of clustering the electrical features and the preprocessed cluster feature sample set comprises:
[0017] Obtaining the distance between the electrical feature and each centroid to obtain a minimum distance value;
[0018] The step of obtaining the second load type of the electrical appliance according to the clustering result includes:
[0019] In response to the minimum distance being less than or equal to a cluster identification threshold, taking the load type of the centroid corresponding to the minimum distance as the clustering result;
[0020] In response to the minimum distance being greater than the cluster identification threshold, the clustering result is output as other load types.
[0021] The malicious load identification method further includes:
[0022] Obtaining a training set, and determining the number of centroids according to the number of sample types in the training set;
[0023] Selecting a feature vector from each sample type in the training set as an initial centroid, and clustering all sample feature vectors;
[0024] The position of the initial centroid is updated by iteratively calculating the mean of each cluster and re-clustering until the position of the centroid does not change, thereby obtaining a number of centroids obtained by clustering the training set.
[0025] Wherein, the preprocessed cluster feature sample set includes a nearest neighbor classifier trained on a training set;
[0026] The step of clustering the electrical features and the preprocessed cluster feature sample set comprises:
[0027] Inputting the electrical characteristics into the nearest neighbor classifier to obtain the weight of each load type;
[0028] The step of obtaining the second load type of the electrical appliance according to the clustering result includes:
[0029] In response to the maximum weight value being greater than or equal to the nearest neighbor threshold, taking the load type corresponding to the maximum weight value as the clustering result;
[0030] In response to the maximum weight being less than the neighbor threshold, the clustering result is output as other load types.
[0031] The malicious load identification method further includes:
[0032] Obtaining a training set, and obtaining feature matrices and power feature vectors of several electrical appliances to be trained from the training set;
[0033] Superimposing the characteristic matrix and power characteristic vector of each electrical appliance to be trained to obtain a filling matrix of each electrical appliance to be trained;
[0034] Determine the number of nearest neighbors according to the number of sample features in the training set;
[0035] A nearest neighbor classifier is trained according to the number of nearest neighbors and the filling matrices of the electrical appliances to be trained.
[0036] The pre-processed cluster feature sample set includes a number of centroids obtained by clustering the training set and a nearest neighbor classifier obtained by training the training set; the clustering result includes a first clustering result and a second clustering result;
[0037] The step of clustering the electrical features and the preprocessed cluster feature sample set comprises:
[0038] Obtaining the distance between the electrical feature and each centroid to obtain a minimum distance value;
[0039] Inputting the electrical characteristics into the nearest neighbor classifier to obtain the weight of each load type;
[0040] The step of obtaining the second load type of the electrical appliance according to the clustering result includes:
[0041] In response to the minimum distance being less than or equal to a cluster identification threshold, taking the load type of the centroid corresponding to the minimum distance as a first clustering result;
[0042] In response to the minimum distance being greater than the cluster identification threshold, outputting the first clustering result as other load types;
[0043] In response to the maximum weight value being greater than or equal to the nearest neighbor threshold, taking the load type corresponding to the maximum weight value as the second clustering result;
[0044] In response to the maximum weight value being less than the neighbor threshold, outputting the second clustering result as other load types;
[0045] In response to the second load type being a preset malicious load, outputting the load type of the electrical appliance as a malicious load includes:
[0046] In response to the first clustering result and / or the second clustering result being both preset malicious loads, outputting a load type indicating that the electrical appliance is a malicious load.
[0047] Wherein, the malignant load includes several malignant load types;
[0048] After the response to the second load type being a preset malicious load and outputting the load type of the electrical appliance as a malicious load, the malicious load identification method further includes:
[0049] In response to the first load type being a first malignant load type, the first clustering result being a second malignant load type, the second clustering result being a third malignant load type, and at least two of the first malignant load type, the second malignant load type, and the third malignant load type being different, respectively acquiring a first confidence of the first load type, a second confidence of the first clustering result, and a third confidence of the second clustering result;
[0050] The malicious load type corresponding to the maximum value among the first confidence level, the second confidence level, and the third confidence level is output as the final load type.
[0051] In order to solve the above technical problems, the present application also proposes a malicious load identification device, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the malicious load identification method as described above.
[0052] In order to solve the above technical problems, the present application also proposes a computer storage medium, which is used to store program data. When the program data is executed by a computer, it is used to implement the above malicious load identification method.
[0053] Compared with the prior art, the beneficial effects of the present application are as follows: the malicious load identification device extracts the electrical characteristics of the electrical appliance based on the voltage and current data of the electrical appliance; the electrical characteristics are input into the load identification model to obtain the first load type identified by the load identification model; in response to the first load type being a preset malicious load, the electrical characteristics and the preprocessed clustering feature sample set are clustered; according to the clustering result, the second load type of the electrical appliance is obtained; in response to the second load type being a preset malicious load, the load type of the electrical appliance as a malicious load is output. Through the above-mentioned malicious load identification method, a high recognition rate and a low false recognition rate are achieved by combining a deep neural network with a traditional machine learning combination scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0055] Figure 1 This is a schematic diagram of the application scenario of monitoring the charging of illegal electrical appliances in the room provided by this application;
[0056] Figure 2 It is a flowchart of the first embodiment of the method for identifying malicious loads provided by the present application;
[0057] Figure 3 It is a schematic diagram of the overall technical solution flow of the malicious load identification method provided by the present application;
[0058] Figure 4 is a flowchart of a second embodiment of a method for identifying malicious loads provided by the present application;
[0059] Figure 5 is a flowchart of a third embodiment of a method for identifying malicious loads provided by the present application;
[0060] Figure 6 is a flowchart of a fourth embodiment of a method for identifying malicious loads provided by the present application;
[0061] Figure 7 It is a structural schematic diagram of an embodiment of a malicious load identification device provided by the present application;
[0062] Figure 8 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION
[0063] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0064] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0065] The problem to be solved by this application is Figure 1 The application scenario shown in the figure below monitors the charging of illegal electrical appliances indoors. While ensuring a high recognition rate, it reduces the misrecognition rate for electrical appliances that have not been trained or lack sample data. This is achieved by combining a deep neural network with two machine learning solutions to provide a dual guarantee for solving the misrecognition problem.
[0066] Please refer to Figure 2 and Figure 3 , Figure 2 is a flowchart of the first embodiment of the method for identifying malicious loads provided by the present application, Figure 3 It is a schematic diagram of the overall technical solution flow of the malicious load identification method provided in this application.
[0067] The malicious load identification method of the present application is applied to a malicious load identification device, wherein the malicious load identification device of the present application can be a server, a terminal device, or a system composed of a server and a terminal device. Accordingly, the various parts of the malicious load identification device, such as various units, sub-units, modules, and sub-modules, can all be set in the server, can all be set in the terminal device, or can be set in the server and the terminal device respectively.
[0068] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here.
[0069] like Figure 2 As shown, the specific steps are as follows:
[0070] Step S11: extracting electrical characteristics of the electrical appliance based on the voltage and current data of the electrical appliance.
[0071] In the embodiment of the present application, the malicious load identification device collects current information and voltage information of at least one cycle of the electrical appliance to be identified, such as Figure 3 Voltage and current data for one cycle are shown.
[0072] Specifically, one cycle in the present application is 128 points. The malicious load identification device uses the voltage and current data of the electrical appliance to construct a characteristic matrix X, where the dimension of the characteristic matrix X is 3*128. Then, the malicious load identification device calculates the active power by performing a fast Fourier transform on the characteristic matrix X. , reactive power , Apparent Power and distortion power .
[0073] In the training phase, the malicious load identification device processes the sample data of all loads through the above steps to obtain all characteristic data. At this point, all electrical characteristics have been prepared.
[0074] Step S12: Input the electrical characteristics into the load identification model to obtain the first load type identified by the load identification model.
[0075] In an embodiment of the present application, the malicious load identification device inputs the electrical characteristics of the electrical appliance into a pre-trained load identification model, thereby obtaining the load type of the electrical appliance output by the load identification model.
[0076] Before inputting the electrical features into the pre-trained load identification model, the malicious load identification device can also perform dimensionality reduction processing on the electrical appliance feature matrix X, which can reduce the complexity of calculation and remove noise and abnormal data. The malicious load identification device can reduce the dimensionality of the 3*128 feature matrix X to a 3*3 feature matrix through PCA (Principal components analysis). .
[0077] Similarly, the training process of the load identification model is as follows:
[0078] The malicious load identification device uses the characteristic matrix X obtained by running various loads to perform dimensionality reduction processing to obtain a 3*3 characteristic matrix Afterwards, deep learning neural network training is performed to obtain the load identification model required for step S12.
[0079] This application utilizes voltage, active current and reactive current characteristics combined with deep learning for load identification, which can make good use of the advantages of deep learning's high prediction accuracy, low model complexity and low maintenance cost.
[0080] From this we can see that Figure 3 The first stage of recognition shown in can maintain a high recognition accuracy for trained loads, but its drawback is that misrecognition may occur once an untrained load is connected.
[0081] Step S13: In response to the first load type being a preset malicious load, clustering the electrical features and the preprocessed cluster feature sample set.
[0082] In the embodiment of the present application, the malicious load identification device, in the first stage, that is, when the result of the deep learning scheme identifying that the electrical appliance is a malicious load, continues to Figure 3 Subsequent machine learning schemes, such as the clustering schemes in the second and / or third stages, perform clustering identification on the electrical features of the appliance, and the clustering identification results can be used as verification information for the identification results in the first stage.
[0083] Step S14: according to the clustering result, the second load type of the electrical appliance is obtained.
[0084] In an embodiment of the present application, the malicious load identification device obtains the clustering result of the machine learning scheme in step S13, and uses the load type of the cluster to which the electrical characteristics in the clustering result belong as the identification result of the electrical appliance in the machine learning scheme, that is, the second load type of the electrical appliance.
[0085] Step S15: In response to the second load type being a preset vicious load, outputting the load type of the electrical appliance as a vicious load.
[0086] In an embodiment of the present application, when the malicious load identification device identifies the electrical appliance as a malicious load through a machine learning scheme, it indicates that the identification result of the deep learning scheme in the first stage is accurate. At this time, the load type of the electrical appliance can be output as a malicious load.
[0087] When the malicious load identification device identifies through a machine learning scheme that the appliance is of other load types, that is, an appliance load type that has not been trained or lacks sample data, it means that the identification result of the deep learning scheme in the first stage is inaccurate. At this time, the misidentification information is output to the user to guide the user to train and learn the load type of the appliance.
[0088] In the present application, a malicious load identification device extracts electrical characteristics of the electrical appliance based on the voltage and current data of the electrical appliance; inputs the electrical characteristics into a load identification model to obtain a first load type identified by the load identification model; in response to the first load type being a preset malicious load, clusters the electrical characteristics and a preprocessed clustering feature sample set; obtains a second load type of the electrical appliance based on the clustering result; in response to the second load type being a preset malicious load, outputs the load type of the electrical appliance as a malicious load. Through the above-mentioned malicious load identification method, a deep neural network combined with a traditional machine learning combination scheme is used to achieve a high recognition rate and a low false recognition rate.
[0089] Please continue reading Figure 3 , Figure 3 The second stage of the machine learning scheme uses the K-means (K-means clustering algorithm) clustering algorithm to achieve clustering recognition of electrical characteristics of electrical appliances. To achieve clustering recognition of electrical characteristics, the malicious load identification device needs to perform clustering training on the training set to obtain several pre-processed centroids.
[0090] Please refer to Figure 4 , Figure 4 It is a flowchart of the second embodiment of the malicious load identification method provided by the present application.
[0091] like Figure 4 As shown, the specific steps are as follows:
[0092] Step S21: extracting electrical characteristics of the electrical appliance based on the voltage and current data of the electrical appliance.
[0093] Step S22: input the electrical characteristics into the load identification model to obtain the first load type identified by the load identification model.
[0094] In the embodiment of the present application, step S21 and step S22 are Figure 2 Step S11 and step S12 in the illustrated embodiment are the same and will not be described in detail herein.
[0095] Step S23: In response to the first load type being a preset vicious load, obtaining a distance between the electrical characteristic and each centroid to obtain a minimum distance value.
[0096] In the embodiment of the present application, the malicious load identification device uses the [ , , , ]Eigenvector , K-Means clustering algorithm is used for load identification.
[0097] Specifically, the malicious load identification device calculates the input feature vector Euclidean distance from each centroid , and get the minimum distance . At the same time, set the cluster identification threshold ,when Greater than It is considered as other load types when Less than or equal to When it is identified as a load type that can be identified in the capability set, the load type enumeration is output.
[0098] The above approach can greatly reduce the probability of misidentification of untrained or small-sample load types.
[0099] The training process of several centroids used in the above process is as follows:
[0100] The malicious load identification device first determines the number of cluster categories as , which is the number of centroids. It is determined according to the current sample category. If the same category has large differences, it can also be split into different categories. The malicious load identification device randomly selects a set of feature vectors in each category of samples as the initial centroid of clustering. The malicious load identification device calculates the mean value of each cluster data point to obtain a new centroid position, and iterates continuously until the centroid position no longer changes, then outputs the centroid.
[0101] Step S24: In response to the minimum distance being less than or equal to the cluster identification threshold, the load type of the centroid corresponding to the minimum distance is taken as the clustering result.
[0102] In the embodiment of the present application, the malicious load identification device is Less than or equal to When the load type of the electrical appliance is determined, the specific load type of the electrical appliance can be obtained. Finally, the specific load type of the electrical appliance is compared with the preset malicious load type. If the load type of the electrical appliance is any malicious load type, the machine learning scheme identification result of the electrical appliance as a malicious auxiliary is output.
[0103] Step S25: In response to the minimum distance being greater than the cluster identification threshold, the clustering result is output as other load types.
[0104] In the embodiment of the present application, the malicious load identification device is Greater than When the load type of the output appliance is other load types, that is, according to the current training set data, there is no training or lack of sample data, and the accurate load type cannot be identified. Therefore, the first stage of the deep learning solution may have false positives.
[0105] Please continue reading Figure 3 , Figure 3 The third stage of the machine learning scheme uses the KNN (K-NearestNeighbor, K nearest neighbor classification) algorithm to achieve cluster recognition of electrical characteristics of electrical appliances. Among them, to achieve cluster recognition of electrical characteristics, the malicious load identification device needs to be trained on the training set to obtain a nearest neighbor classifier.
[0106] Please refer to Figure 5 , Figure 5 It is a flowchart of the third embodiment of the malicious load identification method provided by the present application.
[0107] like Figure 5 As shown, the specific steps are as follows:
[0108] Step S31: extracting electrical characteristics of the electrical appliance based on the voltage and current data of the electrical appliance.
[0109] Step S32: input the electrical characteristics into the load identification model to obtain the first load type identified by the load identification model.
[0110] In the embodiment of the present application, step S31 and step S32 are Figure 2 Step S11 and step S12 in the illustrated embodiment are the same and will not be described in detail herein.
[0111] Step S33: In response to the first load type being a preset malicious load, the electrical characteristics are input into a nearest neighbor classifier to obtain a weight of each load type.
[0112] In the embodiment of the present application, the malicious load identification device uses a trained nearest neighbor classifier to calculate the input feature matrix and obtain the weight of each type of load for the input feature matrix, wherein the higher the weight, the higher the possibility that the input feature matrix belongs to this type of load.
[0113] The malicious load identification device takes the weight of the maximum load As the initial recognition result. Set the K nearest neighbor threshold ,when Greater than or equal to is identified as a load type that can be identified in the capability set, and the process goes to step S34; Less than When it is identified as other load types and the load type enumeration is output, the process goes to step S35.
[0114] The above approach can also help reduce the misidentification of load types that have not been trained or have a small number of samples.
[0115] The training process of the nearest neighbor classifier used in the above process is as follows:
[0116] The malicious load identification device uses a multi-channel mixed feature matrix combined with the KNN algorithm to identify the load. The feature matrix X is 3*128 in size and is obtained after PCA dimensionality reduction. The specification is 3*3. Power characteristic vector =[ , , ] include active power, reactive power and distortion power respectively.
[0117] In order to utilize the complementarity between multiple features, the malicious load identification device transforms the feature matrix and the power eigenvector Superposition is performed to obtain a filling matrix based on multiple feature channels , the specification is 3*4 at this time.
[0118] The malicious load identification device first determines the number of nearest neighbors ,in, It can be determined according to the actual number of samples and the recognition effect; then use right The nearest neighbor classifier is fitted and trained to obtain a trained classifier.
[0119] Step S34: In response to the maximum weight value being greater than or equal to the nearest neighbor threshold, the load type corresponding to the maximum weight value is used as the clustering result.
[0120] In the embodiment of the present application, the malicious load identification device is Greater than or equal to When the load type of the electrical appliance is determined, the specific load type of the electrical appliance can be obtained. Finally, the specific load type of the electrical appliance is compared with the preset malicious load type. If the load type of the electrical appliance is any malicious load type, the machine learning scheme identification result of the electrical appliance as a malicious auxiliary is output.
[0121] Step S35: In response to the maximum weight being less than the neighbor threshold, outputting the clustering result as other load types.
[0122] In the embodiment of the present application, the malicious load identification device is Less than When the load type of the output appliance is other load types, that is, according to the current training set data, there is no training or lack of sample data, and the accurate load type cannot be identified. Therefore, the first stage of the deep learning solution may have false positives.
[0123] Please continue reading Figure 3 , Figure 3The second stage of the machine learning scheme adopts the K-means clustering algorithm, and the third stage of the machine learning scheme adopts the KNN algorithm to realize the clustering recognition of the electrical characteristics of the electrical appliances. Among them, to realize the clustering recognition of electrical characteristics, the malicious load identification device also needs to perform clustering training on the training set to obtain several pre-processed centroids, and the nearest neighbor classifier trained on the training set.
[0124] Please refer to Figure 6 , Figure 6 It is a flowchart of the fourth embodiment of the malicious load identification method provided by the present application.
[0125] like Figure 6 As shown, the specific steps are as follows:
[0126] Step S41: extracting electrical characteristics of the electrical appliance based on the voltage and current data of the electrical appliance.
[0127] Step S42: input the electrical characteristics into the load identification model to obtain the first load type identified by the load identification model.
[0128] Step S43: In response to the first load type being a preset vicious load, obtaining the distance between the electrical characteristic and each centroid to obtain a minimum distance value.
[0129] Step S44: In response to the first load type being a preset malicious load, the electrical characteristics are input into the nearest neighbor classifier to obtain a weight of each load type.
[0130] Step S45: In response to the minimum distance being less than or equal to the cluster identification threshold, the load type of the centroid corresponding to the minimum distance is taken as the first clustering result.
[0131] Step S46: In response to the minimum distance being greater than the cluster identification threshold, outputting the first clustering result as other load types.
[0132] Step S47: In response to the maximum weight value being greater than or equal to the nearest neighbor threshold, the load type corresponding to the maximum weight value is taken as the second clustering result.
[0133] Step S48: In response to the maximum weight value being less than the nearest neighbor threshold, outputting the second clustering result as other load types.
[0134] Step S49: In response to the first clustering result and / or the second clustering result being both preset malicious loads, outputting the load type of the electrical appliance as a malicious load.
[0135] In the embodiment of the present application, the process of the K-means clustering algorithm is as follows: Figure 4 The embodiment shown has been specifically introduced, and the process of the KNN algorithm is described in Figure 5The detailed description has been given in the illustrated embodiment and will not be repeated here.
[0136] In the embodiment of the present application, the malicious load identification device obtains the identification results of the second stage and the third stage respectively. In a specific implementation, when the identification results of the second stage and the third stage are both malicious loads, it is confirmed that the identification results of the first stage are accurate, and the results are summarized and processed to output the load type of the malicious load.
[0137] In another specific implementation, when the recognition result of the second stage or the recognition result of the third stage is a malicious load, it is confirmed that the recognition result of the first stage is accurate, and the results are summarized and processed to output the load type of the malicious load.
[0138] In another specific embodiment, when the recognition results of the second stage and the third stage are both other load types, it is confirmed that the recognition results of the deep learning solution in the first stage are inaccurate. At this time, the misidentification information is output to the user to guide the user to train and learn the load type of the appliance.
[0139] Specifically, the first stage, the second stage, and the third stage can all identify the connected load and generate identification results, and the fourth stage mainly functions to make decisions on the load results.
[0140] It is known that deep neural networks cannot identify samples that have not been learned as other types, and will definitely identify them as one of the load types in the capability set, but they can maintain high-precision recognition for samples that have already been learned.
[0141] The access of electrical appliances in actual use scenarios has very large uncertainty, so this application adds two pure machine learning schemes (i.e., K-Means clustering algorithm and KNN algorithm) to determine whether the connected electrical appliances are other categories of electrical appliances. Even if deep learning mistakenly identifies unlearned samples as malicious loads, if both pure machine learning schemes identify them as other electrical appliances, the final result is still other types of electrical appliances outside the capability set. The above is a combination of the respective advantages of deep learning and machine learning and experimentally verified feature selection, while achieving high accuracy and avoiding misidentification.
[0142] Furthermore, the malicious loads involved in this application include multiple types of malicious loads, such as heating appliances, high-power appliances, mobile power appliances, etc. Each stage of the malicious load identification method of this application can further distinguish specific malicious load types based on the identification of malicious loads.
[0143] Specifically, as described above, when the first, second, and third stages all output the identification results of the malicious load, the fourth stage summarizes the results and outputs the load type of the malicious load. If a specific malicious load type is to be distinguished, each stage needs to output a specific malicious load type, and then the final malicious load type is determined through threshold comparison.
[0144] For example, when the deep neural network in the first stage outputs a malicious load type, it also outputs confidence information, indicating the possibility that the appliance belongs to this malicious load type. Similarly, the same confidence information can be calculated based on the minimum distance in the second stage, and the same confidence information can be calculated based on the maximum weight in the third stage. Therefore, the malicious load identification device can use the malicious load type with the highest confidence in the above three stages as the final malicious load type output by the fourth stage decision.
[0145] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0146] In order to implement the above-mentioned malicious load identification method, the present application also proposes a malicious load identification device, for details, please refer to Figure 7 , Figure 7 It is a structural schematic diagram of an embodiment of a malicious load identification device provided in the present application.
[0147] The malicious load identification device 400 of this embodiment includes a processor 41 , a memory 42 , an input / output device 43 , and a bus 44 .
[0148] The processor 41 , the memory 42 , and the input / output device 43 are respectively connected to the bus 44 . The memory 42 stores program data. The processor 41 is used to execute the program data to implement the malicious load identification method described in the above embodiment.
[0149] In the embodiment of the present application, the processor 41 may also be referred to as a CPU (Central Processing Unit). The processor 41 may be an integrated circuit chip having the ability to process signals. The processor 41 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or the processor 41 may also be any conventional processor, etc.
[0150] This application also provides a computer storage medium, please continue to refer to Figure 8 , Figure 8 1 is a schematic diagram of the structure of an embodiment of a computer storage medium provided in the present application. The computer storage medium 600 stores a computer program 61. When the computer program 61 is executed by a processor, it is used to implement the malicious load identification method of the above embodiment.
[0151] When the embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0152] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for identifying malicious loads, characterized in that: The malicious load identification method comprises: Extracting electrical characteristics of the electrical appliance based on voltage and current data of the electrical appliance; Inputting the electrical characteristics into a load identification model to obtain a first load type identified by the load identification model; In response to the first load type being a preset malignant load, clustering the electrical features and the preprocessed clustering feature sample set; According to the clustering result, obtaining a second load type of the electrical appliance; In response to the second load type being a preset malicious load, outputting a load type indicating that the electrical appliance is a malicious load; The preprocessed cluster feature sample set includes a number of centroids obtained by clustering the training set; The step of clustering the electrical features and the preprocessed cluster feature sample set comprises: Obtaining the distance between the electrical feature and each centroid to obtain a minimum distance value; The step of obtaining the second load type of the electrical appliance according to the clustering result includes: In response to the minimum distance being less than or equal to a cluster identification threshold, taking the load type of the centroid corresponding to the minimum distance as the clustering result; In response to the minimum distance being greater than the cluster identification threshold, the clustering result is output as other load types.
2. The method for identifying malicious loads according to claim 1, characterized in that: The electrical characteristics include one or more of active power, reactive power, apparent power, and distortion power; After extracting the electrical characteristics of the electrical appliance, the malicious load identification method further includes: The electrical features are subjected to dimensionality reduction.
3. The method for identifying malicious loads according to claim 1, characterized in that: The malicious load identification method further includes: Obtaining a training set, and determining the number of centroids according to the number of sample types in the training set; Selecting a feature vector from each sample type in the training set as an initial centroid, and clustering all sample feature vectors; The position of the initial centroid is updated by iteratively calculating the mean of each cluster and re-clustering until the position of the centroid does not change, thereby obtaining a number of centroids obtained by clustering the training set.
4. The method for identifying malicious loads according to claim 1, characterized in that: The preprocessed cluster feature sample set includes a nearest neighbor classifier trained on a training set; The step of clustering the electrical features and the preprocessed cluster feature sample set comprises: Inputting the electrical characteristics into the nearest neighbor classifier to obtain the weight of each load type; The step of obtaining the second load type of the electrical appliance according to the clustering result includes: In response to the maximum weight value being greater than or equal to the nearest neighbor threshold, taking the load type corresponding to the maximum weight value as the clustering result; In response to the maximum weight being less than the neighbor threshold, the clustering result is output as other load types.
5. The method for identifying malicious loads according to claim 4, characterized in that: The malicious load identification method further includes: Obtaining a training set, and obtaining feature matrices and power feature vectors of several electrical appliances to be trained from the training set; Superimposing the characteristic matrix and power characteristic vector of each electrical appliance to be trained to obtain a filling matrix of each electrical appliance to be trained; Determine the number of nearest neighbors according to the number of sample features in the training set; A nearest neighbor classifier is trained according to the number of nearest neighbors and the filling matrices of the electrical appliances to be trained.
6. The method for identifying malicious loads according to claim 1, characterized in that: The pre-processed cluster feature sample set includes a number of centroids obtained by clustering the training set and a nearest neighbor classifier obtained by training the training set; the clustering result includes a first clustering result and a second clustering result; The step of clustering the electrical features and the preprocessed cluster feature sample set comprises: Obtaining the distance between the electrical feature and each centroid to obtain a minimum distance value; Inputting the electrical characteristics into the nearest neighbor classifier to obtain the weight of each load type; The step of obtaining the second load type of the electrical appliance according to the clustering result includes: In response to the minimum distance being less than or equal to a cluster identification threshold, taking the load type of the centroid corresponding to the minimum distance as a first clustering result; In response to the minimum distance being greater than the cluster identification threshold, outputting the first clustering result as other load types; In response to the maximum weight value being greater than or equal to the nearest neighbor threshold, taking the load type corresponding to the maximum weight value as the second clustering result; In response to the maximum weight value being less than the neighbor threshold, outputting the second clustering result as other load types; In response to the second load type being a preset malicious load, outputting the load type of the electrical appliance as a malicious load includes: In response to the first clustering result and / or the second clustering result being both preset malicious loads, outputting a load type indicating that the electrical appliance is a malicious load.
7. The method for identifying malicious loads according to claim 6, characterized in that: The malignant load includes several malignant load types; After the response to the second load type being a preset malicious load and outputting the load type of the electrical appliance as a malicious load, the malicious load identification method further includes: In response to the first load type being a first malignant load type, the first clustering result being a second malignant load type, the second clustering result being a third malignant load type, and at least two of the first malignant load type, the second malignant load type, and the third malignant load type being different, respectively acquiring a first confidence of the first load type, a second confidence of the first clustering result, and a third confidence of the second clustering result; The malicious load type corresponding to the maximum value among the first confidence level, the second confidence level and the third confidence level is output as the final load type.
8. A malicious load identification device, characterized in that: The malicious load identification device includes a memory and a processor coupled to the memory; The memory is used to store program data, and the processor is used to execute the program data to implement the malicious load identification method according to any one of claims 1 to 7.
9. A computer storage medium, characterized in that The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the malicious load identification method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Network intrusion detection method and system
CN111209563A
Malignant load identification method and device and storage medium
CN115795323A
Network traffic anomaly detection method and system
CN115913691A
Load classification method based on two-dimensional feature mining weight adaptive CLK-Means
CN117171608A
Hybrid non-intrusive load identification method and device and storage medium
CN117335408A
