Time series data detection method, device, equipment and computer storage medium

By converting time series data into two-dimensional images and using IntroVAE model for image reconstruction, the problem of small application scope of time series data detection in the prior art is solved, and efficient abnormality detection of large-scale data is achieved.

CN114494242BActive Publication Date: 2024-12-27PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202210158956.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2024-12-27
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

The existing time series data abnormality detection method cannot be applied to large-scale time series data, and there is a problem with a small scope of application.

Method used

The one-dimensional time series data to be detected is converted into a two-dimensional image, and the two-dimensional image is reconstructed using the introspective variational autoencoder IntroVAE model, and the data is detected by calculating the loss value between the reconstructed image and the input image. Whether there is an exception.

Benefits of technology

It improves the scope of application of time series data detection, simplifies the abnormal detection process, and ensures detection efficiency under large-scale data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494242B_ABST
    Figure CN114494242B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of artificial intelligence technology, and provides a time series data detection method, device, equipment and computer storage medium, wherein a time series data detection method comprises the following steps: performing a conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image; reconstructing the image based on the two-dimensional image to obtain a training image sample set containing the reconstructed image; using the training image sample set, training the introspective variational autoencoder IntroVAE model to obtain the trained IntroVAE model; using the trained IntroVAE model, calculating the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize whether the one-dimensional time series data has anomalies. By applying the technical solution provided in the embodiment of the present application, the scope of application of time series data detection is improved when anomaly detection is performed on large-scale time series data while ensuring the efficiency of anomaly detection of time series data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a time series data detection method, device, equipment and computer storage medium. Background Art

[0002] With the development of artificial intelligence technology, the demand for anomaly detection of time series data in the fields of network monitoring, equipment maintenance, information security, finance, aerospace, etc. is also increasing. At present, anomaly detection of time series data is usually an unsupervised anomaly detection method. For example, by segmenting the time series data and then finding anomalies through clustering of neighbor samples or density, such methods are often very sensitive to parameters and are more complicated for anomaly detection of time series data. It can be seen that the existing anomaly detection methods for time series data cannot be applied to large-scale time series data and have a small scope of application. Summary of the invention

[0003] The purpose of the present application is to provide a time series data detection method, device, equipment and computer storage medium to solve the technical problem that the existing time series data anomaly detection method cannot be applied to large-scale time series data and has a small scope of application.

[0004] A first aspect of an embodiment of the present application provides a time series data detection method, comprising:

[0005] Perform conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image;

[0006] Performing image reconstruction based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data and a training image sample set including the reconstructed image;

[0007] Using the training image sample set, training the introspective variational autoencoder IntroVAE model to obtain a trained IntroVAE model;

[0008] The trained IntroVAE model is used to calculate the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize whether there is an anomaly in the one-dimensional time series data.

[0009] A second aspect of an embodiment of the present application provides a time series data detection device, comprising:

[0010] A conversion module, used for performing a conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image;

[0011] A reconstruction module, configured to perform image reconstruction based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set including the reconstructed image;

[0012] A training module, used to train the introspective variational autoencoder IntroVAE model using the training image sample set to obtain a trained IntroVAE model;

[0013] A detection module is used to use the trained IntroVAE model to calculate the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize whether there is an anomaly in the one-dimensional time series data.

[0014] A third aspect of an embodiment of the present application provides a device, including a memory, a processor, and a computer program stored in the memory and executable on the device, wherein when the processor executes the computer program, each step of a time series data detection method provided by the first solution is implemented.

[0015] A fourth aspect of an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a time series data detection provided by the first solution are implemented.

[0016] The time series data detection method, device, equipment and computer storage medium provided by the embodiments of the present application have the following beneficial effects:

