Abnormality detection method and device and related equipment

By introducing an attention mechanism into the target encoder and decoder, combined with variational autoencoding technology, the gradient disappearance and gradient explosion problems caused by the increase in the depth of the neural network are solved, and the accuracy of abnormal detection of time sequence data is improved.

CN119026044APending Publication Date: 2024-11-26CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410994903.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the prior art, as the depth of the neural network continues to deepen, the accuracy of abnormal detection results of timing data is low, and there are problems such as gradient vanishing and gradient explosion.

Method used

The target encoder and decoder based on the attention mechanism cooperate with each other, data reconstruction and abnormal detection are carried out through variational autoencoding, and a multi-head attention mechanism is introduced to ensure full learning of features and avoid gradient vanishing and gradient explosion problems.

Benefits of technology

It improves the accuracy of abnormal detection results, reduces the probability of distortion after data reconstruction, and makes the detection results more accurate and reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026044A_ABST
    Figure CN119026044A_ABST
Patent Text Reader

Abstract

The invention provides an anomaly detection method and device and related equipment, and relates to the technical field of big data, and the method comprises the steps: carrying out the coding of to-be-detected data according to a target encoder, obtaining a target feature, enabling the to-be-detected data to be the time sequence data of a business index, and enabling the to-be-detected data to be the time sequence data of the business index; the target feature is used for indicating posterior probability distribution of hidden variables of the to-be-detected data, and the target encoder is an encoder based on an attention mechanism; decoding and reconstructing the target features according to a target decoder to obtain target data; according to the data similarity between the to-be-detected data and the target data, a detection result is determined, and the detection result is used for indicating whether the to-be-detected data is abnormal data or not. According to the invention, the problems of gradient disappearance, gradient explosion and the like caused by continuous deepening of the network depth of the time sequence model can be avoided, and the accuracy of the detection result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of big data, and in particular to an anomaly detection method, apparatus and related equipment. Background Art

[0002] Time series data refers to a series of indicator data captured continuously at certain time intervals. For example, traffic changes in network systems, quantitative transactions in banks, and environmental changes in the industrial Internet of Things can all be expressed as time series data. Anomaly detection can be achieved by monitoring time series data.

[0003] Related technologies use a neural network framework to achieve intelligent detection of abnormal data, such as recurrent neural network (RNN), long short-term memory network (LSTM), etc.; it is found in applications that as the network depth continues to increase, problems such as gradient disappearance and gradient explosion will occur, which makes the output detection results less accurate.

[0004] In other words, the accuracy of anomaly detection results obtained based on related technologies is low. Summary of the invention

[0005] The purpose of the present disclosure is to provide an anomaly detection method, an apparatus and related equipment to solve the technical problem of low accuracy of anomaly detection results output by related technologies.

[0006] In a first aspect, the present disclosure provides an anomaly detection method, the method comprising:

[0007] Encode the data to be detected according to the target encoder to obtain a target feature, wherein the data to be detected is time series data of a business indicator, and the target feature is used to indicate the posterior probability distribution of a latent variable of the data to be detected, and the target encoder is an encoder based on an attention mechanism;

[0008] Decoding and reconstructing the target feature according to the target decoder to obtain target data;

[0009] A detection result is determined according to the data similarity between the data to be detected and the target data, and the detection result is used to indicate whether the data to be detected is abnormal data.

[0010] In a second aspect, the present disclosure provides an abnormality detection device, the device comprising:

[0011] An encoding module, used for encoding the data to be detected according to a target encoder to obtain a target feature, wherein the data to be detected is time series data of a business indicator, and the target feature is used to indicate a posterior probability distribution of a latent variable of the data to be detected, and the target encoder is an encoder based on an attention mechanism;

[0012] A decoding module, used for decoding and reconstructing the target feature according to a target decoder to obtain target data;

[0013] The detection module is used to determine a detection result according to the data similarity between the data to be detected and the target data, and the detection result is used to indicate whether the data to be detected is abnormal data.

[0014] In a third aspect, the present disclosure provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.

