WO2021169361A1 - 时间序列数据的检测方法、装置、计算机设备及存储介质 - Google Patents

时间序列数据的检测方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021169361A1
WO2021169361A1 PCT/CN2020/125060 CN2020125060W WO2021169361A1 WO 2021169361 A1 WO2021169361 A1 WO 2021169361A1 CN 2020125060 W CN2020125060 W CN 2020125060W WO 2021169361 A1 WO2021169361 A1 WO 2021169361A1
Authority
WO
WIPO (PCT)
Prior art keywords
series data
time series
neural network
time
recurrent neural
Prior art date
Application number
PCT/CN2020/125060
Other languages
English (en)
French (fr)
Inventor
邓悦
郑立颖
徐亮
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021169361A1 publication Critical patent/WO2021169361A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Definitions

  • This application belongs to the field of data detection technology, and in particular relates to a detection method, device, computer equipment, and storage medium for time series data.
  • Anomaly detection is an indispensable basic function in the intelligent operation and maintenance (AIOps) system.
  • AIOps intelligent operation and maintenance
  • the main purpose of anomaly detection is to automatically find abnormal fluctuations in time series data, and provide corresponding alarms and automatic stop losses.
  • Basis for decision-making At present, when there are missing values in the time series data at the last moment due to equipment failure or improper collection of personnel, it will hinder the abnormal detection of the current time series data. Therefore, the inventor realizes that it is necessary to solve the problem of how to detect the time series data at the current time to obtain the time series data at the current time when there are missing values in the time series data at the previous time.
  • the embodiments of the present application provide a detection method, device, computer equipment, and storage medium for time series data, which aim to solve the problem that the current time series data in the prior art has missing values Time series data is subject to normal anomaly detection.
  • an embodiment of the present application provides a method for detecting time series data, which includes:
  • first time series data is the current time series data to be detected
  • second time series data is the upper limit of the first time series data
  • an embodiment of the present application provides a detection device for time series data, which includes:
  • the collecting unit is used to collect preset first time series data and second time series data, wherein the first time series data is the time series data currently to be detected, and the second time series data is the first time series data.
  • the time series data at the last moment of the time series data and there are missing values;
  • An obtaining unit configured to obtain two adjacent time interval series data before and after a missing value in the second time series data according to the second time series data;
  • the first output unit is configured to input the second time series data and the time interval series data into a preset generative confrontation network to output third time series data;
  • a second output unit configured to input the third time series data into a preset convolutional neural network to output fourth time series data matching the first time series data
  • the detection unit detects the first time series data based on the fourth time series data to obtain a detection result of the first time series data.
  • an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored on the memory and running on the processor, wherein the processor executes the Perform the following steps in the computer program:
  • first time series data is the current time series data to be detected
  • second time series data is the upper limit of the first time series data
  • the embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the following steps :
  • first time series data is the current time series data to be detected
  • second time series data is the upper limit of the first time series data
  • the embodiment of the present application not only can perform anomaly detection on the time series data at the current time when there are missing values in the time series data at the last moment, but also complete the missing values of the time series data at the last time. Interpolation reduces the loss caused by abnormal data.
  • FIG. 1 is a schematic flowchart of a method for detecting time series data provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of a sub-process of a method for detecting time series data provided by an embodiment of this application;
  • FIG. 3 is a schematic diagram of another sub-flow of the method for detecting time series data provided by an embodiment of the application;
  • FIG. 4 is a schematic diagram of another sub-flow of the method for detecting time series data provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of another sub-flow of the method for detecting time series data provided by an embodiment of the application.
  • FIG. 6 is a schematic block diagram of a detection device for time series data provided by an embodiment of the application.
  • FIG. 7 is a schematic block diagram of subunits of the apparatus for detecting time series data provided by an embodiment of the application.
  • FIG. 8 is a schematic block diagram of another subunit of the apparatus for detecting time series data provided by an embodiment of the application.
  • FIG. 9 is a schematic block diagram of another subunit of the apparatus for detecting time series data provided by an embodiment of the application.
  • FIG. 10 is a schematic block diagram of another subunit of the apparatus for detecting time series data provided by an embodiment of the application.
  • FIG. 11 is a schematic block diagram of a computer device provided by an embodiment of the application.
  • FIG. 1 is a schematic flowchart of a method for detecting time series data provided by an embodiment of the present application.
  • the method for detecting time series data in the embodiments of the present application can be applied to terminals, such as smart terminal devices such as laptops and tablet computers, and implemented by software installed on the terminal, such as an application named Time Series Data Detection Tool
  • the detection method of the time series data ensures that the abnormal detection of the time series data is performed on the terminal where the user is located.
  • the first time series data, the second time series data, the third time series data, the fourth time series data, the time interval series data, and the mask series data mentioned in the embodiments of the present application are all in the form of a matrix. To process. The detection method of the time series data will be described in detail below.
  • the method includes the following steps S110 to S150.
  • S110 Collect preset first time series data and second time series data, wherein the first time series data is the time series data currently to be detected, and the second time series data is the first time series data The time series data of the last moment and there are missing values.
  • first time series data is the current time series data to be detected
  • second time series data is the upper limit of the first time series data.
  • Time series data at a moment in time and there are missing values Specifically, when it is necessary to perform anomaly detection on the current time series data of a certain device and there are missing values in the time series data of the previous time of the current time series data, the current time series data and the current time series data need to be collected. The time series data at the previous moment of the time series data.
  • the current time series data of the device may be, for example, time series digitized sensor data, device parameter monitoring data, web page access data, human flow data, and so on.
  • S120 Acquire two adjacent time interval series data before and after a missing value in the second time series data according to the second time series data.
  • step S120 includes sub-steps S121 and S122.
  • S121 Construct mask sequence data of the second time sequence data according to the second time sequence data.
  • the mask sequence data has the same size as the second time sequence data, and the number of data elements of the mask sequence data is the same as the number of elements of the second time sequence data and corresponds to one by one. If there is no missing value at a certain position in the second time series data, the value at the position corresponding to the position in the mask sequence data is 1; if there is a certain position in the second time series data When there is a missing value at the position, the value at the position corresponding to the position in the mask sequence data is 0.
  • the matrix of the second time series data X and the matrix of the mask sequence data m are as follows:
  • the "/" in X represents a missing value.
  • the time interval sequence data is constructed according to the second time sequence data and the mask sequence data.
  • the time indirect series data is data that passes through the difference between the values before and after the missing value in the second time series data.
  • the missing value in the second time series data can be anywhere in the second time series data, either at the front end of the second time series data or after the second time series data. The end may also be at a certain position in the middle of the second time series data. There may be multiple missing values in the second time series data.
  • the value at each position in the time interval sequence data is calculated by using a preset calculation formula. Calculate the time interval sequence data The calculation formula is as follows:
  • the matrix of the second time series data X and the matrix of the mask sequence data m are as follows:
  • the time interval sequence data is as follows:
  • the second time series data and the time interval series data are input into a preset generative confrontation network to output the third time series data.
  • the Generative Adversarial Networks (GAN, Generative Adversarial Networks) are pre-trained and used to generate a third sequence corresponding to the second sequence data without missing values according to the second time sequence data Data network.
  • the generative confrontation network usually includes a generator and a discriminator, adopts the idea of confrontation training, and outputs the required data through mutual game learning between the generator and the discriminator.
  • step S130 includes sub-steps S131 and S132.
  • the second time series data and the time interval series data are input into a preset recurrent neural network model to generate the third time series data.
  • the recurrent neural network model is a model that is pre-trained and used to generate third sequence data corresponding to the second time sequence data without missing values.
  • the recurrent neural network model is a gated recurrent neural network model and used as a generator in the generative confrontation neural network, and the second time sequence is generated by the gated recurrent neural network.
  • is the matrix of time interval series data, Is the renewal gate, Is the reset door, Is a candidate hidden layer, W ⁇ , W r ,W ⁇ ,b ⁇ ,b ⁇ ,b r , Is the training parameter, ⁇ is the element multiplication, and ⁇ is the sigmoid activation function.
  • the ⁇ formula guarantees that as ⁇ increases, the ⁇ value decreases; the smaller the ⁇ , the larger the ⁇ value.
  • the range of ⁇ is guaranteed to be between (0,1].
  • the second time series data is a time series data with a noisy missing value
  • the gate recurrent neural network first adds a random noise to the training sample before using the sample containing the missing value for training.
  • the gate recurrent neural network model is set as a denoising gate recurrent neural network model, and finally the noise-added samples are used for training, which is expressed as follows:
  • G(x+ ⁇ ) is the gate recurrent neural network model
  • X′ is the time series data output by the gate recurrent neural network model
  • the square error can be added to the loss of the gate recurrent neural network model In the function, it is expressed as follows:
  • is a hyperparameter that controls the weight of the discriminant loss and the squared error, and can be used to estimate the missing value of the second time sequence X through X'.
  • step S131 includes sub-steps S1311 and S1312.
  • the second time series data and the time interval series data are input into the first recurrent neural network layer in the recurrent neural network model to output a low-dimensional vector from the first recurrent neural network layer.
  • the recurrent neural network model includes a first recurrent neural network layer and a second recurrent neural network layer, wherein the first recurrent neural network layer and the second recurrent neural network layer are both gated recurrent neural networks. Since the second time series data is high-dimensional data, the second time series data is compressed into the position vector in the first recurrent neural network layer and is fully connected from the first recurrent neural network layer Output at the layer to realize the visualization of the second time series.
  • the low-dimensional vector is input to a second recurrent neural network layer in the recurrent neural network model to output the third time series data from the second recurrent neural network layer.
  • the third time series data is similar to the second time series data without missing values, and after the low-dimensional vector is input into the second recurrent neural network layer, the second recurrent neural network Each neural unit in the network layer is output, and then the output of each neural unit in the second recurrent neural network layer is combined to obtain the third time series data.
  • S132 Recognize the third time series data based on the discriminator in the generative confrontation network.
  • the third time series data is identified based on the discriminator in the generative confrontation network.
  • the discriminator is used to discriminate the third time series data generated in the recurrent neural network model in the generative confrontation network, and the discriminator is performing the processing on the third time series.
  • the probability of the authenticity output by the discriminator according to the second time series data is higher than The probability of the authenticity output by the discriminator according to the third time series data.
  • the network structure of the discriminator is a decoder composed of a gated recurrent neural network layer and a fully connected layer.
  • the discriminator is also obtained by training in an unsupervised learning manner.
  • the third time series data is input into a preset convolutional neural network to output fourth time series data matching the first time series data.
  • the convolutional neural network is a pre-trained network that is used to predict the fourth time series data that matches the first time series data according to the third time series data.
  • the convolutional neural network consists of a convolutional layer, a pooling layer and an output layer.
  • the third time series data Before the third time series data is input into the convolutional neural network, noise needs to be added to the third time series data to obtain fifth time series data that is more similar to the second time series data, Then, the fifth time series data is input into the convolutional neural network, and the convolutional layer, the pooling layer, and the output layer of the convolutional neural network are sequentially passed through to obtain the fourth time series data.
  • the convolutional neural network uses the training set to adjust the parameters (weights and biases).
  • the parameters of the neural network are optimized by the stochastic gradient descent method.
  • the idea of training or learning the neural network is to minimize the loss function C.
  • the loss function calculates the difference between the network prediction and the true value. In the model learning process, this difference is minimized by adjusting the weight and bias of the network.
  • the process of calculating the gradient needs to adjust the weight and bias, that is, back propagation. Backpropagation calculates the partial derivative of the loss function to any weight w or deviation b with It is concluded that the weight of the network is updated by the stochastic gradient descent method.
  • the input data is converted into a sequence of multiple overlapping windows of size w.
  • This window size defines the number of timestamps in the history record.
  • This window (historical record window) is taken into account and is also regarded as the background of x t .
  • the number of timestamps that need to be predicted is called the prediction window p w .
  • the third time series is ⁇ x 0 ,x 1 ,...,x t-1 ,x t ,x t+1 ⁇
  • p w 1
  • the time series of time t For example: x t-4 ,x t-3 ,x t-2 ,x t-1 ,x t ⁇ x t+1
  • the left side is the input data
  • the right side represents the data that needs to be predicted.
  • p w can be greater than 1.
  • X imputed is the fifth time series data
  • X is the second time series data
  • m is the mask series data
  • X′ is the third time series data.
  • step S140 includes sub-steps S141, S142, and S143.
  • the third time series data is input to the convolutional layer of the convolutional neural network model for convolution processing to obtain the convolution feature value of the third time series data.
  • the convolutional layer is divided into two stages. In the first stage, a convolution operation is performed to generate linear activations; in the second stage, a nonlinear activation function is applied to each linear activation.
  • the convolution operation is usually expressed as:
  • the function x represents the input third time series data
  • the function w represents the convolution kernel.
  • the new function s can represent a smooth estimate or a weighted average of the function x( ⁇ ) at the time stamp t, where w(- ⁇ ) is the weight.
  • S142 Input the convolution feature value to the pooling layer of the convolutional neural network model to perform pooling processing, so as to obtain the pooling feature value of the third time series data.
  • the convolution feature value is input to the pooling layer of the convolutional neural network model for pooling processing to obtain the pooling feature value of the third time series data.
  • the output of the convolutional layer will be processed by the pooling function of the pooling layer.
  • the pooling function statistically summarizes the output of the convolutional layer at the location according to the neighborhood of a location. The most commonly used max pooling operation is used in this scheme, which outputs the maximum value in the defined neighborhood.
  • S143 Input the characteristic value of the pooling layer to the output layer of the convolutional neural network model to output the fourth time series data.
  • the feature value of the pooling layer is input to the output layer of the convolutional neural network model to output the fourth time series data.
  • the output layer is a fully connected layer in the convolutional neural network, and in the fully connected layer after the accumulation layer and the maximum pooling layer, neurons in the previous layer are connected to all output neurons.
  • the activation function of the convolutional layer is as follows:
  • the activation function of the fully connected layer is as follows:
  • the convolutional neural network uses a preset distance calculation method to calculate the difference between the first time series data and the fourth time series data, and then completes the comparison.
  • the preset distance calculation methods include: Euclidean distance calculation, Manhattan distance calculation, Chebyshev distance calculation, Minkowski distance calculation, standardized Euclidean distance calculation, Mahalanobis distance calculation, angle cosine calculation, Hamming Distance calculation, Jaccard similarity coefficient calculation, correlation coefficient calculation, information entropy calculation and other calculation methods.
  • the Euclidean distance calculation method is used to calculate the difference value, and the calculation formula is as follows:
  • y t is the first time series data
  • y′ t is the fourth time series data
  • Euclidean distance is used as the difference value
  • the threshold value of the difference value is preset, and after the difference value between the first time series data and the fourth time series data is calculated, it is determined whether the difference value exceeds the threshold value; if it exceeds the threshold value, Mark the first time series data as abnormal; if it does not exceed the threshold, mark the first time series data as normal.
  • the embodiment of the present application also provides a time-series data detection device 100, which is used to execute any embodiment of the aforementioned time-series data detection method.
  • a time-series data detection device 100 which is used to execute any embodiment of the aforementioned time-series data detection method.
  • FIG. 6 is a schematic block diagram of the apparatus 100 for detecting time series data provided by an embodiment of the present application.
  • the device 100 for detecting time series data includes an acquisition unit 110, an acquisition unit 120, a first output unit 130, a second output unit 140, and a detection unit 150.
  • the collection unit 110 is configured to collect preset first time series data and second time series data, wherein the first time series data is the time series data currently to be detected, and the second time series data is the first time series data.
  • the obtaining unit 120 is configured to obtain two adjacent time interval series data before and after a missing value in the second time series data according to the second time series data.
  • the acquisition unit 120 includes: a first construction unit 121 and a second construction unit 122.
  • the first constructing unit 121 is configured to construct mask sequence data of the second time series data according to the second time series data.
  • the second construction unit 122 is configured to construct the time interval sequence data according to the second time sequence data and the mask sequence data.
  • the first output unit 130 is configured to input the second time series data and the time interval series data into a preset generative confrontation network to output third time series data.
  • the first output unit 130 includes: a first generation unit 131 and a discrimination unit 132.
  • the first generating unit 131 is configured to input the second time series data and the time interval series data into a preset recurrent neural network model to generate the third time series data.
  • the first generating unit 131 includes: a second generating unit 1311 and a third generating unit 1312.
  • the second generating unit 1311 is configured to input the second time series data and the time interval series data into the first recurrent neural network layer in the recurrent neural network model to obtain information from the first recurrent neural network layer The output low-dimensional vector in.
  • the third generating unit 1312 is configured to input the low-dimensional vector into the second recurrent neural network layer in the recurrent neural network model to output the third time series data from the second recurrent neural network layer .
  • the identification unit 132 is configured to identify the third time series data based on the discriminator in the generative confrontation network.
  • the second output unit 140 is configured to input the third time series data into a preset convolutional neural network to output fourth time series data matching the first time series data.
  • the second output unit 140 includes: a convolution unit 141, a pooling unit 142, and a third output unit 143.
  • the convolution unit 141 is configured to input the third time series data into the convolution layer of the convolutional neural network model to perform convolution processing to obtain the convolution feature value of the third time series data.
  • the pooling unit 142 is configured to input the convolution feature value to the pooling layer of the convolutional neural network model for pooling processing to obtain the pooling feature value of the third time series data.
  • the third output unit 143 is configured to input the feature value of the pooling layer to the output layer of the convolutional neural network model to output the fourth time series data.
  • the detection unit 150 detects the first time series data based on the fourth time series data to obtain a detection result of the first time series data.
  • FIG. 11 is a schematic block diagram of a computer device provided by an embodiment of the present application.
  • the device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the processor 502 can execute the time series data detection method.
  • the processor 502 is used to provide calculation and control capabilities, and support the operation of the entire device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can execute the time series data detection method.
  • the network interface 505 is used for network communication, such as providing data information transmission.
  • 11 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the device 500 to which the solution of the present application is applied.
  • the specific device 500 may be Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
  • the processor 502 is configured to run a computer program 5032 stored in a memory, so as to implement any embodiment of the above-mentioned method for detecting time series data.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors 502, or digital signal processors 502 (Digital Signal Processors, DSPs). ), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor 502 may be a microprocessor 502 or the processor 502 may also be any conventional processor 502 and the like.
  • the computer program may be stored in a storage medium, and the storage medium may be a computer-readable storage medium.
  • the computer program is executed by at least one processor in the computer system to implement the process steps of the foregoing method embodiment.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the storage medium stores a computer program that, when executed by a processor, implements any embodiment of the above-mentioned time-series data detection method.
  • the computer-readable storage medium may be a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk, or an optical disk, and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Fuzzy Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)

