WO2021056724A1 - 异常检测方法、装置、电子设备及存储介质 - Google Patents

异常检测方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021056724A1
WO2021056724A1 PCT/CN2019/117229 CN2019117229W WO2021056724A1 WO 2021056724 A1 WO2021056724 A1 WO 2021056724A1 CN 2019117229 W CN2019117229 W CN 2019117229W WO 2021056724 A1 WO2021056724 A1 WO 2021056724A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
time point
detected
value
residual
Prior art date
Application number
PCT/CN2019/117229
Other languages
English (en)
French (fr)
Inventor
陈桢博
金戈
徐亮
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021056724A1 publication Critical patent/WO2021056724A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3447Performance evaluation by modeling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3452Performance evaluation by statistical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2433Single-class perspective, e.g. one-against-all classification; Novelty detection; Outlier detection

Definitions

  • This application relates to the technical field of intelligent operation and maintenance, and in particular to an abnormality detection method, device, electronic equipment, and storage medium.
  • anomaly detection is an important part of the entire link. Because it is difficult to provide a large number of abnormal annotations for monitoring index sequences, the existing detection methods mainly use unsupervised learning algorithms or statistical algorithms, and also include deep learning algorithms.
  • the anomaly detection has the following two requirements for the algorithm:
  • An abnormality detection method comprising: when an abnormality detection instruction is received, obtaining a sample to be detected; determining whether the sample to be detected has periodicity; when the sample to be detected has periodicity, determining the time to be detected Point; determine the collected value corresponding to the time point to be detected from the sample to be detected; call a pre-trained anomaly detection model, wherein training the anomaly detection model includes: at least one from the time point to be detected Obtain all data that meet the configuration conditions from the sequence feature data and perform STL decomposition to obtain the periodic component of each data in all the data.
  • An abnormality detection device comprising: an acquisition unit for acquiring a sample to be detected when an abnormality detection instruction is received; a determining unit for determining whether the sample to be detected has periodicity; the determining unit, It is also used to determine the time point to be detected when the sample to be detected has periodicity; the determining unit is also used to determine the collected value corresponding to the time point to be detected from the sample to be detected; the call unit , For invoking a pre-trained anomaly detection model, where training the anomaly detection model includes: obtaining all data that meets the configuration condition from the data of at least one sequence feature before the time point to be detected and performing STL decomposition to obtain the The period component of each data in all the data, based on the period component, calculate the residual mean value and residual standard deviation of all the data, and calculate the expected value corresponding to the time point to be detected, to obtain the anomaly detection model The obtaining unit is also used to obtain the expected value corresponding to the collected value from the abnormality detection model; the calculating unit is used to
  • An electronic device comprising: a memory storing at least one instruction;
  • the processor executes the instructions stored in the memory to implement the abnormality detection method.
  • a non-volatile readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the abnormality detection method.
  • the present application can obtain the sample to be detected when an abnormality detection instruction is received, and determine whether the sample to be detected has periodicity, and when the sample to be detected has periodicity, determine the sample to be detected At the time point, because not all data is detected, the detection efficiency is improved.
  • the collected value corresponding to the time point to be detected is determined from the sample to be detected, and the pre-trained anomaly detection model is called, and the anomaly detection Obtain the expected value corresponding to the collected value in the model, calculate the residual value between the collected value and the expected value, and further determine whether the sample to be detected is abnormal based on the abnormality detection model and the residual value, Since the abnormality detection model is a multi-model established based on SH-ESD, the abnormality detection has high-precision characteristics, thereby realizing automatic detection of various abnormalities.
  • Fig. 1 is a flowchart of a preferred embodiment of the abnormality detection method of the present application.
  • Fig. 2 is a functional module diagram of a preferred embodiment of the abnormality detection device of the present application.
  • Fig. 3 is a schematic structural diagram of an electronic device implementing a preferred embodiment of an abnormality detection method according to the present application.
  • FIG. 1 it is a flowchart of a preferred embodiment of the abnormality detection method of the present application. According to different needs, the order of the steps in the flowchart can be changed, and some steps can be omitted.
  • the abnormality detection method is applied to one or more electronic devices.
  • the abnormality detection instruction may be triggered by a relevant worker, or may be configured to be automatically triggered at a fixed time, which is not limited in the present application.
  • the electronic device is configured to trigger the abnormality detection instruction at 12:00 every day.
  • the sample to be detected refers to sequence data or waveform data.
  • the sample to be tested is the operating data output by the system. By detecting the sample to be tested, it can be determined whether the system is abnormal, and effective maintenance measures can be taken in time to avoid the failure of normal output of data due to system errors.
  • the electronic device since the subsequent anomaly detection model is modeled based on the SH-ESD algorithm, and the SH-ESD algorithm is applied to a periodic sequence, the electronic device must first determine the waiting Check whether the sample is periodic.
  • Whether the sample to be tested has periodicity is a recording attribute of the sample to be tested, and the electronic device can be directly determined according to the recorded attribute.
  • the electronic device when the electronic device determines that the sample to be tested does not have periodicity, the electronic device may also use other algorithms (such as statistical algorithms, etc.) to perform a calculation on the sample to be tested. Anomaly detection, this application will not go into details here.
  • the electronic device in order to facilitate detection and improve the efficiency of abnormality detection, does not detect all the data in the sample to be detected, but performs detection of some time points in the sample to be detected. (That is, the data at the time point to be detected) is detected.
  • the time point to be detected can be customized, which is not limited in this application.
  • the collected value refers to the true value of the output.
  • the electronic device can extract the collected value at the time point to be detected from the sample to be detected according to the time point to be detected, to For subsequent anomaly detection.
  • the electronic device may determine that the collected value at 13:00 is A.
  • the anomaly detection model is obtained by training based on the S-H-ESD algorithm.
  • the method further includes:
  • the electronic device trains the abnormality detection model.
  • the method before calling the pre-trained anomaly detection model, the method further includes:
  • the electronic device acquires all data of at least one sequence feature in a preset time period before the time point to be detected, and determines whether all the data has periodicity based on the Fourier transform, and the electronic device calculates all the data The autocorrelation coefficient of the data and compare the autocorrelation coefficient with the configuration value.
  • the electronic device compares all the data Perform time series decomposition (Seasonal and Trend Decomposition using Loess) with robust local weighted regression as a smoothing method to obtain the periodic component of each data in all the data, and the electronic device obtains and The target period component corresponding to the to-be-detected time point, and the target data corresponding to the to-be-detected time point is obtained from all the data, and further, the electronic device calculates the target data and the target period component The historical residual is obtained, and based on the historical residual, the residual mean and residual standard deviation of all the data are calculated, and the electronic device calculates the expected value corresponding to the time point to be detected based on the linear interpolation algorithm , Obtain the abnormality detection model, and further update the abnormality detection model regularly.
  • the preset time period can be customized configuration, such as: two weeks, three weeks, etc.; the configuration value can also be customized configuration, and this application is not limited.
  • the at least one sequence feature may include, but is not limited to one or a combination of the following:
  • the output value and the slope are regular testing items, which can reflect the pros and cons of the data
  • the increase and the average value are scalable testing items, which can be performed according to actual testing requirements. Custom configuration.
  • the electronic device since the data is constantly changing, in order to ensure the availability of the anomaly detection model, the electronic device periodically updates the anomaly detection model.
  • an abnormality detection sub-model can be established for each feature in the at least one sequence feature, and all the established abnormality detection sub-models can be integrated to form the abnormality detection model.
  • a sequence is formed by the superposition of sine waves and cosine waves of multiple frequencies, so the Fourier transform can convert timing information into frequency domain information.
  • the electronic device determines that the amplitude component of the wave exceeds a certain threshold, it is determined that the sample to be detected corresponding to the wave has a significant periodicity.
  • the electronic device determining whether all the data has periodicity based on Fourier transform includes:
  • the electronic device performs Fourier transform on all the data, and obtains the current amplitude of the waveform obtained after the transformation, the electronic device calculates the average amplitude of all the data, and, when the current amplitude is greater than the average In the case of amplitude, the electronic device further determines that all the data have periodicity.
  • the anomaly detection model obtained by training is a multi-model, it can detect anomalies with multiple characteristics at the same time.
  • the anomaly detection model is trained by calling the data at the time point to be detected, it has lightweight characteristics to adapt to the millions-level indicator monitoring environment.
  • SH-ESD Algorithm due to the use of SH-ESD Algorithm, therefore, can simultaneously guarantee the accuracy of the anomaly detection model.
  • the electronic device analyzes all of the at least one sequence feature.
  • the features are classified into levels, and different calculation methods are adopted for the features of different levels.
  • the electronic device classifies the level of the at least one sequence feature into high and low.
  • the electronic device classifies conventional features that require abnormality detection as high, while for secondary features that are not required for all abnormality detection, the electronic device classifies them as low.
  • the secondary feature can improve the accuracy and coverage of abnormality detection, and the electronic device can also detect abnormalities that cannot be caught by other detections.
  • the electronic device will perform different STL decompositions on features of different levels.
  • the STL decomposition of all the data to obtain the periodic component of each data in the all data includes:
  • the electronic device determines the level of the at least one sequence feature, and when the level of the at least one sequence feature is high, executes an inner loop and an outer loop on all the data; or when the level of the at least one sequence feature is When it is low, the electronic device performs an inner loop on all the data.
  • features with a high level can include output value, slope, etc.
  • features with a low level can include an increase, an average value, and so on.
  • the electronic device can determine the periodic component of the sample to be detected. While the outer loop runs in the inner loop, the electronic device can reduce maximum or minimum interference.
  • the calculating the expected value corresponding to the time point to be detected based on the linear interpolation algorithm includes:
  • the electronic device determines the first time point of the preset time interval before the to-be-detected time point, and the second time point of the preset time interval after the to-be-detected time point, and further calculates the respective values before and after the first time point.
  • the first average value of the collected values within the configuration time, and the second average value of the collected values within each configuration time before and after the second time point the electronic device calculates the expected value based on the following linear interpolation formula:
  • W represents the expected value
  • Va represents the first average value
  • Vb represents the second average value
  • t represents the time point to be detected
  • Ta represents the first time point
  • Tb represents the second time point. Point in time.
  • the electronic device is not only used at the first time point and the second time point.
  • the collected value but by simple calculation, the first average value of the collected values in each configuration time before and after the first time point, and the second average value of the collected values in each configuration time before and after the second time point are obtained , And perform subsequent calculations with the first average value and the second average value.
  • the electronic device when the first time point is 12:00, the electronic device obtains the collection value at 12:00 as x, and at the same time obtains the collection value at 11:59 as y, and the collection at 12:01 If the value is z, the electronic device determines that the first average value at 12:00 at the first time point is (x+y+z)/3.
  • the preset time interval can be customized, such as 1 hour, half an hour, and so on.
  • the expected value belongs to one of the outputs of the anomaly detection model and is calculated by a linear interpolation algorithm. Therefore, the electronic device can directly obtain the expected value from the anomaly detection model .
  • the difference between the collected value and the expected value can be reflected by the residual value.
  • calculating the residual value between the collected value and the expected value by the electronic device includes:
  • the electronic device calculates the difference between the collected value and the expected value, and uses the calculated difference as the residual value.
  • S17 Determine whether the sample to be detected is abnormal based on the abnormality detection model and the residual value.
  • the anomaly detection model can provide a basis for judging anomalies, that is, the residual mean value and the residual standard deviation.
  • the determining whether the sample to be detected is abnormal based on the abnormality detection model and the residual value includes:
  • the electronic device obtains the residual mean value and the residual standard deviation from the anomaly detection model, and based on the n-sigma principle, calculates a threshold value according to the residual mean value and the residual standard deviation, and when the When the residual value is greater than or less than the threshold, the electronic device determines that the sample to be detected is abnormal.
  • n the value of n can be customized.
  • a lower threshold can be set to improve the sensitivity of anomaly detection
  • a higher threshold can be set to Improve tolerance for exceptions and avoid false alarms.
  • the electronic device is based on the n-sigma principle, and calculating a threshold according to the residual mean value and the residual standard deviation includes:
  • the electronic device calculates the product of the residual standard deviation and the n, and further calculates the sum of the product and the residual mean to obtain the threshold.
  • the electronic device determines that the sample to be detected is abnormal.
  • the method further includes:
  • the electronic device records the to-be-detected time point and the collected value, and sends alarm information to a designated contact, and the alarm information includes the to-be-detected time point and the collected value.
  • the designated contact can be customized configuration, such as: operation and maintenance personnel, developers, relevant persons in charge, etc.
  • the present application can obtain the sample to be detected when an abnormality detection instruction is received, and determine whether the sample to be detected has periodicity, and when the sample to be detected has periodicity, determine the sample to be detected At the time point, because not all data is detected, the detection efficiency is improved.
  • the collected value corresponding to the time point to be detected is determined from the sample to be detected, and the pre-trained anomaly detection model is called, and the anomaly detection Obtain the expected value corresponding to the collected value in the model, calculate the residual value between the collected value and the expected value, and further determine whether the sample to be detected is abnormal based on the abnormality detection model and the residual value, Since the abnormality detection model is a multi-model established based on SH-ESD, the abnormality detection has high-precision characteristics, thereby realizing automatic detection of various abnormalities.
  • the abnormality detection device 11 includes an acquisition unit 110, a determination unit 111, an retrieval unit 112, a calculation unit 113, a comparison unit 114, a decomposition unit 115, an update unit 116, a recording unit 117, and a sending unit 118.
  • the module/unit referred to in this application refers to a series of computer-readable instruction segments that can be executed by the processor 13 and can complete fixed functions, and are stored in the memory 12. In this embodiment, the functions of each module/unit will be described in detail in subsequent embodiments.
  • the obtaining unit 110 obtains a sample to be detected.
  • the abnormality detection instruction may be triggered by a relevant worker, or may be configured to be automatically triggered at a fixed time, which is not limited in the present application.
  • the abnormality detection instruction in order to reduce labor costs and ensure normal abnormality detection, configure the abnormality detection instruction to be triggered at 12:00 every day.
  • the sample to be detected refers to sequence data or waveform data.
  • the sample to be tested is the operating data output by the system. By detecting the sample to be tested, it can be determined whether the system is abnormal, and effective maintenance measures can be taken in time to avoid failure to output data normally due to system errors.
  • the determining unit 111 determines whether the sample to be detected has periodicity.
  • the determining unit 111 since the subsequent anomaly detection model is modeled based on the SH-ESD algorithm, and the SH-ESD algorithm is applied to a periodic sequence, the determining unit 111 must first determine the Whether the sample to be tested is periodic.
  • Whether the sample to be tested has periodicity is a recording attribute of the sample to be tested, and the determining unit 111 can directly determine according to the recorded attribute.
  • the determining unit 111 determines that the sample to be detected does not have periodicity
  • other algorithms such as statistical algorithms, etc. may also be used to perform abnormality detection on the sample to be detected. This application will not go into details here.
  • the determining unit 111 determines the time point to be detected.
  • not all data in the sample to be detected is detected, but part of the time points in the sample to be detected (that is, the The data at the time point to be tested) is tested.
  • the time point to be detected can be customized, which is not limited in this application.
  • the determining unit 111 determines the collected value corresponding to the time point to be detected from the sample to be detected.
  • the collected value refers to the true value of the output.
  • the determining unit 111 can extract the collected value at the time point to be detected from the sample to be detected according to the time point to be detected, For subsequent anomaly detection.
  • the determining unit 111 may determine that the collected value at 13:00 is A.
  • the retrieval unit 112 retrieves a pre-trained anomaly detection model.
  • the anomaly detection model is obtained by training based on the S-H-ESD algorithm.
  • the method further includes:
  • the method before calling the pre-trained anomaly detection model, the method further includes:
  • the acquiring unit 110 acquires all data of at least one sequence feature in a preset time period before the time point to be detected, the determining unit 111 determines whether all the data has periodicity based on the Fourier transform, and the calculating unit 113 Calculate the autocorrelation coefficient of all the data, the comparing unit 114 compares the autocorrelation coefficient with the configuration value, and when all the data has periodicity and the autocorrelation coefficient is greater than the configuration value, the decomposition unit 115 Perform time series decomposition (Seasonal and Trend Decomposition using Loess) with robust local weighted regression as a smoothing method for all the data to obtain the periodic component of each data in all the data.
  • time series decomposition Seasonal and Trend Decomposition using Loess
  • the calculation unit 113 calculates the target The difference between the data and the target period component is used to obtain the historical residual, and based on the historical residual, the residual mean and residual standard deviation of all the data are calculated. The calculation unit 113 calculates the residuals based on the linear interpolation algorithm. According to the expected value corresponding to the time point to be detected, the abnormality detection model is obtained, and the update unit 116 further periodically updates the abnormality detection model.
  • the preset time period can be customized configuration, such as: two weeks, three weeks, etc.; the configuration value can also be customized configuration, and this application is not limited.
  • the at least one sequence feature may include, but is not limited to one or a combination of the following:
  • the output value and the slope are regular testing items, which can reflect the pros and cons of the data
  • the increase and the average value are scalable testing items, which can be performed according to actual testing requirements. Custom configuration.
  • the update unit 116 periodically updates the anomaly detection model.
  • an abnormality detection sub-model can be established for each feature in the at least one sequence feature, and all the established abnormality detection sub-models can be integrated to form the abnormality detection model.
  • a sequence is formed by the superposition of sine waves and cosine waves of multiple frequencies, so the Fourier transform can convert timing information into frequency domain information.
  • the determining unit 111 determines that the amplitude component of the wave exceeds a certain threshold, it is determined that the sample to be detected corresponding to the wave has significant periodicity.
  • the determining unit 111 determining whether all the data has periodicity based on Fourier transform includes:
  • the determining unit 111 performs Fourier transform on all the data, and obtains the current amplitude of the waveform obtained after the transformation, the determining unit 111 calculates the average amplitude of all the data, and when the current amplitude is greater than the current amplitude In the case of the average amplitude, the determining unit 111 further determines that all the data have periodicity.
  • the anomaly detection model obtained by training is a multi-model, it can detect anomalies with multiple characteristics at the same time.
  • the anomaly detection model is trained by calling the data at the time point to be detected, it has lightweight characteristics to adapt to the millions-level indicator monitoring environment.
  • SH-ESD Algorithm due to the use of SH-ESD Algorithm, therefore, can simultaneously guarantee the accuracy of the anomaly detection model.
  • the level of the at least one sequence feature is divided into high and low.
  • the regular features that require abnormality detection are classified as high, and the secondary features that are not required for all anomaly detection are classified as low.
  • the secondary features can improve the accuracy and coverage of abnormality detection, and abnormalities that cannot be captured by other detections can also be detected.
  • the STL decomposition of all the data to obtain the periodic component of each data in the all data includes:
  • the decomposition unit 115 determines the level of the at least one sequence feature, and when the level of the at least one sequence feature is high, performs an inner loop and an outer loop on all the data; or when the level of the at least one sequence feature When it is low, the decomposition unit 115 performs an inner loop on all the data.
  • features with a high level can include output value, slope, etc.
  • features with a low level can include an increase, an average value, and so on.
  • the periodic component of the sample to be detected can be determined.
  • the outer loop runs in the inner loop, which can reduce the maximum or minimum interference.
  • the calculating the expected value corresponding to the time point to be detected based on the linear interpolation algorithm includes:
  • the calculation unit 113 determines the first time point of the preset time interval before the to-be-detected time point, and the second time point of the preset time interval after the to-be-detected time point, and further calculates before and after the first time point.
  • W represents the expected value
  • Va represents the first average value
  • Vb represents the second average value
  • t represents the time point to be detected
  • Ta represents the first time point
  • Tb represents the second time point. Point in time.
  • the calculation unit 113 is not only used at the first time point and the second time point.
  • the collected value of, but through simple calculations, the first average value of the collected values within each configuration time before and after the first time point, and the second average of the collected values within each configuration time before and after the second time point are obtained through simple calculations Value, and use the first average value and the second average value for subsequent calculations.
  • the calculation unit 113 acquires the acquisition value at 12:00 as x, and at the same time acquires the acquisition value at 11:59 as y, and the acquisition value at 12:01. If the collected value is z, the calculation unit 113 determines that the first average value at 12:00 at the first time point is (x+y+z)/3.
  • the preset time interval can be customized, such as 1 hour, half an hour, and so on.
  • the obtaining unit 110 obtains the expected value corresponding to the collected value from the abnormality detection model.
  • the expected value belongs to one of the outputs of the anomaly detection model and is calculated by a linear interpolation algorithm. Therefore, the acquisition unit 110 can directly acquire the anomaly detection model. Expectations.
  • the calculation unit 113 calculates a residual value between the collected value and the expected value.
  • the difference between the collected value and the expected value can be reflected by the residual value.
  • the calculating unit 113 calculating the residual value between the collected value and the expected value includes:
  • the calculation unit 113 calculates the difference between the collected value and the expected value, and uses the calculated difference as the residual value.
  • the determining unit 111 determines whether the sample to be detected is abnormal based on the abnormality detection model and the residual value.
  • the anomaly detection model can provide a basis for judging anomalies, that is, the residual mean value and the residual standard deviation.
  • the determining unit 111 determining whether the sample to be detected is abnormal based on the abnormality detection model and the residual value includes:
  • the determining unit 111 obtains the residual mean value and the residual standard deviation from the abnormality detection model, and based on the n-sigma principle, calculates a threshold value according to the residual mean value and the residual standard deviation, when When the residual value is greater than or less than the threshold, the determining unit 111 determines that the sample to be detected is abnormal.
  • n the value of n can be customized.
  • a lower threshold can be set to improve the sensitivity of anomaly detection
  • a higher threshold can be set to Improve tolerance for exceptions and avoid false alarms.
  • the determining unit 111 is based on the n-sigma principle, and calculating a threshold value according to the residual mean value and the residual standard deviation includes:
  • the determining unit 111 calculates the product of the residual standard deviation and the n, and further calculates the sum of the product and the residual mean to obtain the threshold.
  • the determining unit 111 determines that the sample to be detected is abnormal.
  • the method further includes:
  • the recording unit 117 records the to-be-detected time point and the collected value, and the sending unit 118 sends alarm information to a designated contact.
  • the alarm information includes the to-be-detected time point and the collected value.
  • the designated contact can be customized configuration, such as: operation and maintenance personnel, developers, relevant persons in charge, etc.
  • the present application can obtain the sample to be detected when an abnormality detection instruction is received, and determine whether the sample to be detected has periodicity, and when the sample to be detected has periodicity, determine the sample to be detected At the time point, because not all data is detected, the detection efficiency is improved.
  • the collected value corresponding to the time point to be detected is determined from the sample to be detected, and the pre-trained anomaly detection model is called, and the anomaly detection Obtain the expected value corresponding to the collected value in the model, calculate the residual value between the collected value and the expected value, and further determine whether the sample to be detected is abnormal based on the abnormality detection model and the residual value, Since the abnormality detection model is a multi-model established based on SH-ESD, the abnormality detection has high-precision characteristics, thereby realizing automatic detection of various abnormalities.
  • FIG. 3 it is a schematic structural diagram of an electronic device implementing a preferred embodiment of an abnormality detection method according to the present application.
  • the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer-readable instructions that are stored in the memory 12 and can run on the processor 13 , Such as an anomaly detection program.
  • the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. It may include more or less components than those shown in the figure, or a combination of certain components, or different components. Components, for example, the electronic device 1 may also include an input/output device, a network access device, a bus, and the like.
  • the processor 13 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
  • the processor 13 is the computing core and control center of the electronic device 1 and connects the entire electronic device with various interfaces and lines. Each part of 1, and executes the operating system of the electronic device 1, and various installed applications, program codes, etc.
  • the processor 13 executes the operating system of the electronic device 1 and various installed applications.
  • the processor 13 executes the application program to implement the steps in the above-mentioned various anomaly detection method embodiments, such as steps S10, S11, S12, S13, S14, S15, S16, and S17 shown in FIG. 1.
  • the processor 13 implements the functions of the modules/units in the foregoing device embodiments when executing the computer-readable instructions, for example: when an abnormality detection instruction is received, obtain a sample to be detected; determine the sample to be detected Whether it has periodicity; when the sample to be detected has periodicity, determine the time point to be detected; determine the collection value corresponding to the time point to be detected from the sample to be detected; call a pre-trained anomaly detection model; Obtain the expected value corresponding to the collected value from the abnormality detection model; calculate the residual value between the collected value and the expected value; determine the to-be-detected based on the abnormality detection model and the residual value Whether the sample is abnormal.
  • the computer-readable instructions may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 12 and executed by the processor 13 to Complete this application.
  • the one or more modules/units may be a series of computer-readable instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions in the electronic device 1.
  • the computer-readable instructions may be divided into an acquisition unit 110, a determination unit 111, a retrieval unit 112, a calculation unit 113, a comparison unit 114, a decomposition unit 115, an update unit 116, a recording unit 117, and a sending unit 118.
  • the memory 12 may be used to store the computer-readable instructions and/or modules.
  • the processor 13 runs or executes the computer-readable instructions and/or modules stored in the memory 12 and calls the computer-readable instructions and/or modules stored in the memory 12
  • the data inside realizes various functions of the electronic device 1.
  • the memory 12 may mainly include a storage program area and a storage data area.
  • the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may Store data (such as audio data, etc.) created based on the use of electronic devices.
  • the memory 12 may include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), At least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
  • non-volatile memory such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card), At least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.
  • the memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a circuit with a storage function without a physical form in an integrated circuit, such as FIFO (First In First Out) and so on. Alternatively, the memory 12 may also be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and so on.
  • FIFO First In First Out
  • TF card Trans-flash Card
  • the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile readable storage medium.
  • this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions.
  • the computer-readable instructions may be stored in a non-volatile memory. In the storage medium, when the computer-readable instructions are executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer-readable instructions may be in the form of source code, object code, executable file, or some intermediate forms.
  • the non-volatile readable medium may include: any entity or device capable of carrying the computer readable instruction code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).
  • the memory 12 in the electronic device 1 stores multiple instructions to implement an abnormality detection method, and the processor 13 can execute the multiple instructions to realize: when an abnormality detection instruction is received, Obtain the sample to be tested; determine whether the sample to be tested has periodicity; when the sample to be tested has periodicity, determine the time point to be tested; determine the collection corresponding to the time point to be tested from the sample to be tested Value; call a pre-trained anomaly detection model; obtain the expected value corresponding to the collected value from the anomaly detection model; calculate the residual value between the collected value and the expected value; based on the anomaly detection model and The residual value determines whether the sample to be detected is abnormal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Probability & Statistics with Applications (AREA)
  • Testing And Monitoring For Control Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本申请提供一种异常检测方法、电子设备及存储介质。该方法能够当接收到异常检测指令时,获取待检测样本,并确定所述待检测样本是否具有周期性,当所述待检测样本具有周期性时,确定待检测时间点,由于并非对所有数据进行检测,提高了检测效率,从所述待检测样本中确定所述待检测时间点对应的采集值,并调取预先训练的异常检测模型,从所述异常检测模型中获取所述采集值对应的期望值,计算所述采集值与所述期望值之间的残差值,进一步基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常,实现智能运维,由于所述异常检测模型是基于S-H-ESD建立的多模型,因此使异常检测具有高精度的特性,进而实现对多种异常的自动化检测。

