A method and device for detecting data anomaly

Through the VAE-GAN model, the historical operation and maintenance data is trained, and the reconstruction error is used to identify operation and maintenance data abnormalities, which solves the problem of low accuracy in operation and maintenance data detection, realizes real-time automatic detection of multi-dimensional operation and maintenance indicators, and improves detection Accuracy and efficiency.

CN114297936BActive Publication Date: 2024-11-05WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111660188.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-11-05
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

The operation and maintenance data abnormal detection accuracy of the application examples in the prior art is low, which cannot meet the high requirements for real-time and reliability in the financial technology field. Especially in the multi-dimensional operation and maintenance timing indicator detection, the accuracy of artificial abnormality is low and maintenance is maintained. High cost.

Method used

Using the VAE-GAN model to train historical normal operation and maintenance data, reconstruct errors to identify abnormal indicators in operation and maintenance data, real-time automatic detection of multi-dimensional operation and maintenance indicators, avoid misjudgment caused by abnormal single-dimensional indicators, and pass Root cause analysis improves the objectivity of detection.

Benefits of technology

It improves the accuracy and efficiency of abnormal detection of operation and maintenance data, reduces human intervention and waste of computing resources, and is suitable for large-scale time series abnormal detection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297936B_ABST
    Figure CN114297936B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a data anomaly detection method and device, the method includes obtaining the original operation and maintenance data at the current moment; the original operation and maintenance data includes data of multiple operation and maintenance indicators, the original operation and maintenance data is input into the anomaly detection model, and the reconstructed data corresponding to the original operation and maintenance data is obtained; the anomaly detection model is obtained by training the VAE-GAN model based on the historical normal operation and maintenance data, and then the reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data is calculated; according to the reconstruction error, the abnormal indicators in the original operation and maintenance data are determined. In this way, it is possible to use a model to detect multi-dimensional operation and maintenance indicators, and identify the abnormal indicators in the original operation and maintenance data in real time, thereby avoiding the problem of judging the application instance as abnormal based on the abnormality of only one dimensional indicator, and further improving the accuracy of the anomaly detection of the original operation and maintenance data of the application instance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of financial technology (Finteh), and in particular, to a data anomaly detection method and device. Background Art

[0002] With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually transforming to financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.

[0003] With the rise of microservice applications and the development of distributed architecture, the scale of subsystems and the complexity of system calls are constantly increasing. At present, the maintenance cost of application instances in the field of IT operation and maintenance is getting higher and higher, and one of the core issues of application instance operation and maintenance is to pay attention to whether the various indicators of the operation and maintenance data of the application instance are abnormal. The monitoring data of application instance operation and maintenance indicators can be mainly divided into host performance indicators (such as central processing unit (CPU), memory (MEM), disk (DISK), Java Virtual Machine (JVM), input output (IO), etc.) and key business indicators (such as business interface transaction volume, time consumption and success rate). These indicators are typical time series data, which can characterize whether the application instance itself and the applications carried on the application instance are running well.

[0004] The existing application instance-level anomaly detection is to horizontally separate the multi-dimensional operation and maintenance time series indicators, convert them into multiple single-dimensional time series, and use the algorithms in the field of single-dimensional time series to detect anomalies. When each dimension in the multi-dimensional sequence is regarded as an independent unit, anomaly analysis is mainly performed on this unit, while the system operation and health status are often determined by a series of indicators. The indicators are not independent of each other. It is unreasonable to judge the entire application instance as abnormal just because a certain dimension indicator is abnormal. At the same time, for different types of time series, operation and maintenance personnel need to configure and use different models based on long-term experience, and the maintenance cost is relatively high. It is not suitable for large-scale time series anomaly detection scenarios. As the system becomes larger, the number of monitoring indicators grows exponentially. Although the visualization cost of the operation and maintenance indicator sequence is low, the meaning of a single dimension is clear, and the numerical change rules are obvious, the manual setting of alarm rules by operation and maintenance personnel has a low detection dimension and low accuracy in manually determining anomalies, which can no longer meet the requirements of rapid iteration of product applications and providing reliable and efficient services.

[0005] Therefore, there is an urgent need for a data anomaly detection method to solve the problem of low accuracy in anomaly detection of original operation and maintenance data of application instances in the prior art. Summary of the invention

[0006] The embodiments of the present invention provide a data anomaly detection method and device to solve the problem of low accuracy in anomaly detection of original operation and maintenance data of application instances existing in the prior art.

[0007] In a first aspect, an embodiment of the present invention provides a data anomaly detection method, comprising:

[0008] Obtain the original operation and maintenance data at the current moment; the original operation and maintenance data includes data of multiple operation and maintenance indicators;

[0009] Inputting the original operation and maintenance data into an anomaly detection model to obtain reconstructed data corresponding to the original operation and maintenance data; the anomaly detection model is obtained by training a VAE-GAN model based on historical normal operation and maintenance data;

[0010] Calculating a reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data;

[0011] According to the reconstruction error, an abnormal indicator in the original operation and maintenance data is determined.

[0012] In the above technical scheme, by inputting the original operation and maintenance data of multiple operation and maintenance indicators at the current moment into a preset anomaly detection model, reconstructed data corresponding to the original operation and maintenance data is obtained, and then the abnormal indicators in the original operation and maintenance data are determined according to the reconstruction error between the calculated reconstructed data and the original operation and maintenance data. This can realize the use of one model to detect multi-dimensional operation and maintenance indicators, and automatically identify the abnormal indicators in the original operation and maintenance data in real time, rather than using different models for different operation and maintenance indicators for anomaly detection. This can avoid the problem of judging that the application instance is abnormal based on the abnormality of an indicator in one dimension, thereby improving the accuracy of anomaly detection of the original operation and maintenance data of the application instance.

[0013] Optionally, determining the abnormal indicators in the original operation and maintenance data based on the reconstruction error includes: if the reconstruction error is greater than or equal to an error threshold, determining that the original operation and maintenance data is abnormal; determining the abnormal indicators in the original operation and maintenance data based on the reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data.

[0014] In the above technical solution, based on the size of the reconstruction error between the original operation and maintenance data and the reconstructed data and the error threshold, it is possible to quickly determine whether the original operation and maintenance data is abnormal. When it is determined that the original operation and maintenance data is abnormal, the root cause analysis is continued, which can avoid wasting computing resources when the original operation and maintenance data is normal.

[0015] Optionally, determining the abnormal indicators in the original operation and maintenance data based on a reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data includes: calculating the reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data, to obtain multiple reconstruction errors corresponding to the multiple operation and maintenance indicators; and determining the operation and maintenance indicators corresponding to M maximum values ​​among the multiple reconstruction errors corresponding to the multiple operation and maintenance indicators as abnormal indicators, where M is a positive integer.

[0016] In the above technical solution, during the root cause analysis, the dimensional indicators corresponding to the M maximum values ​​are found from the reconstruction errors corresponding to the multi-dimensional indicators, and are located as the root causes of the fault, instead of using the reconstruction error as the criterion for judging the indicator abnormality, so that the root cause analysis results are more objective.