[0015] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0016] In a fifth aspect, the present disclosure provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0017] In the present invention, the target encoder and the target decoder cooperate with each other, and the variational autoencoding method is adopted to realize the reconstruction of the data to be detected and the anomaly detection of the data to be detected, and the attention mechanism is introduced in the encoder to ensure the full learning of the features of the data to be detected, so as to avoid the problems of gradient vanishing and gradient explosion caused by the deepening of the network depth of the time series model, and improve the accuracy of the detection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flowchart of an anomaly detection method provided by an embodiment of the present disclosure;

[0019] Figure 2 is a schematic diagram of an encoder architecture provided by an embodiment of the present disclosure;

[0020] Figure 3 is a structural schematic diagram of an abnormality detection device provided by an embodiment of the present disclosure;

[0021] Figure 4 It is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0023] The present disclosure provides an abnormality detection method. Figure 1 As shown, the anomaly detection method includes:

[0024] Step 101: Encode the data to be detected according to the target encoder to obtain target features.

[0025] The data to be detected is time series data of business indicators, the target feature is used to indicate the posterior probability distribution of latent variables of the data to be detected, and the target encoder is an encoder based on an attention mechanism.

[0026] Exemplarily, the data to be detected may be traffic data of a network system, quantitative transaction data of a banking system, environmental monitoring data of an Internet of Things system, etc.

[0027] Step 102: Decode and reconstruct the target features according to the target decoder to obtain target data.

[0028] Step 103: Determine a detection result according to the data similarity between the data to be detected and the target data.

[0029] The detection result is used to indicate whether the data to be detected is abnormal data.

[0030] The data similarity between the data to be detected and the target data may be the cosine similarity between the data to be detected and the target data.

[0031] In the present invention, the target encoder and the target decoder cooperate with each other, and the variational autoencoding method is adopted to realize the reconstruction of the data to be detected and the anomaly detection of the data to be detected, and the attention mechanism is introduced in the encoder to ensure the full learning of the features of the data to be detected, so as to avoid the problems of gradient vanishing and gradient explosion caused by the deepening of the network depth of the time series model, and improve the accuracy of the detection results.

[0032] In one embodiment, the attention mechanism is a multi-head attention mechanism, and the target encoder includes N feature transformation blocks connected in sequence, where N is an integer greater than 1;

[0033] The step of encoding the data to be detected according to the target encoder to obtain the target features includes:

[0034] According to the multi-head attention mechanism, the data to be detected is encoded to obtain the target feature, where the target feature is the output feature of the Nth feature transformation block among the N feature transformation blocks, wherein the output feature of the i-th feature transformation block among the N feature transformation blocks is:

[0035] Convolving i-1 output features of the first i-1 feature transformation blocks among the N feature transformation blocks to obtain features, where i is an integer greater than 1 and less than or equal to N;

[0036] The output feature of the first feature transformation block among the N feature transformation blocks is: the feature obtained by convolving the data to be detected.

[0037] Among them, the multi-head attention mechanism works in parallel through multiple attention heads, and each attention head is responsible for extracting different features from the input, so as to make the features of the captured data to be detected more rich and comprehensive during the encoding process, thereby reducing the probability of distortion of the data obtained after reconstruction of the data to be detected, making the detection results more accurate.

[0038] In one embodiment, before encoding the data to be detected according to the target encoder to obtain the target feature, the method further includes:

[0039] Inputting the training sample into the initial encoder to obtain first distribution data, where the first distribution data is used to indicate the posterior probability distribution of the latent variable of the training sample;

[0040] Obtaining second distribution data according to the first distribution data and an initial decoder, wherein the second distribution data is used to indicate a probability distribution of the training samples;

[0041] According to the distribution difference between the first distribution data and the second distribution data, the initial encoder and the initial decoder are optimized to obtain the target encoder and the target decoder.

[0042] For example, if the input fixed-length data to be tested is set to {x1, x2...x w}, the target coding model is used to extract features from the data at each time point, and the representation x t The prior distribution z of the latent variable t , and then z t Put it into the target decoder, and t Reconstruct, p(X) = ∑ Z p(X|Z)p(Z), where p(X) represents the probability of obtaining X, and p(Z) represents the distribution of the hidden variable Z, that is, through the prior distribution z t Calculate and generate x t Probability

[0043] Use KL divergence to measure x t and The degree of approximation between them is to calculate the loss difference after reconstruction. The objective function is shown as follows: The output distribution after encoding by the target encoder is is the output distribution after decoding by the target decoder, KL divergence measures the asymmetric difference between two distributions. The larger the KL divergence, the greater the difference between the distributions.