[0017] The embodiments of the present application provide a time series data detection method, apparatus, device and computer storage medium. By converting the one-dimensional time series data to be detected into a two-dimensional image and using the two-dimensional image as the input of the model, the problem of anomaly detection for the time series is converted into the problem of anomaly detection for the image, and the anomaly detection for the time series data is relatively simple and has a wide range of applications. The two-dimensional image is reconstructed by the introspective variational autoencoder IntroVAE model, so that the reconstructed image is as close to the input two-dimensional image as possible. The IntroVAE model is trained using an image sample set consisting of the reconstructed image, so that the trained IntroVAE model can detect whether there is an anomaly in the one-dimensional time series data by calculating the reconstruction loss between the reconstructed image and the input two-dimensional image. While ensuring the efficiency of anomaly detection of time series data, when anomaly detection is performed on large-scale time series data, the scope of application of time series data detection is improved. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 A flowchart of a time series data detection method provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of the structure of the IntroVAE model provided in the embodiment of the present application;

[0021] Figure 3 It is a structural block diagram of a time series data detection device provided in an embodiment of the present application;

[0022] Figure 4 It is a structural block diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0024] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0025] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0026] The time series data detection method provided in the embodiment of the present application is applied to a computer device. When implemented, a time series data detection method is configured on the computer device in the form of a target script, and the computer device executes the target script to perform each step of the time series data detection method provided in the embodiment.

[0027] Reference Figure 1 As shown, Figure 1 A time series data detection method provided by an embodiment of the present application is shown, comprising:

[0028] S11: Perform a conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image.

[0029] In step S11, the anomaly detection of the one-dimensional time series to be detected is to determine whether there is obvious statistical anomaly at a certain time point according to a certain statistical or machine learning strategy for the time series data. Among them, the time series data is a data column recorded in chronological order, and each data in the same data column must be of the same caliber and required to be comparable. In the era of big data, the scale and complexity of time series data have increased significantly, and the demand for time series anomaly detection with intelligent and automatic characteristics has surged, and has played a role in many fields, improving the robustness, quality and efficiency of output or services in these fields, such as network monitoring, equipment maintenance, information security, finance, aerospace and other fields. Since there are a large number of time series data recording potential anomalies, an automatic monitoring system must be established to discover these anomalies. Once a high-performance monitoring model is successfully established, efficient search and anomaly detection in large batches of data will greatly help operation and maintenance personnel to find and fix problems. The key to time series anomaly detection is to mine and learn the laws of existing time series data. Because noisy data and complex abnormal patterns from the real world need to be captured.

[0030] Before inputting the time series data into the model for training, the one-dimensional time series data needs to be converted into two-dimensional image data through encoding. The detected abnormal points of the one-dimensional time series data are converted into abnormal points appearing in the two-dimensional image. Detecting the two-dimensional image is more intuitive and simple than directly detecting the one-dimensional time series data. The methods that can be used to convert the one-dimensional time series data into a two-dimensional image include Grammi angle fields (GAFs), including GASF (corresponding to the angle sum), and GADF (corresponding to the angle difference), Markov transition field (MTF), recurrence plot, and short-time Fourier transform (STFT).

[0031] In this embodiment, a two-dimensional image can be constructed by passing one-dimensional time series data through the GAF algorithm and generating a recursive graph as the input of the introspective variational autoencoder IntroVAE model. Based on the GAF algorithm and the recursive graph algorithm, the time series data is converted into a two-dimensional image, and the generated image can restore the original time series of rectangular coordinates through the main diagonal, that is, each graph corresponds to a sequence without information loss. The recursive graph reveals the internal structure of the time series and provides more effective information for anomaly detection.

[0032] As an embodiment of the present application, step S11 may include:

[0033] Based on the GAF algorithm, the one-dimensional time series data is converted to obtain a GAF image;

[0034] Encoding the one-dimensional time series data based on the recursive graph to obtain a REC image;

[0035] The two-dimensional image is generated based on the GAF image and the REC image.

[0036] In this embodiment, the GAF algorithm converts the scaled time series data from the rectangular coordinate system to the polar coordinate system, and then identifies the time correlation of different time points by considering the angles and between different points. k Generate a GAF image as k is an integer greater than 0. Then, the one-dimensional time series data is encoded based on the recursive graph to obtain the REC image. The recursive graph is an image that represents the distance between the trajectories extracted from the original time series. The recursive graph is particularly suitable for short time series data and can test the stationarity and intrinsic similarity of the time series. Specifically, we can extract each trajectory from the original image, and the REC image is an image that shows the distance between the trajectories extracted from the original time series. First, the trajectory is extracted according to the following formula and obtained Where m is the dimension of the trajectory and τ represents the time lag. Both parameters can be set to 1. The formula encodes the lagged data into another format and can generate a REC image based on this data.