[0017] Optionally, calculating the reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data includes: determining the sum of multiple reconstruction errors corresponding to the multiple operation and maintenance indicators as the reconstruction error between the reconstructed data and the original operation and maintenance data.

[0018] Optionally, before inputting the original operation and maintenance data into the anomaly detection model, the method further includes:

[0019] Obtain offline historical operation and maintenance data;

[0020] The historical operation and maintenance data is used as input to construct a VAE-GAN model, and the VAE-GAN model is unsupervisedly trained with the minimum value of the loss function of the VAE-GAN model as the optimization target to obtain the anomaly detection model;

[0021] The VAE-GAN model includes a VAE network and a GAN network. The VAE network includes an encoder and a decoder. The encoder is used to output a variational distribution. The decoder is used to output the posterior probability distribution p θ (z); The GAN network is used to constrain the variational distribution of the encoder output With the posterior probability distribution p θ The KL divergence between (z) is minimized, and the reconstruction error between the reconstructed data outputted by the constrained decoder and the historical operation and maintenance data is minimized.

[0022] In the above technical solution, the VAE-GAN model is trained through offline historical operation and maintenance data to provide support for the real-time recognition of the preset classification strategy model. GAN is introduced into VAE, focusing on the hidden layer output distribution q(z) of the VAE discriminant module and the reconstructed output W′ of the generation module. xt The important features of E Constrain the intermediate output of the variational autoencoder (i.e., the distribution output) to improve the robustness of the reconstruction, reduce the overfitting effect of the reconstruction, and improve the operating efficiency and accuracy of the prediction engine; use the discriminator D D Reconstructed output W′ of the constrained variational autoencoder xt Closer to the input to learn the distribution of the input data.

[0023] Optionally, the constructing a VAE-GAN model using the historical operation and maintenance data as input includes:

[0024] According to the likelihood function of historical operation and maintenance data, the posterior probability distribution p is estimated by maximizing the log-likelihood function. θ The parameter θ of (z|x);

[0025] According to the following formula (1) and formula (2), the variational distribution is calculated With the posterior probability distribution p θ The minimum KL divergence between (z|x) is converted to find the parameters Maximize the value of the variational evidence lower bound:

[0026]

[0027]

[0028] in, is the variational distribution With the posterior probability distribution p θ The KL divergence between (z|x), is the variational evidence lower bound;

[0029] The decoder of the VAN network is constructed according to the parameter θ, and the decoder of the VAN network is constructed according to the parameter Construct the encoder of VAN network;

[0030] A distribution-constrained GAN discriminator is added to the output end of the encoder of the VAN network, and an output-constrained GAN discriminator is added to the output end of the encoder of the VAN to obtain a VAE-GAN model; wherein the distribution-constrained GAN discriminator is used to discriminate the variational distribution With the posterior probability distribution p θ(z|x) is close; the output constrained GAN discriminator is used to determine whether the reconstructed data output by the decoder is close to the historical operation and maintenance data.

[0031] Optionally, unsupervised training is performed on the VAE-GAN model with the minimum value of the loss function of the VAE-GAN model as an optimization target to obtain the anomaly detection model, including:

[0032] Determine the loss function of the GAN discriminator based on distribution constraints in the VAE-GAN model:

[0033]

[0034] Among them, y is random noise, p(y) is the low-dimensional noise distribution, x is the real sample, p(x) is the real sample distribution, D E (z) represents the probability that the input sample is a real sample, D E (G E (x)) represents the probability that the sample with the output of the encoder as input is a real sample;

[0035] Determine the loss function of the generator equivalent to the encoder in the VAE-GAN model:

[0036]

[0037] Among them, x is the real sample, p(x) is the real sample distribution, D E (G E (x)) represents the probability that the sample with the output of the encoder as input is a real sample;

[0038] The loss function of the GAN discriminator with the distribution constraint and the loss function of the generator equivalent to the decoder are minimized to constrain the variational distribution of the encoder output. With the posterior probability distribution p θ (z) The KL divergence between them is minimal, and the VAE-GAN model is continuously optimized;

[0039] Determine the loss function of the GAN discriminator based on the output constraint in the VAE-GAN model:

[0040]

[0041] Among them, x is the real sample, p(x) is the real sample distribution, Indicates the probability that the input sample is a true sample, Indicates the probability that the sample with the output of the decoder as input is a real sample;

[0042] Determine the loss function of the generator equivalent to the decoder:

[0043]

[0044] Among them, x is the real sample, p(x) is the real sample distribution, Indicates the probability that the sample with the output of the decoder as input is a real sample;

[0045] With the minimum value of the loss function of the output-constrained GAN discriminator and the loss function of the encoder-equivalent generator as the target, the reconstruction error between the reconstructed data output by the constraint decoder and the historical operation and maintenance data is minimized.

[0046] In a second aspect, an embodiment of the present invention further provides an abnormal data detection device, comprising:

[0047] An acquisition unit is used to acquire the original operation and maintenance data at the current moment; the original operation and maintenance data includes data of multiple operation and maintenance indicators;

[0048] A processing unit is used to input the original operation and maintenance data into an anomaly detection model to obtain reconstructed data corresponding to the original operation and maintenance data; calculate a reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data; and determine an abnormality indicator in the original operation and maintenance data based on the reconstruction error; the anomaly detection model is obtained by training a VAE-GAN model based on historical normal operation and maintenance data.

[0049] Optionally, the processing unit is specifically used to: determine that the original operation and maintenance data is abnormal if the reconstruction error is greater than or equal to an error threshold; and determine the abnormal indicator in the original operation and maintenance data based on the reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data.

[0050] Optionally, the processing unit is specifically used to: calculate the reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data, to obtain multiple reconstruction errors corresponding to the multiple operation and maintenance indicators; determine the operation and maintenance indicators corresponding to M maximum values ​​among the multiple reconstruction errors corresponding to the multiple operation and maintenance indicators as abnormal indicators, where M is a positive integer.

[0051] Optionally, the processing unit is further used to: determine the sum of multiple reconstruction errors corresponding to the multiple operation and maintenance indicators as the reconstruction error between the reconstructed data and the original operation and maintenance data.

[0052] Optionally, the acquisition unit is further used to: acquire offline historical operation and maintenance data; the processing unit is further used to: construct a VAE-GAN model using the historical operation and maintenance data as input, and perform unsupervised training on the VAE-GAN model with the minimum value of the loss function of the VAE-GAN model as the optimization target to obtain the anomaly detection model;

[0053] The VAE-GAN model includes a VAE network and a GAN network. The VAE network includes an encoder and a decoder. The encoder is used to output a variational distribution. The decoder is used to output the posterior probability distribution p θ (z|x); The GAN network is used to constrain the variational distribution of the encoder output With the posterior probability distribution p θ The KL divergence between (z|x) is minimized, and the reconstruction error between the reconstructed data outputted by the constrained decoder and the historical operation and maintenance data is minimized.