[0044] In one embodiment, after optimizing the initial encoder and the initial decoder according to the distribution difference between the first distribution data and the second distribution data to obtain the target encoder and the target decoder, the method further includes:

[0045] Encoding the plurality of training samples respectively according to the target encoder to obtain encoding features of each training sample;

[0046] Decoding and reconstructing the coding features of each training sample according to the target decoder to obtain reconstructed data of each training sample;

[0047] Calculating the data difference between the reconstructed data of each training sample and the corresponding training sample to obtain a plurality of reconstruction difference parameters corresponding to the plurality of training samples;

[0048] Determining a decision threshold according to the plurality of reconstruction difference parameters;

[0049] The step of determining the detection result according to the data similarity between the data to be detected and the target data includes:

[0050] In the case where the data similarity is greater than the determination threshold, generating a detection result indicating that the data to be detected is not abnormal data;

[0051] In a case where the data similarity is less than or equal to the determination threshold, a detection result indicating that the data to be detected is abnormal data is generated.

[0052] The training samples are processed using the trained target encoder and target decoder, and the outlier training samples are found by clustering. The judgment threshold is formed accordingly, which can avoid the interference caused by human factors and make the determined judgment threshold more accurate, thereby making the obtained detection results more accurate and reliable.

[0053] In one embodiment, determining the decision threshold according to the multiple reconstruction difference parameters includes:

[0054] Clustering the multiple reconstruction difference parameters to obtain multiple difference clusters;

[0055] Among the multiple difference clusters, determining a difference cluster whose number of cluster elements is less than a number threshold as a target cluster;

[0056] The decision threshold is determined according to a mean value of at least one reconstruction difference in the target cluster.

[0057] Exemplarily, the aforementioned multiple difference clusters can be obtained by a hierarchical clustering approach.

[0058] It should be understood that, among the multiple difference clusters, there is at least one determined target cluster; and when there are multiple target clusters, the determination threshold can be understood as the mean value of the elements of the multiple target clusters.

[0059] In one embodiment, the target encoder is an encoder obtained by fusion of the attention mechanism and the CondenseNet model;

[0060] The target encoder includes N feature transformation blocks connected in sequence, and each of the feature transformation blocks includes a learning convolution layer, a grouped convolution layer and a feature mapping layer corresponding to the attention mechanism connected in sequence.

[0061] The size of the learning convolution layer is 1×1, the size of the grouped convolution layer is 3×3, and the attention mechanism is specifically a multi-head attention mechanism. Specifically, given a query value Q, a key value K, and a value V, each attention head s i(i=1,2,....h) The calculation method is The matrix defined in As the weights of Q, K, and V when they take the same input value, f(.) is the softmax function; the output of the multi-head attention mechanism will concatenate the results of h heads through the feedforward neural network, Multih(Q,K,V)=concat[h1,...h n ], where n is the number of heads. After the multi-head attention mechanism module, a linearly transformed result matrix vector W0 is finally output. Each feature transformation layer inputs W0 into all lower feature transformation layers for convolution. The feature map W after convolution transformation of the Nth layer network n As shown in the formula, W n =f(f(W0W1...W n-1 )*u 1*1 )*u 3*3 , where f(.) is the BN-ReLU function, u 1*1 and u 3*3Represents 1*1, 3*3 convolution weight matrices. Finally, the model obtains the final feature matrix by training the data of several network structure blocks and puts it into the fully connected layer. Each neuron in the fully connected layer performs nonlinear transformation on the data in the feature matrix after global average pooling to obtain a one-dimensional feature matrix.

[0062] For example, the CondenseNet model structure integrating the multi-head attention mechanism is as follows Figure 2 shown.

[0063] It should be understood that the method disclosed in the present invention can be widely used in scenarios of anomaly detection of time series data, such as: network traffic anomaly detection, industrial fault detection, transaction fraud detection, etc.; specifically, when the method is applied to a multi-cloud management platform, it can accurately, comprehensively, and low-latency complete the anomaly monitoring of platform costs, and combine with the corresponding algorithm to identify abnormal fluctuations in platform costs, help users discover unexpected expenses in a timely manner, and provide users with more efficient cost control functions.