[0037] Finally, after generating the GAF and REC images, the two images are concatenated in the channel dimension to generate the input image. Then, the judgment of the abnormal points of the time series can be transformed into the study of the image. The formula generates a two-dimensional image.

[0038] As an implementation method in an embodiment of the present application, the above steps convert the one-dimensional time series data based on the GAF algorithm to obtain a GAF image, including:

[0039] Scaling the one-dimensional time series data to obtain scaled one-dimensional time series data;

[0040] The scaled one-dimensional time series data is represented by polar coordinates to obtain a GAF image.

[0041] Specifically, the one-dimensional time series data is scaled to [-1,1]. The scaled one-dimensional time series is encoded into polar coordinates through the coordinate transformation formula. Specifically, the value of a certain time point in the one-dimensional time series data to be detected is first extracted according to the specified width w, and the subsequence X of w time steps forward and backward is extracted. K ={s k-w+1 ,…,s k ,…,s k+w The GAF algorithm first normalizes the values ​​in the sequence to between -1 and 1 according to Formula 1. That is, the sequence is placed on [-1,1] by scaling. Formula 1 is: Where k and N are integers greater than 0. Then The coordinate transformation formula is used to encode the polar coordinates. The coordinate transformation formula is: Finally, the cosine of the sum between the two time steps is calculated to obtain And generate the GAF image based on the data. The final formula of the GAF algorithm is: The GAF image is generated by this formula.

[0042] S12: Perform image reconstruction based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set including the reconstructed image.

[0043] In step S12, training the IntroVAE model requires training samples, and by inputting the two-dimensional image into the IntroVAE model, the IntroVAE model reconstructs the two-dimensional image, that is, using a deep multi-level variational autoencoder structure to improve the reconstruction of time series data to obtain a reconstructed image. The training image sample set includes a reconstructed image and a sampled image. Image reconstruction based on a two-dimensional image is performed by inputting the two-dimensional image into the encoder of the IntroVAE model, the encoder converts the two-dimensional image into a latent variable, and the decoder of the IntroVAE model reconstructs the latent variable into an image, that is, a reconstructed image is obtained. The reconstructed image here is as similar as possible to the two-dimensional image. The latent variable obeys a distribution, and we hope that this distribution obeys a distribution such as a standard normal distribution, so we adjust the encoder, hoping that the variable obtained by the encoder encoding the image obeys this distribution. The latent variable is the two-dimensional image encoded by the encoder, and the sampled variable is directly sampled from the standard normal distribution without any image information. Therefore, the sampled image obtained by inputting the sampled variable into the decoder is not the same as the two-dimensional image and the reconstructed image.

[0044] As an embodiment of the present application, step S12 may include:

[0045] Performing multi-level extraction on the two-dimensional image to obtain latent variables corresponding to the two-dimensional image;

[0046] Encoding the latent variables to obtain a reconstructed image;

[0047] Obtaining a sampled image based on a sampled variable obtained by sampling a prior distribution of the latent variable;

[0048] A sample set is constructed based on the reconstructed image and the sampled image to obtain a training image sample set.

[0049] In this embodiment, Figure 2 This is a schematic diagram of the structure of the IntroVAE model provided in the embodiment of this application. Figure 2 As shown, the introspective variational autoencoder IntroVAE model is a multi-level and multi-scale encoder-decoder structure model for the prior distribution of latent variables and the posterior distribution of latent variables. 1, 2, 3, 4 and 5 in the figure are all feature combinations. The features extracted from the input are combined through feature combination 1, feature combination 2, feature combination 3, feature combination 4 and feature combination 5. In the encoder part, firstly, it is extracted from the two-dimensional image of the input based on a bottom-up network, and then the top-level latent variable Z1 is obtained after layer-by-layer encoding and sampling. Then, from top to bottom, multiple underlying latent variables Z={Z1, Z2, ..., Zg, ... Z G},g∈{2,...,G-1}. Then the decoder also uses a top-down approach to gradually use the latent variables obtained by the encoder, through multiple sampling and multiple residual blocks, and the Output outputs the reconstructed image. The encoder then samples the sampling variables according to the prior distribution of the latent variables, and inputs the sampling variables directly sampled from the standard normal distribution into the decoder to obtain the sampled image. Residual Block is a residual block, which contains several layers of networks with shortcut connections. The network in the residual block can be a fully connected layer or a convolutional layer. The residual block is between the input and output and is used to optimize the Trainable parameter. The residual block uses multiple layers of convolution to improve the receptive field of the network.

[0050] S13: Using the training image sample set, train the introspective variational autoencoder IntroVAE model to obtain a trained IntroVAE model.

[0051] In step S13, the introspective variational autoencoder IntroVAE model is a deep generative model that combines the variational autoencoder VAE and the adversarial generative network GAN. The variational autoencoder is a generative version of the autoencoder that achieves an approximate mapping of data to a prior distribution by optimizing a variational lower bound. The training of VAE is stable and can perform latent variable inference and log-likelihood estimation, but the generated samples are relatively fuzzy. The adversarial generative network learns the distribution of real data through the adversarial relationship between the generator and the discriminator. GAN can generate realistic and clear images, but there is a problem of unstable training, which is particularly serious in synthesizing high-resolution images. Therefore, the IntroVAE model not only overcomes the problem that the synthetic images inherent in the variational autoencoder tend to be blurred without introducing additional adversarial discriminators, and generates high-definition and stable images, but also achieves stable training for high-resolution image synthesis without using the commonly used multi-stage multi-discriminator strategy. The IntroVAE model can self-evaluate the quality of the samples it generates and improve itself accordingly. Introducing adversarial learning into the VAE realizes a kind of introspective learning, that is, the model itself can judge the quality of the samples it generates and make corresponding changes to improve performance. The training method of the IntroVAE model is to train the encoder so that the hidden variables of the real image are close to the prior distribution, and the hidden variables of the synthetic image deviate from the prior distribution; on the contrary, the generator is trained so that the hidden variables of the synthetic image are close to the prior distribution. At the same time, unlike GAN, in addition to adversarial, the encoder and generator must work together to ensure that the reconstruction error of the input image is as small as possible. For real data, the training goal of this method is exactly the same as that of traditional VAE, which greatly stabilizes the model training; for synthetic data, the introduction of adversarial improves the quality of samples.

[0052] In this embodiment, during the training of the IntroVAE model, the encoder and decoder in the IntroVAE model correspond to the discriminator and the generator, respectively. Adversarial training is embodied in: on the one hand, the role of the discriminator is to determine whether the latent variables are generated by real data through the encoder, or by constructed data through the encoder. On the other hand, the role of the generator is to make the latent variables encoded by the generated data and the real data as similar as possible. The purpose of training the IntroVAE model is achieved by iteratively updating the parameters of the model based on the Adamax optimization algorithm using a set of training image samples, reconstruction loss, and KL divergence.

[0053] As an embodiment of the present application, step S13 may include:

[0054] Based on the reconstruction loss and the KL divergence, a loss value between the two-dimensional image and the reconstructed image is calculated to obtain a reconstruction loss value;

[0055] Based on a preconfigured loss function, calculating a loss value between the reconstructed image and the sampled image to obtain a sampling loss value;

[0056] Based on the reconstruction loss value and the sampling loss value, the IntroVAE model is trained to obtain a trained IntroVAE model.

[0057] In this embodiment, reconstruction loss and KL divergence are both loss functions, which are used to calculate the loss after reconstruction. KL divergence is relative entropy, which is an asymmetric measure of the difference between two probability distributions. Relative entropy can measure the distance between two random distributions. When two random distributions are the same, their relative entropy is zero. When the difference between the two random distributions increases, their relative entropy will also increase. Therefore, relative entropy can be used to compare the similarity of texts. In this embodiment, KL divergence and reconstruction loss are used to calculate the loss value between the two-dimensional image and the reconstructed image. Based on unsupervised training of KL divergence and reconstruction loss, the loss value between the two-dimensional image and the reconstructed image is calculated. The reconstruction loss is defined as Where X is a two-dimensional image, X' is a reconstructed image, B is the batch size of training data, N is the length of each subsequence in the time series data, C is the number of image channels, b and c are variables of B and C, and b and c are integers greater than 0, i and j are pixel values ​​of the two-dimensional image and the reconstructed image, and i and j are integers greater than 0. The latent variable Z is divided into disjoint groups z = {z1, z2, ..., z G}, where G is the number of groups, z g is a set of latent variables. For each group, there is the following relationship It is assumed that the distribution of Z, p(z), is the factorial of a series of normal distributions. g The i-th variable in has the following relationship: Then, using the prior distribution parameter Δμ i and Δσ i The relative value of determines the posterior distribution: The KL divergence calculation formula for the i-th variable of the g-th group is as follows:

[0058]

[0059] KL divergence is used as a regular term here to make the posterior distribution of the latent variable as close to the prior distribution as possible. The overall KL divergence calculation formula is as follows: Among them, Z is the latent variable, is the i-th variable of Zg, G is the number of groups of latent variables, I g is the length of Zg.

[0060] The VAE training process based on reconstruction loss and KL divergence as the loss function can fit time series data, but it may also fit abnormal data. In order to improve the performance of the IntroVAE model, adversarial training is introduced to fit the data distribution so that the distribution of the reconstructed data is as close as possible to the input data.

[0061] Specifically, for the encoder and decoder in the IntroVAE model, the parameters of the encoder and decoder are randomly initialized. A two-dimensional image is input to the encoder, and the encoder obtains the latent variable Z. The latent variable Z is used as the input of the decoder to obtain a reconstructed image. The parameters of the encoder and decoder are updated based on the Adamax algorithm according to the reconstruction loss and KL divergence. Then, the sampling variables are sampled according to the prior distribution of the latent variables, and the sampling variables are input into the decoder to obtain the sampled image. The Adamax algorithm is applied based on the pre-configured loss function to update the parameters of the encoder. The pre-configured loss function is the reconstruction loss function and the KL divergence. The pre-configured loss function is Among them, Zr is the variable obtained by re-inputting the reconstructed image into the encoder, Zpp is the variable obtained by re-inputting the sampled image into the encoder, and α and β are parameters that need to be trained to find the optimal values ​​through repeated training. The IntroVAE model is trained by training the sample set and the reconstruction loss as well as the reconstruction loss value and sampling loss value obtained by the Adamax optimization algorithm based on the KL divergence to obtain the trained IntroVAE model.

[0062] S14: Using the trained IntroVAE model, calculate the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize whether there is an anomaly in the one-dimensional time series data.

[0063] In step S14, the trained IntroVAE model itself can judge the quality of the samples it generates and make corresponding changes to improve performance. The target loss value is the difference between the two-dimensional image converted from the one-dimensional time series data and the reconstructed image obtained by reconstructing the two-dimensional image using the trained IntroVAE model. Because the two-dimensional image is real data, it is converted from the one-dimensional time series to be detected. The reconstructed image is the ideal data reconstructed by the IntroVAE model, so the difference between them can detect the anomaly of the one-dimensional time series data.

[0064] By inputting the time data to be detected into the IntroVAE model, after two-dimensional image encoding, the reconstruction loss between the reconstructed image and the input two-dimensional image is calculated, and when the loss exceeds a certain threshold, the point is determined as an outlier. The problem of outlier detection in time series is converted to the problem of outlier detection in images, and the detection results are more intuitive and simple.

[0065] As an implementation method of this embodiment, the following is also included:

[0066] When the target loss value exceeds a preset threshold, an alarm is issued.

[0067] The alarm is the detection of abnormal data in the time series data to be detected. The target loss value is obtained by calculating the reconstruction loss between the two-dimensional image converted from the time series data to be detected and the reconstructed image reconstructed from the two-dimensional image. The target loss value is used to characterize whether the time series data is abnormal, and a certain threshold is set in advance to detect the time series data.

[0068] Corresponding to the above method embodiment, the embodiment of the present invention also provides a time series data detection device, such as Figure 3 As shown, the device 30 may include the following modules:

[0069] A conversion module 31 is used to perform a conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image;

[0070] A reconstruction module 32, configured to perform image reconstruction based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set including the reconstructed image;

[0071] A training module 33 is used to train the introspective variational autoencoder IntroVAE model using the training image sample set to obtain a trained IntroVAE model;

[0072] The detection module 34 is used to use the trained IntroVAE model to calculate the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize whether there is an anomaly in the one-dimensional time series data.

[0073] It should be understood that Figure 3 In the structural block diagram of the time series data detection device shown in FIG. Figure 1 The steps in the corresponding embodiments, and for Figure 1 Each step in the corresponding embodiment has been explained in detail in the above embodiment. Figure 1 as well as Figure 1 The relevant descriptions in the corresponding embodiments are not repeated here.

[0074] Figure 4 is a structural block diagram of a device provided in one embodiment of the present application. Figure 4As shown, the device 40 of this embodiment includes: a processor 41, a memory 42, and a computer program 43 stored in the memory 42 and executable on the processor 41, such as a program of the time series data detection method. When the processor 41 executes the computer program 43, the steps in each embodiment of the above-mentioned time series data detection method are implemented, such as Figure 1 Alternatively, the processor 41 implements the above when executing the computer program 43 Figure 3 The functions of each module in the corresponding embodiment are, for example, Figure 3 For details on the functions of modules 31 to 34 shown, please refer to Figure 3 The relevant descriptions in the corresponding embodiments are not repeated here.

[0075] Exemplarily, the computer program 43 may be divided into one or more modules, which are stored in the memory 42 and executed by the processor 41 to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 43 in the device 40. For example, the computer program 43 may be divided into a conversion module, a reconstruction module, a training module, and a detection module, and the specific functions of each module are as described above.

[0076] The turntable device may include, but is not limited to, a processor 41 and a memory 42. Those skilled in the art will appreciate that Figure 4 It is only an example of the device 40 and does not constitute a limitation of the device 40. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the turntable device may also include input and output devices, network access devices, buses, etc.

[0077] The processor 41 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0078] The memory 42 may be an internal storage unit of the device 40, such as a hard disk or memory of the device 40. The memory 42 may also be an external storage device of the device 40, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the device 40. Further, the memory 42 may include both an internal storage unit of the device 40 and an external storage device. The memory 42 is used to store the computer program and other programs and data required by the turntable device. The memory 42 may also be used to temporarily store data that has been output or is to be output.