[0054] Optionally, the processing unit is specifically configured to:

[0055] According to the likelihood function of historical operation and maintenance data, the posterior probability distribution p is estimated by maximizing the log-likelihood function. θ (z) parameter θ;

[0056] According to the following formula (1) and formula (2), the variational distribution is calculated With the posterior probability distribution p θ The minimum KL divergence between (z|x) is converted to find the parameters Maximize the value of the variational evidence lower bound:

[0057]

[0058]

[0059] in, is the variational distribution With the posterior probability distribution p θ The KL divergence between (z|x), is the variational evidence lower bound;

[0060] The decoder of the VAN network is constructed according to the parameter θ, and the decoder of the VAN network is constructed according to the parameter Construct the encoder of VAN network;

[0061] A distribution-constrained GAN discriminator is added to the output end of the encoder of the VAN network, and an output-constrained GAN discriminator is added to the output end of the encoder of the VAN to obtain a VAE-GAN model; wherein the distribution-constrained GAN discriminator is used to discriminate the variational distribution With the posterior probability distribution p θ (z|x) is close; the output constrained GAN discriminator is used to determine whether the reconstructed data output by the decoder is close to the historical operation and maintenance data.

[0062] Optionally, the processing unit is specifically configured to:

[0063] Determine the loss function of the GAN discriminator based on distribution constraints in the VAE-GAN model:

[0064]

[0065] Among them, y is random noise, p(y) is the low-dimensional noise distribution, x is the real sample, p(x) is the real sample distribution, D E (z) represents the probability that the input sample is a real sample, D E (G E (x)) represents the probability that the sample with the output of the encoder as input is a real sample;

[0066] Determine the loss function of the generator equivalent to the encoder in the VAE-GAN model:

[0067]

[0068] Among them, x is the real sample, p(x) is the real sample distribution, D E (G E (x)) represents the probability that the sample with the output of the encoder as input is a real sample;

[0069] The loss function of the GAN discriminator with the distribution constraint and the loss function of the generator equivalent to the decoder are minimized to constrain the variational distribution of the encoder output. With the posterior probability distribution p θ (z) The KL divergence between them is minimal, and the VAE-GAN model is continuously optimized;

[0070] Determine the loss function of the GAN discriminator based on the output constraint in the VAE-GAN model:

[0071]

[0072] Among them, x is the real sample, p(x) is the real sample distribution, Indicates the probability that the input sample is a true sample, Indicates the probability that the sample with the output of the decoder as input is a real sample;

[0073] Determine the loss function of the generator equivalent to the decoder:

[0074]

[0075] Among them, x is the real sample, p(x) is the real sample distribution, Indicates the probability that the sample with the output of the decoder as input is a real sample;

[0076] With the minimum value of the loss function of the output-constrained GAN discriminator and the loss function of the encoder-equivalent generator as the target, the reconstruction error between the reconstructed data output by the constraint decoder and the historical operation and maintenance data is minimized.

[0077] In a third aspect, an embodiment of the present invention provides a computing device, including:

[0078] A memory for storing program instructions;

[0079] The processor is used to call the program instructions stored in the memory and execute the data anomaly detection method according to the obtained program.

[0080] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a data anomaly detection method. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0082] Figure 1 A schematic diagram of a system architecture provided by an embodiment of the present invention;

[0083] Figure 2 A flowchart of a data anomaly detection method provided by an embodiment of the present invention;

[0084] Figure 3 A flowchart of a data anomaly detection method provided by an embodiment of the present invention;

[0085] Figure 4 A schematic diagram of the basic framework of VAE provided by an embodiment of the present invention;

[0086] Figure 5 A schematic diagram of a specific VAE network structure provided by an embodiment of the present invention;

[0087] Figure 6A schematic diagram of constructing a VAE using heavy parameters provided by an embodiment of the present invention;

[0088] Figure 7 A schematic diagram of the GAN model structure provided by an embodiment of the present invention;

[0089] Figure 8 A schematic diagram of the structure of a multidimensional anomaly detection model provided by an embodiment of the present invention;

[0090] Fig. 9 A schematic diagram of the structure of an abnormal data detection device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0091] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.

[0092] Figure 1 A system architecture is provided for an embodiment of the present invention. Figure 1 As shown, the system architecture may be a server 100 , including a processor 110 , a communication interface 120 , and a memory 130 .

[0093] The communication interface 120 is used to communicate with the terminal device, send and receive information transmitted by the terminal device, and realize communication.

[0094] The processor 110 is the control center of the server 100, and uses various interfaces and lines to connect various parts of the entire server 100, and executes various functions of the server 100 and processes data by running or executing software programs and / or modules stored in the memory 130, and calling data stored in the memory 130. Optionally, the processor 110 may include one or more processing units.

[0095] The memory 130 can be used to store software programs and modules. The processor 110 executes various functional applications and data processing by running the software programs and modules stored in the memory 130. The memory 130 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store operation and maintenance data of an application instance, etc. In addition, the memory 130 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0096] It should be noted that the above Figure 1 The structure shown is only an example and is not limited to this embodiment of the present invention.

[0097] The following is an explanation of the terms involved in the present invention.

[0098] Variational Auto-encoder (VAE) is an important deep generative model in the field of probability statistics and machine learning. Its idea is to use neural networks to model two complex conditional probability density functions respectively. Variational autoencoder is an improvement based on autoencoder, which is divided into two models: encoder and decoder. The encoder maps the input samples into low-dimensional multivariate Gaussian distributions that are independent of each other in different dimensions, learns the implicit features of the input data, and generates a latent space layer. The decoder reconstructs the original input data using the implicit features learned by the encoder. The difference between the original input vector and the reconstructed vector is called the reconstruction error, and VAE will continuously learn to minimize the reconstruction error.

[0099] Generative Adversarial Networks (GAN) are implicit density generation models for unsupervised learning on complex distributions. The output is generated by the mutual game learning between the generative model and the discriminative model. The discriminator and the generator are trained in turn to compete with each other and sample from complex probability distributions, so that the samples generated by the generative network obey the distribution of real data. The discriminative network aims to judge as accurately as possible whether a sample comes from real data or is generated by the generative network; the generative network aims to generate samples that the discriminative network cannot accurately distinguish the source of. By continuously alternating the training of these two networks with opposite goals, a generative network is obtained, in which the discriminative network cannot judge the source of the sample. It can be determined that the generative network can generate samples that conform to the distribution of real samples.

[0100] Based on the above description, Figure 2 The process of a data anomaly detection method provided by an embodiment of the present invention is exemplarily shown. The process can be executed by an abnormal data detection device, which can be located at Figure 1 The server 100 shown may also be the server 100.

[0101] like Figure 2 As shown in the figure, the process specifically includes:

[0102] Step 201, obtaining the original operation and maintenance data at the current moment.

