Internet of Things terminal anomaly detection method, device and equipment and storage medium
Through the combination of variational autoencoders and gated cyclic units, low-dimensional feature data of IoT terminals are extracted and anomaly prediction is performed, which solves the problems of positioning difficulty and data waste in traditional detection methods, and improves detection performance and accuracy. , ensuring the security and stability of IoT terminals.
Patent Information
- Application Number
- CN202410995335.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-24
AI Technical Summary
Traditional IoT smart terminal anomaly detection methods are difficult to quickly locate terminal device anomalies, and their detection capabilities for massive data are insufficient, resulting in data waste and detection delays.
A combination of variational autoencoders and gated recurrent units is used for anomaly detection. Low-dimensional feature data is extracted through the variational autoencoder and gated recurrent units are used for abnormality prediction, thereby improving detection performance and positioning speed.
It improves the accuracy and speed of anomaly detection, effectively handles a large number of detection situations, reduces losses caused by device anomalies, and ensures the security and stability of IoT terminals.
Smart Images

Figure CN118764285A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet of Things security, and in particular to an Internet of Things terminal anomaly detection method, device, equipment and storage medium. Background Art
[0002] At the current stage, the combination of the Internet of Things and intelligent operation terminals has become a development trend. With the comprehensive development of the Internet of Things, the intelligent terminal devices connected to the Internet of Things have gradually become intelligent and automated, and various intelligent terminal devices have been applied to various fields, such as edge computing, industrial intelligent manufacturing, transportation, smart homes, and smart cities. With the rapid popularization of intelligent terminals in the Internet of Things, the abnormal state detection of intelligent terminals in the Internet of Things has become more and more diversified, and the demand for the ability to detect massive data is also increasing.
[0003] For anomaly detection of IoT smart terminals, traditional anomaly detection methods mainly focus on certain attribute characteristics of abnormal data of smart terminals, identify abnormal behaviors through limited behavioral baselines, and do not conduct more in-depth analysis and utilization of a large number of valuable data attributes, which results in the waste of collected data. At the same time, due to the imbalance and diversity of IoT smart terminal device data, anomaly detection has also brought great difficulties. Traditional detection methods are difficult to quickly locate terminal device anomalies. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide an IoT terminal anomaly detection method, device, equipment and storage medium, which can perform anomaly detection based on a combination of a variational autoencoder and a gated recurrent unit, and can utilize the low-dimensional characteristics of the variational autoencoder transform domain to improve detection performance, improve anomaly location speed and anomaly monitoring point accuracy, and utilize gated recurrent units to handle a large number of anomaly detection situations. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a method for detecting anomalies in an IoT terminal, comprising:
[0006] Collect terminal data of the Internet of Things terminal and pre-process the terminal data to obtain target terminal data;
[0007] Inputting the target terminal data into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and performing anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result;
[0008] Decoding the anomaly prediction result by a variational self-decoder in the target anomaly detection model to obtain reconstructed terminal data;
[0009] The error value between the reconstructed terminal data and the target terminal data is compared to determine whether the IoT terminal is abnormal according to the error value.
[0010] Optionally, collecting terminal data of an IoT terminal and preprocessing the terminal data to obtain target terminal data includes:
[0011] Collect terminal data uploaded by an IoT terminal from a preset IoT cloud platform, and perform sliding window segmentation on the terminal data to obtain a plurality of segmented data corresponding to the terminal data;
[0012] Performing redundancy detection on the plurality of segmented data to determine discarded data in the segmented data, and deleting the discarded data from the segmented data to obtain a plurality of first processed data;
[0013] Performing missing value detection on the plurality of first processed data, and performing missing value filling according to the missing value detection result to obtain a plurality of second processed data;
[0014] The plurality of second processed data are standardized by a preset standardization formula to obtain target terminal data.
[0015] Optionally, the preset normalization formula is:
[0016] ;
[0017] Wherein, x' is the target terminal data, x is the second processed data, μ is the mean of x, and σ is the standard deviation of x.
[0018] Optionally, before inputting the target terminal data into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and performing anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result, the method further includes:
[0019] The initial anomaly detection model is trained by using a preset training data set to obtain a trained anomaly detection model;
[0020] Calculating the model loss of the trained anomaly detection model, and determining whether the model loss is less than a preset model loss threshold;
[0021] If the model loss is not less than the preset model loss threshold, the model parameters of the trained anomaly detection model are updated, and the process jumps to the step of training the initial anomaly detection model using the preset training data set to perform the next round of model training until the model loss is less than the preset model loss threshold;
[0022] If the model loss is less than the preset model loss threshold, the trained anomaly detection model is used as the target anomaly detection model for performing anomaly detection on the IoT terminal.
[0023] Optionally, inputting the target terminal data into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model includes:
[0024] The target terminal data is input into a target anomaly detection model, and the target terminal data is mapped to a low-dimensional space through a variational autoencoder in the target anomaly detection model, so as to extract low-dimensional feature data corresponding to the target terminal data from the low-dimensional space.
[0025] Optionally, decoding the anomaly prediction result by a variational self-decoder in the target anomaly detection model to obtain reconstructed terminal data includes:
[0026] The anomaly prediction result is forward propagated through the variational self-decoder in the target anomaly detection model to decode and reconstruct the anomaly prediction structure to obtain reconstructed terminal data corresponding to the anomaly prediction result.
[0027] Optionally, comparing the error value between the reconstructed terminal data and the target terminal data to determine whether the IoT terminal is abnormal according to the error value includes:
[0028] Calculating an error value between the reconstructed terminal data and the target terminal data, and comparing the error value with a preset error threshold;
[0029] If the error value is greater than a preset error threshold, it is determined that the IoT terminal is in an abnormal state;
[0030] If the error value is not greater than the preset error threshold, it is determined that the Internet of Things terminal is in a normal state.
[0031] In a second aspect, the present application discloses an IoT terminal anomaly detection device, comprising:
[0032] A data preprocessing module is used to collect terminal data of the Internet of Things terminal and preprocess the terminal data to obtain target terminal data;
[0033] An anomaly prediction module, used for inputting the target terminal data into a target anomaly detection model, extracting low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and performing anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result;
[0034] A data reconstruction module, used for decoding the anomaly prediction result through a variational self-decoder in the target anomaly detection model to obtain reconstructed terminal data;
[0035] The abnormality determination module is used to compare the error value between the reconstructed terminal data and the target terminal data to determine whether the Internet of Things terminal is abnormal according to the error value.
[0036] In a third aspect, the present application discloses an electronic device, comprising:
[0037] Memory, used to store computer programs;
[0038] A processor is used to execute the computer program to implement the aforementioned method for detecting abnormalities in an IoT terminal.
[0039] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned method for detecting anomalies in an IoT terminal.
[0040] In the present application, terminal data of an IoT terminal is first collected, and the terminal data is preprocessed to obtain target terminal data, and then the target terminal data is input into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and anomaly prediction is performed on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result, and the anomaly prediction result is decoded through a variational autodecoder in the target anomaly detection model to obtain reconstructed terminal data, and finally, an error value between the reconstructed terminal data and the target terminal data is compared to determine whether an abnormality occurs in the IoT terminal according to the error value. It can be seen that the method of the present application can be used to preprocess the terminal data of the collected Internet of Things terminal, and the target terminal data obtained after preprocessing can be input into the target anomaly detection model, so as to extract the low-dimensional feature data of the target terminal data through the variational self-encoder in the target anomaly detection model, and the low-dimensional feature data can be predicted by the gated cycle unit in the target anomaly detection model to obtain the anomaly prediction result, and then the anomaly prediction result can be decoded by the variational self-decoder in the target anomaly detection model, and finally the error value between the reconstructed terminal data obtained by decoding and the target terminal data can be compared to determine whether the Internet of Things terminal is abnormal according to the error value. In this way, through the method of the present application, anomaly detection can be performed based on the combination of variational self-encoder and gated cycle unit, and the low-dimensional characteristics of the variational self-encoder transform domain can be used to improve the detection performance, improve the anomaly positioning speed and the accuracy of the anomaly monitoring point, and use the gated cycle unit to handle a large number of anomaly detection situations. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A flow chart of an IoT terminal anomaly detection method provided in this application;
[0043] Figure 2 A timing diagram of an IoT terminal anomaly detection method provided in this application;
[0044] Figure 3 An interactive diagram of an IoT terminal anomaly detection method provided in this application;
[0045] Figure 4A schematic diagram of the structure of an IoT terminal anomaly detection device provided in this application;
[0046] Figure 5 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] The anomaly detection methods in the existing technology mainly focus on certain attribute characteristics of abnormal data of smart terminals, and identify abnormal behaviors through limited behavioral baselines, but do not conduct more in-depth analysis and utilization of a large number of valuable data attributes, which leads to the waste of collected data. At the same time, the imbalance and diversity of data of smart terminal devices in the Internet of Things also bring great difficulties to anomaly detection. It is difficult for traditional detection methods to quickly locate terminal device anomalies.
[0049] In order to overcome the above technical problems, the present application discloses an IoT terminal anomaly detection method, which can perform anomaly detection based on a combination of a variational autoencoder and a gated recurrent unit. The low-dimensional characteristics of the variational autoencoder transform domain can be used to improve the detection performance, increase the anomaly positioning speed and the accuracy of anomaly monitoring points, and use the gated recurrent unit to handle a large number of anomaly detection situations.
[0050] See also Figure 1 As shown, an embodiment of the present invention discloses a method for detecting abnormalities in an IoT terminal, comprising:
[0051] Step S11: collecting terminal data of the Internet of Things terminal and preprocessing the terminal data to obtain target terminal data.
[0052] In this embodiment, it is necessary to collect the terminal data of the IoT terminal, and then pre-process the collected terminal data to obtain the corresponding target terminal data. Specifically, the IoT terminal will transmit its own terminal data to the preset IoT cloud platform, so Figure 2As shown, when it is necessary to detect anomalies in IoT terminals, the terminal data uploaded by the IoT terminals are collected from the preset IoT cloud platform. It should be noted that the terminal data collected at this time may be normal data or abnormal data. The main types of data collected are: the domain name requested for resolution by the terminal, the six-tuple information of the established network connection, namely the source IP (Internet Protocol), source port, destination IP, destination port, protocol type, timestamp, started process information, file system changes, traffic logs, and system logs.
[0053] Then the collected terminal data needs to be preprocessed. It should be noted that the preprocessing of the terminal data first requires the sliding window segmentation of the collected terminal data to obtain a number of segmented data corresponding to the target terminal data, and then the obtained segmented data is standardized. The standardized processing first requires the redundancy detection of the obtained segmented data to determine the discarded data in the segmented data, and then delete the discarded data from the segmented data to obtain a number of first processed data. After that, it is necessary to perform missing detection on the first processed data, and determine whether there are missing values in the first processed data according to the missing detection results, and then perform the corresponding missing value filling to obtain a number of second processed data. Finally, the second processed data needs to be standardized by a preset standardized formula to obtain the target terminal data. The preset standardized formula is: , and x' is the target terminal data, that is, the original data, x is the second processed data, that is, the data with the discarded data deleted and the missing values filled, μ is the mean of x, and σ is the standard deviation of x. In this way, the accuracy of the detection results can be improved by standardizing the data. In addition, since the VAE (Variational AutoEncoder) model is not a sequence model, if this model is used directly, the original data samples will become independent individuals, which will ignore the time series information of the data and cause poor detection results. Therefore, the data is segmented through this sliding window to obtain multiple continuous segmented data, which can make the processed data adapt to the VAE model.
[0054] Step S12: input the target terminal data into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and perform anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result.
[0055] In this embodiment, before performing terminal anomaly detection based on target terminal data through the target anomaly detection model, it is first necessary to construct the target terminal data. Specifically, Figure 2 As shown, the initial anomaly detection model needs to be trained with a preset training data set to obtain a trained anomaly detection model, and then the model loss of the trained anomaly detection model needs to be calculated, and it is necessary to determine whether the current model loss is less than the preset model loss threshold. If it is greater than or equal to the preset model loss threshold, it means that the current loss of the characterization model is too large, and the prediction accuracy cannot meet the requirements. It is necessary to update the model parameters of the trained anomaly detection model, and perform the next round of model training, and then calculate the model loss corresponding to the model obtained by the next round of model training, until the final model loss is less than the preset model loss threshold, and the obtained trained anomaly detection model is used as the target anomaly detection model for anomaly detection of IoT terminals.
[0056] In this embodiment, anomaly detection is performed by combining VAE with GRU, and since the target anomaly detection model is divided into three parts: VAE encoder, GRU (Gated Recurrent Unit) prediction and VAE decoder, the target terminal data needs to be processed by the VAE encoder, that is, the variational autoencoder, so as to extract the low-dimensional feature data of the target terminal data. Specifically, the target terminal data needs to be input into the target anomaly detection model, and the target terminal data is mapped to a low-dimensional space by the variational autoencoder in the target anomaly detection model, so as to automatically extract the deeper dynamic laws of the target terminal data, that is, the features. After feature extraction, the low-dimensional feature data can be used as the input of the GRU model, and then the abnormal behavior prediction is performed through the GRU model. The feature data mainly includes: network connection six-tuple information (source IP, source port, destination IP, destination port, protocol type, timestamp), started process information, file system integrity information, traffic log, system log, and finally the prediction result value of the abnormal prediction is obtained.
[0057] Step S13: decoding the anomaly prediction result by a variational self-decoder in the target anomaly detection model to obtain reconstructed terminal data.
[0058] In this embodiment, the abnormal prediction result value needs to be decoded by a VAE decoder to obtain reconstructed terminal data. Specifically, the abnormal prediction result value needs to be forward propagated through a variational self-decoder in a target anomaly detection model to decode and reconstruct the abnormal prediction structure to obtain reconstructed terminal data corresponding to the abnormal prediction result.
[0059] Step S14: comparing the error value between the reconstructed terminal data and the target terminal data to determine whether the IoT terminal is abnormal according to the error value.
[0060] In this embodiment, Figure 2As shown, the error value between the reconstructed terminal data and the target terminal data can be calculated, and the error value and the preset error threshold can be compared. If the error value is greater than the preset error threshold, it is determined that the terminal data of the collected Internet of Things terminal is abnormal, and it can be determined that the Internet of Things terminal is in an abnormal state; if the error value is not greater than the preset error threshold, it is determined that the terminal data of the collected Internet of Things terminal is normal data, and it can be determined that the Internet of Things terminal is in a normal state.
[0061] It can be seen that, through the method of the present application, the terminal data of the collected Internet of Things terminal can be preprocessed, and the target terminal data obtained after the preprocessing can be input into the target anomaly detection model, so as to extract the low-dimensional feature data of the target terminal data through the variational autoencoder in the target anomaly detection model, and the low-dimensional feature data can be predicted by the gated cyclic unit in the target anomaly detection model to obtain the anomaly prediction result, and then the anomaly prediction result can be decoded by the variational self-decoder in the target anomaly detection model, and finally the error value between the reconstructed terminal data obtained by decoding and the target terminal data can be compared to determine whether the Internet of Things terminal is abnormal according to the error value. In this way, through the method of the present application, anomaly detection can be performed based on the combination of variational autoencoder and gated cyclic unit, and the low-dimensional characteristics of the variational autoencoder transform domain can be used to improve the detection performance, improve the anomaly positioning speed and the accuracy of the anomaly monitoring point, and use the gated cyclic unit to handle a large number of anomaly detection situations, improve the recognition rate of the anomaly of the Internet of Things smart terminal, ensure the security and stability of the Internet of Things smart terminal, and effectively reduce the losses caused by equipment abnormalities.
[0062] See also Figure 3 As shown, an embodiment of the present invention discloses a method for detecting abnormalities in an IoT terminal, comprising:
[0063] like Figure 3 As shown, through the method of the present application, the Internet of Things terminal will transmit its own terminal data to the preset Internet of Things cloud platform. When abnormal detection of the Internet of Things terminal is required, the terminal data uploaded by the Internet of Things terminal is collected from the preset Internet of Things cloud platform, and then the collected terminal data needs to be segmented by a sliding window to obtain a number of segmented data corresponding to the target terminal data, and the several segmented data are standardized by a preset standardization formula to obtain the target terminal data.
[0064] After obtaining the target terminal data, it is necessary to extract low-dimensional feature data corresponding to several segmented data through the VAE decoder of the target anomaly detection model, and then input the low-dimensional feature data into the GRU model of the target anomaly detection model to perform anomaly prediction and obtain the corresponding anomaly prediction result value. Finally, the anomaly prediction result value is decoded through the VAE decoder to obtain the reconstructed terminal data.
[0065] After obtaining the reconstructed terminal data, the error value between the reconstructed terminal data and the target terminal data can be calculated to determine whether the IoT terminal is abnormal by comparing the results. It should be noted that the method of this application was compared with the traditional decision tree (C4.5) and gradient boosting tree (XGBoost). The experimental results show that compared with other machine learning and deep learning methods, the detection throughput, accuracy, and recall rate of the method of the present invention have certain advantages, and the comparison results are shown in Table 1.
[0066] Table 1
[0067]
[0068] It can be seen that the method of the present application effectively improves the recognition rate of abnormal behavior of IoT smart terminals, which not only solves the problems of poor responsiveness and high detection delay rate of traditional methods, but also ensures the security and stability of IoT smart terminals, reduces the losses caused by equipment abnormalities, and at the same time, will not affect the normal operation of IoT smart terminals.
[0069] See also Figure 4 As shown, an embodiment of the present invention discloses an IoT terminal abnormality detection device, comprising:
[0070] The data preprocessing module 11 is used to collect terminal data of the IoT terminal and preprocess the terminal data to obtain target terminal data;
[0071] An anomaly prediction module 12 is used to input the target terminal data into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and perform anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result;
[0072] A data reconstruction module 13, configured to decode the anomaly prediction result through a variational self-decoder in the target anomaly detection model to obtain reconstructed terminal data;
[0073] The abnormality determination module 14 is used to compare the error value between the reconstructed terminal data and the target terminal data to determine whether the Internet of Things terminal is abnormal according to the error value.
[0074] In the present application, terminal data of an IoT terminal is first collected, and the terminal data is preprocessed to obtain target terminal data, and then the target terminal data is input into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and anomaly prediction is performed on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result, and the anomaly prediction result is decoded through a variational autodecoder in the target anomaly detection model to obtain reconstructed terminal data, and finally, an error value between the reconstructed terminal data and the target terminal data is compared to determine whether an abnormality occurs in the IoT terminal according to the error value. It can be seen that the method of the present application can be used to preprocess the terminal data of the collected Internet of Things terminal, and the target terminal data obtained after preprocessing can be input into the target anomaly detection model, so as to extract the low-dimensional feature data of the target terminal data through the variational self-encoder in the target anomaly detection model, and the low-dimensional feature data can be predicted by the gated cycle unit in the target anomaly detection model to obtain the anomaly prediction result, and then the anomaly prediction result can be decoded by the variational self-decoder in the target anomaly detection model, and finally the error value between the reconstructed terminal data obtained by decoding and the target terminal data can be compared to determine whether the Internet of Things terminal is abnormal according to the error value. In this way, through the method of the present application, anomaly detection can be performed based on the combination of variational self-encoder and gated cycle unit, and the low-dimensional characteristics of the variational self-encoder transform domain can be used to improve the detection performance, improve the anomaly positioning speed and the accuracy of the anomaly monitoring point, and use the gated cycle unit to handle a large number of anomaly detection situations.
[0075] In some embodiments, the data preprocessing module 11 may specifically include:
[0076] A data segmentation unit, used to collect terminal data uploaded by an IoT terminal from a preset IoT cloud platform, and perform sliding window segmentation on the terminal data to obtain a plurality of segmented data corresponding to the terminal data;
[0077] a data deleting unit, configured to perform redundancy detection on the plurality of segmented data to determine discarded data in the segmented data, and delete the discarded data from the segmented data to obtain a plurality of first processed data;
[0078] A data filling unit, used for performing missing detection on the plurality of first processed data, and filling the missing values according to the missing detection result, so as to obtain a plurality of second processed data;
[0079] The data standardization unit is used to standardize the plurality of second processed data by using a preset standardization formula to obtain target terminal data.
[0080] In some embodiments, the IoT terminal abnormality detection device may further include:
[0081] A model training unit, used to train the initial anomaly detection model using a preset training data set to obtain a trained anomaly detection model;
[0082] A loss calculation unit, used to calculate the model loss of the trained anomaly detection model and determine whether the model loss is less than a preset model loss threshold;
[0083] A step jump unit, configured to update the model parameters of the trained anomaly detection model if the model loss is not less than the preset model loss threshold, and jump to the step of training the initial anomaly detection model with the preset training data set to perform the next round of model training until the model loss is less than the preset model loss threshold;
[0084] The model determination unit is used to use the trained anomaly detection model as a target anomaly detection model for performing anomaly detection on an Internet of Things terminal if the model loss is less than the preset model loss threshold.
[0085] In some embodiments, the abnormality prediction module 12 may specifically include:
[0086] A data feature extraction unit is used to input the target terminal data into a target anomaly detection model, and map the target terminal data to a low-dimensional space through a variational autoencoder in the target anomaly detection model to extract low-dimensional feature data corresponding to the target terminal data from the low-dimensional space.
[0087] In some embodiments, the data reconstruction module 13 may specifically include:
[0088] A data reconstruction unit, configured to forward propagate the anomaly prediction result through a variational self-decoder in the target anomaly detection model to decode and reconstruct the anomaly prediction structure to obtain reconstructed terminal data corresponding to the anomaly prediction result.
[0089] In some embodiments, the abnormality determination module 14 may specifically include:
[0090] an error comparison unit, configured to calculate an error value between the reconstructed terminal data and the target terminal data, and compare the error value with a preset error threshold;
[0091] A first state determination unit, configured to determine that the Internet of Things terminal is in an abnormal state if the error value is greater than a preset error threshold;
[0092] The second state determination unit is used to determine that the Internet of Things terminal is in a normal state if the error value is not greater than a preset error threshold.
[0093] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0094] Figure 5 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for detecting abnormalities in an IoT terminal disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0095] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0096] In addition, the memory 22 as a carrier for storing resources may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0097] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the IoT terminal anomaly detection method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0098] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed method for detecting abnormalities in an IoT terminal is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be described in detail here.
[0099] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0100] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0101] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0102] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0103] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for detecting abnormality in an IoT terminal. It is characterized in that include: Collect terminal data of the Internet of Things terminal and pre-process the terminal data to obtain target terminal data; Inputting the target terminal data into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and performing anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result; Decoding the anomaly prediction result by a variational self-decoder in the target anomaly detection model to obtain reconstructed terminal data; The error value between the reconstructed terminal data and the target terminal data is compared to determine whether the IoT terminal is abnormal according to the error value.
2. The method for detecting abnormality of an Internet of Things terminal according to claim 1, It is characterized in that The collecting of terminal data of the IoT terminal and preprocessing the terminal data to obtain target terminal data includes: Collect terminal data uploaded by an IoT terminal from a preset IoT cloud platform, and perform sliding window segmentation on the terminal data to obtain a plurality of segmented data corresponding to the terminal data; Performing redundancy detection on the plurality of segmented data to determine discarded data in the segmented data, and deleting the discarded data from the segmented data to obtain a plurality of first processed data; Performing missing value detection on the plurality of first processed data, and performing missing value filling according to the missing value detection result to obtain a plurality of second processed data; The plurality of second processed data are standardized by a preset standardization formula to obtain target terminal data.
3. The method for detecting abnormality of an Internet of Things terminal according to claim 2, It is characterized in that The preset normalization formula is: ; Wherein, x' is the target terminal data, x is the second processed data, μ is the mean of x, and σ is the standard deviation of x.
4. The method for detecting abnormality of an Internet of Things terminal according to claim 1, It is characterized in that Before inputting the target terminal data into the target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and performing anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result, the method further includes: The initial anomaly detection model is trained by using a preset training data set to obtain a trained anomaly detection model; Calculating the model loss of the trained anomaly detection model, and determining whether the model loss is less than a preset model loss threshold; If the model loss is not less than the preset model loss threshold, the model parameters of the trained anomaly detection model are updated, and the process jumps to the step of training the initial anomaly detection model using the preset training data set to perform the next round of model training until the model loss is less than the preset model loss threshold; If the model loss is less than the preset model loss threshold, the trained anomaly detection model is used as the target anomaly detection model for performing anomaly detection on the IoT terminal.
5. The method for detecting abnormality of an Internet of Things terminal according to claim 1, It is characterized in that The step of inputting the target terminal data into a target anomaly detection model to extract low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model includes: The target terminal data is input into a target anomaly detection model, and the target terminal data is mapped to a low-dimensional space through a variational autoencoder in the target anomaly detection model, so as to extract low-dimensional feature data corresponding to the target terminal data from the low-dimensional space.
6. The method for detecting abnormality of an Internet of Things terminal according to claim 1, It is characterized in that The decoding of the abnormal prediction result by the variational self-decoder in the target abnormality detection model to obtain reconstructed terminal data includes: The anomaly prediction result is forward propagated through the variational self-decoder in the target anomaly detection model to decode and reconstruct the anomaly prediction structure to obtain reconstructed terminal data corresponding to the anomaly prediction result.
7. The method for detecting abnormality of an Internet of Things terminal according to any one of claims 1 to 6, It is characterized in that The comparing the error value between the reconstructed terminal data and the target terminal data to determine whether the IoT terminal is abnormal according to the error value includes: Calculating an error value between the reconstructed terminal data and the target terminal data, and comparing the error value with a preset error threshold; If the error value is greater than a preset error threshold, it is determined that the IoT terminal is in an abnormal state; If the error value is not greater than the preset error threshold, it is determined that the Internet of Things terminal is in a normal state.
8. An abnormality detection device for an Internet of Things terminal, It is characterized in that include: A data preprocessing module is used to collect terminal data of the Internet of Things terminal and preprocess the terminal data to obtain target terminal data; An anomaly prediction module, used for inputting the target terminal data into a target anomaly detection model, extracting low-dimensional feature data of the target terminal data through a variational autoencoder in the target anomaly detection model, and performing anomaly prediction on the low-dimensional feature data through a gated recurrent unit in the target anomaly detection model to obtain an anomaly prediction result; A data reconstruction module, used for decoding the anomaly prediction result through a variational self-decoder in the target anomaly detection model to obtain reconstructed terminal data; The abnormality determination module is used to compare the error value between the reconstructed terminal data and the target terminal data to determine whether the Internet of Things terminal is abnormal according to the error value.
9. An electronic device, It is characterized in that include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the method for detecting anomalies in an Internet of Things terminal according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that Used to store a computer program, which, when executed by a processor, implements the method for detecting anomalies in an Internet of Things terminal as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Fault detection method and device based on discrete wavelet transform and gating cycle unit
CN115144211A
Data center anomaly detection method and device and related product
CN115361307A
Abnormal flow detection method and system and computer storage medium
WO2021258348A1