[0064] See also Figure 3 , Figure 3 is an abnormality detection device provided by an embodiment of the present disclosure, such as Figure 3 As shown, the abnormality detection device 300 includes:

[0065] An encoding module 301 is used to encode the data to be detected according to a target encoder to obtain a target feature, wherein the data to be detected is time series data of a business indicator, and the target feature is used to indicate a posterior probability distribution of a latent variable of the data to be detected, and the target encoder is an encoder based on an attention mechanism;

[0066] A decoding module 302 is used to decode and reconstruct the target feature according to a target decoder to obtain target data;

[0067] The detection module 303 is used to determine a detection result according to the data similarity between the data to be detected and the target data, and the detection result is used to indicate whether the data to be detected is abnormal data.

[0068] In one embodiment, the attention mechanism is a multi-head attention mechanism, and the target encoder includes N feature transformation blocks connected in sequence, where N is an integer greater than 1;

[0069] The encoding module 301 is specifically used for:

[0070] According to the multi-head attention mechanism, the data to be detected is encoded to obtain the target feature, where the target feature is the output feature of the Nth feature transformation block among the N feature transformation blocks, wherein the output feature of the i-th feature transformation block among the N feature transformation blocks is:

[0071] Convolving i-1 output features of the first i-1 feature transformation blocks among the N feature transformation blocks to obtain features, where i is an integer greater than 1 and less than or equal to N;

[0072] The output feature of the first feature transformation block among the N feature transformation blocks is: the feature obtained by convolving the data to be detected.

[0073] In one embodiment, the apparatus 300 further includes an optimization module, wherein the optimization module is specifically configured to:

[0074] Inputting the training sample into an initial encoder to obtain first distribution data, where the first distribution data is used to indicate a posterior probability distribution of a latent variable of the training sample;

[0075] Obtaining second distribution data according to the first distribution data and an initial decoder, wherein the second distribution data is used to indicate a probability distribution of the training samples;

[0076] According to the distribution difference between the first distribution data and the second distribution data, the initial encoder and the initial decoder are optimized to obtain the target encoder and the target decoder.

[0077] In one embodiment, the apparatus 300 further includes a threshold determination module, and the threshold determination module includes:

[0078] A threshold encoding unit, used to encode the plurality of training samples respectively according to the target encoder to obtain an encoding feature of each training sample;

[0079] A threshold decoding unit, used to decode and reconstruct the coding features of each training sample according to the target decoder to obtain reconstructed data of each training sample;

[0080] A parameter calculation unit, used to calculate the data difference between the reconstructed data of each training sample and the corresponding training sample, and obtain a plurality of reconstruction difference parameters corresponding to the plurality of training samples one by one;

[0081] a threshold determination unit, configured to determine a determination threshold according to the plurality of reconstruction difference parameters;

[0082] The detection module 303 is specifically used for:

[0083] In the case where the data similarity is greater than the determination threshold, generating a detection result indicating that the data to be detected is not abnormal data;

[0084] In a case where the data similarity is less than or equal to the determination threshold, a detection result indicating that the data to be detected is abnormal data is generated.

[0085] In one embodiment, the threshold determination unit is specifically configured to:

[0086] Clustering the multiple reconstruction difference parameters to obtain multiple difference clusters;

[0087] Among the multiple difference clusters, determining a difference cluster whose number of cluster elements is less than a number threshold as a target cluster;

[0088] The decision threshold is determined according to a mean value of at least one reconstruction difference in the target cluster.

[0089] In one embodiment, the target encoder is an encoder obtained by fusion of the attention mechanism and the CondenseNet model;

[0090] The target encoder includes N feature transformation blocks connected in sequence, and each of the feature transformation blocks includes a learning convolution layer, a grouped convolution layer and a feature mapping layer corresponding to the attention mechanism connected in sequence.

[0091] The anomaly detection device 300 provided in the embodiment of the present disclosure can implement each process in the above-mentioned anomaly detection method embodiment, and will not be described again here to avoid repetition.

[0092] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0093] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0094] like Figure 4As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 to a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0095] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0096] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as anomaly detection methods. For example, in some embodiments, the anomaly detection method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the anomaly detection method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the anomaly detection method in any other appropriate manner (eg, by means of firmware).