[0103] In the embodiment of the present invention, the original operation and maintenance data includes data of multiple operation and maintenance indicators. Taking the original operation and maintenance data including N-dimensional indicators as an example, the original operation and maintenance data at the current time t is, for example, W={x t 1 ,x t 2 ,x t 3 ……x t N}, where x t N Represents the original data corresponding to the dimension index N, where N is a positive integer.

[0104] The operation and maintenance indicators may be host performance indicators and / or key business indicators, such as CPU, MEM, DISK, JVM, IO, etc., and key business indicators may be business interface transaction volume, time consumption, success rate, etc. The multiple operation and maintenance indicators in step 201 may include at least two indicators of the two categories of indicators: host performance indicators and key business indicators, such as the multiple operation and maintenance indicators including CPU and business interface transaction volume, and another example, the multiple operation and maintenance indicators including CPU, JVM, and IO.

[0105] Step 202: input the original operation and maintenance data into an anomaly detection model to obtain reconstructed data corresponding to the original operation and maintenance data.

[0106] In the embodiment of the present invention, the anomaly detection model is obtained by training the VAE-GAN model based on historical normal operation and maintenance data.

[0107] For example, the original operation and maintenance data W = {x t 1 ,x t 2 ,x t 3 ……x t N}, the reconstructed data corresponding to W is expressed as W′={x t 1′ ,x t 2′ ,x t 3′ ……x t N′}, where x t 1′ For x t 1 The corresponding reconstructed data, x t 2′ For x t 2 The corresponding reconstructed data, x t N′ For xt N The corresponding reconstructed data. t N′ Represents the reconstructed data corresponding to the dimension index N, that is, x t N′ With x t N Corresponding to the same dimension indicator.

[0108] Step 203: Calculate the reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data.

[0109] Step 204 , determining an abnormal indicator in the original operation and maintenance data according to a reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data.

[0110] In an embodiment of the present application, by inputting the original operation and maintenance data of multiple operation and maintenance indicators at the current moment into a preset anomaly detection model, reconstructed data corresponding to the original operation and maintenance data is obtained, and then the abnormal indicators in the original operation and maintenance data are determined based on the reconstruction error between the calculated reconstructed data and the original operation and maintenance data. This allows one model to be used to detect multi-dimensional operation and maintenance indicators, and to identify abnormal indicators in the original operation and maintenance data in real time, rather than using different models for anomaly detection for different operation and maintenance indicators. This avoids the problem of judging an application instance as abnormal based only on the abnormality of an indicator in one dimension, and further improves the accuracy of anomaly detection in the original operation and maintenance data of the application instance.

[0111] In an implementable manner, the reconstruction error in the above step 203 can be obtained in the following manner: based on the reconstruction errors corresponding to multiple operation and maintenance indicators in the original operation and maintenance data and the reconstructed data corresponding to the original operation and maintenance data, the sum of the reconstruction errors corresponding to the multiple operation and maintenance indicators is determined as the reconstruction error between the reconstructed data and the original operation and maintenance data.

[0112] In one example, the original operation and maintenance data W t ={x t 1 ,x t 2 ,x t 3 ……x t N}, the reconstructed data corresponding to W is represented as W t ′={x t 1′ ,x t 2′ ,x t 3′ ……x t N′}, x N′With x N Corresponding to the same dimension index, for dimension index j, the reconstruction error between W′ and W can be calculated by the following formula:

[0113]

[0114] In formula (1), is the original operation and maintenance data corresponding to dimension index j at time t, is the reconstructed data corresponding to the dimension index j at time t, is the reconstruction error corresponding to the dimension index j at time t, It means summing up the reconstruction errors corresponding to the dimension indices 1 to j at time t.

[0115] If the reconstruction error between the reconstructed data and the original operation and maintenance data is less than the error threshold, the original operation and maintenance data is determined to be normal; if the reconstruction error between the reconstructed data and the original operation and maintenance data is greater than or equal to the error threshold, the original operation and maintenance data is determined to be abnormal, and then, the abnormal indicator in the original operation and maintenance data can be determined based on the reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data. In this way, it is possible to quickly determine whether the original operation and maintenance data is abnormal. When it is determined that the original operation and maintenance data is abnormal, the root cause analysis is continued, which can avoid wasting computing resources when the original operation and maintenance data is normal.

[0116] In an implementable manner, based on the reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data, determining the abnormal indicator in the original operation and maintenance data includes: calculating the reconstruction error between the data of each operation and maintenance indicator in the original operation and maintenance data and the data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data, and obtaining multiple reconstruction errors corresponding to the multiple operation and maintenance indicators; determining the operation and maintenance indicators corresponding to the M maximum values ​​among the multiple reconstruction errors corresponding to the multiple operation and maintenance indicators as abnormal indicators, where M is a positive integer. The value of M can be set according to actual needs and is not limited here.

[0117] Taking the error threshold as 0.05 and M as 5 as an example, if the above formula (1) is used to calculate the reconstruction error between the original operation and maintenance data at time t and the reconstructed data corresponding to the original operation and maintenance data, The value of is greater than or equal to 0.05, then Five maximum values ​​are determined, and the operation and maintenance indicators corresponding to these five maximum values ​​are abnormal indicators.

[0118] Through the above method, the dimensional indicators corresponding to the M maximum values ​​are found from the multiple reconstruction errors corresponding to the multi-dimensional indicators, and are located as the root causes of the faults, instead of using the reconstruction errors as the criterion for judging the abnormality of the indicators, so that the root cause analysis results are more objective.

[0119] In the example of the present application, the VAE-GAN model can be first trained in the offline module to obtain an anomaly detection model, and then the trained anomaly detection model can be used in the real-time module to implement the anomaly detection process.

[0120] like Figure 3 As shown in the figure, the specific processing process in the offline module is as follows:

[0121] S301, obtaining offline historical operation and maintenance data.

[0122] The historical operation and maintenance data is the normal data of the application instance within the historical period.

[0123] Then, in the offline module, the VAE-GAN model can be trained based on the historical operation and maintenance data to obtain an anomaly detection model. In one feasible method, the historical operation and maintenance data is used as input to construct the VAE-GAN model, and the VAE-GAN model is unsupervisedly trained with the minimum value of the loss function of the VAE-GAN model as the optimization target to obtain the anomaly detection model.

[0124] Among them, the VAE-GAN model includes a VAE network and a GAN network. The VAE network includes an encoder and a decoder. The encoder is used to output the variational distribution. The decoder is used to output the posterior probability distribution p θ (z); GAN network is used to constrain the variational distribution of encoder output With the posterior probability distribution p θ (z) is the smallest, and the reconstruction error between the reconstructed data output by the constrained decoder and the historical operation and maintenance data is the smallest. It should be noted that the posterior probability distribution p involved in the embodiment of the present application is θ (z) can also be used with p θ (z|x) represents.

[0125] S302: Preprocess the original operation and maintenance data.