[0079] In one embodiment, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the time series data detection method in the above embodiment is implemented.

[0080] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0081] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A time series data detection method, characterized in that: include: Perform conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image; The converting operation is performed on the one-dimensional time series data to be detected to obtain a two-dimensional image, including: Based on the GAF algorithm, the one-dimensional time series data is converted to obtain a GAF image; Encoding the one-dimensional time series data based on the recursive graph to obtain a REC image; generating the two-dimensional image based on the GAF image and the REC image; Performing image reconstruction based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data and a training image sample set including the reconstructed image; The image reconstruction is performed based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set containing the reconstructed image, including: Performing multi-level extraction on the two-dimensional image to obtain latent variables corresponding to the two-dimensional image; Encoding the latent variables to obtain a reconstructed image; Obtaining a sampled image based on a sampled variable obtained by sampling a prior distribution of the latent variable; Constructing a sample set based on the reconstructed image and the sampled image to obtain a training image sample set; Using the training image sample set, training the introspective variational autoencoder IntroVAE model to obtain a trained IntroVAE model; The introspective variational autoencoder IntroVAE model is trained by using the training image sample set to obtain a trained IntroVAE model, including: Based on the reconstruction loss and the KL divergence, a loss value between the two-dimensional image and the reconstructed image is calculated to obtain a reconstruction loss value; Based on a preconfigured loss function, calculating a loss value between the reconstructed image and a sampled image in the training image sample set to obtain a sampling loss value; Based on the reconstruction loss value and the sampling loss value, the IntroVAE model is trained to obtain a trained IntroVAE model; The trained IntroVAE model is used to calculate the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize whether there is an anomaly in the one-dimensional time series data.