Description

异常检测方法、装置、电子设备及存储介质
本申请要求于2019年09月23日提交中国专利局,申请号为201910900798.8发明名称为“异常检测方法、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及智能运维技术领域,尤其涉及一种异常检测方法、装置、电子设备及存储介质。
背景技术
在智能运维监测管理中,异常检测是整个环节的重要部分。由于监测指标序列的异常标注难以大量提供,因此现有检测方法以非监督学习算法或者统计算法为主,同时也包括深度学习算法。
而异常检测对算法存在如下两方面要求:
(1)算法的轻量化,以保证算法能够部署于百万量级的指标监测环境。
(2)算法的高精度(包括准确率Precision及召回率recall)。
在现有技术方案中,如果要保证高精度,则要对所有采集到的数据进行分析及处理,由于数据量巨大将导致无法满足轻量化要求,而要满足轻量化要求,则又必须减少处理的数据量,这又将导致无法满足高精度要求,因此,现有技术还无法同时满足轻量化及高精度两方面要求。
发明内容
鉴于以上内容,有必要提供一种异常检测方法、装置、电子设备及存储介质,能够使用户特征的刻画更加全面,且具有更高的灵活性。
一种异常检测方法,所述方法包括:当接收到异常检测指令时,获取待检测样本;确定所述待检测样本是否具有周期性;当所述待检测样本具有周期性时,确定待检测时间点;从所述待检测样本中确定所述待检测时间点对应的采集值;调取预先训练的异常 检测模型,其中,训练所述异常检测模型包括:从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,得到所述所有数据中每个数据的周期分量,基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型;从所述异常检测模型中获取所述采集值对应的期望值;计算所述采集值与所述期望值之间的残差值;基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
一种异常检测装置,所述装置包括:获取单元,用于当接收到异常检测指令时,获取待检测样本;确定单元,用于确定所述待检测样本是否具有周期性;所述确定单元,还用于当所述待检测样本具有周期性时,确定待检测时间点;所述确定单元,还用于从所述待检测样本中确定所述待检测时间点对应的采集值;调取单元,用于调取预先训练的异常检测模型,其中,训练所述异常检测模型包括:从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,得到所述所有数据中每个数据的周期分量,基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型;所述获取单元,还用于从所述异常检测模型中获取所述采集值对应的期望值;计算单元,用于计算所述采集值与所述期望值之间的残差值;所述确定单元,还用于基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
一种电子设备,所述电子设备包括:存储器,存储至少一个指令;及
处理器,执行所述存储器中存储的指令以实现所述异常检测方法。
一种非易失性可读存储介质,所述非易失性可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现所述异常检测方法。
由以上技术方案可以看出,本申请能够当接收到异常检测指令时,获取待检测样本,并确定所述待检测样本是否具有周期性,当所述待检测样本具有周期性时,确定待检测时间点,由于并非对所有数据进行检测,提高了检测效率,从所述待检测样本中确定所述待检测时间点对应的采集值,并调取预先训练的异常检测模型,从所述异常检测模型中获取所述采集值对应的期望值,计算所述采集值与所述期望值之间的残差值,进一步基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常,由于所述异常检测模型是基于S-H-ESD建立的多模型,因此使异常检测具有高精度的特性,进而实现对多种异常的自动化检测。
附图说明
图1是本申请异常检测方法的较佳实施例的流程图。
图2是本申请异常检测装置的较佳实施例的功能模块图。
图3是本申请实现异常检测方法的较佳实施例的电子设备的结构示意图。
具体实施方式
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图和具体实施例对本申请进行详细描述。
如图1所示,是本申请异常检测方法的较佳实施例的流程图。根据不同的需求,该流程图中步骤的顺序可以改变,某些步骤可以省略。
所述异常检测方法应用于一个或者多个电子设备中。
S10,当接收到异常检测指令时,获取待检测样本。
在本申请的至少一个实施例中,所述异常检测指令可以由相关工作人员触发,也可以配置为定时自动触发,本申请不限制。
例如:为了减少人力成本,同时保证进行正常的异常检测,所述电子设备配置每天12:00定时触发所述异常检测指令。
在本申请的至少一个实施例中,所述待检测样本是指序列数据或者波形数据。
进一步地,所述待检测样本是系统输出的运行数据,通过检测所述待检测样本,能够确定系统是否异常,进而及时采取有效的维护措施,避免由于系统出错导致无法正常输出数据。
S11,确定所述待检测样本是否具有周期性。
在本申请的至少一个实施例中,由于后续的异常检测模型是基于S-H-ESD算法进行建模的,而S-H-ESD算法应用于周期性序列,因此,所述电子设备首先要确定所述待检测样本是否具有周期性。
而所述待检测样本是否具有周期性,是所述待检测样本的一种记录属性,所述电子设备能够直接根据记录的属性确定。
在本申请的至少一个实施例中,当所述电子设备确定所述待检测样本不具备周期性时,所述电子设备还可以采用其他算法(如:统计算法等)对所述待检测样本进行异常检测,本申请在此不赘述。
S12,当所述待检测样本具有周期性时,确定待检测时间点。
在本申请的至少一个实施例中,为了方便检测,提高异常检测的效率,所述电子设备并非对所述待检测样本中的所有数据进行检测,而是对所述待检测样本中部分时间点(即所述待检测时间点)上的数据进行检测。
具体地,所述待检测时间点可以进行自定义配置,本申请不限制。
例如:每个整点、每个半点等。
S13,从所述待检测样本中确定所述待检测时间点对应的采集值。
在本申请的至少一个实施例中,所述采集值是指输出的真实值。
进一步地,所述电子设备在确定了所述待检测时间点后,即可根据所述待检测时间点,从所述待检测样本中抽取出在所述待检测时间点上的采集值,以供后续异常检测使用。
例如:当系统在待检测时间点13:00的输出数据为A时,所述电子设备可以确定13:00的采集值为A。
S14,调取预先训练的异常检测模型。
在本申请的至少一个实施例中,所述异常检测模型是基于S-H-ESD算法训练得到的。
进一步地,所述电子设备在调取预先训练的所述异常检测模型前,所述方法还包括:
所述电子设备训练所述异常检测模型。
具体地,在调取预先训练的异常检测模型前,所述方法还包括:
所述电子设备获取所述待检测时间点前预设时间段内至少一个序列特征的所有数据,并基于傅里叶变换,确定所述所有数据是否具有周期性,所述电子设备计算所述所有数据的自相关系数,并将所述自相关系数与配置值进行比较,当所述所有数据具有周期性,且所述自相关系数大于所述配置值时,所述电子设备对所述所有数据进行以鲁棒局部加权回归作为平滑方法的时间序列分解STL分解(Seasonal and Trend decomposition using Loess),得到所述所有数据中每个数据的周期分量,所述电子设备从所述周期分量中获取与所述待检测时间点对应的目标周期分量,并从所述所有数据中获取与所述待检测时间点对应的目标数据,进一步地,所述电子设备计算所述目标数据与所述目标周期分量的差值,得到历史残差,并基于所述历史残差,计算所述所有数据的残差均值及残差标准差,所述电子设备基于线性插值算法计算所述待检测时间点对应的期望值,得到所述异常检测模型,并进一步定期更新所述异常检测模型。
其中,所述预设时间段可以进行自定义配置,如:两周、三周等;所述配置值也可以自定义配置,本申请不限制。
进一步地,所述至少一个序列特征可以包括,但不限于以下一种或者多种的组合:
输出值、斜率、增幅、平均值等。
另外,在实际检测中,所述输出值及所述斜率属于常规的检测项目,能够反映出数据的优劣,所述增幅及所述平均值属于可扩展的检测项目,可以根据实际检测需求进行自定义配置。
更进一步地,由于数据是不断变化的,因此,为了保证所述异常检测模型的可用性,所述电子设备对所述异常检测模型进行定期更新。
通过上述实施方式,能够针对所述至少一个序列特征中的每个特征建立一个异常检测子模型,并将所有建立的异常检测子模型集成到一起,构成所述异常检测模型。
可以理解的是,一个序列由多个频率的正弦波与余弦波叠加而成,因此傅里叶变换能够将时序信息转化为频域信息。某频率下波的振幅越大,则该波在原始序列成分中的占比越高。
因此,在本实施例中,如果所述电子设备确定波的振幅成分超过一定阈值,则确定该波对应的待检测样本具有显著周期性。
具体地,所述电子设备基于傅里叶变换,确定所述所有数据是否具有周期性包括:
所述电子设备对所述所有数据进行傅里叶变换,并获取变换后得到的波形的当前振幅,所述电子设备计算所述所有数据的平均振幅,并且,当所述当前振幅大于所述平均振幅时,所述电子设备进一步确定所述所有数据具有周期性。
由于训练得到的所述异常检测模型是一个多模型,因此能够对多种特征的异常进行同时检测。并且,由于所述异常检测模型是调取所述待检测时间点上的数据进行训练的,因此具有轻量化的特性,以适应百万量级的指标监测环境,另外,由于采用了S-H-ESD算法,因此能够同时保证所述异常检测模型的精度。
在本申请的至少一个实施例中,由于STL分解需要较高的运算量,因此,为了在不影响检测结果的前提下,节约运算量,所述电子设备对所述至少一个序列特征中的所有特征进行等级划分,并对不同等级的特征采取不同的运算方式。
具体地,所述电子设备将所述至少一个序列特征的等级划分为高及低。
进一步地,对于需要进行异常检测的常规特征,所述电子设备将其划分为高,而对于并非所有异常检测都需要的次要特征,所述电子设备将其划分为低。
可以理解的是,所述次要特征能够提高异常检测的准确率及覆盖率,对于其他检测无法捕捉到的异常,所述电子设备也可以检测到。
但是,由于所述次要特征的非必要性,因此,为了提高运算效率,降低对内存的消耗,所述电子设备将对不同级别的特征执行不同的STL分解。
具体地,所述对所述所有数据进行STL分解,得到所述所有数据中每个数据的周期分量包括:
所述电子设备确定所述至少一个序列特征的等级,当所述至少一个序列特征的等级为高时,对所述所有数据执行内循环及外循环;或者当所述至少一个序列特征的等级为低时,所述电子设备对所述所有数据执行内循环。
例如:等级高的特征可以包括输出值、斜率等,等级低的特征可以包括增幅、平均值等。
其中,通过所述内循环,所述电子设备能够确定所述待检测样本的周期分量。而所述外循环运行于所述内循环,所述电子设备能够减小极大值或极小值的干扰。
进一步地,所述基于线性插值算法计算所述待检测时间点对应的期望值包括:
所述电子设备确定所述待检测时间点前预设时间间隔的第一时间点,以及所述待检测时间点后预设时间间隔的第二时间点,进一步计算所述第一时间点前后各配置时间内采集值的第一平均值,及所述第二时间点前后各配置时间内采集值的第二平均值,所述电子设备基于下述线性插值公式计算所述期望值:
W=Va+(Vb-Va)*(t-Ta)/(Tb-Ta)
其中,W表示所述期望值,Va表示所述第一平均值,Vb表示所述第二平均值,t表示所述待检测时间点,Ta表示所述第一时间点,Tb表示所述第二时间点。
具体地,为了确保在所述第一时间点及所述第二时间点上所采集数据的准确性,所述电子设备并非只使用在所述第一时间点及所述第二时间点上的采集值,而是通过简单的计算,得到在所述第一时间点前后各配置时间内采集值的第一平均值,及所述第二时间点前后各配置时间内采集值的第二平均值,并以所述第一平均值及所述第二平均值进行后续计算。
例如:当所述第一时间点为12:00时,所述电子设备获取到12:00上的采集值为x,同时获取到11:59上的采集值为y,12:01上的采集值为z,则所述电子设备确定所述第一时间点12:00的第一平均值为(x+y+z)/3。
进一步地,在本实施例中,所述预设时间间隔可以进行自定义配置,如1小时、半小时等。
S15,从所述异常检测模型中获取所述采集值对应的期望值。
在本申请的至少一个实施例中,所述期望值属于所述异常检测模型的输出之一,以线性插值算法计算得到,因此,所述电子设备能够直接从所述异常检测模型中获取所述期望值。
S16,计算所述采集值与所述期望值之间的残差值。
在本申请的至少一个实施例中,通过所述残差值能够映出所述采集值与所述期望值之间的差异。
具体地,所述电子设备计算所述采集值与所述期望值之间的残差值包括:
所述电子设备计算所述采集值与所述期望值的差值,并以计算得到的差值作为所述残差值。
S17,基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
在本申请的至少一个实施例中,所述异常检测模型能够提供判断异常的依据,即所述残差均值及所述残差标准差。
具体地,所述基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常包括:
所述电子设备从所述异常检测模型中获取所述残差均值及所述残差标准差,并基于n-sigma原理,根据所述残差均值及所述残差标准差计算阈值,当所述残差值大于或者小于所述阈值时,所述电子设备确定所述待检测样本异常。
其中,n的取值可以进行自定义配置,对于等级为高的特征,可以设置较低的阈值,以提高异常检测的敏感性,而对于等级为低的特征,可以设置较高的阈值,以提高对异常的容忍度,避免误报。
进一步地,所述电子设备基于n-sigma原理,根据所述残差均值及所述残差标准差计算阈值包括:
所述电子设备计算所述残差标准差与所述n的乘积,并进一步计算所述乘积与所述残差均值的和,得到所述阈值。
可以理解的是,当所述残差值大于或者小于所述阈值时,说明所述残差值偏离了所述阈值,因此,所述电子设备确定所述待检测样本异常。
在本申请的至少一个实施例中,在确定所述待检测样本异常后,所述方法还包括:
所述电子设备记录所述待检测时间点及所述采集值,并向指定联系人发送警报信息,所述警报信息包括所述待检测时间点及所述采集值。
其中,所述指定联系人可以进行自定义配置,如:运维人员、开发人员、相关负责人 等。
通过上述实施方式,能够在检测到异常时及时上报,间接提高了运维效率,有效降低异常的不良影响。
由以上技术方案可以看出,本申请能够当接收到异常检测指令时,获取待检测样本,并确定所述待检测样本是否具有周期性,当所述待检测样本具有周期性时,确定待检测时间点,由于并非对所有数据进行检测,提高了检测效率,从所述待检测样本中确定所述待检测时间点对应的采集值,并调取预先训练的异常检测模型,从所述异常检测模型中获取所述采集值对应的期望值,计算所述采集值与所述期望值之间的残差值,进一步基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常,由于所述异常检测模型是基于S-H-ESD建立的多模型,因此使异常检测具有高精度的特性,进而实现对多种异常的自动化检测。
如图2所示,是本申请异常检测装置的较佳实施例的功能模块图。所述异常检测装置11包括获取单元110、确定单元111、调取单元112、计算单元113、比较单元114、分解单元115、更新单元116、记录单元117以及发送单元118。本申请所称的模块/单元是指一种能够被处理器13所执行,并且能够完成固定功能的一系列计算机可读指令段,其存储在存储器12中。在本实施例中,关于各模块/单元的功能将在后续的实施例中详述。
当接收到异常检测指令时,获取单元110获取待检测样本。
在本申请的至少一个实施例中,所述异常检测指令可以由相关工作人员触发,也可以配置为定时自动触发,本申请不限制。
例如:为了减少人力成本,同时保证进行正常的异常检测,配置每天12:00定时触发所述异常检测指令。
在本申请的至少一个实施例中,所述待检测样本是指序列数据或者波形数据。
进一步地,所述待检测样本是系统输出的运行数据,通过检测所述待检测样本,能够确定系统是否异常,进而及时采取有效的维护措施,避免由于系统出错导致无法正常输出数据。
确定单元111确定所述待检测样本是否具有周期性。
在本申请的至少一个实施例中,由于后续的异常检测模型是基于S-H-ESD算法进行建模的,而S-H-ESD算法应用于周期性序列,因此,所述确定单元111首先要确定所述待检测样本是否具有周期性。
而所述待检测样本是否具有周期性,是所述待检测样本的一种记录属性,所述确定单元111能够直接根据记录的属性确定。
在本申请的至少一个实施例中,当所述确定单元111确定所述待检测样本不具备周期性时,还可以采用其他算法(如:统计算法等)对所述待检测样本进行异常检测,本申请在此不赘述。
当所述待检测样本具有周期性时,所述确定单元111确定待检测时间点。
在本申请的至少一个实施例中,为了方便检测,提高异常检测的效率,并非对所述待检测样本中的所有数据进行检测,而是对所述待检测样本中部分时间点(即所述待检测时间点)上的数据进行检测。
具体地,所述待检测时间点可以进行自定义配置,本申请不限制。
例如:每个整点、每个半点等。
所述确定单元111从所述待检测样本中确定所述待检测时间点对应的采集值。
在本申请的至少一个实施例中,所述采集值是指输出的真实值。
进一步地,所述确定单元111在确定了所述待检测时间点后,即可根据所述待检测时间点,从所述待检测样本中抽取出在所述待检测时间点上的采集值,以供后续异常检测使用。
例如:当系统在待检测时间点13:00的输出数据为A时,所述确定单元111可以确定13:00的采集值为A。
调取单元112调取预先训练的异常检测模型。
在本申请的至少一个实施例中,所述异常检测模型是基于S-H-ESD算法训练得到的。
进一步地,所述调取单元112在调取预先训练的所述异常检测模型前,所述方法还包括:
训练所述异常检测模型。
具体地,在调取预先训练的异常检测模型前,所述方法还包括:
所述获取单元110获取所述待检测时间点前预设时间段内至少一个序列特征的所有数据,所述确定单元111基于傅里叶变换,确定所述所有数据是否具有周期性,计算单元113计算所述所有数据的自相关系数,比较单元114将所述自相关系数与配置值进行比较,当所述所有数据具有周期性,且所述自相关系数大于所述配置值时,分解单元115对所述所有数据进行以鲁棒局部加权回归作为平滑方法的时间序列分解STL分解(Seasonal and Trend decomposition using Loess),得到所述所有数据中每个数据的周期 分量,所述获取单元110从所述周期分量中获取与所述待检测时间点对应的目标周期分量,并从所述所有数据中获取与所述待检测时间点对应的目标数据,进一步地,所述计算单元113计算所述目标数据与所述目标周期分量的差值,得到历史残差,并基于所述历史残差,计算所述所有数据的残差均值及残差标准差,所述计算单元113基于线性插值算法计算所述待检测时间点对应的期望值,得到所述异常检测模型,更新单元116进一步定期更新所述异常检测模型。
其中,所述预设时间段可以进行自定义配置,如:两周、三周等;所述配置值也可以自定义配置,本申请不限制。
进一步地,所述至少一个序列特征可以包括,但不限于以下一种或者多种的组合:
输出值、斜率、增幅、平均值等。
另外,在实际检测中,所述输出值及所述斜率属于常规的检测项目,能够反映出数据的优劣,所述增幅及所述平均值属于可扩展的检测项目,可以根据实际检测需求进行自定义配置。
更进一步地,由于数据是不断变化的,因此,为了保证所述异常检测模型的可用性,所述更新单元116对所述异常检测模型进行定期更新。
通过上述实施方式,能够针对所述至少一个序列特征中的每个特征建立一个异常检测子模型,并将所有建立的异常检测子模型集成到一起,构成所述异常检测模型。
可以理解的是,一个序列由多个频率的正弦波与余弦波叠加而成,因此傅里叶变换能够将时序信息转化为频域信息。某频率下波的振幅越大,则该波在原始序列成分中的占比越高。
因此,在本实施例中,如果所述确定单元111确定波的振幅成分超过一定阈值,则确定该波对应的待检测样本具有显著周期性。
具体地,所述确定单元111基于傅里叶变换,确定所述所有数据是否具有周期性包括:
所述确定单元111对所述所有数据进行傅里叶变换,并获取变换后得到的波形的当前振幅,所述确定单元111计算所述所有数据的平均振幅,并且,当所述当前振幅大于所述平均振幅时,所述确定单元111进一步确定所述所有数据具有周期性。
由于训练得到的所述异常检测模型是一个多模型,因此能够对多种特征的异常进行同时检测。并且,由于所述异常检测模型是调取所述待检测时间点上的数据进行训练的,因此具有轻量化的特性,以适应百万量级的指标监测环境,另外,由于采用了S-H-ESD 算法,因此能够同时保证所述异常检测模型的精度。
在本申请的至少一个实施例中,由于STL分解需要较高的运算量,因此,为了在不影响检测结果的前提下,节约运算量,对所述至少一个序列特征中的所有特征进行等级划分,并对不同等级的特征采取不同的运算方式。
具体地,将所述至少一个序列特征的等级划分为高及低。
进一步地,对于需要进行异常检测的常规特征,将其划分为高,而对于并非所有异常检测都需要的次要特征,将其划分为低。
可以理解的是,所述次要特征能够提高异常检测的准确率及覆盖率,对于其他检测无法捕捉到的异常,也可以检测到。
但是,由于所述次要特征的非必要性,因此,为了提高运算效率,降低对内存的消耗,将对不同级别的特征执行不同的STL分解。
具体地,所述对所述所有数据进行STL分解,得到所述所有数据中每个数据的周期分量包括:
所述分解单元115确定所述至少一个序列特征的等级,当所述至少一个序列特征的等级为高时,对所述所有数据执行内循环及外循环;或者当所述至少一个序列特征的等级为低时,所述分解单元115对所述所有数据执行内循环。
例如:等级高的特征可以包括输出值、斜率等,等级低的特征可以包括增幅、平均值等。
其中,通过所述内循环,能够确定所述待检测样本的周期分量。而所述外循环运行于所述内循环,能够减小极大值或极小值的干扰。
进一步地,所述基于线性插值算法计算所述待检测时间点对应的期望值包括:
所述计算单元113确定所述待检测时间点前预设时间间隔的第一时间点,以及所述待检测时间点后预设时间间隔的第二时间点,进一步计算所述第一时间点前后各配置时间内采集值的第一平均值,及所述第二时间点前后各配置时间内采集值的第二平均值,所述计算单元113基于下述线性插值公式计算所述期望值:
W=Va+(Vb-Va)*(t-Ta)/(Tb-Ta)
其中,W表示所述期望值,Va表示所述第一平均值,Vb表示所述第二平均值,t表示所述待检测时间点,Ta表示所述第一时间点,Tb表示所述第二时间点。
具体地,为了确保在所述第一时间点及所述第二时间点上所采集数据的准确性,所述计算单元113并非只使用在所述第一时间点及所述第二时间点上的采集值,而是通过 简单的计算,得到在所述第一时间点前后各配置时间内采集值的第一平均值,及所述第二时间点前后各配置时间内采集值的第二平均值,并以所述第一平均值及所述第二平均值进行后续计算。
例如:当所述第一时间点为12:00时,所述计算单元113获取到12:00上的采集值为x,同时获取到11:59上的采集值为y,12:01上的采集值为z,则所述计算单元113确定所述第一时间点12:00的第一平均值为(x+y+z)/3。
进一步地,在本实施例中,所述预设时间间隔可以进行自定义配置,如1小时、半小时等。
所述获取单元110从所述异常检测模型中获取所述采集值对应的期望值。
在本申请的至少一个实施例中,所述期望值属于所述异常检测模型的输出之一,以线性插值算法计算得到,因此,所述获取单元110能够直接从所述异常检测模型中获取所述期望值。
所述计算单元113计算所述采集值与所述期望值之间的残差值。
在本申请的至少一个实施例中,通过所述残差值能够映出所述采集值与所述期望值之间的差异。
具体地,所述计算单元113计算所述采集值与所述期望值之间的残差值包括:
所述计算单元113计算所述采集值与所述期望值的差值,并以计算得到的差值作为所述残差值。
所述确定单元111基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
在本申请的至少一个实施例中,所述异常检测模型能够提供判断异常的依据,即所述残差均值及所述残差标准差。
具体地,所述确定单元111基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常包括:
所述确定单元111从所述异常检测模型中获取所述残差均值及所述残差标准差,并基于n-sigma原理,根据所述残差均值及所述残差标准差计算阈值,当所述残差值大于或者小于所述阈值时,所述确定单元111确定所述待检测样本异常。
其中,n的取值可以进行自定义配置,对于等级为高的特征,可以设置较低的阈值,以提高异常检测的敏感性,而对于等级为低的特征,可以设置较高的阈值,以提高对异常的容忍度,避免误报。
进一步地,所述确定单元111基于n-sigma原理,根据所述残差均值及所述残差标准差计算阈值包括:
所述确定单元111计算所述残差标准差与所述n的乘积,并进一步计算所述乘积与所述残差均值的和,得到所述阈值。
可以理解的是,当所述残差值大于或者小于所述阈值时,说明所述残差值偏离了所述阈值,因此,所述确定单元111确定所述待检测样本异常。
在本申请的至少一个实施例中,在确定所述待检测样本异常后,所述方法还包括:
记录单元117记录所述待检测时间点及所述采集值,发送单元118向指定联系人发送警报信息,所述警报信息包括所述待检测时间点及所述采集值。
其中,所述指定联系人可以进行自定义配置,如:运维人员、开发人员、相关负责人等。
通过上述实施方式,能够在检测到异常时及时上报,间接提高了运维效率,有效降低异常的不良影响。
由以上技术方案可以看出,本申请能够当接收到异常检测指令时,获取待检测样本,并确定所述待检测样本是否具有周期性,当所述待检测样本具有周期性时,确定待检测时间点,由于并非对所有数据进行检测,提高了检测效率,从所述待检测样本中确定所述待检测时间点对应的采集值,并调取预先训练的异常检测模型,从所述异常检测模型中获取所述采集值对应的期望值,计算所述采集值与所述期望值之间的残差值,进一步基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常,由于所述异常检测模型是基于S-H-ESD建立的多模型,因此使异常检测具有高精度的特性,进而实现对多种异常的自动化检测。
如图3所示,是本申请实现异常检测方法的较佳实施例的电子设备的结构示意图。
在本申请的一个实施例中,所述电子设备1包括,但不限于,存储器12、处理器13,以及存储在所述存储器12中并可在所述处理器13上运行的计算机可读指令,例如异常检测程序。
本领域技术人员可以理解,所述示意图仅仅是电子设备1的示例,并不构成对电子设备1的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备1还可以包括输入输出设备、网络接入设备、总线等。
所述处理器13可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application  Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等,所述处理器13是所述电子设备1的运算核心和控制中心,利用各种接口和线路连接整个电子设备1的各个部分,及执行所述电子设备1的操作系统以及安装的各类应用程序、程序代码等。
所述处理器13执行所述电子设备1的操作系统以及安装的各类应用程序。所述处理器13执行所述应用程序以实现上述各个异常检测方法实施例中的步骤,例如图1所示的步骤S10、S11、S12、S13、S14、S15、S16、S17。
或者,所述处理器13执行所述计算机可读指令时实现上述各装置实施例中各模块/单元的功能,例如:当接收到异常检测指令时,获取待检测样本;确定所述待检测样本是否具有周期性;当所述待检测样本具有周期性时,确定待检测时间点;从所述待检测样本中确定所述待检测时间点对应的采集值;调取预先训练的异常检测模型;从所述异常检测模型中获取所述采集值对应的期望值;计算所述采集值与所述期望值之间的残差值;基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
示例性的,所述计算机可读指令可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器12中,并由所述处理器13执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令在所述电子设备1中的执行过程。例如,所述计算机可读指令可以被分割成获取单元110、确定单元111、调取单元112、计算单元113、比较单元114、分解单元115、更新单元116、记录单元117以及发送单元118。
所述存储器12可用于存储所述计算机可读指令和/或模块,所述处理器13通过运行或执行存储在所述存储器12内的计算机可读指令和/或模块,以及调用存储在存储器12内的数据,实现所述电子设备1的各种功能。所述存储器12可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据(比如音频数据等)等。此外,存储器12可以包括非易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他非易失性固态存储器件。
所述存储器12可以是电子设备1的外部存储器和/或内部存储器。进一步地,所述 存储器12可以是集成电路中没有实物形式的具有存储功能的电路,如、FIFO(First In First Out,)等。或者,所述存储器12也可以是具有实物形式的存储器,如内存条、TF卡(Trans-flash Card)等等。
所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个非易失性可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。
其中,所所述计算机可读指令可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述非易失性可读介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
结合图1,所述电子设备1中的所述存储器12存储多个指令以实现一种异常检测方法,所述处理器13可执行所述多个指令从而实现:当接收到异常检测指令时,获取待检测样本;确定所述待检测样本是否具有周期性;当所述待检测样本具有周期性时,确定待检测时间点;从所述待检测样本中确定所述待检测时间点对应的采集值;调取预先训练的异常检测模型;从所述异常检测模型中获取所述采集值对应的期望值;计算所述采集值与所述期望值之间的残差值;基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
具体地,所述处理器13对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种异常检测方法,其特征在于,所述方法包括:
    当接收到异常检测指令时,获取待检测样本;
    确定所述待检测样本是否具有周期性;
    当所述待检测样本具有周期性时,确定待检测时间点;
    从所述待检测样本中确定所述待检测时间点对应的采集值;
    调取预先训练的异常检测模型,其中,训练所述异常检测模型包括:从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,得到所述所有数据中每个数据的周期分量,基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型;
    从所述异常检测模型中获取所述采集值对应的期望值;
    计算所述采集值与所述期望值之间的残差值;
    基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
  2. 如权利要求1所述的异常检测方法,其特征在于,从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,所述方法包括:
    获取所述待检测时间点前预设时间段内所述至少一个序列特征的所有数据,其中,所述至少一个序列特征包括以下一种或者多种的组合:输出值、斜率、增幅、平均值;
    基于傅里叶变换,确定所述所有数据是否具有周期性;
    计算所述所有数据的自相关系数;
    将所述自相关系数与配置值进行比较;
    当所述所有数据具有周期性,且所述自相关系数大于所述配置值时,对所述所有数据进行STL分解。
  3. 如权利要求2所述的异常检测方法,其特征在于,所述基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型,包括:
    从所述周期分量中获取与所述待检测时间点对应的目标周期分量;
    从所述所有数据中获取与所述待检测时间点对应的目标数据;
    计算所述目标数据与所述目标周期分量的差值,得到历史残差;
    基于所述历史残差,计算所述所有数据的残差均值及残差标准差;
    基于线性插值算法计算所述待检测时间点对应的期望值,得到所述异常检测模型。
  4. 如权利要求2所述的异常检测方法,其特征在于,所述基于傅里叶变换,确定所述所有数据是否具有周期性包括:
    对所述所有数据进行傅里叶变换;
    获取变换后得到的波形的当前振幅;
    计算所述所有数据的平均振幅;
    当所述当前振幅大于所述平均振幅时,确定所述所有数据具有周期性。
  5. 如权利要求2所述的异常检测方法,其特征在于,所述对所述所有数据进行STL分解包括:
    确定所述至少一个序列特征的等级;
    当所述至少一个序列特征的等级为高时,对所述所有数据执行内循环及外循环;或者
    当所述至少一个序列特征的等级为低时,对所述所有数据执行内循环。
  6. 如权利要求3所述的异常检测方法,其特征在于,所述基于线性插值算法计算所述待检测时间点对应的期望值包括:
    确定所述待检测时间点前预设时间间隔的第一时间点,以及所述待检测时间点后预设时间间隔的第二时间点;
    计算所述第一时间点上前后各配置时间内采集值的第一平均值,及所述第二时间点上前后各配置时间内采集值的第二平均值;
    基于下述线性插值公式计算所述期望值:
    W=Va+(Vb-Va)*(t-Ta)/(Tb-Ta)
    其中,W表示所述期望值,Va表示所述第一平均值,Vb表示所述第二平均值,t表示所述待检测时间点,Ta表示所述第一时间点,Tb表示所述第二时间点。
  7. 如权利要求1所述的异常检测方法,其特征在于,所述基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常包括:
    从所述异常检测模型中获取所述残差均值及所述残差标准差;
    基于n-sigma原理,根据所述残差均值及所述残差标准差计算阈值;
    当所述残差值大于或者小于所述阈值时,确定所述待检测样本异常。
  8. 如权利要求1所述的异常检测方法,其特征在于,在确定所述待检测样本异常后,所述方法还包括:
    记录所述待检测时间点及所述采集值;
    向指定联系人发送警报信息,所述警报信息包括所述待检测时间点及所述采集值。
  9. 一种异常检测装置,其特征在于,所述装置包括:
    获取单元,用于当接收到异常检测指令时,获取待检测样本;
    确定单元,用于确定所述待检测样本是否具有周期性;
    所述确定单元,还用于当所述待检测样本具有周期性时,确定待检测时间点;
    所述确定单元,还用于从所述待检测样本中确定所述待检测时间点对应的采集值;
    调取单元,用于调取预先训练的异常检测模型,其中,训练所述异常检测模型包括:从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,得到所述所有数据中每个数据的周期分量,基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型;
    所述获取单元,还用于从所述异常检测模型中获取所述采集值对应的期望值;
    计算单元,用于计算所述采集值与所述期望值之间的残差值;
    所述确定单元,还用于基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
  10. 一种电子设备,其特征在于,所述电子设备包括:
    存储器,存储至少一个计算机可读指令;及
    处理器,执行所述至少一个计算机可读指令以实现以下步骤:
    当接收到异常检测指令时,获取待检测样本;
    确定所述待检测样本是否具有周期性;
    当所述待检测样本具有周期性时,确定待检测时间点;
    从所述待检测样本中确定所述待检测时间点对应的采集值;
    调取预先训练的异常检测模型,其中,训练所述异常检测模型包括:从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,得到所述所有数据中每个数据的周期分量,基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型;
    从所述异常检测模型中获取所述采集值对应的期望值;
    计算所述采集值与所述期望值之间的残差值;
    基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
  11. 如权利要求10所述的电子设备,其特征在于,所述处理器执行至少一个计算机可读指令以实现从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,包括以下步骤:
    获取所述待检测时间点前预设时间段内所述至少一个序列特征的所有数据,其中,所述至少一个序列特征包括以下一种或者多种的组合:输出值、斜率、增幅、平均值;
    基于傅里叶变换,确定所述所有数据是否具有周期性;
    计算所述所有数据的自相关系数;
    将所述自相关系数与配置值进行比较;
    当所述所有数据具有周期性,且所述自相关系数大于所述配置值时,对所述所有数据进行STL分解。
  12. 如权利要求11所述的电子设备,其特征在于,所述处理器执行至少一个计算机可读指令以实现所述基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型时,包括以下步骤:
    从所述周期分量中获取与所述待检测时间点对应的目标周期分量;
    从所述所有数据中获取与所述待检测时间点对应的目标数据;
    计算所述目标数据与所述目标周期分量的差值,得到历史残差;
    基于所述历史残差,计算所述所有数据的残差均值及残差标准差;
    基于线性插值算法计算所述待检测时间点对应的期望值,得到所述异常检测模型。
  13. 如权利要求11所述的电子设备,其特征在于,所述处理器执行至少一个计算机可读指令以实现所述基于傅里叶变换,确定所述所有数据是否具有周期性时,包括以下步骤:
    对所述所有数据进行傅里叶变换;
    获取变换后得到的波形的当前振幅;
    计算所述所有数据的平均振幅;
    当所述当前振幅大于所述平均振幅时,确定所述所有数据具有周期性。
  14. 如权利要求11所述的电子设备,其特征在于,所述处理器执行至少一个计算机可读指令以实现所述对所述所有数据进行STL分解时,包括以下步骤:
    确定所述至少一个序列特征的等级;
    当所述至少一个序列特征的等级为高时,对所述所有数据执行内循环及外循环;或 者
    当所述至少一个序列特征的等级为低时,对所述所有数据执行内循环。
  15. 如权利要求12所述的电子设备,其特征在于,所述处理器执行至少一个计算机可读指令以实现所述基于线性插值算法计算所述待检测时间点对应的期望值时,包括以下步骤:
    确定所述待检测时间点前预设时间间隔的第一时间点,以及所述待检测时间点后预设时间间隔的第二时间点;
    计算所述第一时间点上前后各配置时间内采集值的第一平均值,及所述第二时间点上前后各配置时间内采集值的第二平均值;
    基于下述线性插值公式计算所述期望值:
    W=Va+(Vb-Va)*(t-Ta)/(Tb-Ta)
    其中,W表示所述期望值,Va表示所述第一平均值,Vb表示所述第二平均值,t表示所述待检测时间点,Ta表示所述第一时间点,Tb表示所述第二时间点。
  16. 一种非易失性可读存储介质,其特征在于:所述非易失性可读存储介质中存储有至少一个计算机可读指令,所述至少一个计算机可读指令被电子设备中的处理器执行以实现以下步骤:
    当接收到异常检测指令时,获取待检测样本;
    确定所述待检测样本是否具有周期性;
    当所述待检测样本具有周期性时,确定待检测时间点;
    从所述待检测样本中确定所述待检测时间点对应的采集值;
    调取预先训练的异常检测模型,其中,训练所述异常检测模型包括:从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,得到所述所有数据中每个数据的周期分量,基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型;
    从所述异常检测模型中获取所述采集值对应的期望值;
    计算所述采集值与所述期望值之间的残差值;
    基于所述异常检测模型及所述残差值,确定所述待检测样本是否异常。
  17. 如权利要求16所述的存储介质,其特征在于,所述至少一个计算机可读指令被处理器执行以实现从所述待检测时间点前至少一个序列特征的数据中获取满足配置条件的所有数据进行STL分解,包括以下步骤:
    获取所述待检测时间点前预设时间段内所述至少一个序列特征的所有数据,其中,所述至少一个序列特征包括以下一种或者多种的组合:输出值、斜率、增幅、平均值;
    基于傅里叶变换,确定所述所有数据是否具有周期性;
    计算所述所有数据的自相关系数;
    将所述自相关系数与配置值进行比较;
    当所述所有数据具有周期性,且所述自相关系数大于所述配置值时,对所述所有数据进行STL分解。
  18. 如权利要求17所述的存储介质,其特征在于,所述至少一个计算机可读指令被处理器执行以实现所述基于所述周期分量,计算所述所有数据的残差均值及残差标准差,并计算所述待检测时间点对应的期望值,得到所述异常检测模型时,包括以下步骤:
    从所述周期分量中获取与所述待检测时间点对应的目标周期分量;
    从所述所有数据中获取与所述待检测时间点对应的目标数据;
    计算所述目标数据与所述目标周期分量的差值,得到历史残差;
    基于所述历史残差,计算所述所有数据的残差均值及残差标准差;
    基于线性插值算法计算所述待检测时间点对应的期望值,得到所述异常检测模型。
  19. 如权利要求17所述的存储介质,其特征在于,所述至少一个计算机可读指令被处理器执行以实现所述基于傅里叶变换,确定所述所有数据是否具有周期性时,包括以下步骤:
    对所述所有数据进行傅里叶变换;
    获取变换后得到的波形的当前振幅;
    计算所述所有数据的平均振幅;
    当所述当前振幅大于所述平均振幅时,确定所述所有数据具有周期性。
  20. 如权利要求17所述的存储介质,其特征在于,所述至少一个计算机可读指令被处理器执行以实现所述对所述所有数据进行STL分解时,包括以下步骤:
    确定所述至少一个序列特征的等级;
    当所述至少一个序列特征的等级为高时,对所述所有数据执行内循环及外循环;或者
    当所述至少一个序列特征的等级为低时,对所述所有数据执行内循环。