[0126] It should be understood that S302 is an optional step. Before training the VAE-GAN model, since the maximum and minimum values ​​in the historical operation and maintenance data are unknown and the scales of the data are different, in order to improve the training convergence speed of the model, the original operation and maintenance data is preprocessed and then input into the anomaly detection model. For example, the specific preprocessing method can use the MAXMIN normalization method to map the data values ​​of the original operation and maintenance data to between [0,1]. Removing the data to accelerate model construction, the specific processing method is as follows:

[0127]

[0128] Among them, x′ is a standardized random variable, x is the original sequence value, max is the maximum value in the original operation and maintenance data, and min is the minimum value in the original operation and maintenance data.

[0129] S303, construction of reconstruction module based on VAE.

[0130] VAE is a deep generation model based on probability statistics combined with deep learning. It can be used to randomly generate a series of observable data. Its essence is a directional probabilistic graphical model. Figure 4 As shown in Figure 1, the basic framework of VAE is a random sampling probability model that simulates the relationship between the sample input variable x and the latent variable z. Assume that x can be generated by a latent variable z that obeys a certain distribution, where x→z is the discriminant module. The variational approximation of is similar to the encoder of the autoencoder; z→x is the generation module p θ (x|z), similar to the decoder of the autoencoder.

[0131] VAE uses neural networks to model two complex conditional probability density functions. Its network structure is similar to that of autoencoders, but the output is different. VAE outputs a distribution, while autoencoders output a fixed code. Figure 5 This is the specific network structure of VAE.

[0132] like Figure 5 As shown, the encoding module input is x and the output is the variational distribution VAE uses neural networks to estimate variational distributions Since the hidden variable z in this method is a continuous variable, its true posterior probability distribution p θ (z|x) is difficult to statistically infer, involving integral calculations, and the traditional EM algorithm cannot solve the parameter statistics of θ. Therefore, VAE is based on variational inference and uses Approximate the posterior probability distribution p θ (z|x).

[0133] The input of the decoding module is z, and the output is the probability distribution p θ(x|z). VAE uses a neural network to estimate the probability distribution p θ (x|z), using the fitting function of the neural network to θ The distribution parameters of (x|z) are fitted.

[0134] S303a, VAE objective function - logarithmic maximum likelihood function.

[0135] The goal of VAE is to make the data reconstructed by the decoding module close to the original data, that is, θ (x|z) is used for parameter estimation. The logarithmic maximum likelihood method is to maximize the logarithmic likelihood function. Assume that the input sample set (i.e. historical operation and maintenance data) is D, D = {x 1 ,x 2 ,x 3 ……x N}, where all data are independently distributed and no two observations will affect each other. The maximum likelihood estimation uses the known sample results to estimate the parameter vector θ of the probability density function to obtain the joint probability density function p θ (D) = P(x 1 ,x 2 ,x 3 ……x N |θ) is equivalent to {x 1 ,x 2 ,x 3 ……x N The likelihood function l(θ) of} is calculated as follows:

[0136]

[0137] According to the likelihood function shown in formula (2), θ′ is the value of θ that maximizes the likelihood function l(θ) in the parameter space, which can be expressed as the following formula (3):

[0138]

[0139] For ease of calculation, the logarithmic maximum likelihood function is used, as shown in formula (4):

[0140]

[0141]

[0142] If and only if When , θ′ is maximum.

[0143] S303b, introduces the VAE encoding module construction process.

[0144] The VAE encoding module uses variational approximation Approximate the original posterior probability distribution p θ(z|x), that is, to learn to generate parameter vectors Make the two distributions similar. In probability statistics, KL divergence is used to measure the similarity between two distributions. KL divergence is Kullback-Leibler divergence, also known as relative entropy, which is an asymmetric measure of the difference between two probability distributions P and Q. In information theory, relative entropy is equivalent to the difference between the information entropy of two probability distributions, and its calculation formula is as follows:

[0145]

[0146] S303b-1, Distribution assumptions of the coding network.

[0147] The VAE inference module makes assumptions to simplify the calculation is subject to the mean μ I , the variance is The normal distribution of Right now By μ I and The two parameter vectors are determined and can be predicted by the encoding network, namely in Generally, it is a fully connected network or a convolutional network. In this method, in order to make the feature training of historical training samples more complete, a fully connected network will be used. The calculation method is as follows:

[0148] h=σ(w (1) x+b (1) ) (7);

[0149] μ I =W (2) h+b (2) (8);

[0150]

[0151] Where W (i) and b (i) are the weights and biases of the neural network, and σ is a nonlinear transformation function. Since the variance is always non-negative, an activation function is used:

[0152] softplus=log(1+e x ) (10);

[0153] h is the representation of the input sample X hidden in the hidden layer after being processed by the encoding module.

[0154] S303b-2, variational approximation of the encoding network.

[0155] The goal of the VAE encoding network is As close as possible to the true posterior probability distribution p θ(z|x), that is, find a set of network parameters Minimizing the KL divergence of two distributions can be expressed as the following formula (11):

[0156]

[0157] The calculation process is as follows:

[0158] (1) According to the definition of KL divergence:

[0159]

[0160] (2), according to Gibson's inequality, the KL divergence is always greater than or equal to 0. The KL divergence is 0 if and only if the two distributions are the same, that is, the above formula (12) can be transformed into formula (13):

[0161]

[0162] The above formula (13) is further transformed into formula (14):

[0163]

[0164]

[0165] (3) According to conditional probability The above formula (14) can be transformed into formula (16):

[0166]

[0167] From the above formula (16), we can see that the second term on the right side of the equal sign is the target maximization log-likelihood function of the encoding module, let Right now is the variational evidence lower bound of the log-likelihood, and we get the following formula (17):

[0168]

[0169] Since the KL divergence is always greater than or equal to 0, the objective function of the encoding network can be transformed as follows: The objective function optimization of the encoding network is transformed into finding a set of parameter vectors Make z variational evidence lower bound The largest, among which, It can be expressed by the following formula (18):

[0170]

[0171] S303c, VAE decoding module construction.

[0172] Since the KL divergence is non-negative, we can know from formula (18) Optimizing logp in general θ (x) is not feasible, so we usually optimize its variational evidence lower bound instead. That is, optimizing the log-likelihood function is transformed into optimizing The variational evidence lower bound can be transformed as follows:

[0173]

[0174]

[0175]

[0176] The first term in formula (21) is represented by L1, and the second term is represented by L2, that is, formula (21) can be expressed as the following formula (22):

[0177]

[0178] S303c-1, decoding network objective function conversion.

[0179] VAE maximizes the likelihood function logp θ (x), converted to maximize Improve the lower bound of variational evidence. For the objective function of VAE Equivalent to L1 (approximate posterior probability With the prior distribution p θ (z) KL divergence) + L2 (log likelihood estimate). L1 can be used as a regularization term to prevent overfitting. In this method, GAN is used for distribution constraint. L2 is equivalent to the reconstruction error of the autoencoder and is used to reconstruct the original sample data.

[0180] S303c-2, the neural network approximate fitting of the L1 term is as follows:

