Method, device and storage medium for analyzing abnormality of indicators
By collecting and analyzing historical and real-time data of the business system, a set of parameter ranges is generated to determine whether the indicators exceed the target range. This solves the problems of fixed thresholds and noise interference in the existing technology, and achieves more accurate and efficient indicator anomaly monitoring.
Patent Information
- Application Number
- CN202010326325.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-23
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-04-23
AI Technical Summary
When the existing technology monitors business system indicator anomalies, the threshold is fixed and cannot adapt to real-time changes, resulting in abnormal monitoring that does not meet the objective conditions, and the indicator data has noise interference. The model requires high robustness, and it is difficult to effectively detect anomalies in periodic indicators.
By regularly collecting historical sequence data, a set of parameter ranges is generated, real-time data is collected at a preset frequency, the parameter range of the target time window is determined, comparison is made to determine whether the range is exceeded, and an exception prompt is issued. This method improves the accuracy and efficiency of anomaly analysis by collecting real-time data and determining parameter ranges for at least two time windows.
It improves the accuracy and efficiency of indicator anomaly analysis, adapts to real-time changes, reduces noise interference, enhances the robustness of the model, and can effectively detect anomalies in periodic indicators.
Smart Images

Figure CN111625413B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to an indicator abnormality analysis method, an electronic device and a computer-readable storage medium. Background Art
[0002] With the rapid development of Internet business, companies are becoming more and more dependent on business systems, which places higher demands on the stability of business systems. It is particularly important to monitor abnormal conditions of various indicators of business systems in real time.
[0003] Currently, the monitoring of abnormal conditions of various indicators of business systems is mainly managed by manual monitoring and manual intervention. The main process is as follows: Operation and maintenance personnel set the indicator threshold based on experience; in the actual monitoring process, when the actual value of an indicator reaches the threshold, it is judged as abnormal and an alarm is issued. However, since the threshold is fixed, it is impossible to fully consider the real-time changes in the indicator, resulting in abnormal monitoring not meeting the objective situation.
[0004] In addition, in the prior art, for some indicator data that show periodicity, anomaly detection needs to be implemented based on model algorithms. However, since the indicator data has strong noise interference, the model is required to have high robustness.
[0005] Considering the problems existing in the above prior art, it is urgent to provide an indicator abnormality analysis method. Summary of the invention
[0006] In view of the above, the present invention provides an indicator abnormality analysis method, an electronic device and a computer-readable storage medium, the main purpose of which is to improve the accuracy and efficiency of indicator abnormality analysis.
[0007] To achieve the above object, the present invention provides an indicator abnormality analysis method, the method comprising:
[0008] Periodically collecting historical sequence data of a preset indicator within a first preset time period, analyzing and calculating the historical sequence data based on a preset analysis algorithm, and generating and saving a parameter range set of the preset indicator;
[0009] Collect real-time data of the indicator to be detected according to the preset collection frequency, and record the real-time data of the indicator to be detected and the collection time point;
[0010] Determine the target time window corresponding to the indicator to be detected according to the acquisition time point, and filter out the target parameter range corresponding to the target time window of the indicator to be detected from the parameter range set;
[0011] Comparing the real-time data with the target parameter range to determine whether the real-time data exceeds the target parameter range; and
[0012] When it is determined that the real-time data exceeds the target parameter range, it is determined that the indicator to be detected is abnormal at the collection time point, and a prompt message is sent to a preset terminal.
[0013] In addition, to achieve the above-mentioned purpose, the present invention also provides an electronic device, which includes: a memory and a processor, wherein the memory stores an indicator anomaly analysis program that can be run on the processor, and when the indicator anomaly analysis program is executed by the processor, any step in the indicator anomaly analysis method as described above can be implemented.
[0014] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, which includes an indicator anomaly analysis program. When the indicator anomaly analysis program is executed by a processor, any step in the indicator anomaly analysis method as described above can be implemented.
[0015] The indicator anomaly analysis method, electronic device and computer-readable storage medium proposed in the present invention improve the efficiency of subsequent anomaly analysis by pre-calculating the parameter range corresponding to each preset indicator in different time windows; in the actual abnormal indicator analysis process, real-time data of the indicator to be detected is collected, and at least two time windows corresponding to the indicator to be detected at the collection time point are determined, thereby determining at least two parameter ranges, and the real-time data of the indicator to be detected at the time collection point is analyzed and judged based on the at least two parameter ranges determined comprehensively, thereby improving the accuracy and efficiency of the indicator anomaly analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of a preferred embodiment of the abnormality analysis method of indicators of the present invention;
[0017] Figure 2 A schematic diagram of a preferred embodiment of the electronic device of the present invention;
[0018] Figure 3 for Figure 2 Schematic diagram of the program modules of a preferred embodiment of the abnormality analysis program for indicators.
[0019] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0020] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0021] The present invention provides an indicator abnormality analysis method. The method can be executed by a device, and the device can be implemented by software and / or hardware.
[0022] Reference Figure 1 The figure shows a flow chart of a preferred embodiment of the abnormality analysis method of indicators of the present invention.
[0023] In a preferred embodiment of the indicator abnormality analysis method of the present invention, the indicator abnormality analysis method includes: steps S1 to S5.
[0024] Step S1, regularly collecting historical sequence data of a preset indicator within a first preset time period, analyzing and calculating the historical sequence data based on a preset analysis algorithm, and generating and saving a parameter range set of the preset indicator;
[0025] The following describes various embodiments of the present invention using an electronic device as an execution subject.
[0026] For example, historical series data of each preset indicator is collected at a fixed time point every day. The first preset time period can be 14 days or 21 days before the current time point, and the historical series data includes the historical collection values corresponding to all collection time points in the first preset time period. The time granularity of the historical series data of different indicators may be the same or different.
[0027] For example, taking the indicator "time spent accessing service" as an example, the electronic device starts to obtain the historical collection values of this indicator at all collection time points from 0:00 on February 16, 2020 to 24:00 on February 29, 2020 at early morning every day (0:00 on March 1, 2020).
[0028] After the electronic device collects the historical sequence data of each preset indicator, it is necessary to analyze and predict the historical sequence data to obtain the parameter range of each preset indicator for subsequent anomaly detection.
[0029] Step S2, collecting real-time data of the indicator to be detected according to a preset collection frequency, and recording the real-time data of the indicator to be detected and the collection time point;
[0030] It is understandable that the collection frequency (i.e., collection time point) of each preset indicator needs to be preset. For example, the collection frequency of indicator A is once every 1 minute, and the collection frequency of indicator B is once every 5 minutes. The electronic device collects real-time data of indicator A every 1 minute, collects real-time data of indicator B every 5 minutes, and records the real-time data and collection time point of each indicator.
[0031] Step S3, determining the target time window corresponding to the indicator to be detected according to the acquisition time point, and screening out the target parameter range corresponding to the target time window of the indicator to be detected from the parameter range set;
[0032] It is understandable that different indicators correspond to different parameter ranges, and the parameter ranges corresponding to the same indicator in different time periods (time windows) are also different. In this embodiment, first, the parameter range corresponding to the indicator to be predicted is obtained from the pre-calculated and saved parameter range set as the first subset; then, the target time window corresponding to the indicator to be predicted is determined according to the acquisition time point, and the parameter range corresponding to the target time window is screened out from the first subset as the second subset; finally, the second subset is used as the target parameter range corresponding to the indicator to be detected at the acquisition time point.
[0033] In the process of calculating the parameter range, the parameter range corresponding to each time window is calculated with a time window of preset step size. Therefore, the time window described in this embodiment is consistent with the time window in the process of calculating the parameter range.
[0034] In this embodiment, the parameter range set includes parameter ranges corresponding to different preset indicators in different time windows, and the step length of the time window is less than the length of the time window. Preferably, the length of the time window is 30 minutes and the step length is 15 minutes, that is, within a day, one indicator corresponds to 96 time windows, respectively corresponding to 96 parameter ranges.
[0035] Taking the collection time point of indicator A as 10:25 as an example, there are two time windows including the collection time point, namely: 10:00-10:30 and 10:15-10:45, so these two time windows are the target time windows corresponding to the collection time point. First, all parameter ranges corresponding to indicator A are filtered out from the parameter range set to generate the parameter range subset of indicator A. Then, the parameter ranges corresponding to these two target time windows are filtered out from the parameter range subset of indicator A as the target parameter ranges corresponding to indicator A at the collection time point of 10:25.
[0036] In other embodiments, the length and step size of the time window may be adjusted according to actual conditions. For example, the step size of the time window may be 10 minutes. Then each acquisition time point corresponds to 3 target time windows, i.e., 3 parameter ranges, which will not be described in detail.
[0037] Step S4, comparing the real-time data with the target parameter range to determine whether the real-time data exceeds the target parameter range;
[0038] In this embodiment, determining whether the real-time data exceeds the target parameter range includes:
[0039] Respectively obtain parameter ranges corresponding to different target time windows in the target parameter range, and obtain the intersection of the parameter ranges corresponding to the different target time windows;
[0040] Determining whether the real-time data belongs to the intersection of parameter ranges corresponding to the different target time windows; and
[0041] If so, it is determined that the real-time data does not exceed the target parameter range; if not, it is determined that the real-time data exceeds the target parameter range.
[0042] Taking indicator A as an example, obtain the real-time data collected by indicator A at 10:25, obtain the parameter ranges corresponding to the two target time windows respectively, and take the intersection T of the parameter ranges corresponding to the two target time windows. If the real-time data belongs to the intersection T, that is, the real-time data belongs to the parameter ranges corresponding to different target time windows at the same time, then it is judged that the real-time data of indicator A does not exceed the target parameter range. If the real-time data does not belong to the intersection T, then it is judged that the real-time data of indicator A exceeds the target parameter range.
[0043] Step S5, when it is determined that the real-time data exceeds the target parameter range, it is determined that the indicator to be detected is abnormal at the collection time point, and a prompt message is sent to a preset terminal.
[0044] If the real-time data exceeds the target parameter range, it is considered that the indicator is abnormal or the risk of abnormality is high, and an early warning message needs to be sent to the preset terminal (for example, the terminal used by system operation and maintenance personnel) to prompt the abnormal indicator to be processed.
[0045] The indicator anomaly analysis method proposed in the above embodiment detects the real-time data of the indicator by collecting it, and determines at least two time windows corresponding to the indicator at the collection time point, thereby determining at least two parameter ranges, and then performs an anomaly analysis and judgment on the real-time data of the indicator at the time collection point based on the determined at least two parameter ranges, thereby improving the accuracy and efficiency of the indicator anomaly analysis.
[0046] Considering that short-term abnormalities of some indicators are normal, alarm filtering and compression are required. In other embodiments, when it is determined that the real-time data exceeds the target parameter range, it is determined that the indicator to be detected is abnormal at the collection time point, including:
[0047] When it is determined that the real-time data exceeds the target parameter range, determining whether the indicator to be detected meets a preset condition; and
[0048] When the indicator to be detected does not meet the preset condition, the abnormality is recorded, and the real-time data of the next collection time point is repeatedly collected for abnormality analysis; when the indicator to be detected meets the preset condition, abnormal alarm information is generated and fed back to the preset terminal.
[0049] In this embodiment, the preset condition includes: the preset indicator matches a predetermined list containing designated indicators (indicators to be filtered for alarms), and the preset indicator has a continuous abnormal number of times exceeding a first preset threshold (e.g., 10 times) within a second preset time period (e.g., within 30 minutes). When the above preset conditions are met, 10 abnormalities are sent to the operation and maintenance personnel as a time in a preset form (e.g., email).
[0050] In other embodiments, the indicator abnormality analysis method further includes:
[0051] Receiving feedback information sent by the preset terminal, including: a correct alarm or an alarm error;
[0052] When the feedback information indicates that the alarm is correct, marking the real-time data as abnormal data; and
[0053] When the feedback information is an alarm error, the target parameter range corresponding to the indicator to be detected at the collection time point is adjusted according to the real-time data.
[0054] For example, if the operation and maintenance personnel responds to the abnormal alarm of indicator A and the alarm is correct, it means that the real-time data at the current collection time point is abnormal, and the current real-time data is labeled "abnormal". In the subsequent calculation of the parameter range, the abnormal data points are deleted from the historical data to avoid data interference and improve the accuracy of the parameter range. If the operation and maintenance personnel respond to the abnormal alarm of indicator A and the alarm is wrong, it means that the target parameter range corresponding to the current real-time data is incorrect and needs to be adjusted to avoid similar false alarms in the future.
[0055] In other embodiments, the historical sequence data is analyzed and calculated based on a preset analysis algorithm to generate and save a set of parameter ranges of the preset indicators, including: a1-a4.
[0056] a1. Classify the preset indicators according to the historical sequence data and the preset classification algorithm to determine the indicator type of the preset indicator;
[0057] The indicator types include: periodic indicators and non-periodic indicators. In this embodiment, the preset indicators are classified according to the historical sequence data and the preset classification algorithm, including:
[0058] The historical sequence data is obtained according to the granularity of the indicator, and the historical sequence data is multiplied by a plurality of signal waves of known frequencies (different frequencies) respectively, and all points of the obtained new sequence data are added;
[0059] Calculate the similarity between the addition result and the signal waves of the plurality of known frequencies, wherein the similarity is the amplitude ratio;
[0060] When there is a signal wave whose similarity is greater than or equal to the second preset threshold and has a preset period, it is determined that the historical sequence data has periodicity; and
[0061] When there is no signal wave whose similarity is greater than or equal to the second preset threshold and has a preset period, it is determined that the historical sequence data does not have periodicity.
[0062] Among them, the similarity is the amplitude ratio. When the amplitude ratio exceeds the second preset threshold, the period of the indicator is determined according to the known frequency signal wave whose similarity exceeds the second preset threshold. In order to meet the needs of business indicators, only indicators with a period of 1 day are used as periodic indicators. That is to say, the indicator is judged to be a periodic indicator only when and only when the period of the signal wave with a similarity greater than or equal to the second preset threshold is 1.
[0063] Taking the indicator with a collection frequency of 1 minute as an example, there are 1440 points of historical data for one day. Multiply it with the corresponding point on the sine wave with a frequency of 1, and add the 1440 multiplied results. The result is recorded as a>0 (if it is less than 0, it does not contain this sine wave). Then, the amplitude (similarity, i.e. amplitude ratio) of the sine wave with a frequency of 1 in these 1440 time series points is: a / (1440 / 2). The amplitude calculation of other frequencies is similar. Finally, in the part where the amplitude exceeds the threshold, the sine wave with the largest amplitude is selected, and its period is used as the period of the indicator.
[0064] It should be noted that since this method is computationally intensive, FFT (Fast Fourier Transform) is used to normalize the original data points to complex points within 0-2π and with a modulus of 1. Only half of the points need to be calculated to obtain the other half of the value. The amplitude calculation is as described above.
[0065] a2. When the preset indicator is a periodic indicator of working days, the first preset analysis algorithm is called to analyze and calculate the historical sequence data to obtain the parameter range of each preset indicator in the periodic indicator of working days;
[0066] In this embodiment, different types of indicators correspond to different analysis algorithms, and different indicators of the first type of indicators may also correspond to different analysis algorithms. For example, the analysis algorithm corresponding to the periodic indicators on working days is the first preset analysis algorithm, the analysis algorithm corresponding to the periodic indicators on non-working days is the second preset analysis algorithm, and the analysis algorithm corresponding to the non-periodic indicators is the third preset analysis algorithm.
[0067] In this embodiment (the granularity is taken as 1 min, and there may be different situations in practice), the first preset analysis algorithm includes: a21-a27.
[0068] a21. Obtain the historical data of the preset indicator within a third preset time from the historical sequence data as the first initial training data; wherein the third preset time is a partial time period within the first preset time, for example, 10 working days in the 14 days before the current time point.
[0069] a22. Smoothing the first initial training data to generate a first matrix as the first target training data; for example, after smoothing the data of 10 working days of indicator P, the corresponding time point data of 10 working days are obtained and saved as a 10*1440 matrix.
[0070] a23. Add and average the data corresponding to the same time of each day in the first target training data, and generate a second matrix corresponding to the first target training data; for example, add and average the data corresponding to the same time of 10 days to obtain a 1*1440 mean matrix.
[0071] a24. Generate a third matrix corresponding to the first target training data based on the first matrix and the second matrix; subtract the mean matrix from each row of the matrix of the first target training data to obtain a 10*1440 residual matrix, which represents the residual matrix of indicator P every minute in the first 10 days.
[0072] a25. Divide the third matrix according to the preset time window, and arrange the residual values of each time window into a column to obtain the fourth matrix; wherein, the time window duration is 30 minutes, the step length is 15 minutes, and each day is divided according to the time window, and 96 time windows can be obtained every day. The two time windows will have a 15-minute overlapping part. The residual matrix just obtained is divided according to these time windows, and the residual values of each time window are arranged into a column. Each column contains 300 samples, so the 10*1440 residual matrix can be updated to a 300*96 matrix R.
[0073] a26. Divide the first matrix according to the preset time window, and arrange the values of each time window into a column to obtain a fifth matrix, and calculate the mean and standard deviation of the fifth matrix by column; the same as step a25, convert the first matrix into a 300*96 matrix, and obtain the mean and standard deviation by column, namely mu.hat and se, with dimensions of 1*96.
[0074] a27. Calculate the confidence interval corresponding to each time window respectively, and use the confidence interval as the parameter range.
[0075] First, the matrix R is sampled with replacement.
[0076] Definition: Stat(R,index)=sqrt(max(((n-1)*Mu^2) / (Sq-n*Mu^2))*n), repeatedly extract 200 values from the row dimension 1:300 of the matrix R as the value of index, calculate the value of Stat, repeat the extraction and calculation N times, and obtain N Stat values, recorded as Stat, n is the number of time points in a time window, which is related to the length of the time window and the collection granularity; N is the number of sampling times set manually, and the statistic Stat is calculated using the matrix obtained by extraction and the formula. Each time it is extracted, it is calculated once, and N Stat values are obtained after N extractions;
[0077] Mu=colMeans(RI), which represents the mean of each column of RI; Sq=colSums(RI^2), where RI=R[index,]), represents the matrix R arranged according to the rows specified by index. Then RI represents the 10*1440 matrix generated by arranging the 1st row, 4th row, 2nd row, 1st row, etc. of R in rows. RI^2 represents the matrix composed of the squares of each element of RI, and colSums represents the sum of each column.
[0078] Then, q.boot = quantile(Stat, level) is calculated, which represents the quantile at level (0.975 / 0.025) of Stat; the upper and lower quantiles of the N Stat values obtained above are calculated, where the quantiles are adjusted according to the business rule settings.
[0079] Finally, calculate lb.boot = mu.hat–a*q.boot*se; ub.boot = mu.hat + a*q.boot*se; where a is the confidence band radius compression parameter, which defaults to 1, and mu.hat is a 96-dimensional column vector. Through mu.hat (1*96 matrix), se (1*96 matrix) and q.boot value (1*96 matrix), lb.boot and ub.boot can be obtained, both of which are 1*96 matrices corresponding to 96 time windows, so as to determine the parameter range corresponding to each time window.
[0080] In this embodiment, a locally weighted regression (LOESS) algorithm is used for smoothing, and the regression parameter calculation objective function of LOESS regression is:
[0081] ∑ i w (i) (y i -θ T x i )
[0082] Among them, i represents a collection time point, w(i) It is a function that calculates the weights of the data near the time point to be predicted. Generally, a Gaussian kernel is selected, that is:
[0083]
[0084] Among them, τ is a manually set value that controls the rate at which ω changes.
[0085] For example, the data set is: x:[1,2,3,6,8], y:[10,11,5,12,3], given the prediction data x=4, then the contribution of the data point (3,5) to the prediction point during prediction is:
[0086]
[0087] The contribution of the data point (8,3) to the predicted point during prediction is:
[0088]
[0089] The weight calculation method for the remaining data points is similar. After the weights are calculated, the prediction method is the same as the general regression algorithm, which will not be elaborated here.
[0090] It should be noted that the traditional method of using parameter regression requires the distribution characteristics of the indicator data to be determined in advance, so this method cannot be applied to massive indicators with diverse distribution characteristics. In most cases, the number of features involved in the training of the regression model is not large, and the distribution characteristics between the indicators are not very complex. A general parameter regression model can achieve better generalization ability. However, when the number of indicators, that is, the number of features, is huge, the correlation between these indicators and their respective distribution characteristics become extremely complex. For parameter regression models that are adapted to some known or easy-to-fit distribution characteristics, if you want to obtain a good fitting effect at this time, the number of parameters is unknown and may be infinite. Therefore, choosing a suitable parameter regression model will be a problem. At the same time, a large amount of computing resources will be consumed when estimating parameters, and the computing speed will be greatly reduced, which greatly reduces the model efficiency. The local weighted regression algorithm proposed in this embodiment is suitable for the calculation of massive indicators, and can save computing resources and improve the computing efficiency of the parameter range set.
[0091] a3. When the preset indicator is a non-working day periodic indicator, a second preset analysis algorithm is called to analyze and calculate the historical sequence data to obtain the parameter range of each preset indicator in the non-working day periodic indicator;
[0092] In this embodiment, the second preset analysis algorithm includes: a31-a33.
[0093] a31. Obtaining historical data of the preset indicator within a fourth preset time from the historical sequence data to generate second initial training data, and generating a first matrix corresponding to the second initial training data;
[0094] a32. Divide the first matrix corresponding to the second initial training data according to the preset time window, and arrange the historical collection values of each time window into a column to obtain the second matrix corresponding to the second initial training data, and calculate the mean and standard deviation of the second matrix corresponding to the second initial training data by column;
[0095] a33. Calculate the confidence interval corresponding to each time window respectively, and use the confidence interval as the parameter range.
[0096] The fourth preset time is a partial time period within the first preset time, for example, the four non-working days in the 14 days before the current time point, and the corresponding time point data of the four non-working days are saved as a 4*1440 matrix. Then, the confidence interval (i.e., distribution interval (n-sigma)) of the collected value is directly calculated based on the sliding window (with a length of 30 minutes and a step length of 15 minutes) and the collected value.
[0097] The specific implementation of this embodiment is roughly the same as that of working days, both of which use collected values (that is, original data) for calculation, but the calculation methods of the confidence intervals of the two are different. When calculating the confidence intervals of non-working days, LOESS algorithm smoothing and residual calculation are not required.
[0098] a4. When the preset indicator is a non-periodic indicator, a third preset analysis algorithm is called to analyze and calculate the historical sequence data to obtain the parameter range of each preset indicator in the non-periodic indicator.
[0099] In this embodiment, the third preset analysis algorithm includes: a41-a43.
[0100] a41. Using the historical sequence data as the third initial training data, and generating a first matrix corresponding to the third initial training data;
[0101] a42. Divide the first matrix corresponding to the third initial training data according to the preset time window, and arrange the historical collection values of each time window into a column to obtain the second matrix corresponding to the third initial training data, and calculate the average value and standard deviation of the second matrix corresponding to the third initial training data by column; and
[0102] a43. Calculate the upper and lower boundaries corresponding to each time window based on the mean value and standard deviation corresponding to each time window, and determine the parameter range based on the upper and lower boundaries.
[0103] The specific implementation of steps a41-a42 is roughly the same as the implementation of the non-working day periodic indicator, and will not be described in detail here.
[0104] For example, taking the time window 10:00-10:30 as an example, after calculating the mean and standard deviation of the time window, (mean + m*standard deviation) is used as the upper boundary and (mean - m*standard deviation) is used as the lower boundary to determine the parameter range, where m is a positive integer and can be adjusted according to actual needs.
[0105] The present invention also provides an electronic device. Figure 2 FIG. 1 is a schematic diagram of a preferred embodiment of the electronic device of the present invention.
[0106] In this embodiment, the electronic device 1 can be a terminal device with data processing function such as a server, a smart phone, a tablet computer, a portable computer, a desktop computer, etc. The server can be a rack server, a blade server, a tower server or a cabinet server.
[0107] The electronic device 1 includes a memory 11 , a processor 12 , and a network interface 13 .
[0108] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. equipped on the electronic device 1. Furthermore, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
[0109] The memory 11 can be used not only to store application software and various data installed in the electronic device 1, such as the indicator abnormality analysis program 10, but also to temporarily store data that has been output or is to be output.
[0110] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 11, such as the indicator abnormality analysis program 10.
[0111] The network interface 13 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the electronic device 1 and other electronic devices, such as a client (not shown in the figure). The components 11-13 of the electronic device 1 communicate with each other via a communication bus.
[0112] Figure 2 Only the electronic device 1 having components 11-13 is shown, and those skilled in the art will understand that Figure 2 The structure shown does not constitute a limitation on the electronic device 1 , and the electronic device 1 may include fewer or more components than shown in the figure, or combine some components, or arrange the components differently.
[0113] Optionally, the electronic device 1 may further include a user interface, which may include a display (Display) and an input unit such as a keyboard (Keyboard). The optional user interface may also include a standard wired interface and a wireless interface.
[0114] Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, etc. The display may also be referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.
[0115] exist Figure 2 In the embodiment of the electronic device 1 shown, the program code of the indicator abnormality analysis program 10 is stored in the memory 11 as a computer storage medium, and when the processor 12 executes the program code of the indicator abnormality analysis program 10, the following steps are implemented:
[0116] Step A1, regularly collecting historical sequence data of a preset indicator within a first preset time period, analyzing and calculating the historical sequence data based on a preset analysis algorithm, and generating and saving a parameter range set of the preset indicator;
[0117] For example, historical series data of each preset indicator is collected at a fixed time point every day. The first preset time period can be 14 days or 21 days before the current time point, and the historical series data includes the historical collection values corresponding to all collection time points in the first preset time period. The time granularity of the historical series data of different indicators may be the same or different.
[0118] For example, taking the indicator "time spent accessing service" as an example, the electronic device starts to obtain the historical collection values of this indicator at all collection time points from 0:00 on February 16, 2020 to 24:00 on February 29, 2020 at early morning every day (0:00 on March 1, 2020).
[0119] After the electronic device 1 collects the historical sequence data of each preset indicator, it is necessary to analyze and predict the historical sequence data to obtain the parameter range of each preset indicator for subsequent abnormality detection.
[0120] Step A2, collecting real-time data of the indicator to be detected according to a preset collection frequency, and recording the real-time data of the indicator to be detected and the collection time point;
[0121] It is understandable that the collection frequency (i.e., collection time point) of each preset indicator needs to be preset. For example, the collection frequency of indicator A is once every 1 minute, and the collection frequency of indicator B is once every 5 minutes. The electronic device 1 collects real-time data of indicator A every 1 minute, collects real-time data of indicator B every 5 minutes, and records the real-time data and collection time point of each indicator.
[0122] Step A3, determining the target time window corresponding to the indicator to be detected according to the acquisition time point, and selecting the target parameter range corresponding to the target time window of the indicator to be detected from the parameter range set;
[0123] It is understandable that different indicators correspond to different parameter ranges, and the parameter ranges corresponding to the same indicator in different time periods (time windows) are also different. In this embodiment, first, the parameter range corresponding to the indicator to be predicted is obtained from the pre-calculated and saved parameter range set as the first subset; then, the target time window corresponding to the indicator to be predicted is determined according to the acquisition time point, and the parameter range corresponding to the target time window is screened out from the first subset as the second subset; finally, the second subset is used as the target parameter range corresponding to the indicator to be detected at the acquisition time point.
[0124] In the process of calculating the parameter range, the parameter range corresponding to each time window is calculated with a time window of preset step size. Therefore, the time window described in this embodiment is consistent with the time window in the process of calculating the parameter range.
[0125] In this embodiment, the parameter range set includes parameter ranges corresponding to different preset indicators in different time windows, and the step length of the time window is less than the length of the time window. Preferably, the length of the time window is 30 minutes and the step length is 15 minutes, that is, within a day, one indicator corresponds to 96 time windows, respectively corresponding to 96 parameter ranges.
[0126] Taking the collection time point of indicator A as 10:25 as an example, there are two time windows including the collection time point, namely: 10:00-10:30 and 10:15-10:45, so these two time windows are the target time windows corresponding to the collection time point. First, all parameter ranges corresponding to indicator A are filtered out from the parameter range set to generate the parameter range subset of indicator A. Then, the parameter ranges corresponding to these two target time windows are filtered out from the parameter range subset of indicator A as the target parameter ranges corresponding to indicator A at the collection time point of 10:25.
[0127] In other embodiments, the length and step size of the time window may be adjusted according to actual conditions. For example, the step size of the time window may be 10 minutes. Then each acquisition time point corresponds to 3 target time windows, i.e., 3 parameter ranges, which will not be described in detail.
[0128] Step A4, comparing the real-time data with the target parameter range to determine whether the real-time data exceeds the target parameter range;
[0129] In this embodiment, determining whether the real-time data exceeds the target parameter range includes:
[0130] Respectively obtain parameter ranges corresponding to different target time windows in the target parameter range, and obtain the intersection of the parameter ranges corresponding to the different target time windows;
[0131] Determining whether the real-time data belongs to the intersection of parameter ranges corresponding to the different target time windows; and
[0132] If so, it is determined that the real-time data does not exceed the target parameter range; if not, it is determined that the real-time data exceeds the target parameter range.
[0133] Taking indicator A as an example, obtain the real-time data collected by indicator A at 10:25, obtain the parameter ranges corresponding to the two target time windows respectively, and take the intersection T of the parameter ranges corresponding to the two target time windows. If the real-time data belongs to the intersection T, that is, the real-time data belongs to the parameter ranges corresponding to different target time windows at the same time, then it is judged that the real-time data of indicator A does not exceed the target parameter range. If the real-time data does not belong to the intersection T, then it is judged that the real-time data of indicator A exceeds the target parameter range.
[0134] Step A5: when it is determined that the real-time data exceeds the target parameter range, it is determined that the indicator to be detected is abnormal at the collection time point, and a prompt message is sent to a preset terminal.
[0135] If the real-time data exceeds the target parameter range, it is considered that the indicator is abnormal or the risk of abnormality is high, and an early warning message needs to be sent to the preset terminal (for example, the terminal used by system operation and maintenance personnel) to prompt the abnormal indicator to be processed.
[0136] Considering that short-term abnormalities of some indicators are normal, alarm filtering and compression are required. In other embodiments, when it is determined that the real-time data exceeds the target parameter range, it is determined that the indicator to be detected is abnormal at the collection time point, including:
[0137] When it is determined that the real-time data exceeds the target parameter range, determining whether the indicator to be detected meets a preset condition; and
[0138] When the indicator to be detected does not meet the preset condition, the abnormality is recorded, and the real-time data of the next collection time point is repeatedly collected for abnormality analysis; when the indicator to be detected meets the preset condition, abnormal alarm information is generated and fed back to the preset terminal.
[0139] In this embodiment, the preset condition includes: the preset indicator matches a predetermined list containing designated indicators (indicators to be filtered for alarms), and the preset indicator has a continuous abnormal number of times exceeding a first preset threshold (e.g., 10 times) within a second preset time period (e.g., within 30 minutes). When the above preset conditions are met, 10 abnormalities are sent to the operation and maintenance personnel as a time in a preset form (e.g., email).
[0140] In other embodiments, when the processor 12 executes the program code of the indicator abnormality analysis program 10, the following steps are also implemented:
[0141] Receiving feedback information sent by the preset terminal, including: a correct alarm or an alarm error;
[0142] When the feedback information indicates that the alarm is correct, marking the real-time data as abnormal data; and
[0143] When the feedback information is an alarm error, the target parameter range corresponding to the indicator to be detected at the collection time point is adjusted according to the real-time data.
[0144] For example, if the operation and maintenance personnel responds to the abnormal alarm of indicator A and the alarm is correct, it means that the real-time data at the current collection time point is abnormal, and the current real-time data is labeled "abnormal". In the subsequent calculation of the parameter range, the abnormal data points are deleted from the historical data to avoid data interference and improve the accuracy of the parameter range. If the operation and maintenance personnel respond to the abnormal alarm of indicator A and the alarm is wrong, it means that the target parameter range corresponding to the current real-time data is incorrect and needs to be adjusted to avoid similar false alarms in the future.
[0145] Optionally, in other embodiments, the indicator anomaly analysis program 10 can also be divided into one or more modules, one or more modules are stored in the memory 11, and executed by one or more processors 12 to complete the present invention. The module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions.
[0146] For example, refer to Figure 3 As shown, Figure 2 Schematic diagram of the program modules of the indicator abnormality analysis program 10.
[0147] In an embodiment of the indicator abnormality analysis program 10, the indicator abnormality analysis program 10 includes: modules 110-150, wherein:
[0148] The calculation module 110 is used to periodically collect historical sequence data of a preset indicator within a first preset time period, analyze and calculate the historical sequence data based on a preset analysis algorithm, and generate and save a parameter range set of the preset indicator;
[0149] The collection module 120 is used to collect real-time data of the indicator to be detected according to a preset collection frequency, and record the real-time data of the indicator to be detected and the collection time point;
[0150] A screening module 130, configured to screen out the target parameter range corresponding to the preset indicator at the collection time point from the parameter range set;
[0151] A judgment module 140 is used to compare the real-time data with the target parameter range to determine whether the real-time data exceeds the target parameter range; and
[0152] The early warning module 150 is used to determine that the indicator to be detected is abnormal at the collection time point when it is determined that the real-time data exceeds the target parameter range, and send a prompt message to a preset terminal.
[0153] The functions or operation steps implemented by the modules 110-150 are similar to those described above and will not be described in detail here.
[0154] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, wherein the computer-readable storage medium includes an indicator abnormality analysis program 10, and when the indicator abnormality analysis program 10 is executed by a processor, any step of the indicator abnormality analysis method is implemented. The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the above method embodiment, and will not be repeated here.
[0155] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0156] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.
[0157] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0158] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0159] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for analyzing abnormal indicators, applicable to electronic devices, characterized in that: The method includes: Periodically collect historical sequence data of a preset indicator within a first preset time period, analyze and calculate the historical sequence data based on a preset analysis algorithm, generate and save a parameter range set of the preset indicator, wherein the parameter range set includes parameter ranges corresponding to different preset indicators in different time windows, and the step length of the time window is less than the length of the time window; Collect real-time data of the indicator to be detected according to the preset collection frequency, and record the real-time data of the indicator to be detected and the collection time point; Determine the target time window corresponding to the indicator to be detected according to the acquisition time point, and filter out the target parameter range corresponding to the target time window of the indicator to be detected from the parameter range set; Comparing the real-time data with the target parameter range to determine whether the real-time data exceeds the target parameter range; and When it is determined that the real-time data exceeds the target parameter range, it is determined that the indicator to be detected is abnormal at the collection time point, and a prompt message is sent to a preset terminal; Receive feedback information sent by the preset terminal, and when the feedback information indicates that the alarm is correct, mark the real-time data as abnormal data; when the feedback information indicates that the alarm is wrong, adjust the target parameter range corresponding to the indicator to be detected at the collection time point according to the real-time data; Wherein, the preset analysis algorithm includes: a first preset analysis algorithm, a second preset analysis algorithm and a third preset analysis algorithm, and the historical sequence data is analyzed and calculated based on the preset analysis algorithm to generate and save the parameter range set of the preset indicator, including: classifying the preset indicator according to the historical sequence data and the preset classification algorithm to determine the indicator type of the preset indicator; when the preset indicator is a working day periodic indicator, calling the first preset analysis algorithm to analyze and calculate the historical sequence data to obtain the parameter range of each preset indicator in the working day periodic indicator; when the preset indicator is a non-working day periodic indicator, calling the second preset analysis algorithm to analyze and calculate the historical sequence data to obtain the parameter range of each preset indicator in the non-working day periodic indicator; and when the preset indicator is a non-periodic indicator, calling the third preset analysis algorithm to analyze and calculate the historical sequence data to obtain the parameter range of each preset indicator in the non-periodic indicator; The first preset analysis algorithm includes: obtaining historical data of the preset indicator within a third preset time from the historical sequence data as the first initial training data; smoothing the first initial training data to generate a first matrix as the first target training data; adding and averaging the data at the same time corresponding to each day in the first target training data, and generating a second matrix corresponding to the first target training data; generating a third matrix corresponding to the first target training data based on the first matrix and the second matrix; dividing the third matrix according to the preset time window, and arranging the residual values of each time window into a column to obtain a fourth matrix; dividing the first matrix according to the preset time window, and arranging the values of each time window into a column to obtain a fifth matrix, and calculating the mean and standard deviation of the fifth matrix by column; and calculating the confidence interval corresponding to each time window respectively, and using the confidence interval as the parameter range.
2. The abnormality analysis method according to claim 1, characterized in that: The determining whether the real-time data exceeds the target parameter range includes: Respectively obtain parameter ranges corresponding to different target time windows in the target parameter range, and obtain the intersection of the parameter ranges corresponding to the different target time windows; Determining whether the real-time data belongs to the intersection of parameter ranges corresponding to the different target time windows; and If so, it is determined that the real-time data does not exceed the target parameter range; if not, it is determined that the real-time data exceeds the target parameter range.
3. The method for analyzing abnormal indicators according to claim 2, characterized in that: When it is determined that the real-time data exceeds the target parameter range, determining that the indicator to be detected is abnormal at the collection time point includes: When it is determined that the real-time data exceeds the target parameter range, determining whether the indicator to be detected meets a preset condition, wherein the preset condition includes: the indicator to be detected matches a predetermined list containing designated indicators, and the number of consecutive abnormalities of the preset indicator within a second preset time period exceeds a first preset threshold; and When the indicator to be detected does not meet the preset condition, the abnormality is recorded, and the real-time data of the next collection time point is repeatedly collected for abnormality analysis; when the indicator to be detected meets the preset condition, abnormal alarm information is generated and fed back to the preset terminal.
4. The method for analyzing abnormal indicators according to claim 1, characterized in that: The first initial training data is smoothed using a local weighted regression algorithm.
5. An electronic device, characterized in that: The device includes a memory and a processor, wherein the memory stores an indicator abnormality analysis program that can be run on the processor, and when the indicator abnormality analysis program is executed by the processor, the indicator abnormality analysis method according to any one of claims 1 to 4 is implemented.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes an indicator anomaly analysis program, and when the indicator anomaly analysis program is executed by a processor, the indicator anomaly analysis method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Detecting method and device for abnormal data of diseases as well as computer device and storage medium
CN108320810A
Service anomaly warning method and device based on time sequence
CN108920336A
Time sequence anomaly detection method and device
CN109871401A
Data cleaning method and device
WO2018126367A1