PCT/CN2019/117229 2019-09-23 2019-11-11 异常检测方法、装置、电子设备及存储介质 WO2021056724A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910900798.8A CN110851338B (zh) 2019-09-23 2019-09-23 异常检测方法、电子设备及存储介质
CN201910900798.8 2019-09-23

Publications (1)

Publication Number Publication Date
WO2021056724A1 true WO2021056724A1 (zh) 2021-04-01

Family

ID=69596013

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117229 WO2021056724A1 (zh) 2019-09-23 2019-11-11 异常检测方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN110851338B (zh)
WO (1) WO2021056724A1 (zh)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113128598A (zh) * 2021-04-22 2021-07-16 深信服科技股份有限公司 一种传感数据检测方法、装置、设备及可读存储介质
CN113220771A (zh) * 2021-05-10 2021-08-06 西安热工研究院有限公司 一种基于电厂历史数据自动采集运行工况的方法
CN113535452A (zh) * 2021-07-12 2021-10-22 浙江讯飞智能科技有限公司 数据检测方法、装置、电子设备和存储介质
CN113553239A (zh) * 2021-07-27 2021-10-26 重庆紫光华山智安科技有限公司 异常数据检测方法及相关装置
CN113642601A (zh) * 2021-07-02 2021-11-12 国网江苏省电力有限公司电力科学研究院 一种中压配电网转供操作识别方法、装置以及设备
CN113746862A (zh) * 2021-09-14 2021-12-03 恒安嘉新(北京)科技股份公司 一种基于机器学习的异常流量检测方法、装置和设备
CN114239708A (zh) * 2021-12-13 2022-03-25 中国船舶重工集团公司第七0三研究所 一种基于质量控制图理论的燃机异常检测方法
CN114338533A (zh) * 2021-12-30 2022-04-12 广东明创软件科技有限公司 一种调整方法、电子设备及计算机存储介质
CN114518133A (zh) * 2022-01-13 2022-05-20 首钢京唐钢铁联合有限责任公司 传感器数值跳变的检测方法、装置、电子设备及存储介质
CN114881269A (zh) * 2022-07-13 2022-08-09 山东恩信特种车辆制造有限公司 一种用于物料输送管路的异常检测方法及装置
CN114881167A (zh) * 2022-05-24 2022-08-09 北京百度网讯科技有限公司 异常检测方法、装置、电子设备和介质
CN115328723A (zh) * 2022-04-29 2022-11-11 上海鼎茂信息技术有限公司 一种自适应基带优化的时序异常检测方法及系统
CN115392132A (zh) * 2021-09-18 2022-11-25 天津商科数控技术股份有限公司 基于深度学习的焊点质量异常检测方法、装置、系统
CN115980281A (zh) * 2023-03-16 2023-04-18 深圳奥雅设计股份有限公司 一种基于碳中和的碳源检测方法及系统
CN117041018A (zh) * 2023-10-09 2023-11-10 中电科大数据研究院有限公司 一种数据中心远程智能运维管理方法及相关设备
CN117077066A (zh) * 2023-10-17 2023-11-17 合肥联宝信息技术有限公司 波形异常检测方法、装置、电子设备及存储介质
CN117370917A (zh) * 2023-12-07 2024-01-09 城光(湖南)节能环保服务股份有限公司 一种城市智慧路灯寿命预测方法及系统
CN117421610A (zh) * 2023-12-19 2024-01-19 山东德源电力科技股份有限公司 一种用于电能表运行状态预警的数据异常分析方法
CN114338533B (zh) * 2021-12-30 2024-05-28 广东明创软件科技有限公司 一种调整方法、电子设备及计算机存储介质

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111459778B (zh) * 2020-03-12 2024-05-07 平安科技(深圳)有限公司 运维系统异常指标检测模型优化方法、装置及存储介质
CN113514713B (zh) * 2020-04-10 2022-12-20 中车唐山机车车辆有限公司 动车组牵引变流器性能检测方法、装置及终端设备
CN111457999B (zh) * 2020-04-10 2022-04-01 上海东普信息科技有限公司 快递称重异常核查方法、装置、设备及存储介质
CN111858231A (zh) * 2020-05-11 2020-10-30 北京必示科技有限公司 一种基于运维监控的单指标异常检测方法
CN112148577B (zh) * 2020-10-09 2024-05-07 平安科技(深圳)有限公司 数据异常检测方法、装置、电子设备及存储介质
CN112329847A (zh) * 2020-11-03 2021-02-05 北京神州泰岳软件股份有限公司 一种异常检测方法、装置、电子设备及存储介质
CN112508922B (zh) * 2020-12-14 2021-12-21 深圳精智达技术股份有限公司 Mura检测方法、装置、终端设备以及存储介质
CN112699163B (zh) * 2020-12-25 2022-06-28 创新奇智(青岛)科技有限公司 时间序列异常检测方法、装置、电子设备及存储介质
CN112783744A (zh) * 2021-01-28 2021-05-11 深信服科技股份有限公司 数据检测方法、装置、设备、存储介质
CN112800068B (zh) * 2021-02-22 2023-05-12 首钢京唐钢铁联合有限责任公司 一种能源计量数据自动处理的方法及装置
CN112966016A (zh) * 2021-03-01 2021-06-15 北京青萌数海科技有限公司 一种异常检测方法
CN112965876A (zh) * 2021-03-10 2021-06-15 中国民航信息网络股份有限公司 一种监控报警方法及装置
CN112966222A (zh) * 2021-03-10 2021-06-15 中国民航信息网络股份有限公司 一种时间序列异常数据检测方法及相关设备
CN113139586B (zh) * 2021-03-31 2022-09-23 同济大学 模型训练方法、设备异常诊断方法、电子设备及介质
CN113568950A (zh) * 2021-07-29 2021-10-29 北京字节跳动网络技术有限公司 一种指标检测方法、装置、设备及介质
CN113688125B (zh) * 2021-08-24 2023-12-05 平安国际智慧城市科技股份有限公司 基于人工智能的异常值检测方法、装置、电子设备及介质
CN113434823B (zh) * 2021-08-26 2021-11-16 企查查科技有限公司 数据采集任务异常预警方法、装置、计算机设备和介质
CN115392812B (zh) * 2022-10-31 2023-03-24 成都飞机工业(集团)有限责任公司 一种异常根因定位方法、装置、设备及介质
CN115994248B (zh) * 2023-03-24 2023-06-20 青岛精锐机械制造有限公司 阀门故障的数据检测方法及系统
CN116108008A (zh) * 2023-04-13 2023-05-12 山东明远生物科技有限公司 一种装饰材料甲醛检测数据处理方法
CN117129236B (zh) * 2023-09-11 2024-03-26 深邦智能科技集团(青岛)有限公司 基于远程控制的机动车设备标定检测方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018168140A1 (ja) * 2017-03-15 2018-09-20 株式会社ウフル ログ管理システム、ログ管理装置、方法及びコンピュータプログラム
CN109862129A (zh) * 2018-12-26 2019-06-07 中国互联网络信息中心 Dns流量异常检测方法、装置、电子设备及存储介质
CN110008080A (zh) * 2018-12-25 2019-07-12 阿里巴巴集团控股有限公司 基于时间序列的业务指标异常检测方法、装置和电子设备
CN110008079A (zh) * 2018-12-25 2019-07-12 阿里巴巴集团控股有限公司 监控指标异常检测方法、模型训练方法、装置及设备
CN110134566A (zh) * 2019-04-29 2019-08-16 国网上海市电力公司 一种基于标签技术的云环境下信息系统性能监测方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10832150B2 (en) * 2016-07-28 2020-11-10 International Business Machines Corporation Optimized re-training for analytic models
CN108804703B (zh) * 2018-06-19 2021-09-17 北京焦点新干线信息技术有限公司 一种数据异常检测方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018168140A1 (ja) * 2017-03-15 2018-09-20 株式会社ウフル ログ管理システム、ログ管理装置、方法及びコンピュータプログラム
CN110008080A (zh) * 2018-12-25 2019-07-12 阿里巴巴集团控股有限公司 基于时间序列的业务指标异常检测方法、装置和电子设备
CN110008079A (zh) * 2018-12-25 2019-07-12 阿里巴巴集团控股有限公司 监控指标异常检测方法、模型训练方法、装置及设备
CN109862129A (zh) * 2018-12-26 2019-06-07 中国互联网络信息中心 Dns流量异常检测方法、装置、电子设备及存储介质
CN110134566A (zh) * 2019-04-29 2019-08-16 国网上海市电力公司 一种基于标签技术的云环境下信息系统性能监测方法

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113128598A (zh) * 2021-04-22 2021-07-16 深信服科技股份有限公司 一种传感数据检测方法、装置、设备及可读存储介质
CN113128598B (zh) * 2021-04-22 2024-04-09 深信服科技股份有限公司 一种传感数据检测方法、装置、设备及可读存储介质
CN113220771B (zh) * 2021-05-10 2022-11-08 西安热工研究院有限公司 一种基于电厂历史数据自动采集运行工况的方法
CN113220771A (zh) * 2021-05-10 2021-08-06 西安热工研究院有限公司 一种基于电厂历史数据自动采集运行工况的方法
CN113642601A (zh) * 2021-07-02 2021-11-12 国网江苏省电力有限公司电力科学研究院 一种中压配电网转供操作识别方法、装置以及设备
CN113642601B (zh) * 2021-07-02 2023-11-17 国网江苏省电力有限公司电力科学研究院 一种中压配电网转供操作识别方法、装置以及设备
CN113535452A (zh) * 2021-07-12 2021-10-22 浙江讯飞智能科技有限公司 数据检测方法、装置、电子设备和存储介质
CN113553239A (zh) * 2021-07-27 2021-10-26 重庆紫光华山智安科技有限公司 异常数据检测方法及相关装置
CN113746862A (zh) * 2021-09-14 2021-12-03 恒安嘉新(北京)科技股份公司 一种基于机器学习的异常流量检测方法、装置和设备
CN115392132B (zh) * 2021-09-18 2023-07-11 天津商科数控技术股份有限公司 基于深度学习的焊点质量异常检测方法、装置、系统
CN115392132A (zh) * 2021-09-18 2022-11-25 天津商科数控技术股份有限公司 基于深度学习的焊点质量异常检测方法、装置、系统
CN114239708A (zh) * 2021-12-13 2022-03-25 中国船舶重工集团公司第七0三研究所 一种基于质量控制图理论的燃机异常检测方法
CN114338533A (zh) * 2021-12-30 2022-04-12 广东明创软件科技有限公司 一种调整方法、电子设备及计算机存储介质
CN114338533B (zh) * 2021-12-30 2024-05-28 广东明创软件科技有限公司 一种调整方法、电子设备及计算机存储介质
CN114518133A (zh) * 2022-01-13 2022-05-20 首钢京唐钢铁联合有限责任公司 传感器数值跳变的检测方法、装置、电子设备及存储介质
CN115328723A (zh) * 2022-04-29 2022-11-11 上海鼎茂信息技术有限公司 一种自适应基带优化的时序异常检测方法及系统
CN114881167A (zh) * 2022-05-24 2022-08-09 北京百度网讯科技有限公司 异常检测方法、装置、电子设备和介质
CN114881269A (zh) * 2022-07-13 2022-08-09 山东恩信特种车辆制造有限公司 一种用于物料输送管路的异常检测方法及装置
CN114881269B (zh) * 2022-07-13 2022-09-27 山东恩信特种车辆制造有限公司 一种用于物料输送管路的异常检测方法及装置
CN115980281A (zh) * 2023-03-16 2023-04-18 深圳奥雅设计股份有限公司 一种基于碳中和的碳源检测方法及系统
CN117041018A (zh) * 2023-10-09 2023-11-10 中电科大数据研究院有限公司 一种数据中心远程智能运维管理方法及相关设备
CN117041018B (zh) * 2023-10-09 2024-01-02 中电科大数据研究院有限公司 一种数据中心远程智能运维管理方法及相关设备
CN117077066A (zh) * 2023-10-17 2023-11-17 合肥联宝信息技术有限公司 波形异常检测方法、装置、电子设备及存储介质
CN117077066B (zh) * 2023-10-17 2024-03-12 合肥联宝信息技术有限公司 波形异常检测方法、装置、电子设备及存储介质
CN117370917A (zh) * 2023-12-07 2024-01-09 城光(湖南)节能环保服务股份有限公司 一种城市智慧路灯寿命预测方法及系统
CN117370917B (zh) * 2023-12-07 2024-02-23 城光(湖南)节能环保服务股份有限公司 一种城市智慧路灯寿命预测方法及系统
CN117421610A (zh) * 2023-12-19 2024-01-19 山东德源电力科技股份有限公司 一种用于电能表运行状态预警的数据异常分析方法
CN117421610B (zh) * 2023-12-19 2024-03-15 山东德源电力科技股份有限公司 一种用于电能表运行状态预警的数据异常分析方法