[0181]

[0182] VAE sets the hidden variable z as a simple prior distribution in order to optimize the objective function. θ (z) is the standard normal distribution, approximating the posterior distribution Subject to the mean μ I , the variance is The normal distribution is fitted using a neural network, and its specific form is as follows:

[0183] p θ (z) = N (0, I) (24);

[0184]

[0185] S303c-3, Monte Carlo estimation of L2 terms.

[0186]

[0187] Because the L2 gradient variance is large, it is not suitable for numerical calculations. In the field of machine learning, for the expectation problem of complex integrals, the Monte Carlo method can be used to use Monte Carlo sampling. That is, L2 is equivalent to the following formula (27):

[0188]

[0189] S303d, VAE re-parameterization construction.

[0190] In the generative network, VAE needs to be distributed Sampling enough samples z k The distribution of the approximate original function, although it is assumed that p θ (z|x) is a normal distribution. Since both the mean and variance need to be calculated by the model, this process needs to optimize the mean-variance model through back propagation. The sampling operation in the back propagation process is random sampling and non-differentiable, so VAE uses a heavy parameter construction method, such as Figure 6 As shown, assuming that from N(μ, σ 2 ) is equivalent to sampling an ε from N(0,I), and let Z = μ + ε * σ. Through reparameterization, the sampling operation does not need to participate in gradient descent, making the model training differentiable.

[0191] After constructing the encoder and decoder of the VAN network, a distribution-constrained GAN discriminator is added to the output of the VAN network encoder, and an output-constrained GAN discriminator is added to the output of the VAN encoder to obtain the VAE-GAN model. Among them, the distribution-constrained GAN discriminator is used to discriminate the variational distribution With the posterior probability distribution p θ (z|x) is close; the output constrained GAN discriminator is used to determine whether the reconstructed data output by the decoder is close to the historical operation and maintenance data.

[0192] S304, based on GAN, VAE distribution constraints and VAE output constraints are imposed to train an anomaly detection model.

[0193] The following is a detailed introduction to GAN.

[0194] GAN and VAE are both generative models based on neural networks. The main idea is to generate content that is as similar as possible to the original sample. The difference between the two lies in the different loss functions of training. Among them, the objective function of VAE is the maximum likelihood estimation, that is, minimizing the KL divergence. KL divergence is the model and pθ The distance between (z|x) and its optimization goal and process are explicit, while the goal of GAN is to optimize the game process between the generator network and the discriminator network. That is, the goal of the generator network G is to generate real pictures as much as possible to deceive the discriminator network D, and finally achieve that the discriminator network cannot identify whether the sample is a real sample or a generated sample. GAN is an implicit generative model. Its objective function and training process do not explicitly calculate the maximum likelihood function. Its model structure is as follows Figure 7 shown.

[0195] The basic principles of GAN are introduced below. Figure 7 As shown in the figure, the generator G is a neural network that generates samples. It receives a random noise y and generates samples (such as normal distribution) through this noise, which is recorded as G(z). The discriminator D is a neural network that discriminates whether the sample is real, that is, whether the input sample comes from the generator or the original sample. Its input parameter is the sample x, and the output D(x) represents the probability that x is a real sample. If D(x) = 1, it is determined that the sample comes from the original data.

[0196] (1) The target loss function of GAN is as follows (28):

[0197] V(D,G)=min G max D E x~p(x) [logD(x)]+E y~pnoise(y) [log1-D(G(Z))] (28);

[0198] Among them, p(x) is the true sample distribution, p noise (y) is the low-dimensional noise distribution. The loss calculation of GAN is generated at the output of the discriminator D, and the binary cross entropy function is used for True / Fake judgment.

[0199] The first part is max D The first part is the discriminator training part. The discriminator D is trained on the basis of keeping the generator G unchanged. The training goal of the discriminator is to correctly distinguish True / Fake and represent them as 1 / 0. x~p(x) The input is sampled from real data, and the model expects D(x) to approach 1, that is, to maximize the first overall value E. x~p(x) [logD(x)]. Similarly, the second term E y~pnoise(z) The input is sampled from the generated data of G, and the model expects D(G(z)) to approach 0, that is, to maximize the second term E synchronously. y~pnoise(z) [log1-D(G(Z))] overall value. That is, the loss of the discriminator is defined as follows:

[0200]

[0201] The second part is min G The first part is the generator training part. In the model, the discriminant D is kept unchanged and the generator G is trained. The training goal of the generator is to train the discriminator. It is expected that the output of D(G(z)) is close to 1, that is, to minimize the overall value of the second term. Due to the game with the discriminator training process, the discriminator will produce a large error, and the error will update and optimize G. That is, the loss of the generator is defined as follows:

[0202]

[0203] (2) VAE distribution constraints based on GAN.

[0204] In daily system operation and maintenance, the monitoring system collects data x of dimension N at the minute level. t ∈R N .like Figure 8 As shown, a multi-dimensional anomaly detection model is constructed based on VAE-GAN to detect the time x t The historical sequence window Δ t Operation and maintenance data As input, the intermediate output of VAE follows the distribution Based on the adversarial differential autoencoder, the distribution is constrained to be consistent with the prior distribution p θ (z) approximation, through the discriminator D E Compare and p θ (z), thereby improving the robustness of VAE reconstruction and reducing the overfitting effect of reconstruction. is the original data. According to the standard loss function of GAN, the loss function of the discriminator based on distribution constraints is:

[0205]

[0206] Among them, y is random noise, p(y) is the low-dimensional noise distribution, x is the real sample, p(x) is the real sample distribution, D E (z) represents the probability that the input sample is a real sample; D E (G E (x)) represents the probability that the sample with the output of the encoder as input is a real sample;

[0207] The loss functions of the generator equivalent to the encoder are:

[0208]

[0209] Among them, x is the real sample, p(x) is the real sample distribution, D E (G E(x)) represents the probability that the sample with the output of the encoder as input is a real sample;

[0210] The goal is to minimize the loss function of the generator and the discriminator and constrain the variational distribution of the encoder output. With the posterior probability distribution p θ The KL divergence between (z|x) is minimized, and the VAE-GAN model is continuously optimized.

[0211] (3) VAE output constraints based on GAN.

[0212] like Figure 8 As shown, a multi-dimensional anomaly detection model is constructed based on VAE-GAN to detect the time x t The historical sequence window Δ t Historical operation and maintenance data As input, VAE is used to reconstruct the sequence to obtain The VAE loss function is the distance between the input and output, so that the reconstructed output Approximate the distribution of input data, but the norm distance alone cannot accurately measure the similarity between input and output distributions. Therefore, this method uses the discriminator of GAN to further identify the similarity between output and reconstruction.

[0213] Output constraint GAN generator corresponds to the decoding module G of VAE D , the discriminator is D D Determine the distance between the reconstructed output and the original input, thereby further constraining the output of the autoencoder to allow the autoencoder to learn the normal distribution of the original time series data. From the standard loss function of GAN, the loss functions of the discriminator based on output constraints are:

[0214]

[0215] Among them, x is the real sample, p(x) is the real sample distribution, Represents the input sample is the probability of the true sample, Represents the output of the decoder The probability that the sample given as input is a true sample;

[0216] The loss functions of the generator equivalent to the decoder are:

[0217]

[0218] Among them, x is the real sample, p(x) is the real sample distribution, Indicates the probability that the sample with the output of the decoder as input is a real sample;

[0219] With the minimum loss function of the generator and discriminator as the goal, the reconstruction error between the reconstructed data output by the constrained decoder and the historical operation and maintenance data is minimized, and the VAE-GAN model is continuously optimized.

[0220] In the above scheme, GAN is introduced into VAE, focusing on the hidden layer output distribution q(z) of the VAE discriminant module and the reconstructed output W′ of the generation module xt The important features of E Constrain the intermediate output of the variational autoencoder (i.e., the distribution output) to improve the robustness of the reconstruction, reduce the overfitting effect of the reconstruction, and improve the operating efficiency and accuracy of the prediction engine; use the discriminator D D Reconstructed output W′ of the constrained variational autoencoder xt Closer to the input to learn the distribution of input data, through the above distribution constraints and output constraints, the VAE-GAN model is continuously trained to obtain the model parameters of the final anomaly detection model.

[0221] After the anomaly detection model is trained in S304, the anomaly detection model can be used in the real-time module to perform data anomaly detection. Figure 3 As shown, the specific processing process in the real-time module includes:

[0222] S305, obtaining real-time original operation and maintenance data.

[0223] S306, loading an anomaly detection model, inputting the original operation and maintenance data into the anomaly detection model, and outputting reconstructed data.

[0224] S307, calculating a reconstruction error between the original operation and maintenance data and the reconstructed data, and performing data anomaly judgment based on the reconstruction error.

[0225] Here, the specific implementation of S307 can refer to the above-mentioned description of the specific implementation of S202-203, which will not be repeated here.

[0226] S308, when data anomalies are determined, locate the root cause of the anomaly and determine the anomaly index.

[0227] Here, the specific implementation of S308 can refer to the above description of the specific implementation of S204, which will not be repeated here.

[0228] S309, the operation and maintenance personnel verify the accuracy of the alarm.

[0229] Based on the same technical concept, Fig. 9 An abnormal data detection device provided by an embodiment of the present invention is exemplarily shown, and the device can execute the process of the data anomaly detection method.

[0230] like Fig. 9As shown, the device comprises:

[0231] The acquisition unit 901 is used to acquire the original operation and maintenance data at the current moment; the original operation and maintenance data includes data of multiple operation and maintenance indicators; the original operation and maintenance data includes data of multiple operation and maintenance indicators;

[0232] Processing unit 902 is used to input the original operation and maintenance data into the anomaly detection model to obtain reconstructed data corresponding to the original operation and maintenance data; calculate the reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data; determine the anomaly index in the original operation and maintenance data according to the reconstruction error; the anomaly detection model is obtained by training the VAE-GAN model based on historical normal operation and maintenance data.

[0233] Optionally, the processing unit 902 is specifically used to: determine that the original operation and maintenance data is abnormal if the reconstruction error is greater than or equal to an error threshold; and determine the abnormal indicators in the original operation and maintenance data based on the reconstruction errors corresponding to multiple operation and maintenance indicators in the original operation and maintenance data and the reconstructed data corresponding to the original operation and maintenance data.

[0234] Optionally, the processing unit 902 is specifically configured to: determine the operation and maintenance indicators corresponding to M maximum values ​​among the multiple reconstruction errors corresponding to the multiple operation and maintenance indicators as abnormal indicators, where M is a positive integer.

[0235] Optionally, the processing unit 902 is also used to: determine the sum of the reconstruction errors corresponding to the multiple operation and maintenance indicators according to the original operation and maintenance data and the reconstructed data corresponding to the original operation and maintenance data as the reconstruction error between the reconstructed data and the original operation and maintenance data.

[0236] Optionally, the acquisition unit 901 is further used to: acquire offline historical operation and maintenance data;

[0237] The processing unit 902 is further used to: construct a VAE-GAN model using the historical operation and maintenance data as input, and perform unsupervised training on the VAE-GAN model with the minimum value of the loss function of the VAE-GAN model as the optimization target to obtain the anomaly detection model;

[0238] The VAE-GAN model includes a VAE network and a GAN network. The VAE network includes an encoder and a decoder. The encoder is used to output a variational distribution. The decoder is used to output the posterior probability distribution p θ (z); The GAN network is used to constrain the variational distribution of the encoder output With the posterior probability distribution p θThe KL divergence between (z) is minimized, and the reconstruction error between the reconstructed data outputted by the constrained decoder and the historical operation and maintenance data is minimized.

[0239] Optionally, the processing unit 902 is specifically configured to:

[0240] According to the likelihood function of historical operation and maintenance data, the posterior probability distribution p is estimated by maximizing the log-likelihood function. θ (z) parameter θ;

[0241] According to the following formula (1) and formula (2), the variational distribution is calculated With the posterior probability distribution p θ The minimum KL divergence between (z|x) is converted to find the parameters Maximize the value of the variational evidence lower bound:

[0242]

[0243]

[0244] in, is the variational distribution With the posterior probability distribution p θ The KL divergence between (z|x), is the variational evidence lower bound;

[0245] The decoder of the VAN network is constructed according to the parameter θ, and the decoder of the VAN network is constructed according to the parameter Construct the encoder of VAN network;

[0246] A distribution-constrained GAN discriminator is added to the output end of the encoder of the VAN network, and an output-constrained GAN discriminator is added to the output end of the encoder of the VAN to obtain a VAE-GAN model; wherein the distribution-constrained GAN discriminator is used to discriminate the variational distribution With the posterior probability distribution p θ (z|x) is close; the output constrained GAN discriminator is used to determine whether the reconstructed data output by the decoder is close to the historical operation and maintenance data.

[0247] Optionally, the processing unit 902 is specifically configured to:

[0248] Determine the loss function of the GAN discriminator based on distribution constraints in the VAE-GAN model:

[0249]

[0250] And the loss function of the generator equivalent to the encoder:

[0251]

[0252] The loss function of the GAN discriminator with the distribution constraint and the loss function of the generator equivalent to the decoder are minimized to constrain the variational distribution of the encoder output. With the posterior probability distribution p θ The KL divergence between (z|x) is minimized, and the VAE-GAN model is continuously optimized;

[0253] Determine the loss function of the GAN discriminator based on the output constraint in the VAE-GAN model:

[0254]

[0255] And, determine the loss function of the generator equivalent to the decoder in the VAE-GAN model:

[0256]

[0257] With the minimum value of the loss function of the output-constrained GAN discriminator and the loss function of the encoder-equivalent generator as the target, the reconstruction error between the reconstructed data output by the constraint decoder and the historical operation and maintenance data is minimized.

