A multi-element time series anomaly detection and diagnosis method based on similarity
By reconstructing the model using similarity-based methods and attention mechanisms, the accuracy and interpretability issues of multivariate time series anomaly detection and diagnosis were resolved. This enabled effective detection of anomalous moments and attributes, and improved the processing capability for long-term, high-dimensional data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING UNIV
- Filing Date
- 2023-03-06
- Publication Date
- 2026-04-21
AI Technical Summary
Existing multivariate time series anomaly detection and diagnosis methods are unable to effectively learn deep data features, have poor generalization ability, lack interpretability, and are difficult to simultaneously detect and diagnose abnormal moments and their specific attributes.
A similarity-based approach is adopted, which combines basic probability allocation and Tanimoto measurement to obtain a similarity matrix. The similarity matrix is reconstructed using an attention mechanism reconstruction model. Anomalies are identified through the similarity error matrix, and the number of anomalous elements is counted to determine the anomalous attributes.
It improves the accuracy and interpretability of multivariate time series anomaly detection, effectively detects anomalous moments and their specific attributes, and enhances the ability to process long-term, high-dimensional data.
Smart Images

Figure CN116185694B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method for detecting and diagnosing anomalies in multivariate time series data based on similarity. Background Technology
[0002] With the widespread adoption of the Internet of Things (IoT), ubiquitous connectivity generates massive amounts of high-dimensional data, namely multivariate time series. Data mining experts need to study patterns or instances within monitored systems that deviate from the expected trends in the multivariate time series—a process known as anomaly detection and diagnosis. Because these unusual patterns or instances may reveal signals of functional malfunctions or potential failures, effectively detecting and diagnosing anomalies is crucial for service quality management, including fault-tolerant response and database design.
[0003] Currently, commonly used methods for anomaly detection and diagnosis in multivariate time series data include: Distance-based methods use specific distance metrics to compare the relationships between points or subsequences in a time series; distribution-based methods estimate the data distribution or fit a distribution model to the data. However, traditional distance- or distribution-based methods often struggle to learn deeper data features and have poor generalization ability. Another approach is prediction-based methods, which use a continuous learning model to predict the state of invisible timestamps based on the prediction error and the current context window. However, prediction-based methods are limited by a large number of model parameters and the difficulty in capturing short-term fluctuations. A third approach is reconstruction-based methods, which extract general patterns from normal time series in a low-dimensional space by encoding their subsequences. While some recurrent mechanisms can be used for time dependency modeling, the calculation of later time steps must wait for the completion of previous sequences, requiring high time complexity. Finally, encoding-based methods encode subsequences into a low-dimensional latent space. Encoder-based methods encourage compact latent features to capture the most typical patterns in the input time series and ignore non-representative patterns, such as outliers. However, they are sensitive to outliers and prone to overfitting. Furthermore, anomaly diagnosis requires not only identifying anomalies but also pinpointing the specific data source causing the anomalous behavior; in other words, anomaly detection demands interpretability. This further complicates the issue, and currently, few methods can simultaneously address all these challenges. Summary of the Invention
[0004] The present invention aims to at least solve the technical problems existing in the prior art and provide a method for detecting and diagnosing anomalies in multivariate time series based on similarity.
[0005] To achieve the above-mentioned objectives of the present invention, the present invention provides a method for anomaly detection and diagnosis of multivariate time series based on similarity, comprising: step S1, acquiring the multivariate time series to be tested. , This represents the N-dimensional attribute vector matrix at time t. Indicates the length of the timestamp. Step S2: Combine the basic probability allocation method and the Tanimoto measurement method to obtain the similarity matrix of the N-dimensional attribute vector matrix at each time step; Step S3: Reconstruct the similarity matrix at each time step using the attention-based reconstruction model to obtain the reconstruction matrix at each time step; Step S4: Compare the similarity matrix and the reconstruction matrix at each time step to obtain the similarity error matrix at that time step, and sequentially determine whether each element in the similarity error matrix is abnormal, count the number of abnormal elements in the similarity error matrix, and use the number of abnormal elements as the abnormal score at the corresponding time step; Step S5: Determine whether the abnormal score at each time step reaches the first threshold. If it reaches the first threshold, the N-dimensional attribute vector matrix at that time step is considered abnormal, and further determine the abnormal attributes based on the distribution of abnormal elements in the similarity error matrix at that time step.
[0006] This invention addresses the problem of anomaly detection and diagnosis in multivariate time series data. To obtain interpretable relationships between attributes of multivariate time series, this invention proposes a novel similarity matrix calculation method based on basic probability allocation and the valley coefficient. This method can obtain more information from the original data. The improved attention-based reconstruction model enhances the ability to process long-term, high-dimensional data, better describing long-term temporal dependencies and improving anomaly diagnosis capabilities. This invention can not only detect anomalous moments but also further detect the specific anomalous attributes of those moments. Attached Figure Description
[0007] Figure 1 This is a flowchart illustrating the multivariate time series anomaly detection and diagnosis method based on similarity according to the present invention. Detailed Implementation
[0008] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0009] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0010] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0011] This invention discloses a similarity-based multivariate time series anomaly detection and diagnosis method. In a preferred embodiment, the flowchart is shown below. Figure 1 As shown, it includes:
[0012] Step S1: Obtain the multivariate time series to be tested. , This represents the N-dimensional attribute vector matrix at time t. Indicates the length of the timestamp. The multivariate time series data to be tested is preferably, but not limited to, a set of N sensor signals collected at multiple time points in an IoT system, with each sensor signal serving as an attribute data point; or it could be the HiBench big data benchmark released by Intel, which includes 26 metrics such as network transmission rate, network TCP latency, and CPU I / O latency per second, with each metric serving as an attribute data point; or it could be a dataset of server machines from a large internet company, generated by detecting many machines with the same state, with each machine serving as an attribute. Specifically, a data acquisition device can be set up to collect and store multivariate time series data from IoT sensors, the Intel website, or the server cluster of an internet company. This method reads the multivariate time series data from the data acquisition device during execution.
[0013] Step S2: Combine the basic probability allocation method and the Tanimoto measurement method to obtain the similarity matrix of the N-dimensional attribute vector matrix at each time step. The obtained similarity matrix has good symmetry. This method can obtain more information from the original data and can obtain interpretable relationships between multivariate time series attributes.
[0014] Preferably, in step S2, the process of obtaining the similarity matrix of the N-dimensional attribute vector matrix at time t includes:
[0015] Step S21: Obtain the pre-training sample set , Indicates the first An N-dimensional attribute vector matrix is used for training. Based on the pre-trained sample set, a Gaussian membership function is constructed for each dimension of an N-dimensional vector matrix relative to each detection category. The detection categories include normal and abnormal. Further preferably, the... Each attribute relative to the detection category Gaussian membership function for:
[0016] ;
[0017] in, Represents the first sample to be tested Each attribute value; This indicates that among all samples in the pre-training sample set, those belonging to the detection category... The The mean of the attribute values; This indicates that among all samples in the pre-training sample set, those belonging to the detection category... The The standard deviation of each attribute value ; In step S21, the solution is obtained for the first... Each attribute has a Gaussian membership function relative to each detection category, namely the Gaussian membership function for the normal category and the Gaussian membership function for the abnormal category.
[0018] Step S22, matching the N-dimensional vector matrix at time t Using Gaussian membership functions and fusing the matching results, we obtain an N-dimensional vector matrix at time t. The basic probability assignment (BPA) is calculated for each attribute relative to the calculated category c, which includes three categories: normal, abnormal, and normal or abnormal. This is based on the N-dimensional vector matrix at time t. The basic probability assignment generation method for the intersection with the corresponding Gaussian fuzzy number is as follows: (1) When a sample intersects with a single-set Gaussian fuzzy number model, the vertical coordinate of the intersection point is the sample support of that single set. (2) When a sample intersects with a multi-set Gaussian fuzzy number model, it will definitely intersect with a single-set Gaussian fuzzy number model. The high point of the intersection is the basic probability assignment support of a single sample set, and the low point of the intersection is the basic probability assignment support of multiple sample sets. (3) If the sum of the confidence levels of the basic probability assignments generated above is greater than 1, then normalization is performed; if it is less than 1, then excess confidence is assigned to the unknown set, and the calculation category of the unknown set is normal or abnormal. When calculating samples categorized as normal or abnormal. The basic probability allocation in step S22 can also refer to existing BPA generation methods based on Gaussian distribution, which will not be elaborated here.
[0019] Step S23, based on the N-dimensional vector matrix at time t Iterative acquisition of basic probability assignment for each dimension attribute The uncertainty of this dimension attribute relative to each computational category.
[0020] More preferably, in step S23, the N-dimensional vector matrix at time t is obtained. The Middle The process of calculating the uncertainty of a dimensional attribute relative to the category includes:
[0021] Step S321, Initialize parameters:
[0022] Set variables Represents an N-dimensional vector matrix at time t. The Middle Let the uncertainty of the dimension attribute relative to the calculation of category c be... initial iteration value for The Middle The basic probability assignment of the relative calculation of the dimensional attribute to the category c ;
[0023] set up This is the number of iterations, initially set to 1.
[0024] Calculate intermediate variables Wherein, when the calculation category c is normal or abnormal, When the calculated category c is normal or abnormal, ; This represents the set of values that can be taken for category c. ;
[0025] Step S322, calculate according to the following formula of Next iteration value:
[0026]
[0027] Step S323, calculate the iteration increment If satisfied Then stop iterating and... As Output if not satisfied ,make Return to step S322 and continue execution. This represents the iteration threshold, and its value can be preset.
[0028] Step S24: Calculate the N-dimensional vector matrix at time t. The similarity between any two attributes is used to obtain the similarity matrix of the N-dimensional attribute vector matrix at time t.
[0029] More preferably, step S24 includes:
[0030] Step S241: Calculate the N-dimensional vector matrix at time t using the following formula. The Middle Dimensional attributes and the first Similarity between dimensional attributes :
[0031] ;
[0032] in, , Represents an N-dimensional vector matrix at time t. The Middle The uncertainty of the relative calculation of category c for a dimensional attribute;
[0033] Step S242, using the N-dimensional vector matrix at time t Construct a similarity matrix at time t based on the similarity between all arbitrary attributes. , The size is Similarity matrix at time t It has excellent symmetry.
[0034] Step S3: Reconstruct the similarity matrix at each time step using an attention-based reconstruction model to obtain the reconstruction matrix at each time step.
[0035] Preferably, in step S3, the model reconstruction includes:
[0036] Tensor acquisition module: This module uses sliding windows of different lengths to divide the similarity matrix at time t and before time t, obtaining window matrices of different sizes. Combining all window matrices yields the tensor at time t. Suppose there are U sliding windows, each of different sizes. Let the first U sliding window be... The duration of each sliding window is , Then the first window matrix for:
[0037] ,in, express The similarity matrix at each time step.
[0038] tensor at time t for: .
[0039] A multi-layer convolutional module downsamples the tensor at time t. Preferably, a fully convolutional encoder with L (L = 4) layers is used to extract a deeper representation of the time series data. As the input of the first layer, the Layers are represented as:
[0040] .
[0041] in, , , These represent the first, second, and third network parameters of the first-layer fully convolutional encoder, respectively.
[0042] The attention-based network module splits the downsampled similarity matrix into row vectors, inputs all row vectors into a multi-head attention network, and outputs the reconstructed tensor at time t. More preferably, the attention-based network module performs the following:
[0043] Step A: Split the downsampled similarity matrix into row vectors. ;
[0044] Step B, convert the row vectors Transform it into three matrices, namely the query matrix. Key matrix Sum matrix Query matrix Weight is Key matrix Weight is Value matrix Weight is , , , ;
[0045] Step C, calculate the query matrix With the key matrix at all times The matrix formed Sparsity measure between:
[0046] ;in, Represents a mode;
[0047] Step D, measured by sparsity The top-level queries form a sparse matrix. The definition of obtaining proportional dot product attention is:
[0048] ;in, Represents the matrix of values at all times. The matrix formed;
[0049] Step E: Obtain multi-head proportional dot product attention using a multi-head attention network consisting of multiple parallel attention layers.
[0050] ;
[0051] in, ; Indicates the number of attention layers; ; Indicates the first A sparse matrix of inputs to each attention layer; Indicates the first The key matrix of all time-series inputs to each attention layer The matrix formed; Indicates the first A matrix of all time-values input to each attention layer The matrix formed;
[0052] Step F: When the row vector is input at the first time step, the global attention unit is set to an all-zero matrix with the same shape as the input window, and the all-zero matrix is connected to the input window.
[0053] Step G involves position encoding the multi-head proportional dot product attention and decoding the position at time t to obtain the reconstructed tensor at time t. The input embedding E has the following input encoding structure:
[0054] )
[0055] .
[0056] In the decoding phase, position encoding is applied to the target timestamp to obtain D. The decoder architecture is as follows:
[0057]
[0058]
[0059]
[0060] .
[0061] Obtain the output of the first stage Then, update the output in the following way:
[0062] .
[0063] The reconstructed vectors obtained from each level are concatenated into a matrix. Its shape is similar to the input. same.
[0064] A deconvolutional layer deconvolves the reconstructed tensor at time t to obtain the reconstructed matrix at time t. Perform deconvolution operation:
[0065] .
[0066] In the reconstructed model, convolution and deconvolution operations help the model learn to capture patterns at different scales, separating outliers or abnormal values from normal patterns to improve anomaly detection accuracy. The improved attention-based mechanism partitions the similarity matrix into similar row vectors and introduces sparsity in the transformed scale dot product attention matrix of the query / key. Furthermore, a new globally focused input unit is connected, enhancing the model's ability to handle long-term, high-dimensional data to better describe long-term temporal dependencies and improve anomaly detection accuracy.
[0067] Step S4: Compare the similarity matrix and the reconstruction matrix at each time step to obtain the similarity error matrix at that time step. Sequentially determine whether each element in the similarity error matrix is abnormal, count the number of abnormal elements in the similarity error matrix, and use the number of abnormal elements as the abnormal score at the corresponding time step.
[0068] Preferably, step S4 includes:
[0069] Step S41, calculate Time-similar error matrix ,in, Represents an N-dimensional vector matrix at time t. The similarity matrix, Represents an N-dimensional vector matrix at time t. The reconstruction matrix;
[0070] Step S42, sequentially determine the similarity error matrix Each element is checked against a second threshold; if it is, the element is considered abnormal. for:
[0071] , This represents the second hyperparameter. , This represents the maximum element value of the similarity error matrix obtained during training.
[0072] Step S43, Statistics The number of outlier elements in the time-similarity error matrix and the number of outlier elements as... Abnormal scores at any given time.
[0073] Step S5: Determine whether the anomaly score at each time step reaches a first threshold. If it does, the N-dimensional attribute vector matrix at that time step is considered anomaly. Further, determine the anomalous attribute based on the distribution of anomalous elements in the similarity error matrix at that time step. Preferably, the first threshold is:
[0074] ;
[0075] in, This represents the third hyperparameter. , This represents the maximum outlier score of the similarity matrix obtained during training.
[0076] In step S5, the abnormal attributes are determined based on the distribution of abnormal elements in the similarity error matrix at that time. Specifically, if the position of the abnormal elements in the similarity error matrix at time t is... The elements in the similarity error matrix at time t are abnormal. If the elements in the nth row and nth column of the similarity error matrix at time t are both abnormal, then the matrix at time t... If the nth dimension attribute is abnormal, otherwise the nth dimension attribute is normal; if the nth dimension attribute in the similarity error matrix at time t is abnormal. row and number If all elements in the column are abnormal, then the matrix at time t... The Dimensional attribute exception, otherwise the first The dimension attributes are normal. Preferably, the abnormal time and abnormal attributes are output to the display or stored in the storage unit.
[0077] In a preferred embodiment, the reconstruction model is trained using a pre-trained sample set Z based on a contrastive learning method. During the training process, the reconstruction matrix at time m is obtained. The process of obtaining the post-loss function includes:
[0078] Computed attribute pairs Time-comparison loss at time m:
[0079] ;
[0080] Where B represents a training batch size; Represents the reconstruction matrix at time m Middle position The element value, Represents the reconstruction matrix at time m Middle position The element value, express Time-reconstruction matrix Middle position The element value;
[0081] Computed attribute pairs Instance contrast loss at time m:
[0082] ;
[0083] in, Represents an N-dimensional vector matrix at time m. In addition to the first Dimensional attributes and the first The set of other dimensional attributes besides dimensional attributes;
[0084] Computed attribute pairs Total loss:
[0085] ;
[0086] in, Indicates the first hyperparameter. ;
[0087] calculate Time-reconstruction matrix The total loss is:
[0088] .
[0089] During iterative training, after each iteration, the reconstructed matrix is determined. If the total loss increment is less than the incremental loss threshold, training ends; otherwise, training continues.
[0090] During the training process of the reconstructed model, the good symmetry of the similarity matrix was utilized to design a contrastive learning task from both the time dimension and the instance dimension, which enhanced the ability to construct robust representations.
[0091] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0092] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for anomaly detection and diagnosis in multivariate time series based on similarity, characterized in that, include: Step S1: Obtain the multivariate time series to be tested. , This represents the N-dimensional attribute vector matrix at time t. This includes network transmission rate, network TCP latency, and CPU I / O latency per second. Indicates the length of the timestamp. ; Step S2: Combine the basic probability allocation method and the Tanimoto measurement method to obtain the similarity matrix of the N-dimensional attribute vector matrix at each time step; Step S3: Reconstruct the similarity matrix at each time step using an attention-based reconstruction model to obtain the reconstruction matrix at each time step; Step S4: Compare the similarity matrix and the reconstruction matrix at each time step to obtain the similarity error matrix at that time step. Sequentially determine whether each element in the similarity error matrix is abnormal, count the number of abnormal elements in the similarity error matrix, and use the number of abnormal elements as the abnormal score at the corresponding time step. Step S5: Determine whether the abnormal score at each time step reaches the first threshold. If it reaches the first threshold, the N-dimensional attribute vector matrix at that time step is considered abnormal. Further, the abnormal attributes are determined based on the distribution of abnormal elements in the similarity error matrix at that time step.
2. The method for detecting and diagnosing anomalies in multivariate time series based on similarity as described in claim 1, characterized in that, In step S2, the process of obtaining the similarity matrix of the N-dimensional attribute vector matrix at time t includes: Step S21: Obtain the pre-training sample set , Indicates the first An N-dimensional attribute vector matrix is used for training. Based on the pre-trained sample set, construct a Gaussian membership function for each dimension of the N-dimensional vector matrix relative to each detection category. The detection categories include normal and abnormal. Step S22, matching the N-dimensional vector matrix at time t Using Gaussian membership functions and fusing the matching results, we obtain an N-dimensional vector matrix at time t. The basic probability assignment of each attribute relative to the calculated category c is given. The calculated category c includes three types: normal, abnormal, and normal or abnormal. Step S23, based on the N-dimensional vector matrix at time t Iterative acquisition of basic probability assignment for each dimension attribute The uncertainty of this dimension of the attribute relative to each computational category; Step S24: Calculate the N-dimensional vector matrix at time t. The similarity between any two attributes is used to obtain the similarity matrix of the N-dimensional attribute vector matrix at time t.
3. The similarity-based multivariate time series anomaly detection and diagnosis method as described in claim 2, characterized in that, In step S21, the first Each attribute relative to the detection category Gaussian membership function for: ,in, Represents the first sample to be tested Each attribute value; This indicates that among all samples in the pre-training sample set, those belonging to the detection category... The The mean of the attribute values; This indicates that among all samples in the pre-training sample set, those belonging to the detection category... The The standard deviation of each attribute value; .
4. The similarity-based multivariate time series anomaly detection and diagnosis method as described in claim 3, characterized in that, In step S23, the N-dimensional vector matrix at time t is obtained. The Middle The process of calculating the uncertainty of a dimensional attribute relative to the category includes: Step S321, Initialize parameters: Set variables Represents an N-dimensional vector matrix at time t. The Middle Let the uncertainty of the dimension attribute relative to the calculation of category c be... initial iteration value for The Middle The basic probability assignment of the relative calculation of the dimensional attribute to the category c ; set up This is the number of iterations, initially set to 1. Calculate intermediate variables Wherein, when the calculation category c is normal or abnormal, When the calculated category c is normal or abnormal, ; This represents the set of values that can be taken for category c. ; Step S322, calculate according to the following formula of Next iteration value: ; Step S323, calculate the iteration increment If satisfied Then stop iterating and... As Output if not satisfied ,make Return to step S322 and continue execution.
5. The similarity-based multivariate time series anomaly detection and diagnosis method as described in claim 4, characterized in that, Step S24 includes: Step S241: Calculate the N-dimensional vector matrix at time t using the following formula. The Middle Dimensional attributes and the first Similarity between dimensional attributes : ; in, , Represents an N-dimensional vector matrix at time t. The Middle The uncertainty of the relative calculation of category c for a dimensional attribute; Step S242, using the N-dimensional vector matrix at time t Construct a similarity matrix at time t based on the similarity between all arbitrary attributes. , The size is .
6. The method for detecting and diagnosing anomalies in multivariate time series based on similarity as described in claim 3, 4, or 5, characterized in that, In step S3, the reconstructed model includes: Tensor acquisition module: This module uses sliding windows of different lengths to divide the similarity matrix at time t and before time t, obtaining window matrices of different sizes. Combining all window matrices yields the tensor at time t. ; A multi-layer convolutional module downsamples the tensor at time t. The attention-based network module splits the downsampled similarity matrix into row vectors, inputs all row vectors into a multi-head attention network, and outputs the reconstructed tensor at time t. The deconvolution layer deconvolves the reconstructed tensor at time t to obtain the reconstructed matrix at time t.
7. The similarity-based multivariate time series anomaly detection and diagnosis method as described in claim 6, characterized in that, Attention-based network module execution: Step A: Split the downsampled similarity matrix into row vectors. ; Step B, convert the row vectors Transform it into three matrices, namely the query matrix. Key matrix Sum matrix Query matrix Weight is Key matrix Weight is Value matrix Weight is , , , ; Step C, calculate the query matrix With the key matrix at all times The matrix formed Sparsity measure between: ; in, Represents a mode; Step D, measured by sparsity The top-level queries form a sparse matrix. The definition of obtaining proportional dot product attention is: ; in, Represents the matrix of values at all times. The matrix formed; Step E: Obtain multi-head proportional dot product attention using a multi-head attention network consisting of multiple parallel attention layers. ; in, ; Indicates the number of attention layers; ; Indicates the first A sparse matrix of inputs to each attention layer; Indicates the first The key matrix of all time-series inputs to each attention layer The matrix formed; Indicates the first A matrix of all time-values input to each attention layer The matrix formed; Step F: When the row vector is input at the first time step, the global attention unit is set to an all-zero matrix with the same shape as the input window, and the all-zero matrix is connected to the input window. Step G involves position encoding the multi-head proportional dot product attention and decoding the position at time t to obtain the reconstructed tensor at time t.
8. The method for detecting and diagnosing anomalies in multivariate time series based on similarity as described in claim 7, characterized in that, The reconstruction model is trained using a pre-trained sample set Z based on a contrastive learning method. During the training process, the reconstruction matrix at time m is obtained. The process of obtaining the post-loss function includes: Computed attribute pairs Time-comparison loss at time m: ; Where B represents a training batch size; Represents the reconstruction matrix at time m Middle position The element value, Represents the reconstruction matrix at time m Middle position The element value, express Time-reconstruction matrix Middle position The element value; Computed attribute pairs Instance contrast loss at time m: ; in, Represents an N-dimensional vector matrix at time m. In addition to the first Dimensional attributes and the first The set of other dimensional attributes besides dimensional attributes; Computed attribute pairs Total loss: ; in, Indicates the first hyperparameter. ; calculate Time-reconstruction matrix The total loss is: 。 9. The method for detecting and diagnosing anomalies in multivariate time series based on similarity as described in claim 1, 2, 3, 4, 5, 7, or 8, characterized in that, Step S4 includes: Step S41, calculate Time-similar error matrix ,in, Represents an N-dimensional vector matrix at time t. The similarity matrix Represents an N-dimensional vector matrix at time t. The reconstruction matrix; Step S42, sequentially determine the similarity error matrix Each element is checked against a second threshold; if it is greater than the second threshold, the element is considered abnormal. , This represents the second hyperparameter. , This represents the maximum element value of the similarity error matrix obtained during training. Step S43, Statistics The number of outlier elements in the time-similarity error matrix and the number of outlier elements as... Abnormal scores at any given time.
10. The method for detecting and diagnosing anomalies in multivariate time series based on similarity as described in claim 9, characterized in that, In step S5, the first threshold is: ; in, This represents the third hyperparameter. , This represents the maximum outlier score of the similarity matrix obtained during training.