Data anomaly detection method, device and electronic device
By performing dimensionality reduction processing on high-dimensional data and training target isolation trees to calculate path lengths, the problem of poor anomaly detection performance in high-dimensional data in the existing technology is solved, and a more efficient outlier separation effect is achieved.
Patent Information
- Application Number
- CN202110496465.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-07
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-05-07
AI Technical Summary
When the existing iForest algorithm detects anomalies in high-dimensional data, due to the influence of noise dimensions and irrelevant dimensions, the detection performance is poor and cannot effectively separate abnormal points and normal points.
By performing dimensionality reduction on the data to be detected, multiple target deep implicit features are extracted, and the target isolation tree is trained based on the multiple sample deep implicit features of the sample data, and the path length between the data to be detected and the target isolation tree is calculated to perform anomaly analysis. detection.
It effectively reduces the influence of irrelevant dimensions, improves detection performance, can effectively separate abnormal points from normal points in high-dimensional data, and improves detection accuracy.
Smart Images

Figure CN113239999B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data anomaly detection method, device and electronic device. Background Art
[0002] With the diversification of data, the data usually obtained is high-dimensional data. In order to efficiently perform anomaly detection on massive high-dimensional data, the iForest algorithm is usually used in the prior art to calculate the path length between the high-dimensional data and the isolation tree in the isolation forest, and perform anomaly detection on the high-dimensional data based on the calculation results.
[0003] However, when using the existing iForest algorithm to detect anomalies in high-dimensional data, since high-dimensional data may contain a large number of noise dimensions or irrelevant dimensions, this will affect the construction of the isolation tree. As a result, when performing anomaly detection on the high-dimensional data based on the path length between the high-dimensional data and the constructed isolation tree, the abnormal points in the high-dimensional data cannot be effectively separated from the normal points, resulting in poor detection performance. Summary of the invention
[0004] The embodiments of the present application provide a data anomaly detection method, device, and electronic device, which improve the detection performance when performing anomaly detection on data.
[0005] The present application provides a method for detecting anomalies in data, which may include:
[0006] Get the data to be tested.
[0007] The data to be detected is subjected to dimensionality reduction processing to extract multiple target deep implicit features corresponding to the data to be detected.
[0008] Obtain a target isolation tree; wherein the target isolation tree is trained based on multiple sample deep implicit features corresponding to the sample data, and the multiple sample deep implicit features are the same as the multiple target deep implicit features.
[0009] According to the path length between the data to be detected and the target isolation tree, anomaly detection is performed on the data to be detected.
[0010] In a possible implementation, the number of the target isolation trees is multiple, and the performing anomaly detection on the data to be detected according to the path length between the data to be detected and the target isolation tree includes:
[0011] The average path length is determined according to the path length between the data to be detected and each target isolation tree in the multiple target isolation trees.
[0012] Anomaly detection is performed on the data to be detected according to the average path length.
[0013] In a possible implementation, obtaining the target isolation tree includes:
[0014] The acquired sample data is subjected to dimensionality reduction processing to extract a plurality of sample deep implicit features corresponding to the sample data.
[0015] The sample data is segmented based on the multiple sample deep implicit features to determine a target segmentation hyperplane.
[0016] The sample data is segmented based on the target segmentation hyperplane to obtain the target isolation tree.
[0017] In a possible implementation, segmenting the sample data based on the multiple sample deep implicit features to determine a target segmentation hyperplane includes:
[0018] A plurality of groups of sample feature sets are selected from the plurality of sample deep implicit features, wherein each group of sample feature sets includes a preset number of sample deep implicit features.
[0019] For each group of sample feature sets, a segmentation hyperplane corresponding to the sample feature set is determined according to the deep implicit features of the samples included in the sample feature set, and the sample data is segmented based on the segmentation hyperplane to obtain a first sample sub-dataset and a second sample sub-dataset.
[0020] The target segmentation hyperplane is determined according to the multiple groups of first sample sub-data sets and second sample sub-data sets.
[0021] In a possible implementation, determining the segmentation hyperplane corresponding to the sample feature set according to the sample deep implicit features included in the sample feature set includes:
[0022] The coefficients corresponding to the respective sample deep implicit features in the sample deep implicit features included in the sample feature set are determined respectively.
[0023] For each of the sample deep implicit features, determine the product of the coefficient corresponding to the sample deep implicit feature and the value of the sample deep implicit feature, and calculate a first ratio between the product and the standard deviation corresponding to the value of the sample deep implicit feature.
[0024] According to the first ratio corresponding to the deep implicit feature of each sample, a segmentation hyperplane corresponding to the sample feature set is determined.
[0025] In a possible implementation, determining the segmentation hyperplane corresponding to the sample feature set according to the first ratio corresponding to the deep implicit feature of each sample includes:
[0026] Determine the sum of the first ratios corresponding to the deep implicit features of the samples.
[0027] According to a first difference between the sum and a preset segmentation value, a segmentation hyperplane corresponding to the sample feature set is determined.
[0028] In a possible implementation, determining the target segmentation hyperplane according to the plurality of first sample sub-data sets and the second sample sub-data sets includes:
[0029] For each group of first sample sub-datasets and second sample sub-datasets, determine the first sample sub-datasets and the second sample sub-datasets, the first sample hyperplane data set and the second sample hyperplane data set on the corresponding segmentation hyperplane, respectively, and determine the discreteness change value corresponding to the segmentation hyperplane based on the first sample hyperplane data set and the second sample hyperplane data set.
[0030] The target segmentation hyperplane is determined from among the multiple segmentation hyperplanes according to the discreteness change values corresponding to the multiple segmentation hyperplanes.
[0031] In a possible implementation, determining the discreteness change value corresponding to the segmentation hyperplane according to the first sample hyperplane data set and the second sample hyperplane data set includes:
[0032] An average value between a first standard deviation corresponding to the first sample hyperplane data set and a second standard deviation corresponding to the second sample hyperplane data set is determined.
[0033] Determine a standard deviation of a sample hyperplane data set corresponding to the sample data on the segmentation hyperplane.
[0034] A discreteness change value corresponding to the segmentation hyperplane is determined according to the standard deviation and the average value.
[0035] In a possible implementation manner, determining the discreteness change value corresponding to the segmentation hyperplane according to the standard deviation and the average value includes:
[0036] A second difference between the standard deviation and the mean is determined.
[0037] A second ratio of the second difference to the standard deviation is determined as a discreteness change value corresponding to the segmentation hyperplane.
[0038] In a possible implementation, determining the target segmentation hyperplane from among the multiple segmentation hyperplanes according to the discreteness change values corresponding to the multiple segmentation hyperplanes includes:
[0039] According to the discreteness change values corresponding to the multiple segmentation hyperplanes, a segmentation hyperplane having the largest discreteness change value is determined among the multiple segmentation hyperplanes.
[0040] The segmentation hyperplane with the largest discreteness change value is determined as the target segmentation hyperplane.
[0041] In a possible implementation, the performing dimensionality reduction processing on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected includes:
[0042] The data to be detected is subjected to dimensionality reduction processing by a denoising automatic encoding algorithm to obtain an encoding result corresponding to the data to be detected; wherein the encoding result corresponding to the data to be detected is the multiple target deep implicit features.
[0043] In a second aspect, an embodiment of the present application further provides a data anomaly detection device, which may include:
[0044] The acquisition unit is used to acquire the data to be detected.
[0045] A processing unit is used to perform dimensionality reduction processing on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected.
[0046] The acquisition unit is also used to acquire a target isolation tree; wherein the target isolation tree is trained based on multiple sample deep implicit features corresponding to the sample data, and the multiple sample deep implicit features are the same as the multiple target deep implicit features.
[0047] The processing unit is further used to perform anomaly detection on the data to be detected according to the path length between the data to be detected and the target isolation tree.
[0048] In a possible implementation, there are multiple target isolation trees; the processing unit is specifically used to determine the average path length based on the path length between the data to be detected and each target isolation tree in the multiple target isolation trees; and perform anomaly detection on the data to be detected based on the average path length.
[0049] In a possible implementation, the acquisition unit is specifically used to perform dimensionality reduction processing on the acquired sample data to extract multiple sample deep implicit features corresponding to the sample data; and segment the sample data based on the multiple sample deep implicit features to determine the target segmentation hyperplane; and then segment the sample data based on the target segmentation hyperplane to obtain the target isolation tree.
[0050] In a possible implementation, the acquisition unit is specifically used to select multiple groups of sample feature sets from the multiple sample deep implicit features, respectively; wherein each group of sample feature sets includes a preset number of sample deep implicit features; for each group of sample feature sets, based on the sample deep implicit features included in the sample feature set, determine the segmentation hyperplane corresponding to the sample feature set, and segment the sample data based on the segmentation hyperplane to obtain a first sample sub-data set and a second sample sub-data set; based on the multiple groups of first sample sub-data sets and second sample sub-data sets, determine the target segmentation hyperplane.
[0051] In a possible implementation, the acquisition unit is specifically used to determine the coefficients corresponding to each sample deep implicit feature included in the sample feature set; for each sample deep implicit feature, determine the product of the coefficient corresponding to the sample deep implicit feature and the value of the sample deep implicit feature, and calculate the first ratio between the product and the standard deviation corresponding to the value of the sample deep implicit feature; determine the segmentation hyperplane corresponding to the sample feature set according to the first ratio corresponding to each sample deep implicit feature.
[0052] In a possible implementation, the acquisition unit is specifically used to determine the sum of first ratios corresponding to the deep implicit features of each sample; and determine the segmentation hyperplane corresponding to the sample feature set according to a first difference between the sum and a preset segmentation value.
[0053] In a possible implementation, the acquisition unit is specifically used to determine, for each group of first sample sub-datasets and second sample sub-datasets, the first sample sub-datasets and the second sample sub-datasets, respectively, the first sample hyperplane data set and the second sample hyperplane data set on the corresponding segmentation hyperplane, and determine the discreteness change value corresponding to the segmentation hyperplane based on the first sample hyperplane data set and the second sample hyperplane data set; and determine the target segmentation hyperplane among the multiple segmentation hyperplanes based on the discreteness change values corresponding to the multiple segmentation hyperplanes.
[0054] In a possible implementation, the acquisition unit is specifically used to determine the average value between a first standard deviation corresponding to a first sample hyperplane data set and a second standard deviation corresponding to the second sample hyperplane data set; and determine the standard deviation corresponding to the sample hyperplane data set of the sample data on the segmentation hyperplane; and then determine the discreteness change value corresponding to the segmentation hyperplane based on the standard deviation and the average value.
[0055] In a possible implementation, the acquisition unit is specifically configured to determine a second difference between the standard deviation and the average value; and determine a second ratio of the second difference to the standard deviation as a discreteness change value corresponding to the segmentation hyperplane.
[0056] In a possible implementation, the acquisition unit is specifically used to determine a segmentation hyperplane with the largest discreteness change value among the multiple segmentation hyperplanes according to the discreteness change values corresponding to the multiple segmentation hyperplanes; and determine the segmentation hyperplane with the largest discreteness change value as the target segmentation hyperplane.
[0057] In a possible implementation, the processing unit is specifically used to perform dimensionality reduction processing on the data to be detected through a denoising automatic encoding algorithm to obtain an encoding result corresponding to the data to be detected; wherein the encoding result corresponding to the data to be detected is the multiple target deep implicit features.
[0058] In a third aspect, an embodiment of the present application further provides an electronic device, which may include a processor and a memory; wherein:
[0059] The memory is used to store computer programs.
[0060] The processor is used to read the computer program stored in the memory and execute the data anomaly detection method described in any possible implementation manner of the first aspect according to the computer program in the memory.
[0061] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the data anomaly detection method described in any possible implementation method of the first aspect above is implemented.
[0062] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the data anomaly detection method described in any possible implementation manner of the first aspect above.
[0063] The data anomaly detection method, device and electronic device provided in the embodiments of the present application, when performing anomaly detection on the data to be detected, perform dimensionality reduction processing on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected, thereby reducing the influence of irrelevant dimensional features in the data to be detected; and obtain a target isolation tree trained based on multiple sample deep implicit features corresponding to the sample data, and the multiple sample deep implicit features are the same as the multiple target deep implicit features; then, according to the path length between the data to be detected and the target isolation tree trained based on the multiple sample deep implicit features, perform anomaly detection on the data to be detected. Compared with anomaly detection based on a single dimensional feature, it can effectively separate abnormal points from normal points in the data to be detected, thereby improving detection performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 A flowchart of a data anomaly detection method provided in an embodiment of the present application;
[0065] Figure 2 A schematic diagram of a process of a noise reduction automatic encoding algorithm provided in an embodiment of the present application;
[0066] Figure 3 A schematic diagram of the structure of a noise reduction automatic encoder provided in an embodiment of the present application;
[0067] Figure 4 A schematic diagram of a process for obtaining a target isolation tree provided in an embodiment of the present application;
[0068] Figure 5 A schematic diagram of the structure of a data anomaly detection device provided in an embodiment of the present application;
[0069] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0070] The above drawings show clear embodiments of the present disclosure, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present disclosure to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0071] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0072] In the embodiments of the present application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In the text description of the present application, the character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0073] The technical solution provided by the embodiment of the present application can be applied to the anomaly detection scenario of high-dimensional data. In order to efficiently perform anomaly detection on massive high-dimensional data, the iForest algorithm is usually used in the prior art to calculate the path length between the high-dimensional data and the isolation tree in the isolation forest, and perform anomaly detection on the high-dimensional data based on the calculation results. However, when using the existing iForest algorithm to perform anomaly detection on high-dimensional data, since the high-dimensional data may contain a large number of noise dimensions or irrelevant dimensions, this will affect the construction of the isolation tree, making it impossible to effectively separate the abnormal points from the normal points in the high-dimensional data when performing anomaly detection on the high-dimensional data based on the path length between the high-dimensional data and the constructed isolation tree, resulting in poor detection performance.
[0074] In order to improve the detection performance, we can consider dimensionality reduction of high-dimensional features in high-dimensional data to extract deep implicit features and reduce the impact of irrelevant dimensional features. In addition, considering that the features of a single dimension cannot effectively separate abnormal points from normal points in high-dimensional data, we can combine the features of multiple dimensions for anomaly detection, thereby realizing anomaly detection of high dimensions.
[0075] Based on the above technical concept, an embodiment of the present application provides a data anomaly detection method. When performing anomaly detection on the data to be detected, the data to be detected can be first obtained; the data to be detected can be subjected to dimensionality reduction processing to extract multiple target deep implicit features corresponding to the data to be detected; and a target isolation tree can be obtained; wherein the target isolation tree is trained based on multiple sample deep implicit features corresponding to the sample data, and the multiple sample deep implicit features are the same as the multiple target deep implicit features; and then anomaly detection is performed on the data to be detected based on the path length between the data to be detected and the target isolation tree.
[0076] The data to be detected is high-dimensional data, which can be understood as data with a dimension greater than a certain threshold. The target deep implicit feature is a deep implicit feature obtained by integrating features based on multiple dimensions.
[0077] It should be noted that the multiple sample deep implicit features are the same as the multiple target deep implicit features. For example, assuming that the multiple sample deep implicit features include four deep implicit features A, B, C and D, the multiple target deep implicit features also include four deep implicit features A, B, C and D.
[0078] It can be seen that in the embodiment of the present application, when anomaly detection is performed on the data to be detected, dimensionality reduction is performed on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected, thereby reducing the influence of irrelevant dimensional features in the data to be detected; and a target isolation tree trained based on multiple sample deep implicit features corresponding to the sample data is obtained, and the multiple sample deep implicit features are the same as the multiple target deep implicit features; then, according to the path length between the data to be detected and the target isolation tree trained based on the multiple sample deep implicit features, anomaly detection is performed on the data to be detected. Compared with anomaly detection based on a single dimensional feature, anomaly points in the data to be detected can be effectively separated from normal points, thereby improving detection performance.
[0079] The data anomaly detection method provided by the present application will be described in detail below through specific embodiments. It is understandable that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0080] Figure 1 This is a flow chart of a data anomaly detection method provided in an embodiment of the present application. The data anomaly detection method can be executed by software and / or hardware devices. For example, the hardware device can be a data anomaly detection device, and the data anomaly detection device can be an electronic device. For example, see Figure 1 As shown, the data anomaly detection method may include:
[0081] S101, obtaining data to be detected.
[0082] Among them, the data to be detected is high-dimensional data.
[0083] For example, when obtaining the data to be detected, the data to be detected can be obtained locally or from other devices. The specific settings can be made according to actual needs. Here, the embodiments of the present application only take these two methods as examples for explanation.
[0084] After the data to be detected is obtained, in order to reduce the influence of irrelevant dimensional features in the data to be detected, the data to be detected may be first subjected to dimensionality reduction processing to extract multiple target deep implicit features corresponding to the data to be detected, that is, the following S102 is executed:
[0085] S102: Perform dimensionality reduction processing on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected.
[0086] For examples, see Figure 2 As shown, Figure 2 A process diagram of a denoising automatic encoding algorithm provided in an embodiment of the present application, when performing dimensionality reduction processing on the data to be detected to extract the target deep implicit features corresponding to the data to be detected, the denoising automatic encoding algorithm can be used to perform dimensionality reduction processing on the data to be detected to obtain the encoding result corresponding to the data to be detected; wherein the encoding result corresponding to the data to be detected is the target deep implicit features corresponding to the data to be detected, thereby obtaining multiple target deep implicit features.
[0087] It can be understood that in the embodiments of the present application, when extracting the deep implicit features of the target corresponding to the data to be detected, in addition to using the denoising auto-encoding algorithm, the Kurtosis algorithm, or principal component analysis (PCA), etc. can also be used. The specific settings can be made according to actual needs. Here, the embodiments of the present application only use the denoising auto-encoding algorithm to perform dimensionality reduction processing on the data to be detected to extract the deep implicit features of the target corresponding to the data to be detected as an example for explanation, but it does not mean that the embodiments of the present application are limited to this.
[0088] Taking the denoising auto-encoding algorithm as an example, when the denoising auto-encoding algorithm is used to reduce the dimension of the data to be detected, the denoising auto-encoder can be used to reduce the dimension of the data to be detected. In order to prevent overfitting, noise is usually added to the input data. In the embodiment of the present application, denoising can be performed by masking the data. The specific method is to set the input data to 0 at a certain ratio, which can be seen in Figure 3 As shown, Figure 3 A schematic diagram of the structure of a denoising auto-encoder provided in an embodiment of the present application, wherein the denoising auto-encoder uses a random mapping function Destroy the input data and generate q D Usually the values in the input data are set to 0 with a certain probability and The difference between the generated reconstruction y and the original input x is used as the reconstruction error, and the weight matrix and offset vector are iteratively updated to continuously train the denoising autoencoder. In this way, the values in the input data are set to 0 with a certain probability, which can mask some dimensional data and train the denoising autoencoder based on other dimensional data, which can effectively improve the generalization ability and robustness of the denoising autoencoder. The weight matrix of the encoding process in the denoising autoencoder can be denoted as W 1 , the weight matrix of the decoding process is recorded as W 2 , where W2 It is W 1 The encoding process can be seen in the following formula (1):
[0089]
[0090] In the above formula (1), b 1 is the offset vector, and the encoding process obtains the implicit feature vector h through the offset vector and the weight matrix.
[0091] The decoding process in the denoising autoencoder will restore the deep implicit feature vector into an output vector through the weight matrix and the offset vector, which is as close to the input vector as possible. The decoding process can be shown in the following formula (2):
[0092] y=g(W 2 h+b 2 ) (2)
[0093] In the above formula (2), b 2 is the offset vector of the decoding process, g and f represent the activation function.
[0094] When training the denoising autoencoder, the weight matrix and the offset vector can be adjusted by minimizing the loss function. Correspondingly, the formula of the denoising autoencoder loss function can be shown in the following formula (3):
[0095]
[0096] In the above formula (3), is a regular term, the purpose is to prevent overfitting, the first term is the error term, which represents the error between the input vector and the output vector.
[0097] The parameters are updated by the gradient descent method, and the partial derivatives of the function are calculated using the back propagation algorithm. In the process of training the denoising autoencoder, a set of random values close to 0 are first obtained by random sampling from a normal distribution to initialize the weight matrix W and the offset vector b, and the parameters are updated by the gradient descent method in the iterative process, as shown in the following formulas (4) and (5):
[0098]
[0099]
[0100] In this way, the fitting weight matrix W and the offset vector b are learned by repeatedly minimizing the loss function, and h is calculated through the weight matrix W and the offset vector b, as shown in formula (1), so as to obtain the denoising autoencoder. Then, based on the obtained denoising autoencoder, the dimensionality reduction processing is performed on the data to be detected to extract multiple deep implicit features of the target corresponding to the data to be detected.
[0101] When performing anomaly detection on the data to be detected, in addition to extracting multiple target deep implicit features corresponding to the data to be detected, it is also necessary to obtain a target isolation tree trained based on multiple sample deep implicit features corresponding to the sample data, that is, execute the following S103; in this way, anomaly detection can be performed on the data to be detected based on the path length between the data to be detected and the target isolation tree.
[0102] S103, obtaining a target isolation tree; wherein the target isolation tree is trained based on multiple sample deep implicit features corresponding to the sample data, and the multiple sample deep implicit features are the same as the multiple target deep implicit features.
[0103] It can be understood that, in the embodiment of the present application, obtaining the target isolation tree can be understood as the target isolation tree has been pre-trained before the technical solution of the present application is executed, and here only the pre-trained target isolation tree is obtained; it can also be that the target isolation tree has not been pre-trained before the technical solution of the present application is executed, and the target isolation tree is obtained by training here, and the specific setting can be made according to actual needs. In order to improve the efficiency of abnormal detection of the data to be detected, usually, the target isolation tree is pre-trained and stored locally or in the cloud, and here only the pre-trained target isolation tree is obtained from the local or cloud.
[0104] After the target isolation tree is obtained, anomaly detection can be performed on the data to be detected according to the path length between the data to be detected and the target isolation tree, that is, the following S104 is executed:
[0105] S104: Perform anomaly detection on the data to be detected according to the path length between the data to be detected and the target isolation tree.
[0106] Generally, when training a target isolation tree based on multiple sample deep implicit features corresponding to sample data, multiple sample sub-data are selected from the sample data, and each sample sub-data corresponds to its own target isolation tree, so the number of target isolation trees is multiple. Assuming that there are 10,000 sample data, 100 sample sub-data can be selected from the 10,000 sample data, and each sample sub-data can include 256 sample data. Based on the 256 sample data included in each sample sub-data, the target isolation tree corresponding to the sample sub-data will be trained, so that 100 target isolation trees corresponding to the 100 sample sub-data can be obtained.
[0107] Taking the case where there are multiple target isolation trees as an example, in an embodiment of the present application, when performing anomaly detection on the data to be detected based on the path length between the data to be detected and the target isolation tree, the path length between the data to be detected and each of the target isolation trees in the multiple target isolation trees can be calculated first to obtain multiple path lengths, and the average path length can be determined based on the obtained multiple path lengths; then, anomaly detection can be performed on the data to be detected based on the average path length.
[0108] For example, let the data to be detected x = {x 1 , x 2 , …, x n}, each data to be detected has a d-dimensional target deep implicit feature, that is, each data corresponds to {x 1 , x 2 , …, x d}. According to the path length between the data to be detected and the target isolation tree, the main process of anomaly detection on the data to be detected can be described as:
[0109] The forest of target isolation trees iForest(x,t,ψ)
[0110] Input: x->input data, t->number of target isolation trees, ψ->subsampling size
[0111] Output: t target isolation trees iTree
[0112] Initialize iForest and set the target isolation tree height L
[0113] for i to t do
[0114] x′←sample(x,ψ)
[0115] Forest←Forest∪iTree(x′,e,L,q,τ)
[0116] end for
[0117] return iForest
[0118] The specific process can be: first calculate the path length h(x) between the data to be detected x and each target isolation tree in each target isolation tree. Specifically, follow a target isolation tree iTree, starting from the root node to reach a leaf node. Assuming that the data falling on the leaf node in the data to be detected x is recorded as T.size, the path length h(x) between the data to be detected x and this target isolation tree can be expressed as h(x)=e+C(T.size).
[0119] Among them, e represents the number of edges that the detected data x passes through from the root node to the leaf node of the target isolation tree iTree, and C(T.size) is a correction value, which represents the average path length in a binary tree constructed with T.size sample data.
[0120] After respectively calculating the path length h(x) between the data to be detected x and each target isolation tree in each target isolation tree based on the above formula h(x)=e+C(T.size), the average path length is determined based on the obtained multiple path lengths. The average path length can be recorded as E(h(x)), that is, the average of the path lengths of the data to be detected x in multiple target isolation trees. After calculating the average of the path lengths of the data to be detected x in multiple target isolation trees, the abnormal score of the data to be detected x can be determined based on the average of the path lengths of the data to be detected x in multiple target isolation trees:
[0121]
[0122] Among them, score(x) represents the anomaly score of the data to be detected x, ψ represents the number of samples of the training sample data of a single target isolation tree, and C(ψ) represents the average path length of the binary tree constructed with ψ pieces of data, which is used for normalization processing; H(ψ-1) can be estimated by ln(ψ-1)+0.5772156649, where the constant is Euler's constant.
[0123] After determining the anomaly score of the data to be detected x, it is possible to further determine whether there is abnormal data in the data to be detected based on the anomaly score, thereby realizing anomaly detection of the data to be detected. For example, when the anomaly score is greater than or equal to a preset value, it can be determined that there is abnormal data in the data to be detected x; on the contrary, when the anomaly score is less than a preset value, it can be determined that there is no abnormal data in the data to be detected x, thereby realizing anomaly detection of the data to be detected. The preset value can be set according to actual needs.
[0124] It can be seen that in the embodiment of the present application, when anomaly detection is performed on the data to be detected, dimensionality reduction is performed on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected, thereby reducing the influence of irrelevant dimensional features in the data to be detected; and a target isolation tree trained based on multiple sample deep implicit features corresponding to the sample data is obtained, and the multiple sample deep implicit features are the same as the multiple target deep implicit features; then, according to the path length between the data to be detected and the target isolation tree trained based on the multiple sample deep implicit features, anomaly detection is performed on the data to be detected. Compared with anomaly detection based on a single dimensional feature, anomaly points in the data to be detected can be effectively separated from normal points, thereby improving detection performance.
[0125] Based on the above Figure 1 In the illustrated embodiment, when training to obtain a target isolation tree, a plurality of sample sub-data are usually selected from the sample data, and each sample sub-data will correspond to its own target isolation tree, so the number of target isolation trees is multiple. When training to obtain a target isolation tree, since the training acquisition method of each target isolation tree is similar, in order to avoid redundancy, how to obtain a target isolation tree can be described by taking the training to obtain a certain target isolation tree as an example. For example, when training to obtain a target isolation tree, a plurality of sample deep implicit features corresponding to the sample data can be first extracted, and the sample data can be segmented based on the plurality of sample deep implicit features, and a target segmentation hyperplane, i.e., the optimal segmentation hyperplane, is determined, and then the sample data is segmented based on the optimal segmentation hyperplane, thereby obtaining a target isolation tree.
[0126] Assume that a target isolation tree is trained. From the sample data X, a sample sub-data X′ with a size of ψ is randomly selected. For the training sample subset X′, with the goal of minimizing the dispersion of the two sub-datasets split by the segmentation hyperplane, a target segmentation hyperplane segmentation rule is proposed to determine the target segmentation hyperplane f.
[0127] The algorithm for training the target isolation tree can be shown as follows:
[0128] iTree(X′, e, L, q, τ)
[0129] Input: X'->input data, e->the height of the current spanning tree, L->the maximum height of the spanning tree, q->the number of features used in the splitting hyperplane, τ->the number of random splitting hyperplanes in each node;
[0130] Output: iTree
[0131] if(|X′|≤2ore≥L)then
[0132] return exNode{Size←|X′|}
[0133] else
[0134] f←For the deep implicit features of q samples, among the τ random segmentation hyperplanes, according to the target segmentation hyperplane rule, determine the target segmentation hyperplane f:
[0135] X l ←{x∈X′|f(x)<0}
[0136] X r ←{x∈X′|f(x)≥0}
[0137] return inNode{Left←iTree(X l,e+1,L,q,τ)
[0138] Right←iTree(X r ,e+1,L,q,τ)
[0139] SplitPlane←f}
[0140] end if
[0141] Below, we will explain in detail how to train and obtain the target isolation tree through a specific example. Figure 4 As shown, Figure 4 A schematic diagram of a process for obtaining a target isolation tree is provided in an embodiment of the present application. The method for obtaining a target isolation tree may include:
[0142] S401: Perform dimensionality reduction processing on the acquired sample data to extract multiple sample deep implicit features corresponding to the sample data.
[0143] For example, when performing dimensionality reduction processing on the acquired sample data, the acquired sample data can be subjected to dimensionality reduction processing by a denoising auto-encoding algorithm to extract multiple sample deep implicit features corresponding to the sample data; wherein, the encoding result corresponding to the sample data is the sample deep implicit feature, thereby obtaining multiple sample deep implicit features, and its specific implementation method is similar to the implementation method of performing dimensionality reduction processing on the data to be detected in the above S102 to extract multiple target deep implicit features corresponding to the data to be detected. Please refer to the relevant description of performing dimensionality reduction processing on the data to be detected in the above S102 to extract multiple target deep implicit features corresponding to the data to be detected, and the embodiments of the present application will not be repeated here.
[0144] It can be understood that in the embodiments of the present application, when extracting multiple sample deep implicit features corresponding to sample data, in addition to using the denoising auto-encoding algorithm, the Kurtosis algorithm, or principal component analysis (PCA), etc. can also be used. The specific settings can be made according to actual needs. Here, the embodiments of the present application only use the denoising auto-encoding algorithm to perform dimensionality reduction processing on the acquired sample data to extract multiple sample deep implicit features corresponding to the sample data as an example for explanation, but it does not mean that the embodiments of the present application are limited to this.
[0145] By performing dimensionality reduction processing on the acquired sample data, after extracting multiple sample deep implicit features corresponding to the sample data, the sample data can be segmented based on the multiple sample deep implicit features to determine the target segmentation hyperplane, that is, executing the following S402:
[0146] S402: Segment the sample data based on multiple sample deep implicit features to determine a target segmentation hyperplane.
[0147] For example, when the sample data is segmented based on multiple sample deep implicit features and a target segmentation hyperplane is determined, multiple groups of sample feature sets can be selected from the multiple sample deep implicit features; wherein each group of sample feature sets includes a preset number of sample deep implicit features; for each group of sample feature sets, a segmentation hyperplane corresponding to the sample feature set is determined according to the sample deep implicit features included in the sample feature set, and the sample data is segmented based on the segmentation hyperplane to obtain a first sample sub-data set and a second sample sub-data set; based on the multiple groups of first sample sub-data sets and second sample sub-data sets, a target segmentation hyperplane is determined.
[0148] Assume that the number of multiple sample deep implicit features is d, that is, the sample deep implicit features corresponding to the extracted sample data include d sample deep implicit features, and multiple groups of sample feature sets are selected from the d sample deep implicit features. Any sample feature set in the multiple groups of sample feature sets can be recorded as Q, and each sample feature set Q includes q sample deep implicit features. For each group of sample feature sets, the segmentation hyperplane corresponding to the group of sample feature sets can be determined according to the sample deep implicit features included in the group of sample feature sets, so as to obtain the segmentation hyperplane corresponding to each group of sample feature sets in the multiple groups of sample feature sets. It can be understood that in the embodiments of the present application, in view of the similarity of the method for obtaining the segmentation hyperplane corresponding to each group of sample feature sets, in the embodiments of the present application, in order to avoid redundancy, the segmentation hyperplane corresponding to any group of sample feature sets will be obtained as an example for explanation.
[0149] For example, when determining the segmentation hyperplane corresponding to the sample feature set based on the sample deep implicit features included in the sample feature set, the coefficients corresponding to each sample deep implicit feature in the sample feature set can be first determined respectively; for each sample deep implicit feature, the product between the coefficient corresponding to the sample deep implicit feature and the value of the sample deep implicit feature is determined, and the first ratio between the product and the standard deviation corresponding to the value of the sample deep implicit feature is calculated; then the sum of the first ratios corresponding to each sample deep implicit feature is determined; and based on the first difference between the sum and the preset segmentation value, the segmentation hyperplane corresponding to the sample feature set is determined.
[0150] Among them, the coefficient corresponding to each sample deep implicit feature can be recorded as w. Considering that the features of a single dimension cannot effectively separate the abnormal points from the normal points in the high-dimensional data, the features of multiple dimensions can be combined for anomaly detection. Therefore, according to the deep implicit features of the sample included in the sample feature set, the segmentation hyperplane corresponding to the sample feature set is determined, and a random segmentation hyperplane f that is not parallel to the original feature axis is introduced, which can be seen in the following formula (6):
[0151]
[0152] In the above formula (6), f represents the segmentation hyperplane corresponding to the sample feature set, i represents the deep implicit feature of the i-th sample included in the sample feature set Q, Q represents the sample feature set, and w i The coefficient corresponding to the deep implicit feature of the i-th sample is randomly selected from [-1,1]; X′ i is the value of the deep implicit feature of the i-th sample in X′, σ1 is the standard deviation corresponding to the value of the deep implicit feature of the sample; p is the segmentation point.
[0153] After determining the segmentation hyperplanes corresponding to each of the multiple sample feature sets through the above (6), the sample sub-data X′ can be segmented based on the segmentation hyperplanes corresponding to each of the sample feature sets, which can be expressed as: l ←{x∈X′|f(x)<0}, and X r ←{x∈X′|f(x)≥0}, so that the sample sub-data X′ can be divided into the first sample sub-dataset and the second sample sub-dataset. Thus, for any sample sub-data, there are multiple groups of first sample sub-datasets and second sample sub-datasets, and each group of first sample sub-datasets and second sample sub-datasets can be recorded as set X l and X r , X l ∪X r =X′. After obtaining multiple groups of first sample sub-data sets and second sample sub-data sets corresponding to the sample sub-data, the target segmentation hyperplane, ie, the optimal segmentation hyperplane, can be determined according to the multiple groups of first sample sub-data sets and second sample sub-data sets.
[0154] For example, when determining a target segmentation hyperplane based on multiple groups of first sample sub-datasets and second sample sub-datasets, for each group of first sample sub-datasets and second sample sub-datasets, determine the first sample sub-datasets and second sample sub-datasets, the first sample hyperplane data set and the second sample hyperplane data set on the corresponding segmentation hyperplane, respectively, and determine the discreteness change value corresponding to the segmentation hyperplane based on the first sample hyperplane data set and the second sample hyperplane data set, thereby obtaining the discreteness change values corresponding to multiple segmentation hyperplanes; then, based on the discreteness change values corresponding to the multiple segmentation hyperplanes, determine the target segmentation hyperplane among the multiple segmentation hyperplanes.
[0155] It can be understood that in the embodiment of the present application, for each group of first sample sub-datasets and second sample sub-datasets, when determining the discreteness change value corresponding to each segmentation hyperplane, the determination method is similar. In order to avoid redundancy, the discreteness change value corresponding to any segmentation hyperplane is used as an example for explanation. For example, when determining the discreteness change value corresponding to the segmentation hyperplane according to the first sample hyperplane data set and the second sample hyperplane data set, the average value between the first standard deviation corresponding to the first sample hyperplane data set and the second standard deviation corresponding to the second sample hyperplane data set can be first determined; and the standard deviation corresponding to the sample hyperplane data set of the sample data on the segmentation hyperplane is determined; then the second difference between the standard deviation and the average value is determined; and the second ratio of the second difference to the standard deviation is determined as the discreteness change value corresponding to the segmentation hyperplane.
[0156] Assume that a set of first sample sub-dataset and second sample sub-dataset are denoted as X l and X r , X l ∪X r =X′, where X l The sample data in can be recorded as x l , X r The sample data in can be recorded as x r , the first sample sub-dataset X l The first sample hyperplane data set on the corresponding segmentation hyperplane is denoted as Y l , the first sample sub-dataset X r The first sample hyperplane data set on the corresponding segmentation hyperplane is denoted as Y r , then the discreteness change value corresponding to the segmentation hyperplane can be determined by the following formula (7).
[0157]
[0158] In the above formula (7), DF decrease (Y) represents the discrete change value corresponding to the segmentation hyperplane, σ2(Y) represents the standard deviation of the sample hyperplane data set corresponding to the sample sub-data X′ on the segmentation hyperplane, avg(σ2(Y l ),σ2(Y r )) represents the average value between the first standard deviation corresponding to the first sample hyperplane data set and the second standard deviation corresponding to the second sample hyperplane data set, Y l Represents the first sample sub-dataset X l The first sample hyperplane data set on the corresponding splitting hyperplane, Y r Represents the first sample sub-dataset X rThe first sample hyperplane data set on the corresponding split hyperplane, Y represents the result of the sample sub-data X′ calculated on the split hyperplane f, and the split point p divides Y into Y l and Y r , where y l <p≤y r ,y l ∈Y l ,y r ∈Y r .
[0159] The discreteness change values corresponding to multiple splitting hyperplanes can be obtained through the above formula (7). When training the target isolation tree, multiple splitting hyperplanes will be randomly created in each splitting process of the target isolation tree iTree. When traversing each splitting hyperplane, all value spaces of the splitting point p are traversed. The splitting hyperplane splits Y to generate multiple Y l and Y r Combination, and then obtain the discreteness change values corresponding to the multiple segmentation hyperplanes. For example, according to the discreteness change values DF corresponding to the multiple segmentation hyperplanes decrease (Y), when determining the target segmentation hyperplane among multiple segmentation hyperplanes, due to DF decrease (Y) The corresponding segmentation point p is the best segmentation point of the current segmentation hyperplane. Therefore, when multiple segmentation hyperplanes are traversed, there are multiple best segmentation point sets and multiple DFs. decrease (Y) Maximum value set, DF decrease (Y) The random segmentation hyperplane corresponding to the maximum value in the set is the optimal segmentation hyperplane, that is, the segmentation hyperplane with the largest discreteness change value corresponding to each split can be determined from the multiple segmentation hyperplanes obtained in each split; and the segmentation hyperplane with the largest discreteness change value is determined as the target segmentation hyperplane.
[0160] After the target segmentation hyperplane is determined, the sample data can be segmented based on the target segmentation hyperplane to obtain a target isolation tree, that is, the following S403 is executed:
[0161] S403: Segment the sample data based on the target segmentation hyperplane to obtain a target isolation tree.
[0162] It can be seen that in the embodiment of the present application, when training to obtain the target isolation tree, the acquired sample data is first subjected to dimensionality reduction processing to extract multiple sample deep implicit features corresponding to the sample data; and the sample data is segmented based on the multiple sample deep implicit features to determine the target segmentation hyperplane; and then the sample data is segmented based on the target segmentation hyperplane to obtain the target isolation tree. In this way, the target isolation tree is trained with multiple sample deep implicit features, so that the data to be detected is subsequently subjected to anomaly detection based on the path length between the data to be detected and the target isolation tree obtained by training based on multiple sample deep implicit features. Compared with anomaly detection based on a single dimensional feature, the abnormal points in the data to be detected can be effectively separated from the normal points, thereby improving the detection performance.
[0163] Based on the above Figure 1 or Figure 4 The data anomaly detection method provided by the embodiment shown can further use an artificial thyroid data set to verify the detection results of the data anomaly detection method provided by the embodiment of the present application after anomaly detection is performed on the data to be detected. Assume that when extracting multiple target deep implicit features of the data to be detected, the input dimension of the data to be detected is noised by 10%, that is, the values of 2 dimensions in the data to be detected are randomly set to 0, the number of target deep implicit features is set to 10, and the encoding layer and the decoding layer are both 2 layers to construct a denoising autoencoder. Set the number of target isolation trees t to 100, and the subsampling size ψ to three groups of 256, 512 and 1024. The maximum height L of the generated target isolation tree is set to 8, the number of features q used by the segmentation hyperplane is set to 3, and the number of random segmentation hyperplanes is set to 10. The area under the ROC curve (Area Under Curve, AUC) results obtained by the data anomaly detection method provided by the embodiment of the present application and the existing iForest method can be seen in the following Table 1:
[0164] Table 1
[0165]
[0166] It can be seen from Table 1 that the data anomaly detection method provided in the embodiment of the present application uses deep implicit features of the target to create multiple target isolation trees, and combines multiple deep implicit features to establish a target segmentation hyperplane, which can better isolate the data to be detected and has higher anomaly detection performance than the iForest algorithm provided by the prior art.
[0167] Figure 5 This is a structural diagram of a data anomaly detection device 50 provided in an embodiment of the present application. For example, see Figure 5 As shown, the data anomaly detection device 50 may include:
[0168] The acquisition unit 501 is used to acquire the data to be detected.
[0169] The processing unit 502 is used to perform dimensionality reduction processing on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected.
[0170] The acquisition unit 501 is also used to acquire a target isolation tree; wherein the target isolation tree is trained based on multiple sample deep implicit features corresponding to the sample data, and the multiple sample deep implicit features are the same as the multiple target deep implicit features.
[0171] The processing unit 502 is further configured to perform anomaly detection on the data to be detected according to the path length between the data to be detected and the target isolation tree.
[0172] Optionally, there are multiple target isolation trees; the processing unit 502 is specifically used to determine the average path length according to the path length between the data to be detected and each target isolation tree in the multiple target isolation trees; and perform anomaly detection on the data to be detected according to the average path length.
[0173] Optionally, the acquisition unit 501 is specifically used to perform dimensionality reduction processing on the acquired sample data to extract multiple sample deep implicit features corresponding to the sample data; and segment the sample data based on the multiple sample deep implicit features to determine the target segmentation hyperplane; and then segment the sample data based on the target segmentation hyperplane to obtain a target isolation tree.
[0174] Optionally, the acquisition unit 501 is specifically used to select multiple groups of sample feature sets from multiple sample deep implicit features, respectively; wherein each group of sample feature sets includes a preset number of sample deep implicit features; for each group of sample feature sets, according to the sample deep implicit features included in the sample feature set, determine the segmentation hyperplane corresponding to the sample feature set, and segment the sample data based on the segmentation hyperplane to obtain a first sample sub-data set and a second sample sub-data set; based on the multiple groups of first sample sub-data sets and second sample sub-data sets, determine the target segmentation hyperplane.
[0175] Optionally, the acquisition unit 501 is specifically used to determine the coefficients corresponding to each sample deep implicit feature included in the sample deep implicit features included in the sample feature set; for each sample deep implicit feature, determine the product between the coefficient corresponding to the sample deep implicit feature and the value of the sample deep implicit feature, and calculate the first ratio between the product and the standard deviation corresponding to the value of the sample deep implicit feature; determine the segmentation hyperplane corresponding to the sample feature set according to the first ratio corresponding to each sample deep implicit feature.
[0176] Optionally, the acquisition unit 501 is specifically used to determine the sum of the first ratios corresponding to the deep implicit features of each sample; and determine the segmentation hyperplane corresponding to the sample feature set according to a first difference between the sum and a preset segmentation value.
[0177] Optionally, the acquisition unit 501 is specifically used to determine, for each group of first sample sub-datasets and second sample sub-datasets, the first sample hyperplane data set and the second sample hyperplane data set on the corresponding segmentation hyperplane, respectively, and determine the discreteness change value corresponding to the segmentation hyperplane based on the first sample hyperplane data set and the second sample hyperplane data set; determine the target segmentation hyperplane among the multiple segmentation hyperplanes based on the discreteness change values corresponding to the multiple segmentation hyperplanes.
[0178] Optionally, the acquisition unit 501 is specifically used to determine the average value between a first standard deviation corresponding to the first sample hyperplane data set and a second standard deviation corresponding to the second sample hyperplane data set; and determine the standard deviation corresponding to the sample hyperplane data set of the sample data on the splitting hyperplane; and then determine the discreteness change value corresponding to the splitting hyperplane based on the standard deviation and the average value.
[0179] Optionally, the acquisition unit 501 is specifically configured to determine a second difference between the standard deviation and the average value; and determine a second ratio of the second difference to the standard deviation as a discreteness change value corresponding to the segmentation hyperplane.
[0180] Optionally, the acquisition unit 501 is specifically used to determine a segmentation hyperplane with the largest discreteness change value among multiple segmentation hyperplanes according to discreteness change values corresponding to multiple segmentation hyperplanes; and determine the segmentation hyperplane with the largest discreteness change value as the target segmentation hyperplane.
[0181] Optionally, the processing unit 502 is specifically used to perform dimensionality reduction processing on the data to be detected through a denoising automatic encoding algorithm to obtain an encoding result corresponding to the data to be detected; wherein the encoding result corresponding to the data to be detected is a plurality of target deep implicit features.
[0182] The data anomaly detection device 50 provided in the embodiment of the present application can execute the technical solution of the data anomaly detection method in any of the above-mentioned embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the data anomaly detection method. Please refer to the implementation principle and beneficial effects of the data anomaly detection method, which will not be repeated here.
[0183] Figure 6 This is a schematic diagram of the structure of an electronic device 60 provided in an embodiment of the present application. For example, see Figure 6 As shown, the electronic device 60 may include a processor 601 and a memory 602; wherein,
[0184] The memory 602 is used to store computer programs.
[0185] The processor 601 is used to read the computer program stored in the memory 602 and execute the technical solution of the data anomaly detection method in any of the above embodiments according to the computer program in the memory 602.
[0186] Optionally, the memory 602 may be independent or integrated with the processor 601. When the memory 602 is a device independent of the processor 601, the electronic device 60 may further include: a bus for connecting the memory 602 and the processor 601.
[0187] Optionally, this embodiment further includes: a communication interface, which can be connected to the processor 601 through a bus. The processor 601 can control the communication interface to implement the acquisition and transmission functions of the electronic device 60.
[0188] The electronic device 60 shown in the embodiment of the present application can execute the technical solution of the data anomaly detection method in any of the above embodiments, and its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the data anomaly detection method. Please refer to the implementation principle and beneficial effects of the data anomaly detection method, and no further details will be given here.
[0189] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When a processor executes the computer-executable instructions, the technical solution of the data anomaly detection method in any of the above embodiments is implemented. Its implementation principle and beneficial effects are similar to those of the data anomaly detection method. Please refer to the implementation principle and beneficial effects of the data anomaly detection method, which will not be repeated here.
[0190] An embodiment of the present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the technical solution of the data anomaly detection method in any of the above embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the data anomaly detection method. Please refer to the implementation principle and beneficial effects of the data anomaly detection method, which will not be repeated here.
[0191] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0193] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of various embodiments of the present application.
[0194] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0195] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0196] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0197] The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium may be any available medium that can be accessed by a general or special purpose computer.
[0198] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data anomaly detection method, It is characterized in that include: Obtain the data to be tested; Performing dimensionality reduction processing on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected; Obtain a target isolation tree; wherein the target isolation tree is trained based on multiple sample deep implicit features corresponding to the sample data, and the multiple sample deep implicit features are the same as the multiple target deep implicit features, and the target isolation tree is obtained by segmenting the sample data using a target segmentation hyperplane; Performing anomaly detection on the data to be detected according to the path length between the data to be detected and the target isolation tree; Acquiring the target segmentation plane includes: Respectively determine the coefficient corresponding to each sample deep implicit feature in the sample deep implicit feature included in the sample feature set, wherein the sample feature set includes a preset number of sample deep implicit features; For each of the sample deep implicit features, determine the product of the coefficient corresponding to the sample deep implicit feature and the value of the sample deep implicit feature, and calculate a first ratio between the product and the standard deviation corresponding to the value of the sample deep implicit feature; Determining a segmentation hyperplane corresponding to the sample feature set according to a first ratio corresponding to the deep implicit feature of each sample; The sample data is segmented based on the segmentation hyperplane to determine the target segmentation hyperplane.
2. The method according to claim 1, It is characterized in that The number of the target isolation trees is multiple, and the abnormality detection of the data to be detected according to the path length between the data to be detected and the target isolation tree includes: Determining an average path length according to the path length between the data to be detected and each target isolation tree in the plurality of target isolation trees; Anomaly detection is performed on the data to be detected according to the average path length.
3. The method according to claim 1 or 2, It is characterized in that Before obtaining the target segmentation plane, the method further includes: The acquired sample data is subjected to dimensionality reduction processing to extract a plurality of sample deep implicit features corresponding to the sample data.
4. The method according to claim 3, It is characterized in that After extracting a plurality of sample deep implicit features corresponding to the sample data, the method further includes: Selecting a plurality of sample feature sets from the plurality of sample deep implicit features respectively; Accordingly, segmenting the sample data based on the segmentation hyperplane to determine the target segmentation hyperplane includes: Segmenting the sample data based on the segmentation hyperplane to obtain a first sample sub-dataset and a second sample sub-dataset; The target segmentation hyperplane is determined according to the multiple groups of first sample sub-data sets and second sample sub-data sets.
5. The method according to claim 1, It is characterized in that The step of determining the segmentation hyperplane corresponding to the sample feature set according to the first ratio corresponding to the deep implicit feature of each sample includes: Determine the sum of the first ratios corresponding to the deep implicit features of each sample; According to a first difference between the sum and a preset segmentation value, a segmentation hyperplane corresponding to the sample feature set is determined.
6. The method according to claim 3, It is characterized in that The step of determining the target segmentation hyperplane according to the plurality of groups of first sample sub-data sets and second sample sub-data sets comprises: For each group of the first sample sub-dataset and the second sample sub-dataset, determine the first sample sub-dataset and the second sample sub-dataset, respectively, the first sample hyperplane data set and the second sample hyperplane data set on the corresponding segmentation hyperplane, and determine the discreteness change value corresponding to the segmentation hyperplane according to the first sample hyperplane data set and the second sample hyperplane data set; The target segmentation hyperplane is determined from among the multiple segmentation hyperplanes according to the discreteness change values corresponding to the multiple segmentation hyperplanes.
7. The method according to claim 6, It is characterized in that The step of determining the discreteness change value corresponding to the segmentation hyperplane according to the first sample hyperplane data set and the second sample hyperplane data set includes: Determine an average value between a first standard deviation corresponding to the first sample hyperplane data set and a second standard deviation corresponding to the second sample hyperplane data set; Determine the standard deviation of the sample hyperplane data set corresponding to the sample data on the segmentation hyperplane; A discreteness change value corresponding to the segmentation hyperplane is determined according to the standard deviation and the average value.
8. The method according to claim 7, It is characterized in that The step of determining the discreteness change value corresponding to the segmentation hyperplane according to the standard deviation and the average value includes: determining a second difference between the standard deviation and the mean; A second ratio of the second difference to the standard deviation is determined as a discreteness change value corresponding to the segmentation hyperplane.
9. The method according to claim 6, It is characterized in that The step of determining the target segmentation hyperplane from among the multiple segmentation hyperplanes according to the discreteness change values corresponding to the multiple segmentation hyperplanes includes: According to the discreteness change values corresponding to the multiple segmentation hyperplanes, determining the segmentation hyperplane with the largest discreteness change value among the multiple segmentation hyperplanes; The segmentation hyperplane with the largest discreteness change value is determined as the target segmentation hyperplane.
10. The method according to claim 1 or 2, It is characterized in that The dimensionality reduction processing is performed on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected, including: The data to be detected is subjected to dimensionality reduction processing by a denoising automatic encoding algorithm to obtain an encoding result corresponding to the data to be detected; wherein the encoding result corresponding to the data to be detected is the multiple target deep implicit features.
11. A data anomaly detection device, It is characterized in that include: An acquisition unit, used for acquiring data to be detected; A processing unit, used for performing dimensionality reduction processing on the data to be detected to extract multiple target deep implicit features corresponding to the data to be detected; The acquisition unit is further used to acquire a target isolation tree; wherein the target isolation tree is trained based on a plurality of sample deep implicit features corresponding to the sample data, and the plurality of sample deep implicit features are the same as the plurality of target deep implicit features, and the target isolation tree is obtained by segmenting the sample data using a target segmentation hyperplane; The processing unit is further used to perform anomaly detection on the data to be detected according to the path length between the data to be detected and the target isolation tree; The acquisition unit is specifically used for: Respectively determine the coefficient corresponding to each sample deep implicit feature in the sample deep implicit feature included in the sample feature set, wherein the sample feature set includes a preset number of sample deep implicit features; For each of the sample deep implicit features, determine the product of the coefficient corresponding to the sample deep implicit feature and the value of the sample deep implicit feature, and calculate a first ratio between the product and the standard deviation corresponding to the value of the sample deep implicit feature; Determining a segmentation hyperplane corresponding to the sample feature set according to a first ratio corresponding to the deep implicit feature of each sample; The sample data is segmented based on the segmentation hyperplane to determine the target segmentation hyperplane.
12. An electronic device, It is characterized in that comprising a processor and a memory; wherein, The memory is used to store computer programs; The processor is used to read the computer program stored in the memory and execute the data anomaly detection method according to any one of claims 1 to 10 according to the computer program in the memory.
13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the data anomaly detection method described in any one of claims 1 to 10 is implemented.
14. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the data anomaly detection method described in any one of claims 1 to 10 is implemented.