[0258] Based on the same technical concept, an embodiment of the present invention provides a computing device, including:

[0259] A memory for storing program instructions;

[0260] The processor is used to call the program instructions stored in the memory and execute the data anomaly detection method according to the obtained program.

[0261] Based on the same technical concept, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a data anomaly detection method.

[0262] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0263] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0264] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0265] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0266] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0267] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of this application and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A data anomaly detection method, It is characterized in that include: Get the original operation and maintenance data at the current moment; The original operation and maintenance data includes data of multiple operation and maintenance indicators; Inputting the original operation and maintenance data into an anomaly detection model to obtain reconstructed data corresponding to the original operation and maintenance data; The anomaly detection model is obtained by constructing a VAE-GAN model using offline historical operation and maintenance data as input, and performing unsupervised training on the VAE-GAN model with the minimum value of the loss function of the VAE-GAN model as the optimization target; wherein the VAE-GAN model includes a VAE network and a GAN network, the VAE network includes an encoder and a decoder, and the encoder is used to output a variational distribution The decoder is used to output the posterior probability distribution p θ (z|x); The GAN network is used to constrain the variational distribution of the encoder output With the posterior probability distribution p θ The KL divergence between (z|x) is minimized, and the reconstruction error between the reconstructed data outputted by the constrained decoder and the historical operation and maintenance data is minimized; Calculating a reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data; According to the reconstruction error, an abnormal indicator in the original operation and maintenance data is determined.

2. The method according to claim 1, It is characterized in that The determining, according to the reconstruction error, an abnormal indicator in the original operation and maintenance data includes: If the reconstruction error is greater than or equal to the error threshold, determining that the original operation and maintenance data is abnormal; The abnormal indicator in the original operation and maintenance data is determined according to a reconstruction error between data of each operation and maintenance indicator in the original operation and maintenance data and data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data.

3. The method according to claim 2, It is characterized in that The determining the abnormal indicator in the original operation and maintenance data according to a reconstruction error between data of each operation and maintenance indicator in the original operation and maintenance data and data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data includes: Calculating a reconstruction error between data of each operation and maintenance indicator in the original operation and maintenance data and data corresponding to the operation and maintenance indicator in the reconstructed data corresponding to the original operation and maintenance data, to obtain a plurality of reconstruction errors corresponding to the plurality of operation and maintenance indicators; The operation and maintenance indicators corresponding to M maximum values ​​among the multiple reconstruction errors corresponding to the multiple operation and maintenance indicators are determined as abnormal indicators, where M is a positive integer.

4. The method according to claim 3, It is characterized in that The calculating a reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data includes: The sum of the multiple reconstruction errors corresponding to the multiple operation and maintenance indicators is determined as the reconstruction error between the reconstructed data and the original operation and maintenance data.

5. The method according to claim 1, It is characterized in that The method of using the historical operation and maintenance data as input to construct a VAE-GAN model includes: According to the likelihood function of historical operation and maintenance data, the posterior probability distribution p is estimated by maximizing the log-likelihood function. θ The parameter θ of (z|x); According to the following formula (1) and formula (2), the variational distribution is calculated With the posterior probability distribution p θ The minimum KL divergence between (z|x) is converted to find the parameters Maximize the value of the variational evidence lower bound: in, is the variational distribution With the posterior probability distribution p θ The KL divergence between (z|x), is the variational evidence lower bound; The decoder of the VAN network is constructed according to the parameter θ, and the decoder of the VAN network is constructed according to the parameter Construct the encoder of VAN network; A distribution-constrained GAN discriminator is added to the output end of the encoder of the VAN network, and an output-constrained GAN discriminator is added to the output end of the encoder of the VAN to obtain a VAE-GAN model; wherein the distribution-constrained GAN discriminator is used to discriminate the variational distribution With the posterior probability distribution p θ (z|x) is close; the output constrained GAN discriminator is used to determine whether the reconstructed data output by the decoder is close to the historical operation and maintenance data.

6. The method according to claim 5, It is characterized in that The VAE-GAN model is unsupervisedly trained with the minimum loss function of the VAE-GAN model as the optimization target to obtain the anomaly detection model, including: Determine the loss function of the distribution-constrained GAN discriminator in the VAE-GAN model: Among them, y is random noise, p(y) is the low-dimensional noise distribution, x is the real sample, p(x) is the real sample distribution, D E (z) represents the probability that the input sample is a real sample, D E (G E (x)) represents the probability that the sample with the output of the encoder as input is a real sample; Determine the loss function of the generator equivalent to the encoder in the VAE-GAN model: Among them, x is the real sample, p(x) is the real sample distribution, D E (G E (x)) represents the probability that the sample with the output of the encoder as input is a real sample; The loss function of the GAN discriminator with the distribution constraint and the loss function of the generator equivalent to the decoder are minimized to constrain the variational distribution of the encoder output. With the posterior probability distribution p θ (z) The KL divergence between them is minimal, and the VAE-GAN model is continuously optimized; Determine the loss function of the GAN discriminator based on the output constraint in the VAE-GAN model: Among them, x is the real sample, p(x) is the real sample distribution, Indicates the probability that the input sample is a true sample, Indicates the probability that the sample with the output of the decoder as input is a real sample; Determine the loss function of the generator equivalent to the decoder: Among them, x is the real sample, p(x) is the real sample distribution, Indicates the probability that the sample with the output of the decoder as input is a real sample; With the minimum value of the loss function of the output-constrained GAN discriminator and the loss function of the encoder-equivalent generator as the target, the reconstruction error between the reconstructed data output by the constraint decoder and the historical operation and maintenance data is minimized.

7. An abnormal data detection device, It is characterized in that include: An acquisition unit is used to acquire the original operation and maintenance data at the current moment; The original operation and maintenance data includes data of multiple operation and maintenance indicators; A processing unit is used to input the original operation and maintenance data into an anomaly detection model to obtain reconstructed data corresponding to the original operation and maintenance data; calculate the reconstruction error between the reconstructed data corresponding to the original operation and maintenance data and the original operation and maintenance data; determine the anomaly index in the original operation and maintenance data according to the reconstruction error; wherein the anomaly detection model is obtained by constructing a VAE-GAN model using offline historical operation and maintenance data as input, and performing unsupervised training on the VAE-GAN model with the minimum value of the loss function of the VAE-GAN model as the optimization target; wherein the VAE-GAN model includes a VAE network and a GAN network, the VAE network includes an encoder and a decoder, and the encoder is used to output a variational distribution The decoder is used to output the posterior probability distribution p θ (z|x); The GAN network is used to constrain the variational distribution of the encoder output With the posterior probability distribution p θ The KL divergence between (z|x) is minimized, and the reconstruction error between the reconstructed data outputted by the constrained decoder and the historical operation and maintenance data is minimized.

8. A computing device, It is characterized in that include: A memory for storing program instructions; A processor, configured to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 6 according to the obtained program.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 6.