Also Published As

Publication number Publication date
CN110851338A (zh) 2020-02-28
CN110851338B (zh) 2022-06-24

Similar Documents

Publication Publication Date Title
WO2021056724A1 (zh) 异常检测方法、装置、电子设备及存储介质
WO2021174835A1 (zh) 告警信息处理方法、装置、计算机装置及存储介质
CN107528722B (zh) 一种时间序列中异常点检测方法及装置
JP6609050B2 (ja) 時間的因果グラフにおける異常フュージョン
CN105071983B (zh) 一种面向云计算在线业务的异常负载检测方法
CN113518011B (zh) 异常检测方法和装置、电子设备及计算机可读存储介质
US10852357B2 (en) System and method for UPS battery monitoring and data analysis
CN105718715A (zh) 异常检测方法和设备
CA2471013A1 (en) Method and system for analyzing and predicting the behavior of systems
CN113852603B (zh) 网络流量的异常检测方法、装置、电子设备和可读介质
CN109343853B (zh) 一种应用程序的异常识别方法及设备
CN112188531A (zh) 异常检测方法、装置、电子设备及计算机存储介质
CN110444011B (zh) 交通流高峰识别方法、装置、电子设备及存储介质
CN112565187B (zh) 基于逻辑回归的电网攻击检测方法、系统、设备及介质
CN112148768A (zh) 一种指标时间序列异常检测方法、系统及存储介质
CN109326087B (zh) 一种基于排水管网监测的城市内涝预警方法及装置
CN108491931B (zh) 一种基于机器学习提高无损检测精度的方法
WO2019012029A1 (en) METHOD AND SYSTEM FOR GAP DETECTION IN SENSOR DATA SETS
CN108664603A (zh) 一种修复时序数据的异常聚合值的方法及装置
CN106503841B (zh) 指标阈值的确定方法和装置
CN112148733A (zh) 确定故障类型的方法、装置、电子装置和计算机可读介质
CN111626360B (zh) 用于检测锅炉故障类型的方法、装置、设备和存储介质
CN116881737A (zh) 一种工业智慧监盘系统中的系统分析方法
CN116304909A (zh) 一种异常检测模型训练方法、故障场景定位方法及装置
CN112380073B (zh) 一种故障位置的检测方法、装置及可读存储介质

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: 19946988

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: 19946988

Country of ref document: EP

Kind code of ref document: A1