[0097] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0098] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0099] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0100] As used herein, the term "machine-readable medium" refers to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0101] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0102] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0103] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0104] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. An anomaly detection method, It is characterized in that The method comprises: Encode the data to be detected according to the target encoder to obtain a target feature, wherein the data to be detected is time series data of a business indicator, and the target feature is used to indicate the posterior probability distribution of a latent variable of the data to be detected, and the target encoder is an encoder based on an attention mechanism; Decoding and reconstructing the target feature according to the target decoder to obtain target data; A detection result is determined according to the data similarity between the data to be detected and the target data, and the detection result is used to indicate whether the data to be detected is abnormal data.

2. The method according to claim 1, It is characterized in that The attention mechanism is a multi-head attention mechanism, and the target encoder includes N feature transformation blocks connected in sequence, where N is an integer greater than 1; The step of encoding the data to be detected according to the target encoder to obtain the target features includes: According to the multi-head attention mechanism, the data to be detected is encoded to obtain the target feature, where the target feature is the output feature of the Nth feature transformation block among the N feature transformation blocks, wherein the output feature of the i-th feature transformation block among the N feature transformation blocks is: Convolving i-1 output features of the first i-1 feature transformation blocks among the N feature transformation blocks to obtain features, where i is an integer greater than 1 and less than or equal to N; The output feature of the first feature transformation block among the N feature transformation blocks is: the feature obtained by convolving the data to be detected.

3. The method according to claim 1, It is characterized in that Before encoding the data to be detected according to the target encoder to obtain the target feature, the method further includes: Inputting the training sample into the initial encoder to obtain first distribution data, where the first distribution data is used to indicate the posterior probability distribution of the latent variable of the training sample; Obtaining second distribution data according to the first distribution data and an initial decoder, wherein the second distribution data is used to indicate a probability distribution of the training samples; According to the distribution difference between the first distribution data and the second distribution data, the initial encoder and the initial decoder are optimized to obtain the target encoder and the target decoder.

4. The method according to claim 3, It is characterized in that After optimizing the initial encoder and the initial decoder according to the distribution difference between the first distribution data and the second distribution data to obtain the target encoder and the target decoder, the method further includes: Encoding the plurality of training samples respectively according to the target encoder to obtain encoding features of each training sample; Decoding and reconstructing the coding features of each training sample according to the target decoder to obtain reconstructed data of each training sample; Calculating the data difference between the reconstructed data of each training sample and the corresponding training sample to obtain a plurality of reconstruction difference parameters corresponding to the plurality of training samples; Determining a decision threshold according to the plurality of reconstruction difference parameters; The step of determining the detection result according to the data similarity between the data to be detected and the target data includes: In the case where the data similarity is greater than the determination threshold, generating a detection result indicating that the data to be detected is not abnormal data; In a case where the data similarity is less than or equal to the determination threshold, a detection result indicating that the data to be detected is abnormal data is generated.

5. The method according to claim 4, It is characterized in that The step of determining a determination threshold according to the plurality of reconstruction difference parameters comprises: Clustering the multiple reconstruction difference parameters to obtain multiple difference clusters; Among the multiple difference clusters, determining a difference cluster whose number of cluster elements is less than a number threshold as a target cluster; The decision threshold is determined according to a mean value of at least one reconstruction difference in the target cluster.

6. The method according to claim 1, It is characterized in that The target encoder is an encoder obtained by fusion of the attention mechanism and the CondenseNet model; The target encoder includes N feature transformation blocks connected in sequence, and each of the feature transformation blocks includes a learning convolution layer, a grouped convolution layer and a feature mapping layer corresponding to the attention mechanism connected in sequence.

7. An abnormality detection device, It is characterized in that The device comprises: An encoding module, used for encoding the data to be detected according to a target encoder to obtain a target feature, wherein the data to be detected is time series data of a business indicator, and the target feature is used to indicate a posterior probability distribution of a latent variable of the data to be detected, and the target encoder is an encoder based on an attention mechanism; A decoding module, used for decoding and reconstructing the target feature according to a target decoder to obtain target data; The detection module is used to determine a detection result according to the data similarity between the data to be detected and the target data, and the detection result is used to indicate whether the data to be detected is abnormal data.

8. An electronic device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 6 when executed by the processor.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, It is characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 6.