Abstract

一种时间序列数据的检测方法、装置、计算机设备及存储介质,该方法包括:采集第一时间序列数据、第一时间序列数据上一时刻含有缺失值的第二时间序列数据;根据第二时间序列数据获取第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;将第二时间序列数据、时间间隔序列数据输入至生成式对抗网络中以输出第三时间序列数据;将第三时间序列数据输入至卷积神经网络中以输出第四时间序列数据;基于第四时间序列数据对第一时间序列数据进行检测以得到检测结果。基于人工智能中的神经网络技术,可在上一时刻的时间序列数据出现缺失值的情况下,对当前时刻的时间序列数据进行检测,减少了因数据异常而造成的损失。

Description

时间序列数据的检测方法、装置、计算机设备及存储介质
本申请要求于2020年09月18日提交中国专利局、申请号为202010986193.8,发明名称为“时间序列数据的检测方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于数据检测技术领域,尤其涉及一种时间序列数据的检测方法、装置、计算机设备及存储介质。
背景技术
异常检测是智能运维(AIOps)系统中一项必不可少的基础功能,通常异常检测的主要目的是自动的发现时间序列数据中的异常波动后,为后续的告警、自动止损提供相应的决策依据。目前,当上一时刻的时间序列数据因设备故障或者人员采集不当的原因导致存在缺失值时,便会阻碍当前时间序列数据的异常检测。因此,发明人意识到需解决如何在上一时刻的时间序列数据出现缺失值的情况下,对当前时刻的时间序列数据进行检测以得到当前时刻的时间序列数据的问题。
发明内容
本申请实施例提供了一种时间序列数据的检测方法、装置、计算机设备及存储介质,旨在解决现有技术中在上一时刻的时间序列数据出现缺失值的情况下,能对当前时刻的时间序列数据进行正常的异常检测的问题。
第一方面,本申请实施例提供了一种时间序列数据的检测方法,其包括:
采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
第二方面,本申请实施例提供了一种时间序列数据的检测装置,其包括:
采集单元,用于采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
获取单元,用于根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
第一输出单元,用于将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
第二输出单元,用于将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
检测单元,基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
第三方面,本申请实施例又提供了一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时执行以下步骤:
采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
第四方面,本申请实施例还提供了一种计算机可读存储介质,其中所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行以下步骤:
采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
本申请实施例通过上述方法不仅可在上一时刻的时间序列数据出现缺失值的情况下,对当前时刻的时间序列数据进行异常检测,而且还完成了对上一时刻的时间序列数据的缺失值进行插补,减少了因数据异常而造成的损失。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的时间序列数据的检测方法的流程示意图;
图2为本申请实施例提供的时间序列数据的检测方法的子流程示意图;
图3为本申请实施例提供的时间序列数据的检测方法的另一子流程示意图;
图4为本申请实施例提供的时间序列数据的检测方法的另一子流程示意图;
图5为本申请实施例提供的时间序列数据的检测方法的另一子流程示意图;
图6为本申请实施例提供的时间序列数据的检测装置的示意性框图;
图7为本申请实施例提供的时间序列数据的检测装置的子单元示意性框图;
图8为本申请实施例提供的时间序列数据的检测装置的另一子单元示意性框图;
图9为本申请实施例提供的时间序列数据的检测装置的另一子单元示意性框图;
图10为本申请实施例提供的时间序列数据的检测装置的另一子单元示意性框图;
图11为本申请实施例提供的计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
请参阅图1,图1为本申请实施例提供的时间序列数据的检测方法的流程示意图。本申请实施例的时间序列数据的检测方法可应用于终端,例如手提电脑、平板电脑等智能终端设备,通过安装于所述终端上的软件例如命名为时间序列数据的检测工具的应用程序来实现所述时间序列数据的检测方法,从而确保用户所在所述终端上对时间序列数据的进行异常检测。需要说明的是,本申请实施例中所述第一时间序列数据、第二时间序列数据、第三时间序列数据、第四时间序列数据、时间间隔序列数据、掩码序列数据均以矩阵的形式进行处理。下面对所述时间序列数据的检测方法进行详细说明。
如图1所示,该方法包括以下步骤S110~S150。
S110、采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值。
采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值。具体的,当需要对某一设备当前的时间序列数据进行异常检测且当前时刻的时间序列数据的上一时刻的时间序列数据中存在缺失值时,需采集当前时刻的时间序列数据以及当前时刻的时间序列数据的上一时刻的时间序列数据。通过上一时刻的时间序列数据对当前时刻的时间序列数据进行预测以得到预测的当前时刻的时间序列数据,然后将预测的当前时刻的时间序列数据与当前时刻真实的时间序列数据进行对比分析,从而完成对当前时刻的时间序列数据的异常检测。其中,该设备当前的时间序列数据可以例如为时间序列数据化的传感器数据、设备参数监控数据、网页访问量数据、人流量数据等等。
S120、根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据。
根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据。具体的,在获取所述第二时间序列数据后,获取所述第二时间序列数据中的缺失值的位置,然后确定所述缺失值前后的差距以得到所述时间间序列数据。
在另一实施例中,如图2所示,步骤S120包括子步骤S121和S122。
S121、根据所述第二时间序列数据构建所述第二时间序列数据的掩码序列数据。
根据所述第二时间序列数据构建所述第二时间序列数据的掩码序列数据。具体的,所述掩码序列数据与所述第二时间序列数据的尺寸相同且所述掩码序列数据的数据元素的数量与所述第二时间序列数据的元素的数量相同并一一对应。若所述第二时间序列数据中某一位置处不存在缺失值时,则掩码序列数据中与该位置相对应的位置处的值为1;若所述第二时间序列数据中某一位置处存在缺失值时,则掩码序列数据中与该位置相对应的位置处的值为0。例如:所述第二时间序列数据X的矩阵、所述掩码序列数据m矩阵分别如下:
Figure PCTCN2020125060-appb-000001
其中,X中的“/”代表缺失值。
S122、根据所述第二时间序列数据、所述掩码序列数据构建所述时间间隔序列数据。
根据所述第二时间序列数据、所述掩码序列数据构建所述时间间隔序列数据。具体的,所述时间间接序列数据为通过所述第二时间序列数据中缺失值前后值的差距的数据。所述第二时间序列数据中的缺失值可以在所述第二时间序列数据中的任何位置,既可以在所述第二时间序列数据的前端,也可以在所述第二时间序列数据的后端,还可以在所述第二时间序列数据的中间的某一位置处。所述第二时间序列数据中可以存在多个缺失值。在本申请实施例中,通过预设的计算公式来计算所述时间间隔序列数据中每一个位置处的值。计算所述时间 间隔序列数据
Figure PCTCN2020125060-appb-000002
的计算公式如下:
Figure PCTCN2020125060-appb-000003
其中,i==0表示的是所述第二时间序列数据中的缺失值位于所述第二时间序列数据的后端,
Figure PCTCN2020125060-appb-000004
表示的是所述第二时间序列数据中缺失值位于所述第二时间序列数据的中间某一位置,
Figure PCTCN2020125060-appb-000005
表示的是所述第二时间序列数据中缺失值位于所述第二时间序列数据的前端,t i表示的是所述第二时间序列数据中某一位置处的时间数值,
Figure PCTCN2020125060-appb-000006
为所述第二时间序列数据前的时间序列数据中的时间间隔序列数据。例如:所述第二时间序列数据X的矩阵、所述掩码序列数据m矩阵分别如下:
Figure PCTCN2020125060-appb-000007
时,
所述时间间隔序列数据如下:
Figure PCTCN2020125060-appb-000008
S130、将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据。
将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据。具体的,所述生成式对抗网络(GAN,Generative Adversarial Networks)为预先训练好且用于根据所述第二时间序列数据生成与所述第二序列数据相对应的不存在缺失值的第三序列数据的网络。所述生成式对抗网络通常包括生成器和辨别器,采用对抗训练的思想,通过生成器和辨别器的互相博弈学习以输出所需要的数据。
在另一实施例中,如图3所示,步骤S130包括子步骤S131和S132。
S131、将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据。
将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据。具体的,所述递归神经网络模型为预先训练好且用于生成与所述第二时间序列数据相对应的不存在缺失值的第三序列数据的模型。在本申请实施例中,将所述递归神经网络模型为门递归神经网络模型并作为所述生成对抗神经网络中的生成器,所述第二时间序列通过所述门递归神经网络生成所述第三时间序列数据的同时对所述门递归神经网络进行非监督学习训练,而且采用所述门递归神经网络模型进行插补的主要思想是引入时间衰减向量β来控制过去时刻观测值的影响,所述门递归神经网络的更新函数如下:
Figure PCTCN2020125060-appb-000009
Figure PCTCN2020125060-appb-000010
Figure PCTCN2020125060-appb-000011
Figure PCTCN2020125060-appb-000012
Figure PCTCN2020125060-appb-000013
其中,δ是时间间隔序列数据的矩阵,
Figure PCTCN2020125060-appb-000014
是更新门,
Figure PCTCN2020125060-appb-000015
是重置门,
Figure PCTCN2020125060-appb-000016
是候选隐藏层,W β,
Figure PCTCN2020125060-appb-000017
W r,W μ,b β,b μ,b r,
Figure PCTCN2020125060-appb-000018
是训练参数,⊙是元素相乘,σ是sigmoid激活函数,β公式保证了随着δ的增大,β值减小;δ越小,β值越大。β的范围确保在(0,1]之间。
所述第二时间序列数据是以一个的有噪声的缺失值的时间序列数据,所述门递归神经网络在采用含有缺失值的样本进行训练之前,首先在训练样本的基础上中添加一个随机噪声η,然后所述门递归神经网络模型设置为一个去噪的门递归神经网络模型,最后使用添加了噪声的样本进行训练,其表示如下:
G(x+η)=X′
其中,G(x+η)为所述门递归神经网络模型,X′为所述门递归神经网络模型输出的时间序列数据。
另外,由于所述门递归神经网络模型的目的是生成与所述第二时间序列数据最相似的不存在缺失值的时间序列数据,因此可将平方误差添加到所述门递归神经网络模型的损失函数中,其表示如下:
L G=λ‖x⊙m-G(x+η)⊙m‖ 2-D(x′)
其中,λ是控制判别损失和平方误差权重的超参数,通过X′就可以被用来估算第二时间序X的缺失值。
在另一实施例中,如图4所示,步骤S131包括子步骤S1311和S1312。
S1311、将所述第二时间序列数据、所述时间间隔序列数据输入至所述递归神经网络模型中的第一递归神经网络层中以从所述第一递归神经网络层中的输出低维向量。
将所述第二时间序列数据、所述时间间隔序列数据输入至所述递归神经网络模型中的第一递归神经网络层中以从所述第一递归神经网络层中的输出低维向量。具体的,所述递归神经网络模型包括第一递归神经网络层和第二递归神经网络层,其中所述第一递归神经网络层、所述第二递归神经网络层均为门递归神经网络。由于所述第二时间序列数据为高维数据,所述第二时间序列数据在所述第一递归神经网络层中被压缩成所述地位向量并从所述第一递归神经网络层的全连接层处输出,进而实现所述第二时间序列的可视化。
S1312、将所述低维向量输入至所述递归神经网络模型中的第二递归神经网络层中以从所述第二递归神经网络层中输出所述第三时间序列数据。
将所述低维向量输入至所述递归神经网络模型中的第二递归神经网络层中以从所述第二递归神经网络层中输出所述第三时间序列数据。具体的,所述第三时间序列数据与所述第二时间序列数据相似且不存在缺失值,所述低维向量输入至所述第二递归神经网络层中后,从所述第二递归神经网络层中的每个神经单元中输出,然后将所述第二递归神经网络层中的每个神经单元中的输出进行合并以得到所述第三时间序列数据。
S132、基于所述生成式对抗网络中的辨别器识别出所述第三时间序列数据。
基于所述生成式对抗网络中的辨别器识别出所述第三时间序列数据。具体的,所述辨别器为用于在所述生成式对抗网络中辨别出所述递归神经网络模型中生成的所述第三时间序列数据,所述辨别器在对所述第三时间序列进行辨别的过程中,当所述第二时间序列、所述第三时间序列数据分别输入到所述辨别器中,所述辨别器根据所述第二时间序列数据输出的真实度的概率要高于所述辨别器根据所述第三时间序列数据输出的真实度的概率。在本申请实施例中,所述辨别器的网络结构是一个解码器,由门递归神经网络层和完全连接层构成,同样的,所述辨别器也是采用非监督学习的方式进行训练而得到。
S140、将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据。
将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据。具体的,所述卷积神经网络为预先训练好的且用于根据所述第三时间序列数据以预测出与所述第一时间序列数据相匹配的第四时间序列数据的网络。所述卷积神经网络由卷积层、池化层和输出层组成。所述第三时间序列数据在输入至所述卷积神经网络中之前,先需对所述第三时间序列数据添加噪声以得到与所述第二时间序列数据更相似的第五时间序列数据,然后将所述第五时间序列数据输入至所述卷积神经网络中,依次经过所述卷积神经网络的卷积层、池化层以及输出层,进而得到所述第四时间序列数据。
卷积神经网络利用训练集来调整参数(权重和偏置),神经网络的参数由随机梯度下降法优化,训练或者学习神经网络的思想即为最小化损失函数C。在预测器模型中,损失函数计算了网络预测和真实值之间的差异。在模型学习进程中,这个差异通过调整网络的权重和偏置来实现最小化。计算梯度的过程需要调整权重和偏置,即反向传播。反向传播通过计算损失函数对任何权重w或偏差b的偏导数
Figure PCTCN2020125060-appb-000019
Figure PCTCN2020125060-appb-000020
得出,网络的权重由随机梯度下降法更新。
对于所述第三时间序列中时间戳t的每一个元素x t,下一个时间戳t+1的元素x t+1作为它的标签。输入数据被转换成多个大小为w的重叠窗口序列。这个窗口大小定义了历史记录中时间戳的数量,将该窗口(历史记录窗口)考虑在内,并且也将其看做为x t的背景,需要预测的时间戳数称为预测窗口p w
例如,当所述第三时间序列为{x 0,x 1,…,x t-1,x t,x t+1},对于w=5,p w=1,时间戳为t的时间序列来说:x t-4,x t-3,x t-2,x t-1,x t→x t+1,左边是输入的数据,右边代表需要预测的数据,其中,p w可以大于1。
另外,对所述第三时间序列数据添加噪声以得到第五时间序列数据的公式如下:
X imputed=X⊙m+(1-m)⊙X′
其中,X imputed为第五时间序列数据,X为第二时间序列数据,m为掩码序列数据,X′为第三时间序列数据。
在另一实施例中,如图5所示,步骤S140包括子步骤S141、S142和S143。
S141、将所述第三时间序列数据输入至所述卷积神经网络模型的卷积层进行卷积处理,以得到所述第三时间序列数据的卷积特征值。
将所述第三时间序列数据输入至所述卷积神经网络模型的卷积层进行卷积处理,以得到所述第三时间序列数据的卷积特征值。具体的,所述卷积层分为两个阶段。第一阶段,进行卷积运算,从而产生线性激活;第二阶段,对每一个线性激活应用一个非线性激活函数。卷积运算通常表示为:
s(t)=(x*w)(t)
其中,函数x表示输入的第三时间序列数据,函数w表示卷积核。新函数s可以表示函数x(τ)在时间戳t处的的平滑估计或加权平均,其中w(-τ)是权重。
Figure PCTCN2020125060-appb-000021
S142、将所述卷积特征值输入至所述卷积神经网络模型的池化层进行池化处理,以得到所述第三时间序列数据的池化特征值。
将所述卷积特征值输入至所述卷积神经网络模型的池化层进行池化处理,以得到所述第三时间序列数据的池化特征值。具体的,卷积层的输出将由池化层的池化函数处理。池化函数根据某一位置的邻域统计地汇总卷积层在该位置的输出。本方案中使用了最常用的最大池化操作,它输出了定义的邻域中的最大值。
S143将所述池化层特征值输入至所述卷积神经网络模型的输出层以输出所述第四时间序列数据。
将所述池化层特征值输入至所述卷积神经网络模型的输出层以输出所述第四时间序列数据。具体的,所述输出层为所述卷积神经网络中的全连接层,积层和最大池化层之后的全连接层中,前面一层的神经元与所有输出神经元相连。卷积层的激活函数如下:
Figure PCTCN2020125060-appb-000022
Figure PCTCN2020125060-appb-000023
其中,
Figure PCTCN2020125060-appb-000024
表示卷积层的第i个输入位置处第l层中的第j个神经元的激活函数。全连接层的激活函数如下:
Figure PCTCN2020125060-appb-000025
Figure PCTCN2020125060-appb-000026
其中,
Figure PCTCN2020125060-appb-000027
表示第l个全连接层中第j个神经元的激活函数。
S150、基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。具体的,所述卷积神经网络输出所述第四时间序列数据后,使用预设的 距离计算方法来计算所述第一时间序列数据与所述第四时间序列数据的差异值,进而完成对所述第一时间序列数据的异常检测。其中,所述预设的距离计算方法包括:欧式距离计算、曼哈顿距离计算、切比雪夫距离计算、闵可夫斯基距离计算、标准化欧氏距离计算、马氏距离计算、夹角余弦计算、汉明距离计算、杰卡德相似系数计算、相关系数计算、信息熵计算等计算方法。在本申请实施例中采用欧式距离计算方法来进行计算差异值,计算的公式如下:
Figure PCTCN2020125060-appb-000028
其中,y t是所述第一时间序列数据,y′ t是所述第四时间序列数据,欧氏距离作为差异值。
预先设定所述差异值的阈值,当计算出所述第一时间序列数据与所述第四时间序列数据的差异值后,判断所述差异值是否超过所述阈值;若超过所述阈值,则标记所述第一时间序列数据为异常;若未超过所述阈值,则标记所述第一时间序列数据为正常。
本申请实施例还提供了一种时间序列数据的检测装置100,该装置用于执行前述时间序列数据的检测方法的任一实施例。具体地,请参阅图6,图6是本申请实施例提供的时间序列数据的检测装置100的示意性框图。
如图6所示,所述时间序列数据的检测装置100,该装置包括采集单元110、获取单元120、第一输出单元130、第二输出单元140和检测单元150。
采集单元110,用于采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值。
获取单元120,用于根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据。
在其他申请实施例中,如图7所示,所述获取单元120包括:第一构建单元121和第二构建单元122。
第一构建单元121,用于根据所述第二时间序列数据构建所述第二时间序列数据的掩码序列数据。
第二构建单元122,用于根据所述第二时间序列数据、所述掩码序列数据构建所述时间间隔序列数据。
第一输出单元130,用于将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据。
在其他申请实施例中,如图8所示,所述第一输出单元130包括:第一生成单元131和辨别单元132。
第一生成单元131,用于将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据。
在其他申请实施例中,如图9所示,所述第一生成单元131包括:第二生成单元1311和第三生成单元1312。
第二生成单元1311,用于将所述第二时间序列数据、所述时间间隔序列数据输入至所述递归神经网络模型中的第一递归神经网络层中以从所述第一递归神经网络层中的输出低维向 量。
第三生成单元1312,用于将所述低维向量输入至所述递归神经网络模型中的第二递归神经网络层中以从所述第二递归神经网络层中输出所述第三时间序列数据。
辨别单元132,用于基于所述生成式对抗网络中的辨别器识别出所述第三时间序列数据。
第二输出单元140,用于将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据。
在其他申请实施例中,如图10所示,所述第二输出单元140包括:卷积单元141、池化单元142和第三输出单元143。
卷积单元141,用于将所述第三时间序列数据输入至所述卷积神经网络模型的卷积层进行卷积处理,以得到所述第三时间序列数据的卷积特征值。
池化单元142,用于将所述卷积特征值输入至所述卷积神经网络模型的池化层进行池化处理,以得到所述第三时间序列数据的池化特征值。
第三输出单元143,用于将所述池化层特征值输入至所述卷积神经网络模型的输出层以输出所述第四时间序列数据。
检测单元150,基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
参阅图11,图11是本申请实施例提供的计算机设备的示意性框图。
参阅图11,该设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行时间序列数据的检测方法。该处理器502用于提供计算和控制能力,支撑整个设备500的运行。该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行时间序列数据的检测方法。该网络接口505用于进行网络通信,如提供数据信息的传输等。本领域技术人员可以理解,图11中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的设备500的限定,具体的设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现上述时间序列数据的检测方法的任一实施例。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器502、数字信号处理器502(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器502可以是微处理器502或者该处理器502也可以是任何常规的处理器502等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以 通过计算机程序来指令相关的硬件来完成。该计算机程序可存储于一存储介质中,该存储介质可以为计算机可读存储介质。该计算机程序被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。
因此,本申请还提供了一种计算机可读存储介质。该计算机可读存储介质可以是非易失性,也可以是易失性。该存储介质存储有计算机程序,该计算机程序当被处理器执行时实现上述时间序列数据的检测方法的任一实施例。
该计算机可读存储介质可以是U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置、设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置、设备和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种时间序列数据的检测方法,其中,包括以下步骤:
    采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
    根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
    将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
    将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
    基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
  2. 根据权利要求1所述的时间序列数据的检测方法,其中,所述根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据,包括:
    根据所述第二时间序列数据构建所述第二时间序列数据的掩码序列数据;
    根据所述第二时间序列数据、所述掩码序列数据构建所述时间间隔序列数据。
  3. 根据权利要求1所述的时间序列数据的检测方法,其中,所述将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据,包括:
    将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据;
    基于所述生成式对抗网络中的辨别器识别出所述第三时间序列数据。
  4. 根据权利要求3所述的时间序列数据的检测方法,其中,所述将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据,包括:
    将所述第二时间序列数据、所述时间间隔序列数据输入至所述递归神经网络模型中的第一递归神经网络层中以从所述第一递归神经网络层中的输出低维向量;
    将所述低维向量输入至所述递归神经网络模型中的第二递归神经网络层中以从所述第二递归神经网络层中输出所述第三时间序列数据。
  5. 根据权利要求4所述的时间序列数据的检测方法,其中,所述第一递归神经网络层、所述第二递归神经网络层均为门递归神经网络。
  6. 根据权利要求1所述的时间序列数据的检测方法,其中,所述将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据,包括:
    将所述第三时间序列数据输入至所述卷积神经网络模型的卷积层进行卷积处理,以得到所述第三时间序列数据的卷积特征值;
    将所述卷积特征值输入至所述卷积神经网络模型的池化层进行池化处理,以得到所述第 三时间序列数据的池化特征值;
    将所述池化层特征值输入至所述卷积神经网络模型的输出层以输出所述第四时间序列数据。
  7. 根据权利要求1所述的时间序列数据的检测方法,其中,所述基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果,包括:
    采用欧式距离计算方法计算所述第一时间序列数据与所述第四时间序列数据的差异值以得到所述第一时间序列数据的检测结果。
  8. 一种时间序列数据的检测装置,其中,包括:
    采集单元,用于采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
    获取单元,用于根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
    第一输出单元,用于将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
    第二输出单元,用于将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
    检测单元,基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
  9. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时执行以下步骤:
    采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
    根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
    将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
    将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
    基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
  10. 根据权利要求9所述的计算机设备,其中,所述根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据,包括:
    根据所述第二时间序列数据构建所述第二时间序列数据的掩码序列数据;
    根据所述第二时间序列数据、所述掩码序列数据构建所述时间间隔序列数据。
  11. 根据权利要求9所述的计算机设备,其中,所述将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据,包括:
    将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据;
    基于所述生成式对抗网络中的辨别器识别出所述第三时间序列数据。
  12. 根据权利要求11所述的计算机设备,其中,所述将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据,包括:
    将所述第二时间序列数据、所述时间间隔序列数据输入至所述递归神经网络模型中的第一递归神经网络层中以从所述第一递归神经网络层中的输出低维向量;
    将所述低维向量输入至所述递归神经网络模型中的第二递归神经网络层中以从所述第二递归神经网络层中输出所述第三时间序列数据。
  13. 根据权利要求12所述的计算机设备,其中,所述第一递归神经网络层、所述第二递归神经网络层均为门递归神经网络。
  14. 根据权利要求9所述的计算机设备,其中,所述将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据,包括:
    将所述第三时间序列数据输入至所述卷积神经网络模型的卷积层进行卷积处理,以得到所述第三时间序列数据的卷积特征值;
    将所述卷积特征值输入至所述卷积神经网络模型的池化层进行池化处理,以得到所述第三时间序列数据的池化特征值;
    将所述池化层特征值输入至所述卷积神经网络模型的输出层以输出所述第四时间序列数据。
  15. 根据权利要求9所述的计算机设备,其中,所述基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果,包括:
    采用欧式距离计算方法计算所述第一时间序列数据与所述第四时间序列数据的差异值以得到所述第一时间序列数据的检测结果。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行以下步骤:
    采集预置的第一时间序列数据、第二时间序列数据,其中所述第一时间序列数据为当前需检测的时间序列数据,所述第二时间序列数据为所述第一时间序列数据的上一时刻的时间序列数据且存在缺失值;
    根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据;
    将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据;
    将所述第三时间序列数据输入至预置的卷积神经网络中以输出与所述第一时间序列数据相匹配的第四时间序列数据;
    基于所述第四时间序列数据对所述第一时间序列数据进行检测以得到所述第一时间序列数据的检测结果。
  17. 根据权利要求16所述的计算机可读存储介质,其中,所述根据所述第二时间序列数据获取所述第二时间序列数据中缺失值的前后两个相邻的时间间隔序列数据,包括:
    根据所述第二时间序列数据构建所述第二时间序列数据的掩码序列数据;
    根据所述第二时间序列数据、所述掩码序列数据构建所述时间间隔序列数据。
  18. 根据权利要求16所述的计算机可读存储介质,其中,所述将所述第二时间序列数据、所述时间间隔序列数据输入至预置的生成式对抗网络中以输出第三时间序列数据,包括:
    将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据;
    基于所述生成式对抗网络中的辨别器识别出所述第三时间序列数据。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述将所述第二时间序列数据、所述时间间隔序列数据输入至预置的递归神经网络模型中以生成所述第三时间序列数据,包括:
    将所述第二时间序列数据、所述时间间隔序列数据输入至所述递归神经网络模型中的第一递归神经网络层中以从所述第一递归神经网络层中的输出低维向量;
    将所述低维向量输入至所述递归神经网络模型中的第二递归神经网络层中以从所述第二递归神经网络层中输出所述第三时间序列数据。
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述第一递归神经网络层、所述第二递归神经网络层均为门递归神经网络。
PCT/CN2020/125060 2020-09-18 2020-10-30 时间序列数据的检测方法、装置、计算机设备及存储介质 WO2021169361A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010986193.8 2020-09-18
CN202010986193.8A CN112115184A (zh) 2020-09-18 2020-09-18 时间序列数据的检测方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021169361A1 true WO2021169361A1 (zh) 2021-09-02

Family

ID=73800745

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/125060 WO2021169361A1 (zh) 2020-09-18 2020-10-30 时间序列数据的检测方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN112115184A (zh)
WO (1) WO2021169361A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704627A (zh) * 2021-09-06 2021-11-26 中国计量大学 一种基于时间间隔图的会话推荐方法
CN114925808A (zh) * 2022-04-15 2022-08-19 北京理工大学 一种基于云网端资源中不完整时间序列的异常检测方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113011476B (zh) * 2021-03-05 2022-11-11 桂林电子科技大学 基于自适应滑动窗口gan的用户行为安全检测方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109034127A (zh) * 2018-08-31 2018-12-18 中国电子科技集团公司第三十六研究所 一种频谱异常检测方法、装置和电子设备
CN110473084A (zh) * 2019-07-17 2019-11-19 中国银行股份有限公司 一种异常检测方法和装置
CN110555018A (zh) * 2019-07-29 2019-12-10 浙江工业大学 一种交通流量补全与预测方法
CN111027058A (zh) * 2019-11-12 2020-04-17 深圳供电局有限公司 一种电力系统检测数据攻击的方法、计算机设备和存储介质
CN111046027A (zh) * 2019-11-25 2020-04-21 北京百度网讯科技有限公司 时间序列数据的缺失值填充方法和装置
US20200210809A1 (en) * 2018-12-30 2020-07-02 Playtika Ltd. System and method for outlier detection using a cascade of neural networks

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10866939B2 (en) * 2015-11-30 2020-12-15 Micro Focus Llc Alignment and deduplication of time-series datasets
CN108491886A (zh) * 2018-03-29 2018-09-04 重庆大学 一种基于卷积神经网络的多元时序数据的分类方法
CN109948646A (zh) * 2019-01-24 2019-06-28 西安交通大学 一种时序数据相似度度量方法及度量系统
CN110286656B (zh) * 2019-05-07 2020-07-17 清华大学 一种错误数据容忍的虚警过滤方法和装置
CN110362999B (zh) * 2019-06-25 2023-04-18 创新先进技术有限公司 用于检测账户使用异常的方法及装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109034127A (zh) * 2018-08-31 2018-12-18 中国电子科技集团公司第三十六研究所 一种频谱异常检测方法、装置和电子设备
US20200210809A1 (en) * 2018-12-30 2020-07-02 Playtika Ltd. System and method for outlier detection using a cascade of neural networks
CN110473084A (zh) * 2019-07-17 2019-11-19 中国银行股份有限公司 一种异常检测方法和装置
CN110555018A (zh) * 2019-07-29 2019-12-10 浙江工业大学 一种交通流量补全与预测方法
CN111027058A (zh) * 2019-11-12 2020-04-17 深圳供电局有限公司 一种电力系统检测数据攻击的方法、计算机设备和存储介质
CN111046027A (zh) * 2019-11-25 2020-04-21 北京百度网讯科技有限公司 时间序列数据的缺失值填充方法和装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704627A (zh) * 2021-09-06 2021-11-26 中国计量大学 一种基于时间间隔图的会话推荐方法
CN113704627B (zh) * 2021-09-06 2022-05-17 中国计量大学 一种基于时间间隔图的会话推荐方法
CN114925808A (zh) * 2022-04-15 2022-08-19 北京理工大学 一种基于云网端资源中不完整时间序列的异常检测方法
CN114925808B (zh) * 2022-04-15 2023-10-10 北京理工大学 一种基于云网端资源中不完整时间序列的异常检测方法

Also Published As

Publication number Publication date
CN112115184A (zh) 2020-12-22

Similar Documents

Publication Publication Date Title
WO2021169361A1 (zh) 时间序列数据的检测方法、装置、计算机设备及存储介质
JP7223839B2 (ja) 異常検出および/または予知保全のためのコンピュータ実装方法、コンピュータプログラム製品およびシステム
US10929722B2 (en) Anomaly detection in streaming networks
EP3929824A2 (en) Robust multimodal sensor fusion for autonomous driving vehicles
CN107092582B (zh) 一种基于残差后验的异常值在线检测及置信度评估方法
US20200371491A1 (en) Determining Operating State from Complex Sensor Data
Lee et al. Studies on the GAN-based anomaly detection methods for the time series data
CN116757534B (zh) 一种基于神经训练网络的智能冰箱可靠性分析方法
CN112202726B (zh) 一种基于上下文感知的系统异常检测方法
Mahmoud et al. User activities outliers detection; integration of statistical and computational intelligence techniques
Cheng et al. Using neural networks to detect the bivariate process variance shifts pattern
CN113438114B (zh) 互联网系统的运行状态监控方法、装置、设备及存储介质
CN117041017B (zh) 数据中心的智能运维管理方法及系统
CN117421684B (zh) 基于数据挖掘和神经网络的异常数据监测与分析方法
CN111177224A (zh) 一种基于条件式规整化流模型的时间序列无监督异常检测方法
Kumar et al. An adaptive transformer model for anomaly detection in wireless sensor networks in real-time
Cho et al. Hierarchical anomaly detection using a multioutput Gaussian process
Saci et al. Autocorrelation integrated gaussian based anomaly detection using sensory data in industrial manufacturing
CN111881299A (zh) 基于复制神经网络的离群事件检测与识别方法
Tembhekar et al. Cross-Domain Applications of MLOps: From Healthcare to Finance
Moon et al. Anomaly detection using a model-agnostic meta-learning-based variational auto-encoder for facility management
Qin et al. CSCAD: Correlation structure-based collective anomaly detection in complex system
Xu et al. A multivariate anomaly detector for satellite telemetry data using temporal attention-based lstm autoencoder
CN117076869B (zh) 旋转机械时频域融合故障诊断方法及系统
Pushkar et al. A comparative study on change-point detection methods in time series data

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20922006

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20922006

Country of ref document: EP

Kind code of ref document: A1