WO2021189845A1 - Detection method and apparatus for time series anomaly point, and device and readable storage medium - Google Patents
Detection method and apparatus for time series anomaly point, and device and readable storage medium Download PDFInfo
- Publication number
- WO2021189845A1 WO2021189845A1 PCT/CN2020/125004 CN2020125004W WO2021189845A1 WO 2021189845 A1 WO2021189845 A1 WO 2021189845A1 CN 2020125004 W CN2020125004 W CN 2020125004W WO 2021189845 A1 WO2021189845 A1 WO 2021189845A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- window
- processed
- target
- target window
- time point
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2474—Sequence data queries, e.g. querying versioned data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
Definitions
- This application relates to the field of artificial intelligence, and in particular to methods, devices, equipment, and computer-readable storage medium names for detecting abnormal points in time series.
- time series refers to a sequence composed of observation data of a certain indicator according to time.
- Hardware devices such as hosts and servers will generate a large number of indicator values during operation. For example, the CPU usage per second of the host and the hourly request volume of a certain business can form univariate time series indicator data.
- the anomaly detection of time series is to find the difference from the historical behavior pattern from the data.
- the inventor realizes that traditional time series anomaly detection methods often use distance measurement methods, that is, by calculating the distance between a given univariate time series and the expected value and comparing it with a given threshold, if the distance is greater than the given threshold, it can be determined This point is an abnormal point.
- the threshold is usually selected as some basic statistics, such as the median or 90% quantile. However, the selection of the threshold is too subjective and is not suitable for data anomaly detection in all time series.
- a method for detecting abnormal points in a time series includes:
- the similarity value it is determined whether the time point corresponding to the target window is an abnormal point.
- a detection device for abnormal points in a time series includes:
- An obtaining module configured to obtain a target window in a time series to be processed, and obtain a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
- the first determining module is configured to determine the similarity value between the target window and the window to be processed based on the preset model according to the target window and the window to be processed;
- the second determining module is configured to determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
- a computer device including a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the following steps are implemented :
- the similarity value it is determined whether the time point corresponding to the target window is an abnormal point.
- a computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:
- the similarity value it is determined whether the time point corresponding to the target window is an abnormal point.
- the method, device, device, and computer-readable storage medium for detecting abnormal points in a time series realize that by obtaining the target window and the window to be processed in the time series, the difference between the collected sample sequences is small , Through the preset model to determine the similarity value of the target window and the window to be processed, to avoid large errors in the obtained abnormal sequence.
- FIG. 1 is a schematic flowchart of a method for detecting abnormal points in a time series provided by an embodiment of this application;
- FIG. 2 is a schematic flowchart of sub-steps of the method for detecting abnormal points in the time series in FIG. 1;
- Fig. 3 is a schematic flow diagram of sub-steps of the method for detecting abnormal points in the time series in Fig. 1;
- FIG. 4 is a schematic flowchart of sub-steps of the method for detecting abnormal points in the time series in FIG. 1;
- FIG. 5 is a schematic diagram of a network layer of a preset model in an embodiment of the application.
- FIG. 6 is a schematic flowchart of sub-steps of the method for detecting abnormal points in the time series in FIG. 1;
- FIG. 7 is a schematic flowchart of another method for detecting abnormal points in a time series provided by an embodiment of this application.
- FIG. 8 is a schematic block diagram of a device for detecting abnormal points in a time series provided by an embodiment of the application.
- FIG. 9 is a schematic block diagram of the structure of a computer device related to an embodiment of the application.
- the embodiments of the present application provide a method, device, equipment, and computer-readable storage medium for detecting abnormal points in a time series.
- the method for detecting abnormal points in the time series can be applied to terminal devices, which can be mobile phones, tablet computers, notebook computers, and desktop computers.
- FIG. 1 is a schematic flowchart of a method for detecting abnormal points in a time series according to an embodiment of the application.
- the method for detecting abnormal points in the time series includes steps S101 to S103.
- Step S101 Obtain a target window in the to-be-processed time series, and acquire a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one.
- the time series refers to a sequence formed by arranging the values of a certain statistical indicator of a certain phenomenon at different times in chronological order.
- the target window refers to the value obtained on the time series based on the window information and contains the value corresponding to the window on the time series. For example, based on the user's operation instruction, the target window corresponding to the operation instruction in the to-be-processed time sequence can be obtained through preset window information. Sliding on the time series based on the window information of the target window, and collecting the to-be-processed window corresponding to the target window on the time series.
- step S101 includes: sub-step S1011 to sub-step S1012.
- Sub-step S1011 determine the target time point to be detected on the time sequence to be processed.
- Receive the user's operation instruction determine the corresponding time point of the operation instruction in the to-be-processed time sequence based on the operation instruction, and use the time point as the target time point to be detected.
- Sub-step S1012 Obtain a target window corresponding to the target time point based on the preset window information and the target time point.
- a target window corresponding to the target time point is obtained. For example, when it is determined that the target time point on the time series to be processed is time t, and the length of the window information is 20 time points, the sequence corresponding to the 20 time points before time t in the time series to be processed is obtained as the time point t The target window.
- step S101 includes: sub-step S1013 to sub-step S1014.
- Sub-step S1013 Determine the collection strategy of the target time point according to the time sequence to be processed.
- the duration information of the to-be-processed time sequence is acquired, and the preset segmentation strategy is determined based on the duration information of the to-be-processed time sequence.
- the time sequence to be trained is segmented according to a preset segmentation strategy to obtain multiple sub-time sequences of the processing time sequence. For example, each time point of the time sequence to be trained is acquired, and it is determined whether the time sequence to be trained is less than a preset time point. If the time point is less than the preset time point, the time point is segmented based on the preset segmentation strategy.
- the training time sequence is from 2018-1-1-00-00-00 to 2020-7-1-00-00-00, and the preset time point is 2020-1-1-00-00-00, then it is determined
- the time sequence to be trained is greater than the preset time point. Divide the time series to be trained into 2018-1-1-00-00-00 to 2020-1-1-00-00-00 and 2020-1-1-00-00-00 through the preset split strategy To 2020-7-1-00-00-00 two sub-time sequences to be trained. Through different sub-time series to be trained, the acquisition strategy of the time series to be trained is determined.
- Sub-step S1014 based on the acquisition strategy and the preset window information, obtain a window to be processed corresponding to the target window.
- the two time series to be trained are collected separately to obtain the to-be-processed window corresponding to the target window.
- the duration information of the time sequence to be processed is the current time 2020-6-1-00-00-00
- the preset time information is 2020-7-1-00-00-00
- the duration information includes the preset time Information
- the collection strategy of the target time point is determined by the duration information. For example, determine the first acquisition strategy from the current moment to 2020-7-1-00-00-00, and determine the second acquisition strategy of 2020-7-1-00-00-00-2020-6-1-00-00-00 Acquisition strategy.
- the current time on the to-be-processed time sequence is slid to 2020-7-1-00-00-00 to obtain the to-be-processed window corresponding to the target window.
- slide 2020-7-1-00-00-00-00-2020-6-1-00-00-00 on the to-be-processed time series to obtain the corresponding target window Pending window.
- the sliding interval in 2020-7-1-00-00-00-2020-6-1-00-00-00 on the to-be-processed time series is greater than the current moment -2020 on the to-be-processed time series -The sliding interval in 7-1-00-00-00, and the number of windows to be processed is greater than 1.
- Step S102 Based on a preset model, determine a similarity value between the target window and the window to be processed according to the target window and the window to be processed.
- the preset model is obtained through training in advance through training data.
- the training data includes windows to be trained, similar windows, and dissimilar windows.
- the model to be trained is trained through the window to be trained and the similar window, the target window and the dissimilar window, and the weight parameters in the model are adjusted to obtain the corresponding preset model.
- the target window and the window to be processed are input into a preset model, and the preset model is run to obtain a similarity value between the target window and the window to be processed. If the number of windows to be processed is multiple, the windows to be processed and the target window are sequentially input into the preset model.
- the number of windows to be processed is three, they are respectively the window to be processed A1, the window to be processed A2, and the window to be processed A3.
- Input the to-be-processed window A1 and the target window into the preset model in turn to obtain the similarity value between the to-be-processed window A1 and the target window; input the to-be-processed window A2 and the target window into the preset model to obtain the to-be-processed window A2 and the target window
- the similarity value between the window A3 to be processed and the target window are input into the preset model to obtain the similarity value between the window A3 to be processed and the target window.
- step S102 includes: sub-step S1021 to sub-step S1023.
- Sub-step S1021 based on a preset model, input the target window and the window to be processed into the preset model respectively.
- a preset model is obtained, and the preset model includes a twin neural network model.
- the target window and the window to be processed are respectively input into the preset model, where the model includes two input layers.
- mapping parameters of the target window and the mapping parameters of the window to be processed are obtained respectively through the weight parameters of the preset model.
- the preset model includes an input layer, a forward propagation layer, a back propagation layer, and an output layer.
- the value in the target window is mapped through the weight parameters in the input layer, the forward propagation layer, the back propagation layer, and the output layer in the preset model to obtain the mapping parameter of each value in the target window.
- the value in the window to be processed is mapped by the weight parameters in the input layer, the forward propagation layer, the back propagation layer, and the output layer in the preset model to obtain the mapping parameter of each value in the window to be processed. Based on the mapping parameter of each value in the target window and the mapping parameter of each value in the window to be processed, the similarity value corresponding to the target window and the window to be processed is obtained.
- Step S103 Determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
- the similarity value between the target window and the window to be processed is acquired, and based on the similarity value between the target window and the window to be processed, it is determined that the time point corresponding to the target window is an abnormal point.
- a preset threshold is acquired, and if the similarity value between the target window and the window to be processed is greater than the preset threshold, the time point is marked as an abnormal point. If the similarity value between the target window and the window to be processed is less than the preset threshold, it can be considered that the time point is not an abnormal point.
- step S103 includes: sub-step S1031 to sub-step S1032.
- sub-step S1031 it is determined whether the similarity value between the target window and each of the windows to be processed is less than a preset threshold.
- a preset threshold value is acquired, and whether the time point corresponding to the target window is an abnormal point is determined through the preset threshold value.
- the similarity value between the target window and the window to be processed is compared with the preset threshold. If the similarity value between the target window and the window to be processed is greater than or equal to the preset threshold, the time corresponding to the target window is determined The point is not an abnormal point; for example, when the preset threshold is 80%, and the similarity value between the target window and the window to be processed is obtained as 85%, it is determined that the time point corresponding to the target window is not an abnormal point.
- sub-step S1032 if the similarity value between the target window and any one of the windows to be processed is less than the preset threshold, it is determined that the target time point corresponding to the target window is an abnormal point.
- the similarity value between the target window and the window to be processed is less than the preset threshold, it is determined that the time point corresponding to the target window is an abnormal point. For example, when the preset threshold is 80%, if it is obtained that the similarity value between the target target window and the window to be processed is 75%, it is determined that the time point corresponding to the target window is an abnormal point.
- the difference between the collected sample sequence is small, and the similarity value of the target window and the window to be processed is determined by the preset model, so as to avoid the obtained
- the abnormal sequence has a large error. Map the time series fragments into the new space through the preset model, compare the similarity of the series, and avoid the disadvantages caused by missing sampling.
- FIG. 7 is a schematic diagram of a scene for implementing the method for detecting abnormal points in a time series provided by this embodiment. As shown in FIG. 7, the method for detecting abnormal points in a time series includes:
- Step S201 Obtain a window to be trained, a similar window, and a dissimilar window.
- the window to be trained, the similar window and the dissimilar window are acquired, wherein the number of the window to be trained, the similar window and the dissimilar window is at least one.
- the window corresponding to the waiting time point is obtained.
- the length of the window information is preset to 20 time points, and based on the time point, 20 time points before the time point are used as the window corresponding to the time point.
- the similar window and the dissimilar window on the time series to be trained are collected through the window. For example, the value corresponding to the time point is obtained, and the corresponding time on the time sequence to be trained is determined based on the value.
- the value corresponding to the time point is 10
- the value corresponding to each time in the time series to be trained is obtained.
- the similarity window is obtained based on the time corresponding to the value 10.
- Obtain the time when the numerical value is different from the numerical value at the time point and obtain the dissimilar window based on the time of the different numerical value. For example, 20 moments that are different from the value of the time point are acquired, and these 20 moments are combined to obtain the corresponding dissimilar window.
- the obtaining the window to be trained, the similar window, and the dissimilar window includes: determining any time point in a preset time sequence to be trained; determining window information based on the arbitrary time point, and obtaining the corresponding window at the any time point
- the window to be trained determine the time that matches the arbitrary time point in the time sequence to be trained, and obtain the corresponding similarity window based on the window information; determine the time sequence to be trained and the arbitrary time point At the time of mismatch, the corresponding non-similar window is obtained based on the window information.
- the corresponding time point in the preset time sequence to be trained is determined based on the user's operation instruction, where the time point is any time point in the time sequence to be trained.
- the window information is determined based on the time point.
- the window information includes first preset window information and second preset window information. If the time point is the current time point, the window information corresponding to the time point is determined to be the first preset window information; if the time point is not the current time point, the window information corresponding to the time point is determined to be the second preset window information.
- the first preset window information is smaller than the second preset window information.
- the length of the first preset window information is 10 time points
- the length of the second preset window information is 20 time points.
- the window corresponding to the time point is obtained. For example, according to the window information and the time point of the time point, 10 time points before the time point are regarded as the window of the time point, and the window includes the values corresponding to the 10 time points before the time point.
- the numerical value corresponding to the arbitrary time point in the time sequence to be trained is obtained, and the numerical value is matched with the numerical value at each time in the time sequence to be trained based on the numerical value. If the first numerical value that is the same as the numerical value is obtained, it is determined that the first time corresponding to the first numerical value matches the time corresponding to the arbitrary point. For example, when the value corresponding to any time point in the time series to be trained is acquired as 10, the time corresponding to the value 10 in the time series to be trained is acquired, and this time is taken as the first time at the arbitrary time point.
- a similar window corresponding to the window is obtained. For example, according to the window information corresponding to the arbitrary time point, if the length of the window information is 20, the 20 time points before the first time point are regarded as the similar window at the arbitrary time point.
- the numerical value corresponding to the arbitrary time point in the time sequence to be trained is obtained, and the numerical value is matched with the numerical value at each time in the time sequence to be trained based on the numerical value. If a second value different from the value is obtained, the second time corresponding to the second value is determined. For example, when the value corresponding to any time point in the time series to be trained is acquired as 10, the time corresponding to the value 10 in the time series to be trained is acquired, and this time is taken as the second time at the arbitrary time point.
- a similar window corresponding to the window is obtained. For example, according to the window information corresponding to the arbitrary time point, if the length of the window information is 20, that is, 20 second moments with different values from the arbitrary time point are obtained, and the 20 second moments are combined, Get the non-similar window corresponding to the window.
- Step S202 Training a preset model to be trained according to the windows to be trained, similar windows, and dissimilar windows, to obtain a trained preset model.
- the acquired window, similar window and dissimilar window are trained in pairs of preset models to be trained, wherein the pair of preset models to be trained are trained as windows and similar windows, or windows and dissimilar windows.
- L ⁇ X t-10 ,X t-9 ,...X t-2 ,X t-1 ⁇ and dissimilar windows Enter the left and right network layers as shown in Figure 5 respectively.
- the weights of the two networks are shared.
- the mapping function of the network layer of the preset model is trained according to the label of each pair of windows, and then the feature difference between the similar window pair and the dissimilar window pair is learned, so that the distance of the similar window after mapping to the new space Close, the distance between the pair of dissimilar windows is longer. Then calculate the cross entropy of all matching window pairs as the loss function, and loop multiple times to update the network parameters by optimizing the loss function.
- Step S203 Obtain a target window in the to-be-processed time series, and acquire a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one.
- the time series refers to a sequence formed by arranging the values of a certain statistical indicator of a certain phenomenon at different times in chronological order.
- the target window refers to the value obtained on the time series based on the window information and contains the value corresponding to the window on the time series. For example, based on the user's operation instruction, the target window corresponding to the operation instruction in the to-be-processed time sequence can be obtained through preset window information. Sliding on the time series based on the window information of the target window, and collecting the to-be-processed window corresponding to the target window on the time series.
- Step S204 Based on a preset model, determine a similarity value between the target window and the window to be processed according to the target window and the window to be processed.
- the preset model is obtained through training in advance through training data.
- the training data includes windows to be trained, similar windows, and dissimilar windows.
- the model to be trained is trained through the window to be trained and the similar window, the target window and the dissimilar window, and the weight parameters in the model are adjusted to obtain the corresponding preset model.
- the target window and the window to be processed are input into a preset model, and the preset model is run to obtain a similarity value between the target window and the window to be processed. If the number of windows to be processed is multiple, the windows to be processed and the target window are sequentially input into the preset model.
- the number of windows to be processed is three, they are respectively the window to be processed A1, the window to be processed A2, and the window to be processed A3.
- Input the to-be-processed window A1 and the target window into the preset model in turn to obtain the similarity value between the to-be-processed window A1 and the target window; input the to-be-processed window A2 and the target window into the preset model to obtain the to-be-processed window A2 and the target window
- the similarity value between the window A3 to be processed and the target window are input into the preset model to obtain the similarity value between the window A3 to be processed and the target window.
- Step S205 Determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
- the similarity value between the target window and the window to be processed is acquired, and based on the similarity value between the target window and the window to be processed, it is determined that the time point corresponding to the target window is an abnormal point.
- a preset threshold is acquired, and if the similarity value between the target window and the window to be processed is greater than the preset threshold, the time point is marked as an abnormal point. If the similarity value between the target window and the window to be processed is less than the preset threshold, it can be considered that the time point is not an abnormal point.
- the model automatically learns the feature difference between positive and negative sample pairs by collecting dissimilar windows and similar windows, omitting the subjective threshold selection step, and improving the accuracy of the model.
- FIG. 8 is a schematic block diagram of an apparatus for detecting abnormal points in a time series according to an embodiment of the present application.
- the device 400 for detecting abnormal points in the time series includes: an acquiring module 401, a first determining module 402, and a second determining module 403.
- the acquiring module 401 is configured to acquire a target window in a time series to be processed, and acquire a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
- the first determining module 402 determines a similarity value between the target window and the window to be processed according to the target window and the window to be processed;
- the second determining module 403 is configured to determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
- the obtaining module 401 is specifically also used for:
- a target window corresponding to the target time point is acquired.
- the obtaining module 401 is specifically also used for:
- a window to be processed corresponding to the target window is acquired.
- the first determining module 402 is specifically further used for:
- the similarity value between the target window and the window to be processed is output.
- the second determining module 403 is also specifically used for:
- the target time point corresponding to the target window is an abnormal point.
- the detection device for time series abnormal points is specifically used for:
- the preset model to be trained is trained according to the window to be trained, the similar window and the dissimilar window to obtain the preset model after training.
- the detection device for time series abnormal points is specifically used for:
- the apparatus provided in the foregoing embodiment may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 9.
- FIG. 9 is a schematic block diagram of the structure of a computer device provided by an embodiment of the application.
- the computer device may be a terminal.
- the computer device includes a processor, a memory, and a network interface connected through a system bus, where the memory may include a non-volatile storage medium and an internal memory.
- the non-volatile storage medium can store an operating system and a computer program.
- the computer program includes program instructions, and when the program instructions are executed, the processor can execute any method for detecting abnormal points in a time series.
- the processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
- the internal memory provides an environment for the operation of the computer program in the non-volatile storage medium.
- the processor can execute any method for detecting abnormal points in the time series.
- the network interface is used for network communication, such as sending assigned tasks.
- the network interface is used for network communication, such as sending assigned tasks.
- FIG. 9 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 computer device to which the solution of the present application is applied. Specifically, the computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
- the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), and application specific integrated circuits (Application Specific Integrated Circuits). 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 may be a microprocessor or the processor may also be any conventional processor.
- the processor is used to run a computer program stored in a memory to implement the following steps:
- the similarity value it is determined whether the time point corresponding to the target window is an abnormal point.
- the processor when the processor obtains the realization of the target window in the to-be-processed time sequence, it is used to realize:
- a target window corresponding to the target time point is acquired.
- the processor when the processor obtains the realization of the to-be-processed window corresponding to the target window, it is used to realize:
- a window to be processed corresponding to the target window is acquired.
- the processor determines the similarity value between the target window and the window to be processed based on a preset model and based on the target window and the window to be processed, the processor is configured to implement:
- the similarity value between the target window and the window to be processed is output.
- the processor determines whether the time point corresponding to the target window is an abnormal point realization according to the similarity value, the processor is used to realize:
- the target time point corresponding to the target window is an abnormal point.
- the processor when the processor acquires the target window of the to-be-processed time sequence before being implemented, it is used to implement:
- the preset model to be trained is trained according to the window to be trained, the similar window and the dissimilar window to obtain the preset model after training.
- the processor when the processor obtains the windows to be trained, the similar windows and the dissimilar windows to be implemented, it is used to implement:
- the embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium may be volatile or non-volatile, and the computer-readable storage medium stores a computer program, so
- the computer program includes program instructions, and the following steps are implemented when the program instructions are executed:
- the similarity value it is determined whether the time point corresponding to the target window is an abnormal point.
- the computer-readable storage medium may be the internal storage unit of the computer device described in the foregoing embodiment, for example, the hard disk or memory of the computer device.
- the computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), and a Secure Digital (SD) ) Card, Flash Card, etc.
- a plug-in hard disk equipped on the computer device such as a smart memory card (Smart Media Card, SMC), and a Secure Digital (SD) ) Card, Flash Card, etc.
- SD Secure Digital
- the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
- the blockchain referred to in this application is a new application mode of computer technology such as storage of preset models, point-to-point transmission, consensus mechanism, and encryption algorithm.
- Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
- the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Computational Biology (AREA)
- Fuzzy Systems (AREA)
- Evolutionary Computation (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Biology (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Databases & Information Systems (AREA)
- Debugging And Monitoring (AREA)
- Image Analysis (AREA)
Abstract
A detection method and apparatus for a time series anomaly point, and a computer device and a computer-readable storage medium, which relate to the field of artificial intelligence. The method comprises: acquiring a target window in a time series to be processed, and acquiring windows to be processed corresponding to the target window (S101), wherein the number of windows to be processed is greater than one; on the basis of a preset model, determining, according to the target window and the windows to be processed, a similarity value between the target window and each of the windows to be processed (S102); and according to the similarity values, determining whether a time point corresponding to the target window is an anomaly point (S103). By means of the method, a target window and windows to be processed in a time series are acquired, such that collected sample series have a relatively small difference; and the similarity value between the target window and each of the windows to be processed is determined by means of the preset model, thereby avoiding a relatively great error in an obtained anomalous series.
Description
本申请要求于2020年9月22日提交中国专利局、申请号为CN2020110068006,发明名称为“时间序列异常点的检测方法、装置、设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on September 22, 2020, the application number is CN2020110068006, and the invention title is "Time series abnormal point detection method, device, equipment and readable storage medium". The entire content is incorporated into this application by reference.
本申请涉及人工智能领域,尤其涉及时间序列异常点的检测方法、装置、设备及计算机可读存储介质名称。This application relates to the field of artificial intelligence, and in particular to methods, devices, equipment, and computer-readable storage medium names for detecting abnormal points in time series.
在AIOps领域中,时间序列是指在某一个指标按照时间的观测数据组成的序列,主机、服务器等硬件设备在运行过程中会产生大量的指标数值。如主机每秒的CPU使用率、某项业务每小时的请求量,都可以形成单变量时间序列指标数据。时间序列的异常检测则是从数据中找到与历史行为模式不同的点。In the field of AIOps, time series refers to a sequence composed of observation data of a certain indicator according to time. Hardware devices such as hosts and servers will generate a large number of indicator values during operation. For example, the CPU usage per second of the host and the hourly request volume of a certain business can form univariate time series indicator data. The anomaly detection of time series is to find the difference from the historical behavior pattern from the data.
发明人意识到传统的时间序列异常检测方法常采用距离度量方法,即通过计算给定的单变量时间序列与预期值的距离并于给定阈值进行比较,若距离大于给定阈值,则可以判定该点为异常点。而阈值通常选取为一些基本统计量,例如中位数或90%分位数。但阈值的选定过于主观,且不适用于所有时间序列的数据异常检测。The inventor realizes that traditional time series anomaly detection methods often use distance measurement methods, that is, by calculating the distance between a given univariate time series and the expected value and comparing it with a given threshold, if the distance is greater than the given threshold, it can be determined This point is an abnormal point. The threshold is usually selected as some basic statistics, such as the median or 90% quantile. However, the selection of the threshold is too subjective and is not suitable for data anomaly detection in all time series.
发明内容Summary of the invention
一种时间序列异常点的检测方法,所述时间序列异常点的检测方法包括:A method for detecting abnormal points in a time series, the method for detecting abnormal points in a time series includes:
获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;
根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
一种时间序列异常点的检测装置,所述时间序列异常点的检测装置包括:A detection device for abnormal points in a time series, the detection device for abnormal points in a time series includes:
获取模块,用于获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;An obtaining module, configured to obtain a target window in a time series to be processed, and obtain a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
第一确定模块,用于基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;The first determining module is configured to determine the similarity value between the target window and the window to be processed based on the preset model according to the target window and the window to be processed;
第二确定模块,用于根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。The second determining module is configured to determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
一种计算机设备,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如下步骤:A computer device including a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the following steps are implemented :
获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;
根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
一种计算机可读存储介质,所所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如下步骤:A computer-readable storage medium having a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:
获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;
根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
本申请实施例提出的一种时间序列异常点的检测方法、装置、设备及计算机可读存储介质,实现了通过获取时间序列中的目标窗口和待处理窗口,使采集到的样本序列相差较小,通过预置模型来确定目标窗口和待处理窗口的相似度值,避免得到的异常序列误差较大。The method, device, device, and computer-readable storage medium for detecting abnormal points in a time series proposed in the embodiments of the present application realize that by obtaining the target window and the window to be processed in the time series, the difference between the collected sample sequences is small , Through the preset model to determine the similarity value of the target window and the window to be processed, to avoid large errors in the obtained abnormal sequence.
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的一种时间序列异常点的检测方法的流程示意图;FIG. 1 is a schematic flowchart of a method for detecting abnormal points in a time series provided by an embodiment of this application;
图2为图1中的时间序列异常点的检测方法的子步骤流程示意图;FIG. 2 is a schematic flowchart of sub-steps of the method for detecting abnormal points in the time series in FIG. 1;
图3为图1中的时间序列异常点的检测方法的子步骤流程示意图;Fig. 3 is a schematic flow diagram of sub-steps of the method for detecting abnormal points in the time series in Fig. 1;
图4为图1中的时间序列异常点的检测方法的子步骤流程示意图;4 is a schematic flowchart of sub-steps of the method for detecting abnormal points in the time series in FIG. 1;
图5为本申请实施例中预置模型的网络层示意图;FIG. 5 is a schematic diagram of a network layer of a preset model in an embodiment of the application;
图6为图1中的时间序列异常点的检测方法的子步骤流程示意图;6 is a schematic flowchart of sub-steps of the method for detecting abnormal points in the time series in FIG. 1;
图7为本申请实施例提供的另一种时间序列异常点的检测方法的流程示意图;FIG. 7 is a schematic flowchart of another method for detecting abnormal points in a time series provided by an embodiment of this application;
图8为本申请实施例提供的一种时间序列异常点的检测装置的示意性框图;FIG. 8 is a schematic block diagram of a device for detecting abnormal points in a time series provided by an embodiment of the application;
图9为本申请一实施例涉及的计算机设备的结构示意框图。FIG. 9 is a schematic block diagram of the structure of a computer device related to an embodiment of the application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowchart shown in the drawings is only an example, and does not necessarily include all contents and operations/steps, nor does it have to be executed in the described order. For example, some operations/steps can also be decomposed, combined or partially combined, so the actual execution order may be changed according to actual conditions.
本申请实施例提供一种时间序列异常点的检测方法、装置、设备及计算机可读存储介质。其中,该时间序列异常点的检测方法可应用于终端设备中,该终端设备可以手机、平板电脑、笔记本电脑、台式电脑。The embodiments of the present application provide a method, device, equipment, and computer-readable storage medium for detecting abnormal points in a time series. Among them, the method for detecting abnormal points in the time series can be applied to terminal devices, which can be mobile phones, tablet computers, notebook computers, and desktop computers.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Hereinafter, some embodiments of the present application will be described in detail with reference to the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
请参照图1,图1为本申请的实施例提供的一种时间序列异常点的检测方法的的流程示意图。Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a method for detecting abnormal points in a time series according to an embodiment of the application.
如图1所示,该时间序列异常点的检测方法包括步骤S101至步骤S103。As shown in Fig. 1, the method for detecting abnormal points in the time series includes steps S101 to S103.
步骤S101、获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1。Step S101: Obtain a target window in the to-be-processed time series, and acquire a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one.
示范性的,获取待处理时间序列的目标窗口,时间序列是指将某种现象某一个统计指标在不同时间上的各个数值,按时间先后顺序排列而形成的序列。目标窗口是指时间序列上基于窗口信息得到的包含时间序列上窗口对应的数值。例如,基于用户的操作指令,通 过预置的窗口信息,获取待处理时间序列中该操作指令对应的目标窗口。基于该目标窗口的窗口信息在时间序列上滑动,采集该目标窗口在时间序列上对应的待处理窗口。Exemplarily, obtaining the target window of the time series to be processed. The time series refers to a sequence formed by arranging the values of a certain statistical indicator of a certain phenomenon at different times in chronological order. The target window refers to the value obtained on the time series based on the window information and contains the value corresponding to the window on the time series. For example, based on the user's operation instruction, the target window corresponding to the operation instruction in the to-be-processed time sequence can be obtained through preset window information. Sliding on the time series based on the window information of the target window, and collecting the to-be-processed window corresponding to the target window on the time series.
在一实施例中,具体地,参照图2,步骤S101包括:子步骤S1011至子步骤S1012。In an embodiment, specifically, referring to FIG. 2, step S101 includes: sub-step S1011 to sub-step S1012.
子步骤S1011、确定待处理时间序列上待检测的目标时间点。Sub-step S1011, determine the target time point to be detected on the time sequence to be processed.
接收用户的操作指令,基于该操作指令确定该操作指令在待处理时间序列上对应时间点,将该时间点作为待检测的目标时间点。Receive the user's operation instruction, determine the corresponding time point of the operation instruction in the to-be-processed time sequence based on the operation instruction, and use the time point as the target time point to be detected.
子步骤S1012、基于预置窗口信息和所述目标时间点,获取所述目标时间点对应的目标窗口。Sub-step S1012: Obtain a target window corresponding to the target time point based on the preset window information and the target time point.
获取该目标时间点对应的预置窗口信息,该窗口信息包括窗口的长度信息等。基于该目标时间点和该预置窗口信息,得到该目标时间点对应的目标窗口。例如,当确定待处理时间序列上的目标时间点为t时刻时,该窗口信息的长度为20个时刻时,获取该待处理时间序列中t时刻之前的20个时刻对应的序列作为该t时刻的目标窗口。Obtain preset window information corresponding to the target time point, where the window information includes window length information, etc. Based on the target time point and the preset window information, a target window corresponding to the target time point is obtained. For example, when it is determined that the target time point on the time series to be processed is time t, and the length of the window information is 20 time points, the sequence corresponding to the 20 time points before time t in the time series to be processed is obtained as the time point t The target window.
在一实施例中,具体地,参照图3,步骤S101包括:子步骤S1013至子步骤S1014。In an embodiment, specifically, referring to FIG. 3, step S101 includes: sub-step S1013 to sub-step S1014.
子步骤S1013、根据所述待处理时间序列,确定所述目标时间点的采集策略。Sub-step S1013: Determine the collection strategy of the target time point according to the time sequence to be processed.
获取待处理时间序列的时长信息,基于该待处理时间序列的时长信息确定预置切分策略。根据预置切分策略对该待训练时间序列进行切分,得到该处理时间序列的多段子时间序列。例如,获取该待训练时间序列的各个时间点,确定该待训练时间序列是否小于预置时间点。若该时间点小于预置时间点,则基于预置切分策略对该时间点进行切分。例如,该训练时间序列为2018-1-1-00-00-00至2020-7-1-00-00-00,预置时间点为2020-1-1-00-00-00,则确定待训练时间序列大于预置时间点。通过预置切分策略将待训练时间序列切分为2018-1-1-00-00-00至2020-1-1-00-00-00,以及2020-1-1-00-00-00至2020-7-1-00-00-00两段待训练的子时间序列。通过不同的待训练的子时间序列,确定该待训练时间序列的采集策略。The duration information of the to-be-processed time sequence is acquired, and the preset segmentation strategy is determined based on the duration information of the to-be-processed time sequence. The time sequence to be trained is segmented according to a preset segmentation strategy to obtain multiple sub-time sequences of the processing time sequence. For example, each time point of the time sequence to be trained is acquired, and it is determined whether the time sequence to be trained is less than a preset time point. If the time point is less than the preset time point, the time point is segmented based on the preset segmentation strategy. For example, the training time sequence is from 2018-1-1-00-00-00 to 2020-7-1-00-00-00, and the preset time point is 2020-1-1-00-00-00, then it is determined The time sequence to be trained is greater than the preset time point. Divide the time series to be trained into 2018-1-1-00-00-00 to 2020-1-1-00-00-00 and 2020-1-1-00-00-00 through the preset split strategy To 2020-7-1-00-00-00 two sub-time sequences to be trained. Through different sub-time series to be trained, the acquisition strategy of the time series to be trained is determined.
子步骤S1014、基于所述采集策略和所述预置窗口信息,获取所述目标窗口对应的待处理窗口。Sub-step S1014, based on the acquisition strategy and the preset window information, obtain a window to be processed corresponding to the target window.
基于预置采集策略,分别对两段待训练时间序列进行采集,得到与目标窗口对应的待处理窗口。该待处理时间序列的时长信息为当前时刻2020-6-1-00-00-00时,预置时刻信息为2020-7-1-00-00-00时,则该时长信息包含预置时刻信息,通过该时长信息确定该目标时间点的采集策略。例如,确定当前时刻至2020-7-1-00-00-00的第一采集策略,确定2020-7-1-00-00-00-2020-6-1-00-00-00的第二采集策略。基于该预置窗口信息和第一采集策略在该待处理时间序列上的当前时刻至2020-7-1-00-00-00进行滑动,获取该目标窗口对应的待处理窗口。基于该窗口信息和第二采集策略在该待处理时间序列上的2020-7-1-00-00-00-2020-6-1-00-00-00中进行滑动,获取该目标窗口对应的待处理窗口。其中,在该待处理时间序列上的2020-7-1-00-00-00-2020-6-1-00-00-00中的滑动间隔大于在该待处理时间序列上的当前时刻-2020-7-1-00-00-00中的滑动间隔,且该待处理窗口的数量大于1。Based on the preset acquisition strategy, the two time series to be trained are collected separately to obtain the to-be-processed window corresponding to the target window. When the duration information of the time sequence to be processed is the current time 2020-6-1-00-00-00, and the preset time information is 2020-7-1-00-00-00, the duration information includes the preset time Information, the collection strategy of the target time point is determined by the duration information. For example, determine the first acquisition strategy from the current moment to 2020-7-1-00-00-00, and determine the second acquisition strategy of 2020-7-1-00-00-00-2020-6-1-00-00-00 Acquisition strategy. Based on the preset window information and the first collection strategy, the current time on the to-be-processed time sequence is slid to 2020-7-1-00-00-00 to obtain the to-be-processed window corresponding to the target window. Based on the window information and the second collection strategy, slide 2020-7-1-00-00-00-2020-6-1-00-00-00 on the to-be-processed time series to obtain the corresponding target window Pending window. Among them, the sliding interval in 2020-7-1-00-00-00-2020-6-1-00-00-00 on the to-be-processed time series is greater than the current moment -2020 on the to-be-processed time series -The sliding interval in 7-1-00-00-00, and the number of windows to be processed is greater than 1.
步骤S102、基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值。Step S102: Based on a preset model, determine a similarity value between the target window and the window to be processed according to the target window and the window to be processed.
示范性的,通过预置模型,该预置模型是预先通过训练数据进行训练得到的。该训练数据包括待训练的窗口、相似窗口以及非相似窗口。例如,通过待训练的窗口和相似窗口以及目标窗口和非相似窗口对待训练模型进行训练,调整该模型中的权重参数,得到对应的预置模型。将该目标窗口和待处理窗口输入预置模型,运行该预置模型,得到目标窗口与待处理窗口之间的相似度值。若该待处理窗口的数量为多个时,依次将待处理窗口与目标窗口输入预置模型。例如,待处理窗口的数量为3个时,分别为待处理窗口A1、待处理窗口A2、待处理窗口A3。依次将待处理窗口A1和目标窗口输入预置模型,得到待处理 窗口A1与目标窗口之间的相似度值;将待处理窗口A2和目标窗口输入预置模型,得到待处理窗口A2与目标窗口之间的相似度值;将待处理窗口A3和目标窗口输入预置模型,得到待处理窗口A3与目标窗口之间的相似度值。Exemplarily, through a preset model, the preset model is obtained through training in advance through training data. The training data includes windows to be trained, similar windows, and dissimilar windows. For example, the model to be trained is trained through the window to be trained and the similar window, the target window and the dissimilar window, and the weight parameters in the model are adjusted to obtain the corresponding preset model. The target window and the window to be processed are input into a preset model, and the preset model is run to obtain a similarity value between the target window and the window to be processed. If the number of windows to be processed is multiple, the windows to be processed and the target window are sequentially input into the preset model. For example, when the number of windows to be processed is three, they are respectively the window to be processed A1, the window to be processed A2, and the window to be processed A3. Input the to-be-processed window A1 and the target window into the preset model in turn to obtain the similarity value between the to-be-processed window A1 and the target window; input the to-be-processed window A2 and the target window into the preset model to obtain the to-be-processed window A2 and the target window The similarity value between the window A3 to be processed and the target window are input into the preset model to obtain the similarity value between the window A3 to be processed and the target window.
在一实施例中,具体地,参照图4,步骤S102包括:子步骤S1021至子步骤S1023。In an embodiment, specifically, referring to FIG. 4, step S102 includes: sub-step S1021 to sub-step S1023.
子步骤S1021、基于预置模型,将所述目标窗口和所述待处理窗口分别输入所述预置模型。Sub-step S1021, based on a preset model, input the target window and the window to be processed into the preset model respectively.
示范性的,获取预置模型,该预置模型包括孪生神经网络模型。将目标窗口和待处理窗口分别输入该预置模型,其中,该模型包括两个输入层。Exemplarily, a preset model is obtained, and the preset model includes a twin neural network model. The target window and the window to be processed are respectively input into the preset model, where the model includes two input layers.
子步骤S1022、通过所述预置模型的权重参数,分别获取所述目标窗口的映射参数和所述待处理窗口的映射参数。In sub-step S1022, the mapping parameters of the target window and the mapping parameters of the window to be processed are obtained respectively through the weight parameters of the preset model.
如图5所示,预置模型包括输入层、正向传播层、反向传播层以及输出层。通过该预置模型中输入层、正向传播层、反向传播层以及输出层中的权重参数对该目标窗口中的数值进行映射,得到该目标窗口中各个数值的映射参数。As shown in Figure 5, the preset model includes an input layer, a forward propagation layer, a back propagation layer, and an output layer. The value in the target window is mapped through the weight parameters in the input layer, the forward propagation layer, the back propagation layer, and the output layer in the preset model to obtain the mapping parameter of each value in the target window.
子步骤S1023、基于所述目标窗口的映射参数和所述待处理窗口的映射参数,输出所述目标窗口与所述待处理窗口之间的相似度值。Sub-step S1023, based on the mapping parameter of the target window and the mapping parameter of the window to be processed, output the similarity value between the target window and the window to be processed.
通过该预置模型中输入层、正向传播层、反向传播层以及输出层中的权重参数对该待处理窗口中的数值进行映射,得到该待处理窗口中各个数值的映射参数。基于该目标窗口中各个数值的映射参数和待处理窗口中各个数值的映射参数,得到目标窗口和待处理窗口对应的相似度值。The value in the window to be processed is mapped by the weight parameters in the input layer, the forward propagation layer, the back propagation layer, and the output layer in the preset model to obtain the mapping parameter of each value in the window to be processed. Based on the mapping parameter of each value in the target window and the mapping parameter of each value in the window to be processed, the similarity value corresponding to the target window and the window to be processed is obtained.
步骤S103、根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。Step S103: Determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
示范性的,获取目标窗口与待处理窗口之间的相似度值,基于该目标窗口与待处理窗口之间的相似度值,确定该目标窗口对应的时间点为异常点。示例性的,获取预置阈值,若目标窗口与待处理窗口之间的相似度值大于预设阈值,则将其时间点标为异常点。若目标窗口与待处理窗口之间的相似度值小于预设阈值,则可以认为该时间点不是异常点。Exemplarily, the similarity value between the target window and the window to be processed is acquired, and based on the similarity value between the target window and the window to be processed, it is determined that the time point corresponding to the target window is an abnormal point. Exemplarily, a preset threshold is acquired, and if the similarity value between the target window and the window to be processed is greater than the preset threshold, the time point is marked as an abnormal point. If the similarity value between the target window and the window to be processed is less than the preset threshold, it can be considered that the time point is not an abnormal point.
在一实施例中,具体地,参照图6,步骤S103包括:子步骤S1031至子步骤S1032。In an embodiment, specifically, referring to FIG. 6, step S103 includes: sub-step S1031 to sub-step S1032.
子步骤S1031、确定所述目标窗口与各个所述待处理窗口之间的相似度值是否小于预置阈值。In sub-step S1031, it is determined whether the similarity value between the target window and each of the windows to be processed is less than a preset threshold.
示范性的,获取预先设置的阈值,通过该预先预置的阈值确定该目标窗口对应的时间点是否为异常点。将目标窗口与待处理窗口之间的相似度值与预置阈值进行比对,若该目标窗口与待处理窗口之间的相似度值大于或等于预置阈值,则确定该目标窗口对应的时间点不是异常点;例如,预先设置的阈值为80%时,获取到目标窗口与待处理窗口之间的相似度值为85%,则确定该目标窗口对应的时间点不是异常点。Exemplarily, a preset threshold value is acquired, and whether the time point corresponding to the target window is an abnormal point is determined through the preset threshold value. The similarity value between the target window and the window to be processed is compared with the preset threshold. If the similarity value between the target window and the window to be processed is greater than or equal to the preset threshold, the time corresponding to the target window is determined The point is not an abnormal point; for example, when the preset threshold is 80%, and the similarity value between the target window and the window to be processed is obtained as 85%, it is determined that the time point corresponding to the target window is not an abnormal point.
子步骤S1032、若所述目标窗口与任意一个所述待处理窗口之间的相似度值小于所述预置阈值,则确定所述目标窗口对应的目标时间点为异常点。In sub-step S1032, if the similarity value between the target window and any one of the windows to be processed is less than the preset threshold, it is determined that the target time point corresponding to the target window is an abnormal point.
若该目标窗口与待处理窗口之间的相似度值小于预置阈值,则确定该目标窗口对应的时间点为异常点。例如,预先设置的阈值为80%时,若获取到目标目标窗口与待处理窗口之间的相似度值为75%时,则确定该目标窗口对应的时间点是异常点。If the similarity value between the target window and the window to be processed is less than the preset threshold, it is determined that the time point corresponding to the target window is an abnormal point. For example, when the preset threshold is 80%, if it is obtained that the similarity value between the target target window and the window to be processed is 75%, it is determined that the time point corresponding to the target window is an abnormal point.
在本申请实施例中,通过获取时间序列中的目标窗口和待处理窗口,使采集到的样本序列相差较小,通过预置模型来确定目标窗口和待处理窗口的相似度值,避免得到的异常序列误差较大。通过预置模型将时间序列片段映射到新空间中,比较序列的相似性,避免了漏采样带来的弊端。In the embodiment of the present application, by acquiring the target window and the window to be processed in the time series, the difference between the collected sample sequence is small, and the similarity value of the target window and the window to be processed is determined by the preset model, so as to avoid the obtained The abnormal sequence has a large error. Map the time series fragments into the new space through the preset model, compare the similarity of the series, and avoid the disadvantages caused by missing sampling.
请参照图7,图7为实施本实施例提供的时间序列异常点的检测方法的一场景示意图,如图7所示,该时间序列异常点的检测方法包括:Please refer to FIG. 7. FIG. 7 is a schematic diagram of a scene for implementing the method for detecting abnormal points in a time series provided by this embodiment. As shown in FIG. 7, the method for detecting abnormal points in a time series includes:
步骤S201、获取待训练的窗口、相似窗口和非相似窗口。Step S201: Obtain a window to be trained, a similar window, and a dissimilar window.
示范性的,获取待训练的窗口、相似窗口和非相似窗口,其中待训练的窗口、相似窗口和非相似窗口的数量至少为一个。获取待训练时间序列,确定该待训练时间序列上的任意一个时间点。基于该时间点和预置窗口信息,得到待时间点对应的窗口。例如,预先设置该窗口信息的长度为20个时刻,基于该时间点,将该时间点之前的20个时刻作为该时间点对应的窗口。通过该窗口采集该待训练时间序列上的相似窗口和非相似窗口。例如,获取该时间点对应的数值,基于该数值确定该待训练时间序列上对应的时刻。例如,该时间点对应的数值为10时,获取待训练时间序列上各个时刻对应的数值,若获取到与该时间点对应的数值10时,基于该数值10对应的时刻,得到相似窗口。获取与该时间点的数值不相同数值的时刻,基于该不相同数值的时刻,得到非相似窗口。例如,获取与该时间点的数值不同的20个时刻,将这20个时刻进行组合,得到对应的非相似窗口。Exemplarily, the window to be trained, the similar window and the dissimilar window are acquired, wherein the number of the window to be trained, the similar window and the dissimilar window is at least one. Obtain the time sequence to be trained, and determine any time point on the time sequence to be trained. Based on the time point and the preset window information, the window corresponding to the waiting time point is obtained. For example, the length of the window information is preset to 20 time points, and based on the time point, 20 time points before the time point are used as the window corresponding to the time point. The similar window and the dissimilar window on the time series to be trained are collected through the window. For example, the value corresponding to the time point is obtained, and the corresponding time on the time sequence to be trained is determined based on the value. For example, when the value corresponding to the time point is 10, the value corresponding to each time in the time series to be trained is obtained. If the value 10 corresponding to the time point is obtained, the similarity window is obtained based on the time corresponding to the value 10. Obtain the time when the numerical value is different from the numerical value at the time point, and obtain the dissimilar window based on the time of the different numerical value. For example, 20 moments that are different from the value of the time point are acquired, and these 20 moments are combined to obtain the corresponding dissimilar window.
具体的,所述获取待训练的窗口、相似窗口和非相似窗口包括:确定预置待训练时间序列中的任意时间点;基于所述任意时间点确定窗口信息,得到所述任意时间点对应的待训练的窗口;确定所述待训练时间序列中与所述任意时间点相匹配的时刻,并基于所述窗口信息得到对应的相似窗口;确定所述待训练时间序列中与所述任意时间点不匹配的时刻,并基于所述窗口信息得到对应的非相似窗口。Specifically, the obtaining the window to be trained, the similar window, and the dissimilar window includes: determining any time point in a preset time sequence to be trained; determining window information based on the arbitrary time point, and obtaining the corresponding window at the any time point The window to be trained; determine the time that matches the arbitrary time point in the time sequence to be trained, and obtain the corresponding similarity window based on the window information; determine the time sequence to be trained and the arbitrary time point At the time of mismatch, the corresponding non-similar window is obtained based on the window information.
示范性的,在接收到用户的操作指令,基于用户的操作指令确定预置待训练时间序列中对应的时间点,其中,该时间点为待训练时间序列中的任意时间点。在确定操作指令对应预置待训练时间序列中的时间点时,基于该时间点确定窗口信息。例如,窗口信息包括第一预置窗口信息和第二预置窗口信息。若该时间点为当前时间点时,确定该时间点对应的窗口信息为第一预置窗口信息;若该时间点不是当前时间点时,确定该时间点对应的窗口信息为第二预置窗口信息。其中第一预置窗口信息小于第二预置窗口信息。例如,第一预置窗口信息的长度为10个时间点,第二预置窗口信息的长度为20个时间点。基于该时间点对应的窗口信息,得到该时间点对应的窗口。例如,根据该时间点的窗口信息和时间点,将该时间点之前的10个时间点作为该时间点的窗口,该窗口包括该时间点之前10个时间点对应的数值。Exemplarily, upon receiving the user's operation instruction, the corresponding time point in the preset time sequence to be trained is determined based on the user's operation instruction, where the time point is any time point in the time sequence to be trained. When it is determined that the operation instruction corresponds to a time point in the preset time sequence to be trained, the window information is determined based on the time point. For example, the window information includes first preset window information and second preset window information. If the time point is the current time point, the window information corresponding to the time point is determined to be the first preset window information; if the time point is not the current time point, the window information corresponding to the time point is determined to be the second preset window information. The first preset window information is smaller than the second preset window information. For example, the length of the first preset window information is 10 time points, and the length of the second preset window information is 20 time points. Based on the window information corresponding to the time point, the window corresponding to the time point is obtained. For example, according to the window information and the time point of the time point, 10 time points before the time point are regarded as the window of the time point, and the window includes the values corresponding to the 10 time points before the time point.
确定所述子时间序列中与所述任意时间点相匹配的时刻,并通过所述窗口信息得到对应的相似窗口。获取该任意时间点在待训练时间序列中对应的数值,基于该数值在该待训练时间序列中与各个时刻的数值进行匹配。若获取到与该数值相同的第一数值时,确定该第一数值对应的第一时刻与该任意点对应的时刻匹配。例如,获取待训练时间序列中任意时间点对应的数值为10时,获取待训练时间序列中数值为10对应的时刻,将该时刻作为该任意时间点的第一时刻。基于该任意时间点对应的窗口信息与该第一时刻,得到该窗口对应的相似窗口。例如,通过该任意时间点对应的窗口信息,若该窗口信息的长度为20,将该第一时刻之前20个时间点作为该任意时间点的相似窗口。Determine the time matching the arbitrary time point in the sub-time sequence, and obtain the corresponding similar window through the window information. The numerical value corresponding to the arbitrary time point in the time sequence to be trained is obtained, and the numerical value is matched with the numerical value at each time in the time sequence to be trained based on the numerical value. If the first numerical value that is the same as the numerical value is obtained, it is determined that the first time corresponding to the first numerical value matches the time corresponding to the arbitrary point. For example, when the value corresponding to any time point in the time series to be trained is acquired as 10, the time corresponding to the value 10 in the time series to be trained is acquired, and this time is taken as the first time at the arbitrary time point. Based on the window information corresponding to the arbitrary time point and the first moment, a similar window corresponding to the window is obtained. For example, according to the window information corresponding to the arbitrary time point, if the length of the window information is 20, the 20 time points before the first time point are regarded as the similar window at the arbitrary time point.
确定所述子时间序列中与所述任意时间点不相匹配的时刻,并通过所述窗口信息得到对应的非相似窗口。获取该任意时间点在待训练时间序列中对应的数值,基于该数值在该待训练时间序列中与各个时刻的数值进行匹配。若获取到与该数值不相同的第二数值时,确定该第二数值对应的第二时刻。例如,获取待训练时间序列中任意时间点对应的数值为10时,获取待训练时间序列中数值为10对应的时刻,将该时刻作为该任意时间点的第二时刻。基于该任意时间点对应的窗口信息与该第二时刻,得到该窗口对应的相似窗口。例如,通过该任意时间点对应的窗口信息,若该窗口信息的长度为20,即获取20个与任意时间点的数值不相同的第二时刻,并将这20个的第二时刻进行组合,得到该窗口对应的非相似窗口。Determine the time in the sub-time sequence that does not match the arbitrary time point, and obtain the corresponding non-similar window through the window information. The numerical value corresponding to the arbitrary time point in the time sequence to be trained is obtained, and the numerical value is matched with the numerical value at each time in the time sequence to be trained based on the numerical value. If a second value different from the value is obtained, the second time corresponding to the second value is determined. For example, when the value corresponding to any time point in the time series to be trained is acquired as 10, the time corresponding to the value 10 in the time series to be trained is acquired, and this time is taken as the second time at the arbitrary time point. Based on the window information corresponding to the arbitrary time point and the second moment, a similar window corresponding to the window is obtained. For example, according to the window information corresponding to the arbitrary time point, if the length of the window information is 20, that is, 20 second moments with different values from the arbitrary time point are obtained, and the 20 second moments are combined, Get the non-similar window corresponding to the window.
步骤S202、根据所述待训练的窗口、相似窗口和非相似窗口对预置待训练模型进行训练,得到训练后的预置模型。Step S202: Training a preset model to be trained according to the windows to be trained, similar windows, and dissimilar windows, to obtain a trained preset model.
将获取到的窗口、相似窗口和非相似窗口两两对预置待训练模型进行训练,其中,两两对预置待训练模型进行训练为窗口和相似窗口,或者窗口和非相似窗口。例如,将原始的两个窗口时序数据,即窗口L={X
t-10,X
t-9,....X
t-2,X
t-1}和相似窗口
或者,L={X
t-10,X
t-9,....X
t-2,X
t-1}和非相似窗口
分别输入如图5所示左右两个网络层,为了将两个网络的输入映射到同一片新空间中,对两个网络的权重进行共享。经过模型训练后,预置模型的网络层的映射函数根据每对窗口的标签进行训练,进而学习到了相似窗口对与非相似窗口对之间的特征差异,使得映射到新空间后相似窗口的距离相近,非相似窗口对之间的距离较远。再计算所有匹配窗口对的交叉熵作为损失函数,多次循环,通过优化损失函数进而更新网络参数,其中,w
1、w
2、w
3、w
4、w
5为权重参数,x
t、x
t-1、x
t+1为L={X
t-10,X
t-9,....X
t-2,X
t-1}、相似窗口
或
中的数值。对时间序列数据映射网络结构进行改进,随机删去网络层中的额外连接,从而大大增强模型泛化性,拓宽了适用范围的同时也简化了模型参数,减少运算复杂度,从而降低对硬件配置的要求并节约了大量计算资源。
The acquired window, similar window and dissimilar window are trained in pairs of preset models to be trained, wherein the pair of preset models to be trained are trained as windows and similar windows, or windows and dissimilar windows. For example, the original two window time series data, namely window L = {X t-10 ,X t-9 ,...X t-2 ,X t-1 } and similar windows Or, L={X t-10 ,X t-9 ,...X t-2 ,X t-1 } and dissimilar windows Enter the left and right network layers as shown in Figure 5 respectively. In order to map the input of the two networks to the same new space, the weights of the two networks are shared. After model training, the mapping function of the network layer of the preset model is trained according to the label of each pair of windows, and then the feature difference between the similar window pair and the dissimilar window pair is learned, so that the distance of the similar window after mapping to the new space Close, the distance between the pair of dissimilar windows is longer. Then calculate the cross entropy of all matching window pairs as the loss function, and loop multiple times to update the network parameters by optimizing the loss function. Among them, w 1 , w 2 , w 3 , w 4 , and w 5 are weight parameters, and x t , x t-1 and x t+1 are L={X t-10 ,X t-9 ,...X t-2 ,X t-1 }, similar window or The value in. Improve the time series data mapping network structure, randomly delete extra connections in the network layer, thereby greatly enhancing the generalization of the model, broadening the scope of application, simplifying model parameters, reducing computational complexity, and reducing hardware configuration Requirements and save a lot of computing resources.
步骤S203、获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1。Step S203: Obtain a target window in the to-be-processed time series, and acquire a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one.
示范性的,获取待处理时间序列的目标窗口,时间序列是指将某种现象某一个统计指标在不同时间上的各个数值,按时间先后顺序排列而形成的序列。目标窗口是指时间序列上基于窗口信息得到的包含时间序列上窗口对应的数值。例如,基于用户的操作指令,通过预置的窗口信息,获取待处理时间序列中该操作指令对应的目标窗口。基于该目标窗口的窗口信息在时间序列上滑动,采集该目标窗口在时间序列上对应的待处理窗口。Exemplarily, obtaining the target window of the time series to be processed. The time series refers to a sequence formed by arranging the values of a certain statistical indicator of a certain phenomenon at different times in chronological order. The target window refers to the value obtained on the time series based on the window information and contains the value corresponding to the window on the time series. For example, based on the user's operation instruction, the target window corresponding to the operation instruction in the to-be-processed time sequence can be obtained through preset window information. Sliding on the time series based on the window information of the target window, and collecting the to-be-processed window corresponding to the target window on the time series.
步骤S204、基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值。Step S204: Based on a preset model, determine a similarity value between the target window and the window to be processed according to the target window and the window to be processed.
示范性的,通过预置模型,该预置模型是预先通过训练数据进行训练得到的。该训练数据包括待训练的窗口、相似窗口以及非相似窗口。例如,通过待训练的窗口和相似窗口以及目标窗口和非相似窗口对待训练模型进行训练,调整该模型中的权重参数,得到对应的预置模型。将该目标窗口和待处理窗口输入预置模型,运行该预置模型,得到目标窗口与待处理窗口之间的相似度值。若该待处理窗口的数量为多个时,依次将待处理窗口与目标窗口输入预置模型。例如,待处理窗口的数量为3个时,分别为待处理窗口A1、待处理窗口A2、待处理窗口A3。依次将待处理窗口A1和目标窗口输入预置模型,得到待处理窗口A1与目标窗口之间的相似度值;将待处理窗口A2和目标窗口输入预置模型,得到待处理窗口A2与目标窗口之间的相似度值;将待处理窗口A3和目标窗口输入预置模型,得到待处理窗口A3与目标窗口之间的相似度值。Exemplarily, through a preset model, the preset model is obtained through training in advance through training data. The training data includes windows to be trained, similar windows, and dissimilar windows. For example, the model to be trained is trained through the window to be trained and the similar window, the target window and the dissimilar window, and the weight parameters in the model are adjusted to obtain the corresponding preset model. The target window and the window to be processed are input into a preset model, and the preset model is run to obtain a similarity value between the target window and the window to be processed. If the number of windows to be processed is multiple, the windows to be processed and the target window are sequentially input into the preset model. For example, when the number of windows to be processed is three, they are respectively the window to be processed A1, the window to be processed A2, and the window to be processed A3. Input the to-be-processed window A1 and the target window into the preset model in turn to obtain the similarity value between the to-be-processed window A1 and the target window; input the to-be-processed window A2 and the target window into the preset model to obtain the to-be-processed window A2 and the target window The similarity value between the window A3 to be processed and the target window are input into the preset model to obtain the similarity value between the window A3 to be processed and the target window.
步骤S205、根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。Step S205: Determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
示范性的,获取目标窗口与待处理窗口之间的相似度值,基于该目标窗口与待处理窗口之间的相似度值,确定该目标窗口对应的时间点为异常点。示例性的,获取预置阈值,若目标窗口与待处理窗口之间的相似度值大于预设阈值,则将其时间点标为异常点。若目标窗口与待处理窗口之间的相似度值小于预设阈值,则可以认为该时间点不是异常点。Exemplarily, the similarity value between the target window and the window to be processed is acquired, and based on the similarity value between the target window and the window to be processed, it is determined that the time point corresponding to the target window is an abnormal point. Exemplarily, a preset threshold is acquired, and if the similarity value between the target window and the window to be processed is greater than the preset threshold, the time point is marked as an abnormal point. If the similarity value between the target window and the window to be processed is less than the preset threshold, it can be considered that the time point is not an abnormal point.
在本申请实施例中,通过采集非相似窗口和相似窗口让模型自动学习正负样本对之间的特征差异,省略了主观的阈值选取步骤,提升了模型的准确率。In the embodiment of the present application, the model automatically learns the feature difference between positive and negative sample pairs by collecting dissimilar windows and similar windows, omitting the subjective threshold selection step, and improving the accuracy of the model.
请参照图8,图8为本申请实施例提供的一种时间序列异常点的检测装置的示意性框图。Please refer to FIG. 8. FIG. 8 is a schematic block diagram of an apparatus for detecting abnormal points in a time series according to an embodiment of the present application.
如图8所示,该时间序列异常点的检测装置400,包括:获取模块401、第一确定模块402、第二确定模块403。As shown in FIG. 8, the device 400 for detecting abnormal points in the time series includes: an acquiring module 401, a first determining module 402, and a second determining module 403.
获取模块401、用于获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;The acquiring module 401 is configured to acquire a target window in a time series to be processed, and acquire a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
第一确定模块402、基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;The first determining module 402, based on a preset model, determines a similarity value between the target window and the window to be processed according to the target window and the window to be processed;
第二确定模块403、用于根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。The second determining module 403 is configured to determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
其中,获取模块401具体还用于:Among them, the obtaining module 401 is specifically also used for:
确定待处理时间序列上待检测的目标时间点;Determine the target time point to be detected on the time series to be processed;
基于预置窗口信息和所述目标时间点,获取所述目标时间点对应的目标窗口。Based on the preset window information and the target time point, a target window corresponding to the target time point is acquired.
其中,获取模块401具体还用于:Among them, the obtaining module 401 is specifically also used for:
根据所述待处理时间序列,确定所述目标时间点的采集策略;Determine the collection strategy of the target time point according to the time sequence to be processed;
基于所述采集策略和所述预置窗口信息,获取所述目标窗口对应的待处理窗口。Based on the collection strategy and the preset window information, a window to be processed corresponding to the target window is acquired.
其中,第一确定模块402具体还用于:Wherein, the first determining module 402 is specifically further used for:
基于预置模型,将所述目标窗口和所述待处理窗口分别输入所述预置模型;Based on a preset model, input the target window and the window to be processed into the preset model respectively;
通过所述预置模型的权重参数,分别获取所述目标窗口的映射参数和所述待处理窗口的映射参数;Respectively acquiring the mapping parameter of the target window and the mapping parameter of the window to be processed through the weight parameter of the preset model;
基于所述目标窗口的映射参数和所述待处理窗口的映射参数,输出所述目标窗口与所述待处理窗口之间的相似度值。Based on the mapping parameter of the target window and the mapping parameter of the window to be processed, the similarity value between the target window and the window to be processed is output.
其中,第二确定模块403具体还用于:Among them, the second determining module 403 is also specifically used for:
确定所述目标窗口与各个所述待处理窗口之间的相似度值是否小于预置阈值;Determining whether the similarity value between the target window and each of the windows to be processed is less than a preset threshold;
若所述目标窗口与任意一个所述待处理窗口之间的相似度值小于所述预置阈值,则确定所述目标窗口对应的目标时间点为异常点。If the similarity value between the target window and any of the windows to be processed is less than the preset threshold, it is determined that the target time point corresponding to the target window is an abnormal point.
其中,时间序列异常点的检测装置具体用于:Among them, the detection device for time series abnormal points is specifically used for:
获取待训练的窗口、相似窗口和非相似窗口;Obtain the windows to be trained, similar windows and non-similar windows;
根据所述待训练的窗口、相似窗口和非相似窗口对预置待训练模型进行训练,得到训练后的预置模型。The preset model to be trained is trained according to the window to be trained, the similar window and the dissimilar window to obtain the preset model after training.
其中,时间序列异常点的检测装置具体用于:Among them, the detection device for time series abnormal points is specifically used for:
确定预置待训练时间序列中的任意时间点;Determine any time point in the preset time sequence to be trained;
基于所述任意时间点确定窗口信息,得到所述任意时间点对应的待训练的窗口;Determine window information based on the arbitrary time point, and obtain the window to be trained corresponding to the arbitrary time point;
确定所述待训练时间序列中与所述任意时间点相匹配的时刻,并基于所述窗口信息得到对应的相似窗口;Determining a time matching the arbitrary time point in the time sequence to be trained, and obtaining a corresponding similar window based on the window information;
确定所述待训练时间序列中与所述任意时间点不匹配的时刻,并基于所述窗口信息得到对应的非相似窗口。Determine a time that does not match the arbitrary time point in the time sequence to be trained, and obtain a corresponding non-similar window based on the window information.
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和各模块及单元的具体工作过程,可以参考前述时间序列异常点的检测方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described device and each module and unit can be referred to in the above-mentioned time series abnormal point detection method embodiment The corresponding process will not be repeated here.
上述实施例提供的装置可以实现为一种计算机程序的形式,该计算机程序可以在如图9所示的计算机设备上运行。The apparatus provided in the foregoing embodiment may be implemented in the form of a computer program, and the computer program may run on the computer device as shown in FIG. 9.
请参阅图9,图9为本申请实施例提供的一种计算机设备的结构示意性框图。该计算机设备可以为终端。Please refer to FIG. 9, which is a schematic block diagram of the structure of a computer device provided by an embodiment of the application. The computer device may be a terminal.
如图9所示,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口,其中,存储器可以包括非易失性存储介质和内存储器。As shown in FIG. 9, the computer device includes a processor, a memory, and a network interface connected through a system bus, where the memory may include a non-volatile storage medium and an internal memory.
非易失性存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令,该程序指令被执行时,可使得处理器执行任意一种时间序列异常点的检测方法。The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any method for detecting abnormal points in a time series.
处理器用于提供计算和控制能力,支撑整个计算机设备的运行。The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
内存储器为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器执行时,可使得处理器执行任意一种时间序列异常点的检测方法。The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for detecting abnormal points in the time series.
该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体地计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The network interface is used for network communication, such as sending assigned tasks. Those skilled in the art can understand that the structure shown in FIG. 9 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 computer device to which the solution of the present application is applied. Specifically, the computer device may Including more or fewer parts than shown in the figure, or combining some parts, or having a different arrangement of parts.
应当理解的是,处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), and application specific integrated circuits (Application Specific Integrated Circuits). Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:Wherein, in an embodiment, the processor is used to run a computer program stored in a memory to implement the following steps:
获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;
根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
在一个实施例中,所述处理器获取待处理时间序列中的目标窗口实现时,用于实现:In an embodiment, when the processor obtains the realization of the target window in the to-be-processed time sequence, it is used to realize:
确定待处理时间序列上待检测的目标时间点;Determine the target time point to be detected on the time series to be processed;
基于预置窗口信息和所述目标时间点,获取所述目标时间点对应的目标窗口。Based on the preset window information and the target time point, a target window corresponding to the target time point is acquired.
在一个实施例中,所述处理器获取所述目标窗口对应的待处理窗口实现时,用于实现:In an embodiment, when the processor obtains the realization of the to-be-processed window corresponding to the target window, it is used to realize:
根据所述待处理时间序列,确定所述目标时间点的采集策略;Determine the collection strategy of the target time point according to the time sequence to be processed;
基于所述采集策略和所述预置窗口信息,获取所述目标窗口对应的待处理窗口。Based on the collection strategy and the preset window information, a window to be processed corresponding to the target window is acquired.
在一个实施例中,所述处理器在基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值实现时,用于实现:In one embodiment, when the processor determines the similarity value between the target window and the window to be processed based on a preset model and based on the target window and the window to be processed, the processor is configured to implement:
基于预置模型,将所述目标窗口和所述待处理窗口分别输入所述预置模型;Based on a preset model, input the target window and the window to be processed into the preset model respectively;
通过所述预置模型的权重参数,分别获取所述目标窗口的映射参数和所述待处理窗口的映射参数;Respectively acquiring the mapping parameter of the target window and the mapping parameter of the window to be processed through the weight parameter of the preset model;
基于所述目标窗口的映射参数和所述待处理窗口的映射参数,输出所述目标窗口与所述待处理窗口之间的相似度值。Based on the mapping parameter of the target window and the mapping parameter of the window to be processed, the similarity value between the target window and the window to be processed is output.
在一个实施例中,所述处理器根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点实现时,用于实现:In an embodiment, when the processor determines whether the time point corresponding to the target window is an abnormal point realization according to the similarity value, the processor is used to realize:
确定所述目标窗口与各个所述待处理窗口之间的相似度值是否小于预置阈值;Determining whether the similarity value between the target window and each of the windows to be processed is less than a preset threshold;
若所述目标窗口与任意一个所述待处理窗口之间的相似度值小于所述预置阈值,则确定所述目标窗口对应的目标时间点为异常点。If the similarity value between the target window and any of the windows to be processed is less than the preset threshold, it is determined that the target time point corresponding to the target window is an abnormal point.
在一个实施例中,所述处理器获取待处理时间序列的目标窗口之前实现时,用于实现:In an embodiment, when the processor acquires the target window of the to-be-processed time sequence before being implemented, it is used to implement:
获取待训练的窗口、相似窗口和非相似窗口;Obtain the windows to be trained, similar windows and non-similar windows;
根据所述待训练的窗口、相似窗口和非相似窗口对预置待训练模型进行训练,得到训练后的预置模型。The preset model to be trained is trained according to the window to be trained, the similar window and the dissimilar window to obtain the preset model after training.
在一个实施例中,所述处理器获取待训练的窗口、相似窗口和非相似窗口实现时,用于实现:In one embodiment, when the processor obtains the windows to be trained, the similar windows and the dissimilar windows to be implemented, it is used to implement:
确定预置待训练时间序列中的任意时间点;Determine any time point in the preset time sequence to be trained;
基于所述任意时间点确定窗口信息,得到所述任意时间点对应的待训练的窗口;Determine window information based on the arbitrary time point, and obtain the window to be trained corresponding to the arbitrary time point;
确定所述待训练时间序列中与所述任意时间点相匹配的时刻,并基于所述窗口信息得到对应的相似窗口;Determining a time matching the arbitrary time point in the time sequence to be trained, and obtaining a corresponding similar window based on the window information;
确定所述待训练时间序列中与所述任意时间点不匹配的时刻,并基于所述窗口信息得到对应的非相似窗口。Determine a time that does not match the arbitrary time point in the time sequence to be trained, and obtain a corresponding non-similar window based on the window information.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质可以是易失性的,也可以是非易失性的,所述计算机可读存储介质上存储有计算机程序,所述计算机程序中包括程序指令,所述程序指令被执行时实现如下步骤:The embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium may be volatile or non-volatile, and the computer-readable storage medium stores a computer program, so The computer program includes program instructions, and the following steps are implemented when the program instructions are executed:
获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;
基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;
根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
所述程序指令被执行时所实现步骤的实施例可参照本申请时间序列异常点的检方法的各个实施例。For the embodiments of the steps implemented when the program instructions are executed, reference may be made to the various embodiments of the method for detecting abnormal points in the time series of the present application.
其中,所述计算机可读存储介质可以是前述实施例所述的计算机设备的内部存储单元,例如所述计算机设备的硬盘或内存。所述计算机可读存储介质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。The computer-readable storage medium may be the internal storage unit of the computer device described in the foregoing embodiment, for example, the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), and a Secure Digital (SD) ) Card, Flash Card, etc.
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
本申请所指区块链是预置模型的存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technology such as storage of preset models, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority or inferiority of the embodiments. The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Anyone familiar with the technical field can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.
Claims (20)
- 一种时间序列异常点的检测方法,其中,所述时间序列异常点的检测方法包括:A method for detecting abnormal points in a time series, wherein the method for detecting abnormal points in a time series includes:获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
- 如权利要求1所述的时间序列异常点的检测方法,其中,所述获取待处理时间序列中的目标窗口包括:The method for detecting abnormal points in a time series according to claim 1, wherein said obtaining the target window in the time series to be processed comprises:确定待处理时间序列上待检测的目标时间点;Determine the target time point to be detected on the time series to be processed;基于预置窗口信息和所述目标时间点,获取所述目标时间点对应的目标窗口。Based on the preset window information and the target time point, a target window corresponding to the target time point is acquired.
- 如权利要求2所述的时间序列异常点的检测方法,其中,所述获取所述目标窗口对应的待处理窗口包括:The method for detecting abnormal points in a time series according to claim 2, wherein said obtaining the window to be processed corresponding to the target window comprises:根据所述待处理时间序列,确定所述目标时间点的采集策略;Determine the collection strategy of the target time point according to the time sequence to be processed;基于所述采集策略和所述预置窗口信息,获取所述目标窗口对应的待处理窗口。Based on the collection strategy and the preset window information, a window to be processed corresponding to the target window is acquired.
- 如权利要求1所述的时间序列异常点的检测方法,其中,所述基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值,包括;The method for detecting abnormal points in a time series according to claim 1, wherein the determining the similarity value between the target window and the window to be processed according to the target window and the window to be processed based on a preset model includes ;基于预置模型,将所述目标窗口和所述待处理窗口分别输入所述预置模型;Based on a preset model, input the target window and the window to be processed into the preset model respectively;通过所述预置模型的权重参数,分别获取所述目标窗口的映射参数和所述待处理窗口的映射参数;Respectively acquiring the mapping parameter of the target window and the mapping parameter of the window to be processed through the weight parameter of the preset model;基于所述目标窗口的映射参数和所述待处理窗口的映射参数,输出所述目标窗口与所述待处理窗口之间的相似度值。Based on the mapping parameter of the target window and the mapping parameter of the window to be processed, the similarity value between the target window and the window to be processed is output.
- 如权利要求1所述的时间序列异常点的检测方法,其中,所述根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点包括:The method for detecting abnormal points in a time series according to claim 1, wherein the determining whether a time point corresponding to the target window is an abnormal point according to the similarity value comprises:确定所述目标窗口与各个所述待处理窗口之间的相似度值是否小于预置阈值;Determining whether the similarity value between the target window and each of the windows to be processed is less than a preset threshold;若所述目标窗口与任意一个所述待处理窗口之间的相似度值小于所述预置阈值,则确定所述目标窗口对应的目标时间点为异常点。If the similarity value between the target window and any of the windows to be processed is less than the preset threshold, it is determined that the target time point corresponding to the target window is an abnormal point.
- 如权利要求1所述的时间序列异常点的检测方法,其中,所述获取待处理时间序列的目标窗口之前,还包括:The method for detecting abnormal points in a time series according to claim 1, wherein before said obtaining the target window of the time series to be processed, the method further comprises:获取待训练的窗口、相似窗口和非相似窗口;Obtain the windows to be trained, similar windows and non-similar windows;根据所述待训练的窗口、相似窗口和非相似窗口对预置待训练模型进行训练,得到训练后的预置模型。The preset model to be trained is trained according to the window to be trained, the similar window and the dissimilar window to obtain the preset model after training.
- 如权利要求6所述的时间序列异常点的检测方法,其中,所述获取待训练的窗口、相似窗口和非相似窗口包括:The method for detecting abnormal points in a time series according to claim 6, wherein said obtaining the window to be trained, the similar window and the non-similar window comprises:确定预置待训练时间序列中的任意时间点;Determine any time point in the preset time sequence to be trained;基于所述任意时间点确定窗口信息,得到所述任意时间点对应的待训练的窗口;Determine window information based on the arbitrary time point, and obtain the window to be trained corresponding to the arbitrary time point;确定所述待训练时间序列中与所述任意时间点相匹配的时刻,并基于所述窗口信息得到对应的相似窗口;Determining a time matching the arbitrary time point in the time sequence to be trained, and obtaining a corresponding similar window based on the window information;确定所述待训练时间序列中与所述任意时间点不匹配的时刻,并基于所述窗口信息得到对应的非相似窗口。Determine a time that does not match the arbitrary time point in the time sequence to be trained, and obtain a corresponding non-similar window based on the window information.
- 一种时间序列异常点的检测装置、其中,所述时间序列异常点的检测装置包括:A device for detecting abnormal points in a time series, wherein the device for detecting abnormal points in a time series includes:获取模块,用于获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;An obtaining module, configured to obtain a target window in a time series to be processed, and obtain a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;第一确定模块,用于基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗 口和待处理窗口之间的相似度值;The first determining module is configured to determine the similarity value between the target window and the window to be processed according to the target window and the window to be processed based on a preset model;第二确定模块,用于根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。The second determining module is configured to determine whether the time point corresponding to the target window is an abnormal point according to the similarity value.
- 一种计算机设备,其中,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如下步骤:A computer device, wherein the computer device includes a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the The following steps:获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
- 如权利要求9所述的计算机设备,其中,所述获取待处理时间序列中的目标窗口包括:9. The computer device according to claim 9, wherein said obtaining the target window in the time series to be processed comprises:确定待处理时间序列上待检测的目标时间点;Determine the target time point to be detected on the time series to be processed;基于预置窗口信息和所述目标时间点,获取所述目标时间点对应的目标窗口。Based on the preset window information and the target time point, a target window corresponding to the target time point is acquired.
- 如权利要求10所述的计算机设备,其中,所述获取所述目标窗口对应的待处理窗口包括:10. The computer device according to claim 10, wherein said obtaining the to-be-processed window corresponding to the target window comprises:根据所述待处理时间序列,确定所述目标时间点的采集策略;Determine the collection strategy of the target time point according to the time sequence to be processed;基于所述采集策略和所述预置窗口信息,获取所述目标窗口对应的待处理窗口。Based on the collection strategy and the preset window information, a window to be processed corresponding to the target window is acquired.
- 如权利要求9所述的计算机设备,其中,所述基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值,包括;9. The computer device according to claim 9, wherein the determining the similarity value between the target window and the window to be processed according to the target window and the window to be processed based on a preset model comprises;基于预置模型,将所述目标窗口和所述待处理窗口分别输入所述预置模型;Based on a preset model, input the target window and the window to be processed into the preset model respectively;通过所述预置模型的权重参数,分别获取所述目标窗口的映射参数和所述待处理窗口的映射参数;Respectively acquiring the mapping parameter of the target window and the mapping parameter of the window to be processed through the weight parameter of the preset model;基于所述目标窗口的映射参数和所述待处理窗口的映射参数,输出所述目标窗口与所述待处理窗口之间的相似度值。Based on the mapping parameter of the target window and the mapping parameter of the window to be processed, the similarity value between the target window and the window to be processed is output.
- 如权利要求9所述的计算机设备,其中,所述根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点包括:9. The computer device according to claim 9, wherein the determining whether the time point corresponding to the target window is an abnormal point according to the similarity value comprises:确定所述目标窗口与各个所述待处理窗口之间的相似度值是否小于预置阈值;Determining whether the similarity value between the target window and each of the windows to be processed is less than a preset threshold;若所述目标窗口与任意一个所述待处理窗口之间的相似度值小于所述预置阈值,则确定所述目标窗口对应的目标时间点为异常点。If the similarity value between the target window and any of the windows to be processed is less than the preset threshold, it is determined that the target time point corresponding to the target window is an abnormal point.
- 如权利要求9所述的计算机设备,其中,所述获取待处理时间序列的目标窗口之前,所述计算机程序被所述处理器执行时还实现如下步骤:9. The computer device according to claim 9, wherein, before said obtaining the target window of the time sequence to be processed, the following steps are further implemented when the computer program is executed by the processor:获取待训练的窗口、相似窗口和非相似窗口;Obtain the windows to be trained, similar windows and non-similar windows;根据所述待训练的窗口、相似窗口和非相似窗口对预置待训练模型进行训练,得到训练后的预置模型。The preset model to be trained is trained according to the window to be trained, the similar window and the dissimilar window to obtain the preset model after training.
- 如权利要求14所述的计算机设备,其中,所述获取待训练的窗口、相似窗口和非相似窗口包括:The computer device according to claim 14, wherein said acquiring a window to be trained, a similar window and a non-similar window comprises:确定预置待训练时间序列中的任意时间点;Determine any time point in the preset time sequence to be trained;基于所述任意时间点确定窗口信息,得到所述任意时间点对应的待训练的窗口;Determine window information based on the arbitrary time point, and obtain the window to be trained corresponding to the arbitrary time point;确定所述待训练时间序列中与所述任意时间点相匹配的时刻,并基于所述窗口信息得到对应的相似窗口;Determining a time matching the arbitrary time point in the time sequence to be trained, and obtaining a corresponding similar window based on the window information;确定所述待训练时间序列中与所述任意时间点不匹配的时刻,并基于所述窗口信息得到对应的非相似窗口。Determine a time that does not match the arbitrary time point in the time sequence to be trained, and obtain a corresponding non-similar window based on the window information.
- 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序, 其中所述计算机程序被处理器执行时,实现如下步骤:A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the following steps are implemented:获取待处理时间序列中的目标窗口,以及获取所述目标窗口对应的待处理窗口,其中,所述待处理窗口数量大于1;Acquiring a target window in the to-be-processed time sequence, and acquiring a to-be-processed window corresponding to the target window, wherein the number of the to-be-processed windows is greater than one;基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值;Based on a preset model, determining a similarity value between the target window and the window to be processed according to the target window and the window to be processed;根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点。According to the similarity value, it is determined whether the time point corresponding to the target window is an abnormal point.
- 如权利要求16所述的计算机可读存储介质,其中,所述获取待处理时间序列中的目标窗口包括:15. The computer-readable storage medium according to claim 16, wherein said obtaining the target window in the to-be-processed time series comprises:确定待处理时间序列上待检测的目标时间点;Determine the target time point to be detected on the time series to be processed;基于预置窗口信息和所述目标时间点,获取所述目标时间点对应的目标窗口。Based on the preset window information and the target time point, a target window corresponding to the target time point is acquired.
- 如权利要求17所述的计算机可读存储介质,其中,所述获取所述目标窗口对应的待处理窗口包括:17. The computer-readable storage medium according to claim 17, wherein said obtaining the to-be-processed window corresponding to the target window comprises:根据所述待处理时间序列,确定所述目标时间点的采集策略;Determine the collection strategy of the target time point according to the time sequence to be processed;基于所述采集策略和所述预置窗口信息,获取所述目标窗口对应的待处理窗口。Based on the collection strategy and the preset window information, a window to be processed corresponding to the target window is acquired.
- 如权利要求16所述的计算机可读存储介质,其中,所述基于预置模型,根据所述目标窗口和待处理窗口确定所述目标窗口和待处理窗口之间的相似度值,包括;15. The computer-readable storage medium of claim 16, wherein the determining the similarity value between the target window and the window to be processed according to the target window and the window to be processed based on a preset model comprises;基于预置模型,将所述目标窗口和所述待处理窗口分别输入所述预置模型;Based on a preset model, input the target window and the window to be processed into the preset model respectively;通过所述预置模型的权重参数,分别获取所述目标窗口的映射参数和所述待处理窗口的映射参数;Respectively acquiring the mapping parameter of the target window and the mapping parameter of the window to be processed through the weight parameter of the preset model;基于所述目标窗口的映射参数和所述待处理窗口的映射参数,输出所述目标窗口与所述待处理窗口之间的相似度值。Based on the mapping parameter of the target window and the mapping parameter of the window to be processed, the similarity value between the target window and the window to be processed is output.
- 如权利要求16所述的计算机可读存储介质,其中,所述根据所述相似度值,确定所述目标窗口对应的时间点是否为异常点包括:15. The computer-readable storage medium of claim 16, wherein the determining whether the time point corresponding to the target window is an abnormal point according to the similarity value comprises:确定所述目标窗口与各个所述待处理窗口之间的相似度值是否小于预置阈值;Determining whether the similarity value between the target window and each of the windows to be processed is less than a preset threshold;若所述目标窗口与任意一个所述待处理窗口之间的相似度值小于所述预置阈值,则确定所述目标窗口对应的目标时间点为异常点。If the similarity value between the target window and any of the windows to be processed is less than the preset threshold, it is determined that the target time point corresponding to the target window is an abnormal point.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011006800.6A CN112131274B (en) | 2020-09-22 | 2020-09-22 | Method, device, equipment and readable storage medium for detecting abnormal points of time sequence |
CN202011006800.6 | 2020-09-22 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021189845A1 true WO2021189845A1 (en) | 2021-09-30 |
Family
ID=73842731
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/125004 WO2021189845A1 (en) | 2020-09-22 | 2020-10-30 | Detection method and apparatus for time series anomaly point, and device and readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112131274B (en) |
WO (1) | WO2021189845A1 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220166681A1 (en) * | 2019-08-15 | 2022-05-26 | Huawei Technologies Co., Ltd. | Traffic Anomaly Detection Method, and Model Training Method and Apparatus |
CN114726581A (en) * | 2022-03-09 | 2022-07-08 | 同济大学 | Abnormity detection method and device, electronic equipment and storage medium |
CN118468206A (en) * | 2024-07-12 | 2024-08-09 | 宁德时代新能源科技股份有限公司 | Abnormality detection method, abnormality detection device, electronic equipment, abnormality detection medium and abnormality detection product |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114235652A (en) * | 2021-11-30 | 2022-03-25 | 国网北京市电力公司 | Smoke dust particle concentration abnormity identification method and device, storage medium and equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080140751A1 (en) * | 2006-12-11 | 2008-06-12 | Tsuyoshi Ide | Technique for detecting anomaly in observation target |
CN106951680A (en) * | 2017-02-21 | 2017-07-14 | 河海大学 | A kind of Hydrological Time Series abnormal patterns detection method |
CN107194184A (en) * | 2017-05-31 | 2017-09-22 | 成都数联易康科技有限公司 | Based on Time Series Similarity analysis in institute person-time method for detecting abnormality and system |
CN107493277A (en) * | 2017-08-10 | 2017-12-19 | 福建师范大学 | The online method for detecting abnormality of big data platform based on maximum information coefficient |
CN107528722A (en) * | 2017-07-06 | 2017-12-29 | 阿里巴巴集团控股有限公司 | Abnormal point detecting method and device in a kind of time series |
CN108071941A (en) * | 2017-12-13 | 2018-05-25 | 清华大学 | A kind of booster identification and localization method based on time series vector similarity analysis |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103618651B (en) * | 2013-12-11 | 2017-03-29 | 上海电机学院 | It is a kind of based on comentropy and the network anomaly detection method and system of sliding window |
CN105160181B (en) * | 2015-09-02 | 2018-02-23 | 华中科技大学 | A kind of digital control system domain of instruction sequence variation data detection method |
CN106411597A (en) * | 2016-10-14 | 2017-02-15 | 广东工业大学 | Network traffic abnormality detection method and system |
CN106528313B (en) * | 2016-10-24 | 2018-10-16 | 中国银联股份有限公司 | A kind of host variable method for detecting abnormality and system |
CN107703920B (en) * | 2017-10-25 | 2019-12-17 | 北京交通大学 | Fault detection method of train braking system based on multivariate time sequence |
CN108509979B (en) * | 2018-02-28 | 2022-03-11 | 努比亚技术有限公司 | Anomaly detection method, server and computer readable storage medium |
CN109871401B (en) * | 2018-12-26 | 2021-05-25 | 北京奇安信科技有限公司 | Time series abnormity detection method and device |
CN111679949B (en) * | 2020-04-23 | 2024-10-18 | 平安科技(深圳)有限公司 | Abnormality detection method based on equipment index data and related equipment |
CN111669373B (en) * | 2020-05-25 | 2022-04-01 | 山东理工大学 | Network anomaly detection method and system based on space-time convolutional network and topology perception |
-
2020
- 2020-09-22 CN CN202011006800.6A patent/CN112131274B/en active Active
- 2020-10-30 WO PCT/CN2020/125004 patent/WO2021189845A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080140751A1 (en) * | 2006-12-11 | 2008-06-12 | Tsuyoshi Ide | Technique for detecting anomaly in observation target |
CN106951680A (en) * | 2017-02-21 | 2017-07-14 | 河海大学 | A kind of Hydrological Time Series abnormal patterns detection method |
CN107194184A (en) * | 2017-05-31 | 2017-09-22 | 成都数联易康科技有限公司 | Based on Time Series Similarity analysis in institute person-time method for detecting abnormality and system |
CN107528722A (en) * | 2017-07-06 | 2017-12-29 | 阿里巴巴集团控股有限公司 | Abnormal point detecting method and device in a kind of time series |
CN107493277A (en) * | 2017-08-10 | 2017-12-19 | 福建师范大学 | The online method for detecting abnormality of big data platform based on maximum information coefficient |
CN108071941A (en) * | 2017-12-13 | 2018-05-25 | 清华大学 | A kind of booster identification and localization method based on time series vector similarity analysis |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20220166681A1 (en) * | 2019-08-15 | 2022-05-26 | Huawei Technologies Co., Ltd. | Traffic Anomaly Detection Method, and Model Training Method and Apparatus |
CN114726581A (en) * | 2022-03-09 | 2022-07-08 | 同济大学 | Abnormity detection method and device, electronic equipment and storage medium |
CN118468206A (en) * | 2024-07-12 | 2024-08-09 | 宁德时代新能源科技股份有限公司 | Abnormality detection method, abnormality detection device, electronic equipment, abnormality detection medium and abnormality detection product |
Also Published As
Publication number | Publication date |
---|---|
CN112131274A (en) | 2020-12-25 |
CN112131274B (en) | 2024-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021189845A1 (en) | Detection method and apparatus for time series anomaly point, and device and readable storage medium | |
WO2022179138A1 (en) | Image processing method and apparatus, and computer device and storage medium | |
WO2022227388A1 (en) | Log anomaly detection model training method, apparatus and device | |
WO2022083093A1 (en) | Probability calculation method and apparatus in graph, computer device and storage medium | |
US20210092160A1 (en) | Data set creation with crowd-based reinforcement | |
WO2021089013A1 (en) | Spatial graph convolutional network training method, electronic device and storage medium | |
WO2020164272A1 (en) | Network access device identifying method and apparatus, storage medium and computer device | |
WO2015044155A1 (en) | Method, apparatus, and computer program product for data quality analysis | |
CN110135590B (en) | Information processing method, information processing apparatus, information processing medium, and electronic device | |
WO2022088632A1 (en) | User data monitoring and analysis method, apparatus, device, and medium | |
WO2020173136A1 (en) | Method and apparatus for monitoring application system, device, and storage medium | |
CN111400126B (en) | Network service abnormal data detection method, device, equipment and medium | |
WO2021196935A1 (en) | Data checking method and apparatus, electronic device, and storage medium | |
US20210286763A1 (en) | Suggesting a destination folder for a file to be saved | |
WO2019056496A1 (en) | Method for generating picture review probability interval and method for picture review determination | |
WO2024098699A1 (en) | Entity object thread detection method and apparatus, device, and storage medium | |
WO2021218063A1 (en) | Method and apparatus for assigning parameter with value on the basis of name mapping, and computer device | |
CN110390011B (en) | Data classification method and device | |
CN113157198A (en) | Method, apparatus and computer program product for managing a cache | |
WO2021169217A1 (en) | Abstract extraction method and apparatus, device, and computer-readable storage medium | |
WO2020234977A1 (en) | Information processing device, creation method, and creation program | |
US11593014B2 (en) | System and method for approximating replication completion time | |
CN113591458B (en) | Medical term processing method, device, equipment and storage medium based on neural network | |
WO2022105120A1 (en) | Text detection method and apparatus from image, computer device and storage medium | |
CN115511105A (en) | Method, apparatus, device, and medium for determining an update gradient of a contrast learning model |
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: 20926406 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: 20926406 Country of ref document: EP Kind code of ref document: A1 |