2. The method according to claim 1, characterized in that: The step of converting the one-dimensional time series data based on the GAF algorithm to obtain a GAF image includes: Scaling the one-dimensional time series data to obtain scaled one-dimensional time series data; The scaled one-dimensional time series data is represented by polar coordinates to obtain a GAF image.

3. The method according to claim 1, characterized in that The step of calculating the loss value between the two-dimensional image and the reconstructed image based on the reconstruction loss and the KL divergence to obtain the reconstruction loss value includes: The loss value between the two-dimensional image and the reconstructed image is calculated by the following formula: in, is the reconstruction loss function, X is the two-dimensional image, X′ is the reconstructed image, B is the number of the two-dimensional images, N is the length of each subsequence in the one-dimensional time series data, C is the number of image channels, b and c are variables of B and C, and b and c are integers greater than 0, i and j are pixel values ​​of the two-dimensional image and the reconstructed image, and i and j are integers greater than 0, summing the squares of the differences between the two-dimensional image and the reconstructed image; The loss value between the two-dimensional image and the latent variable of the two-dimensional image is calculated by the following formula to obtain the reconstruction loss value: ; in, is the KL divergence function of the two-dimensional image and the latent variable of the two-dimensional image, X is the two-dimensional image, z is the latent variable, z g is the g-th group of the latent variables, and g is an integer greater than 0, For z g The i-th variable of , where i is an integer greater than 0, z <g Represented as latent variable z1 to latent variable z g-1 Any latent variable of, G is the number of groups of the latent variable, I g For z g Length, is the prior distribution, q(z i g |z g ,X) is the posterior distribution, q(z i g |z g ,X)|| The posterior distribution of the latent variable approximates the prior distribution.

4. The method according to claim 1, characterized in that The method further comprises: When the target loss value exceeds a preset threshold, an alarm is issued.

5. A time series data detection device, characterized in that: include: A conversion module, used for performing a conversion operation on the one-dimensional time series data to be detected to obtain a two-dimensional image; The conversion module is also used for: Based on the GAF algorithm, the one-dimensional time series data is converted to obtain a GAF image; Encoding the one-dimensional time series data based on the recursive graph to obtain a REC image; generating the two-dimensional image based on the GAF image and the REC image; A reconstruction module, configured to perform image reconstruction based on the two-dimensional image to obtain a reconstructed image associated with the one-dimensional time series data, and a training image sample set including the reconstructed image; The reconstruction module is also used to: Performing multi-level extraction on the two-dimensional image to obtain latent variables corresponding to the two-dimensional image; Encoding the latent variables to obtain a reconstructed image; Obtaining a sampled image based on a sampled variable obtained by sampling a prior distribution of the latent variable; Constructing a sample set based on the reconstructed image and the sampled image to obtain a training image sample set; A training module, used to train the introspective variational autoencoder IntroVAE model using the training image sample set to obtain a trained IntroVAE model; The training module is also used to: The introspective variational autoencoder IntroVAE model is trained by using the training image sample set to obtain a trained IntroVAE model, including: Based on the reconstruction loss and the KL divergence, a loss value between the two-dimensional image and the reconstructed image is calculated to obtain a reconstruction loss value; Based on a preconfigured loss function, calculating a loss value between the reconstructed image and a sampled image in the training image sample set to obtain a sampling loss value; Based on the reconstruction loss value and the sampling loss value, the IntroVAE model is trained to obtain a trained IntroVAE model; A detection module is used to use the trained IntroVAE model to calculate the loss value between the two-dimensional image and the reconstructed image to obtain a target loss value; wherein the target loss value is used to characterize whether there is an anomaly in the one-dimensional time series data.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Cited By

  • Photovoltaic module hot spot detection system and method

    CN120433720A