Abnormality identification method for time series data
By performing differential and clustering processing on time series data, abnormal data points are identified, which solves the problem of poor abnormality identification accuracy in the existing technology and achieves fast response and low-cost abnormality monitoring effects.
Patent Information
- Application Number
- CN202410913854.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-09-27
AI Technical Summary
Existing technologies have problems with poor accuracy in anomaly identification of time series data. In particular, due to the volatility of indicator data, there is a lag in the update of anomaly detection standards, which affects the identification effect.
By extracting multiple data point sequences and calculating first-order difference values, clustering is performed to identify whether the data point sequence is an isolated sequence, thereby determining whether it is abnormal data, thereby improving the accuracy of anomaly identification without determining the anomaly detection threshold. .
This method can dynamically adjust anomaly detection standards without relying on manual configuration of thresholds, quickly identify abnormal changes in indicators, improve the accuracy and responsiveness of abnormal identification of time series data, and reduce management costs.
Smart Images

Figure CN118709113A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a method for identifying anomalies in time series data, an apparatus for identifying anomalies in time series data, a computer-readable medium, an electronic device, and a computer program product. Background Art
[0002] In business processes executed through computer devices, there are a large number of monitorable indicator data (for example, order volume in retail scenarios), and abnormal changes in these indicators may be a harbinger of important business problems. Therefore, it is necessary to monitor these indicators on a regular basis.
[0003] Existing solutions mainly rely on manual threshold configuration for indicator monitoring, including the constant threshold method with fixed parameters as the abnormal standard and the relative threshold method with interval range as the abnormal standard. Through manual configuration or through artificial intelligence model prediction, the indicator reference value (or interval range) can be obtained as the threshold for abnormal detection.
[0004] Due to the volatility of indicator data, in order to avoid unreasonable threshold configuration, it is necessary to continuously update the anomaly detection standard. However, there is a certain lag in the update of the anomaly detection standard, which leads to poor anomaly recognition accuracy. Summary of the invention
[0005] The present application provides a method for identifying anomalies in time series data, an apparatus for identifying anomalies in time series data, a computer-readable medium, an electronic device, and a computer program product, the purpose of which is to improve the accuracy of identifying anomalies in time series data.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of an embodiment of the present application, a method for identifying anomalies in time series data is provided, the method comprising: extracting multiple data point sequences from the time series data according to a preset detection length, the detection length being the minimum sequence length for performing anomaly detection on the time series data; calculating first-order difference values for the data point sequences according to at least two different differential distances, to obtain multiple differential value sequences; clustering the data point sequences and the differential value sequences, to obtain multiple clustering results, the clustering results being used to indicate whether each of the data point sequences and each of the differential value sequences is an isolated sequence; and identifying whether the data point sequence at the current time node is abnormal data according to the multiple clustering results.
[0008] According to one aspect of an embodiment of the present application, a device for identifying anomalies in time series data is provided, the device comprising:
[0009] An extraction module is configured to extract multiple data point sequences from the time series data according to a preset detection length, wherein the detection length is a minimum sequence length for performing anomaly detection on the time series data;
[0010] A calculation module is configured to calculate first-order difference values of the data point sequence according to at least two different difference distances to obtain multiple difference value sequences;
[0011] a clustering module configured to perform clustering processing on the data point sequence and the differential value sequence respectively to obtain a plurality of clustering results, wherein the clustering results are used to indicate whether each of the data point sequence and each of the differential value sequence is an isolated sequence;
[0012] The identification module is configured to identify whether the data point sequence at the current time node is abnormal data based on the multiple clustering results.
[0013] In some embodiments of the present application, based on the above technical solution, the extraction module includes:
[0014] A cycle acquisition module is configured to acquire a time series cycle of the time series data, wherein the time series cycle is a minimum time cycle for describing a law of value variation of the time series data;
[0015] a length determination module, configured to determine a detection length for performing anomaly detection according to the timing cycle and a preset extraction ratio;
[0016] The sequence extraction module is configured to extract multiple data point sequences from the time series data according to the detection length, the sequence length of each data point sequence is the detection length, and each data point sequence is at the same period node in the time series period.
[0017] In some embodiments of the present application, based on the above technical solution, the period acquisition module includes:
[0018] A data aggregation module is configured to perform aggregation processing on the time series data according to a preset sliding window and sliding step size to obtain aggregated time series data;
[0019] a periodicity detection module, configured to perform periodicity detection on the aggregated time series data to obtain a candidate period corresponding to the sliding window;
[0020] The period determination module is configured to determine the candidate period as the timing period of the time series data when the sliding window matches the candidate period.
[0021] In some embodiments of the present application, based on the above technical solution, the periodicity detection module is further configured to: map the aggregated time series data from the time domain space to the frequency domain space to obtain the distribution frequency of the aggregated time series data in the frequency domain space; if the distribution frequency successfully matches the sliding window, determine the candidate period corresponding to the sliding window according to the distribution frequency; if the distribution frequency fails to match the sliding window, calculate the fundamental frequency and autocorrelation score of the aggregated time series data according to the autocorrelation function, and when the autocorrelation score is greater than a preset score threshold, determine the candidate period corresponding to the sliding window according to the fundamental frequency.
[0022] In some embodiments of the present application, based on the above technical solution, the device further includes:
[0023] The aggregation module is configured to use the time series period as a sliding window and perform aggregation processing on the time series data according to a preset sliding step to obtain aggregated time series data.
[0024] In some embodiments of the present application, based on the above technical solution, the device further includes:
[0025] The smoothing processing module is configured to perform polynomial fitting on the data point sequence according to a preset smoothing processing window to obtain a smoothed data point sequence, wherein the window size of the smoothing processing window is larger than the differential distance.
[0026] In some embodiments of the present application, based on the above technical solution, the device further includes:
[0027] A sequence selection module is configured to respectively calculate the sequence similarity between each data point sequence and the data point sequence at the current time node;
[0028] A plurality of data point sequences and a differential value sequence corresponding to the data point sequences are selected for clustering processing according to the sequence similarity.
[0029] In some embodiments of the present application, based on the above technical solution, the clustering module is further configured to: cluster the data point sequence according to a preset number of clustering clusters to obtain a target clustering cluster corresponding to the data point sequence where the current time node is located; if the number of elements of the target clustering cluster is equal to one, determine that the data point sequence where the current time node is located is an isolated sequence; if the number of elements of the target clustering cluster is greater than one, increase the number of clustering clusters and continue to cluster the data point sequence until the preset upper limit of the number of clustering clusters is reached.
[0030] In some embodiments of the present application, based on the above technical solution, the identification module is further configured to: obtain the number of isolated results in the multiple clustering results, the isolated result indicates that the data point sequence or differential value sequence corresponding to the current time node is identified as an isolated sequence in the clustering results; if the number of isolated results is greater than one half of the total number of clustering results, then determine that the data point sequence where the current time node is located is abnormal data; if the number of isolated results is greater than zero and less than one half of the total number of clustering results, then identify whether the data point sequence where the current time node is located is abnormal data based on the number of cluster clusters corresponding to the isolated results.
[0031] In some embodiments of the present application, based on the above technical solution, the identification module is further configured to: determine a quantity threshold based on a preset upper limit on the number of clusters and a preset quantity ratio; if the number of clusters corresponding to the isolated result is less than the quantity threshold, then determine that the data point sequence at the current time node is abnormal data.
[0032] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for identifying anomalies in time series data in the above technical solution is implemented.
[0033] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to implement the anomaly identification method for time series data as in the above technical solution.
[0034] According to one aspect of an embodiment of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method for identifying anomalies in time series data in the above technical solution.
[0035] In the technical solution provided in the embodiment of the present application, multiple data point sequences are extracted from the time series data according to a preset detection length, and first-order differential values are calculated for the data point sequences according to at least two different differential distances to obtain multiple differential value sequences; multiple clustering results are obtained by clustering the data point sequences and the differential value sequences respectively, and whether the data point sequence at the current time node is abnormal data can be identified according to the multiple clustering results. The embodiment of the present application can improve the accuracy of abnormal data identification without determining an abnormal detection threshold.
[0036] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0038] Figure 1 The exemplary system architecture block diagram applying the technical solution of the present application is schematically shown.
[0039] Figure 2 A flowchart of a method for identifying anomalies in time series data in one embodiment of the present application is shown.
[0040] Figure 3 A flowchart for extracting a data point sequence in one embodiment of the present application is shown.
[0041] Figure 4 The data aggregation principle of an embodiment of the present application in an application scenario is shown.
[0042] Figure 5 It shows a plurality of periodic time point sequences extracted from an application scenario according to an embodiment of the present application.
[0043] Figure 6 A schematic diagram showing an embodiment of the present application using a curve change angle as a numerical value change rate in an application scenario.
[0044] Figure 7 A flowchart of anomaly identification in an application scenario in an embodiment of the present application is shown.
[0045] Figure 8 The structural block diagram of the anomaly identification device for time series data provided by an embodiment of the present application is schematically shown.
[0046] Fig. 9 The structure block diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0048] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0049] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0050] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0051] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0052] Figure 1 The exemplary system architecture block diagram applying the technical solution of the present application is schematically shown.
[0053] like Figure 1As shown, the system architecture 100 may include a terminal device 110, a network 120 and a server 130. The terminal device 110 may include various electronic devices such as smart phones, tablet computers, laptops, desktop computers, smart speakers, smart wearable devices, smart vehicle-mounted devices, and smart payment terminals. The server 130 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The network 120 may be a communication medium of various connection types that can provide a communication link between the terminal device 110 and the server 130, such as a wired communication link or a wireless communication link.
[0054] According to the implementation requirements, the system architecture in the embodiment of the present application can have any number of terminal devices, networks and servers. For example, the server 130 can be a server group composed of multiple server devices. In addition, the technical solution provided in the embodiment of the present application can be applied to the terminal device 110, can also be applied to the server 130, or can be implemented by the terminal device 110 and the server 130 together, and the present application does not make any special restrictions on this.
[0055] In the related technology of the present application, the indicator monitoring mainly relies on the manual threshold configuration, which can be further divided into the constant threshold method and the relative threshold method.
[0056] The constant threshold method sets fixed parameters as abnormal standards, for example, the order volume does not exceed 100 orders / minute and is not less than 1 order / minute.
[0057] The relative threshold method is based on the value of a statistical indicator (such as the mean, median, etc.) within a certain range of data (weekly year-on-year, daily year-on-year, etc.), or a reference value (such as predicted by a model), plus an upper and lower interval (fixed value or percentage) as the abnormality standard. For example, the average order volume in the same time period over the past 7 days is 100 orders / minute, and 50% is selected as the interval ratio. It is calculated that 50-150 orders / minute is a reasonable interval, otherwise it will be identified as an abnormality.
[0058] Statistical methods are easily affected by extreme data, resulting in unreasonable values, which in turn lead to misidentification / missed identification problems. For example: if the historical data of an indicator belongs to two clusters, the values are only 0 or 1 and are evenly distributed, then the calculated average value is 0.5. When the threshold range is small and does not cover 0 / 1, it will cause a large number of alarms, and 0.5, which should be an abnormal value, cannot be identified. Other direct statistical methods also have similar problems. Using models to calculate predicted values takes a long time and cannot solve the problem of unreasonable single predicted values. For example, in the above example, whether the prediction is 0 or 1, it may cause another type of value to be misidentified.
[0059] If the constant threshold is configured manually, the labor cost will be high and management will be difficult. The other methods mentioned above also have similar problems. Taking the order volume as an example, an important feature of this indicator is that the volume is large and the fluctuation is large during the day, while the volume is small and the fluctuation is small at night. If the absolute difference is used as the threshold standard, it will affect the recognition effect. If the percentage threshold method is used, it may cause two indicators with the same fluctuation range to have different threshold widths calculated due to different current prediction values, which is also an unreasonable assumption. This will inevitably lead to the need to manually set multiple sets of threshold modes for a single indicator, and the management cost will also rise rapidly with the number and complexity of indicators.
[0060] Similar problems also exist when using artificial intelligence models to obtain prediction values. Most of these models are limited to predicting specific indicators, so a large number of pre-trained models need to be managed. This leads to high initial investment costs and a large amount of data required. After the function is launched, new models need to be continuously trained and stored as indicators increase.
[0061] Existing methods lack the ability to respond quickly to changes in indicators. In actual applications, indicators may fluctuate greatly with business events. For example, a promotional activity causes the order volume to increase within 12 hours, but it returns to its original state after 12 hours; for another example, the order volume increases to a new level due to the addition of a new sales channel. In the former example, a large amount of misidentification information may appear before and after the two changes, and the records of these 12 hours may affect the calculation of subsequent prediction values; in the latter example, the current method requires a large amount of data (i.e. time) to adjust the prediction value to a new level (or retrain the model).
[0062] In response to the problems existing in the above-mentioned related technologies, the present application aims to provide a method for quickly monitoring the above-mentioned indicators based on historical data, which can distinguish between normal numerical fluctuations and abnormal changes in the indicators, and quickly learn and self-adjust the change patterns that have been marked as normal in history, and comprehensively prompt the indicator monitoring efficiency.
[0063] Regarding the model and threshold management issues, the technical solution of this application does not involve training deep models, so there is no upfront cost. Since the indicator anomaly judgment is made by dynamic comparison with historical data, the performance of the indicator in each time period can be dynamically adjusted, so there is no manual threshold configuration step and subsequent management issues. All algorithm parameters (only a small number) are global common parameters, so they will not increase due to the increase in the number of monitored indicators or complexity.
[0064] Regarding the issue of indicator changes, if an event that causes an indicator change has occurred in history, it will inevitably be taken into consideration in unsupervised clustering, and therefore will be regarded as an event that "has occurred" and not identified as an anomaly. This process gives the technical solution of the present application the ability to quickly learn indicator fluctuation patterns that have occurred. When choosing similar curves for comparison, the technical solution of the present application will tend to take comparison objects both above and below the current data point, further enhancing its ability to identify systematic fluctuations. The same comparison process will be applied to the indicator data itself, as well as its differential value and angle value, in order to more comprehensively distinguish potential outliers from reasonable small fluctuations.
[0065] In response to the problem of predictive value selection, the indicator monitoring method proposed in this application does not calculate the predicted value as the abnormality judgment standard, but compares the current indicator data with the most similar batch of indicator data in history, and uses its performance in the K-means clustering algorithm to make an abnormality judgment. This method can more reasonably observe whether the current data performance has appeared in historical data, and identify indicator anomalies based on the standard of "existence is reasonable" in history.
[0066] The abnormality monitoring system proposed in the embodiment of the present application can be roughly divided into the following three stages: data preprocessing, most similar curve identification, and abnormality identification.
[0067] When the indicator is cyclical, the current data is compared year-on-year, that is, it is assumed that the performance of the indicator in the same period (such as the same time of day) should be relatively consistent. The criterion of the anomaly itself is to determine whether the currently observed indicator value pattern has appeared in the historical data. It should be noted that because the indicator value may exist in multiple intervals, it is not necessary to compare all historical data, but only select close examples for comparison. Anomaly identification itself is completed by an unsupervised clustering algorithm, that is, it is assumed that a non-abnormal point can be effectively clustered in the same cluster with at least one historical data.
[0068] If there is no periodicity, a month-on-month comparison (such as the past 24 hours) is performed. At this time, there is no need to select the most similar curve. It can be assumed that the values of such data are relatively stable after window aggregation, and the clustering algorithm can be directly applied.
[0069] For example, if an abnormal order volume indicator is identified at 9 am on a certain day, the historical data of the past two months is traced back to the data at 9 am in the 20 days in the nearly 3-hour window (6am-9am) that are most similar to the indicator change pattern of today, and unsupervised clustering is performed on the above 20 (historical) + 1 (today) data points to check whether the data point of today is isolated.
[0070] The following is a detailed description of the technical solutions such as the time series data anomaly identification method, time series data anomaly identification device, computer-readable medium, electronic device, and computer program product provided by the present application in conjunction with specific implementation methods.
[0071] Figure 2 A flowchart of a method for identifying anomalies in time series data in one embodiment of the present application is shown. Figure 2 As shown, the method includes the following steps S210 to S240.
[0072] In step S210, multiple data point sequences are extracted from the time series data according to a preset detection length, where the detection length is a minimum sequence length for performing anomaly detection on the time series data.
[0073] For example, if the current time node is 10 a.m. and the detection length is 3 hours, then the data point sequence for the current time node extracted from the time series data is a sequence composed of data points between 7 a.m. and 10 a.m. Based on the same extraction method, a large number of data point sequences can be extracted within the historical time range, and the sequence length of each data point sequence is the detection length.
[0074] Figure 3 FIG. 1 shows a flowchart of extracting a data point sequence in one embodiment of the present application. Figure 3 As shown, based on the above embodiment, extracting multiple data point sequences from the time series data according to a preset detection length in step S210 may include the following steps S211 to S213.
[0075] In step S211, the time series period of the time series data is obtained, where the time series period is the minimum time period used to describe the numerical variation law of the time series data.
[0076] The time series period is the minimum time period determined by periodic detection to describe the numerical change pattern of time series data. For example, the sales volume data of goods shows a periodic numerical change pattern over time.
[0077] In one embodiment of the present application, a method for obtaining a timing period of time series data includes: aggregating the time series data according to a preset sliding window and sliding step to obtain aggregated time series data; performing periodic detection on the aggregated time series data to obtain a candidate period corresponding to the sliding window; when the sliding window matches the candidate period, determining the candidate period as the timing period of the time series data.
[0078] Due to the high sampling frequency of the original data, the indicator performance may be relatively sparse, that is, there are a large number of 0 values, which results in the original indicator itself having no available periodicity. For example, the order of commodity A can only be processed within 5 minutes after each hour. In this case, among the 60 minutes / 5 minutes = 12 original data points per hour, only one data point has a value, and the other data points are 0. To deal with this problem, the indicator data can be aggregated with a sliding window (that is, the data analysis frequency and data analysis width are determined). The aggregated data no longer has the above-mentioned sparse characteristics and can be periodically identified. If the nature of the indicator has not changed significantly, the test only needs to be performed once, and the existing results can be retrieved later. If there is a major business change, re-testing is required. The interval of the sliding window (that is, the data analysis frequency) should be based on the original data as much as possible (that is, the data sampling frequency), but the small intervals of less than 30 minutes should be supplemented to 30 minutes to ensure that the data points per day are less than 48, so as to achieve a trade-off between processing speed and processing accuracy.
[0079] For example, first you need to specify a default cycle target, such as a daily cycle. In actual use, the target cycle is part of the business knowledge and can be configured by the user. Among the reasonable widths preset by the algorithm (2 hours, 4 hours, 6 hours, etc.), select a minimum value as the sliding window width (i.e., data analysis width), and aggregate the original data according to this width and a certain data analysis frequency (which can be the same as the data sampling frequency). Taking a width of 2 hours and a frequency of 30 minutes as an example, each time you need to sum 2 hours * 60 minutes / 5 minutes = 24 data points in the original data, each summation interval is 30 minutes / 5 minutes = 6 data points, that is, the first data point after aggregation is the sum of the 1-24 bits of the original data, the second data point is the sum of the 7-30 bits, and so on. Check whether the aggregated data meets the periodicity. If not, determine the next alternative width. If all reasonable widths are not met, the maximum width is taken by default, but the conclusion of no periodicity is retained.
[0080] Figure 4 The data aggregation principle of the embodiment of the present application in an application scenario is shown. Figure 4As shown, if the aggregation starts from the data at 9:00 on January 1, the first data point is the total order volume from 9:00 to 11:00 on January 1, the next data point is the total order volume from 9:30 to 11:30 on January 1, and so on.
[0081] In one embodiment of the present application, a periodicity detection is performed on the aggregated time series data, including: mapping the aggregated time series data from the time domain space to the frequency domain space to obtain the distribution frequency of the aggregated time series data in the frequency domain space; if the distribution frequency successfully matches the sliding window, determining the candidate period corresponding to the sliding window based on the distribution frequency; if the distribution frequency fails to match the sliding window, calculating the fundamental frequency and autocorrelation score of the aggregated time series data based on the autocorrelation function, and when the autocorrelation score is greater than a preset score threshold, determining the candidate period corresponding to the sliding window based on the fundamental frequency.
[0082] For example, the embodiment of the present application first uses Fast Fourier Transform (FFT) to extract the frequency of the data. When the amount of data is large, this is the fastest algorithm for identifying periodicity. FFT can directly use the entire set of data as input to obtain the possible cycle width (i.e., the number of data points in each cycle). The embodiment of the present application can check whether the selected width matches the most likely width identified by FFT. If so, the periodicity can be directly confirmed; if not, the autocorrelation function (ACF) is used to calculate the autocorrelation score (using the entire set of data, with a reasonable width as the ACF delay). When this score is higher than a certain threshold, it can also be concluded that the width can obtain the best data periodicity.
[0083] Figure 5 FIG. 1 shows multiple periodic time point sequences extracted from an application scenario in an embodiment of the present application. Figure 5 As shown, each time point sequence constitutes a numerical curve with a daily period.
[0084] In step S212, a detection length for abnormality detection is determined according to the timing cycle and a preset extraction ratio.
[0085] For example, suppose that the order volume shows an upward trend in the morning of each day in the early part of each month, a downward trend in the late part of the month, and stability in the middle of the month. When judging anomalies, a data point located in the morning of a certain day in the early part of a month should only be compared with other historical year-on-year data with an upward trend. Therefore, in order to capture this upward trend, a certain comparison width (i.e., detection length) must be allowed to determine that the historical data is similar to the data of the current time. In the embodiment of the present application, this comparison width is corresponded to the preset indicator period, and one quarter is taken. That is, if the indicator data is a daily cycle, the comparison width is 6 hours (6*60 / 30=12 aggregated data points), which is used as the basis for subsequent calculations.
[0086] In step S213, multiple data point sequences are extracted from the time series data according to the detection length, the sequence length of each data point sequence is the detection length, and each data point sequence is at the same period node in the time series period.
[0087] After specifying the detection length, trace back the data of this length from the current time point to cut a curve segment as the data point sequence at the current time point. At the same time, the data point sequence corresponding to the same period node can be extracted from the historical data. For example, if the current time point is 9:00 on March 1, if the detection length is 6 hours, the data point sequence at the current time node is the data point sequence from 3:00 to 9:00. If the time series period is 24 hours, the data point sequence from 3:00 to 9:00 every day is extracted from the historical data of the previous 60 days.
[0088] In one embodiment of the present application, before extracting multiple data point sequences from time series data according to the detection length, the time series data is aggregated according to a preset sliding step size using a time series period as a sliding window to obtain aggregated time series data.
[0089] If there are identified anomalies in the historical data, they should be removed, otherwise the clustering algorithm may aggregate two identical anomalies and fail to identify the anomaly. The embodiment of the present application provides a correction value after each anomaly is identified, which can be safely applied in subsequent clustering.
[0090] In actual business applications, each alarm point will be pushed to the person who pays attention to the indicator, and inappropriate alarm points will be re-recorded as normal. Only the confirmed historical alarm point data will be replaced to prevent interference with the algorithm. When a data point similar to the previous inappropriate alarm appears in the subsequent data, the data point is not easily isolated by the clustering algorithm (because there are similar points in history), thus achieving an adaptive effect.
[0091] Replace the original data with the data aggregated in the previous step, check the labels of the historical data, and replace the identified anomalies with the recorded corrected values (because the data has been aggregated, the overall replacement needs to be done in units of the aggregated data window). The current time point data is not replaced with the corrected value because its label and corrected value have not yet been calculated.
[0092] In step S220, first-order difference values are calculated for the data point sequence according to at least two different difference distances to obtain a plurality of difference value sequences.
[0093] In order to better evaluate whether a data point is an outlier, in addition to the data value itself, the indicator change trend should also be analyzed to see if it is abnormal. Since the aggregated indicator data may not be differentiable, the first-order difference is used for this evaluation. In order to reflect the rate of change of the indicator at different time lengths, the embodiment of the present application can calculate the difference between it and the previous 1-3 data points. Perform differential calculation on each data point, and take the difference between it and the previous 1-3 data points and store them.
[0094] For example, the first-order difference value is calculated between each data point and a data point of the nearest neighbor to obtain a first difference value sequence; the first-order difference value is calculated between each data point and a data point of the second nearest neighbor to obtain a second difference value sequence; the first-order difference value is calculated between each data point and a data point of the third nearest neighbor to obtain a third difference value sequence.
[0095] For example, the current data point is the total order volume from 7:00 to 9:00 on March 1 after aggregation. The first-order difference values between the current data point and the previous point (6:30-8:30), the previous two points (6-8), and the previous three points (5:30-7:30) are calculated respectively.
[0096] Because the window width (data analysis width) with the best periodicity detected by each indicator is different, and the numerical values of each indicator are different, the difference values calculated in the previous step are very different. In order to ensure the stability of the subsequent steps, it can be converted into a ratio relative to the extreme value of the indicator. That is, the first-order difference value is divided by the corresponding time difference to obtain the value change rate, so as to eliminate the abnormal identification standard deviation caused by the absolute value difference.
[0097] Figure 6 A schematic diagram showing an embodiment of the present application using a curve change angle as a numerical value change rate in an application scenario.
[0098] like Figure 6As shown, if the data is plotted as a line graph, the length of the y-axis is fixed to 1, corresponding to the interval from 0 to the maximum value of the indicator, and the interval between each data point on the x-axis is fixed to 1, then the above rate of change is the arctangent value of the angle between the line segment between the data points and the positive x-axis. This angle calculation is more intuitive and easier to understand in the trend charts commonly used in business. The asymptotic characteristics of the inverse tangent function also have a better tolerance for extreme values.
[0099] In one embodiment of the present application, before calculating the first-order difference values of the data point sequence according to at least two different differential distances, a polynomial fitting is performed on the data point sequence according to a preset smoothing processing window to obtain a smoothed data point sequence, and the window size of the smoothing processing window is larger than the differential distance.
[0100] In the subsequent anomaly identification process, since it is necessary to compare multiple year-on-year curve segments rather than year-on-year data points, if the data is unstable (curves with many fluctuations and spikes), the effects of most similarity algorithms will be negatively affected. For example, in a curve that shows an overall downward trend, local upward fluctuations may make the absolute value of the calculated first-order norm smaller or even become a positive number. Therefore, the processed data needs to be smoothed.
[0101] The embodiment of the present application can use the Savitzky-Golay algorithm to smooth the aggregated data. According to the nature of the time series, a polynomial is used to implement the least squares fitting within a fixed and small sliding window to smooth the original curve. The window size and polynomial order of this algorithm are both adjustable parameters, and the goal is to make the smoothness of the processed data curve convenient for the calculation of the first-order norm.
[0102] In step S230, clustering processing is performed on the data point sequence and the differential value sequence respectively to obtain a plurality of clustering results, and the clustering results are used to indicate whether each data point sequence and each differential value sequence is an isolated sequence.
[0103] In one embodiment of the present application, before clustering the data point sequence and the differential value sequence respectively, the sequence similarity between each data point sequence and the data point sequence at the current time node is calculated respectively; and multiple data point sequences for clustering and the differential value sequences corresponding to the data point sequences are selected based on the sequence similarity.
[0104] The first-order norm can directly reflect the absolute distance between two curves, so it is an effective similarity evaluation function.
[0105] The first-order norm of the current data curve segment and the year-on-year segment in the historical data is calculated, and the closest segments (i.e. the smallest first-order norm) are selected as the most similar curve segments. The clustering results of the current data and these curves will be used as the standard for abnormal judgment. The number of this curve is set to 30 in the daily cycle, firstly to cover the characteristics of some monthly patterns, and secondly to ensure the balance between efficiency and accuracy.
[0106] For example, through the above process, it is found that the order volume from 3:00 to 9:00 on March 1 is most similar to the order volume from 3:00 to 9:00 on February 19, February 17, February 16, January 24, January 20, etc. The data of these dates are selected for clustering in the next step.
[0107] There is a risk in the above selection, that is, if all the selected similar curves are on the same side of the current data (the judgment standard is whether more than half of the data points are greater than / less than the corresponding position of the current data segment), the current data is an extreme value and is easily isolated in the cluster. However, such values are not necessarily outliers. For example (to keep it simple, a value is used to represent a data curve segment), take the 5 most similar curves [46, 49, 51, 52, 53], the current time node is 55, and another data point is 65, which is not selected because of its large first-order norm. It is not difficult to see that the current value 55 is most likely not an outlier.
[0108] Therefore, to prevent the clustering algorithm from identifying such situations as abnormalities, when all selected curves are on the same side of the current data, a most similar segment (if any) is selected from the other side to replace the one with the largest first-order norm (i.e., the lowest similarity) in the original result.
[0109] In one embodiment of the present application, clustering processing is performed on the data point sequence, including: clustering processing is performed on the data point sequence according to a preset number of cluster clusters to obtain a target cluster cluster corresponding to the data point sequence at the current time node; if the number of elements of the target cluster cluster is equal to one, determining that the data point sequence at the current time node is an isolated sequence; if the number of elements of the target cluster cluster is greater than one, increasing the number of cluster clusters and continuing to cluster the data point sequence until the preset upper limit of the number of cluster clusters is reached.
[0110] In this stage, an unsupervised clustering method is used to identify anomalies. The criterion is whether the clustering result isolates the current data point, that is, "outlier" detection. Because the data involved in clustering are the most similar historical data, if the current data point still cannot be effectively aggregated with a certain data, it is highly likely to be an anomaly. At the same time, because the number of similar data selected is small, the clustering algorithm can converge quickly.
[0111] For example, the embodiment of the present application can use the K-means algorithm to try to isolate the current data segment, and traverse the integers from 2 to half the number of similar curves (for example, 15 if 30 similar curves are taken) as the k value (number of clusters) of the K-means algorithm; use the first-order norm as the distance calculation standard of K-means; if at the end of any K-means cycle, the current data segment is the only element in its cluster, then the k value is returned: the current data point is an outlier (isolation is successful); otherwise, no anomaly is returned at the end of the traversal (the current data can be matched with the history). Cluster isolation identification is performed on the three differential angles calculated in the preprocessing and the data points themselves, and all results and k values are recorded.
[0112] In step S240, it is identified whether the data point sequence at the current time node is abnormal data based on the multiple clustering results.
[0113] In one embodiment of the present application, identifying whether the data point sequence at the current time node is abnormal data based on multiple clustering results includes: obtaining the number of isolated results in the multiple clustering results, the isolated result indicates that the data point sequence or differential value sequence corresponding to the current time node is identified as an isolated sequence in the clustering results; if the number of isolated results is greater than one half of the total number of clustering results, determining that the data point sequence at the current time node is abnormal data; if the number of isolated results is greater than zero and less than one half of the total number of clustering results, identifying whether the data point sequence at the current time node is abnormal data based on the number of cluster clusters corresponding to the isolated results.
[0114] In one embodiment of the present application, whether the data point sequence at the current time node is abnormal data is identified based on the number of clusters corresponding to the isolated result, including: determining a quantity threshold based on a preset upper limit of the number of clusters and a preset quantity ratio; if the number of clusters corresponding to the isolated result is less than the quantity threshold, determining that the data point sequence at the current time node is abnormal data.
[0115] For example, the above clustering process is performed on the data point sequence, the first difference value sequence, the second difference value sequence, and the third difference value sequence, respectively, to obtain 4 clustering results. Analyze the total of 4 clustering results recorded. If at least 3 results are successfully isolated, then this data point is confirmed to be an indicator anomaly; if only 1 or 2 results return anomalies, the number of clusters k needs to be analyzed: if the number of clusters is close to 2, it means that the current data point is a significant outlier, and this data point is confirmed to be an indicator anomaly; otherwise, the log is recorded but the anomaly is not identified;
[0116] The criterion for the number of clusters to be close to 2 is that at least one k value is within the first quarter of the allowable range of k values (for example, if 30 similar curves are taken, the maximum value of k is 15, the allowable range of k is 15-2=13, and the first quarter is 2+13 / 4=5.25, so when k appears to be 2, 3, 4, or 5, it is considered to be close to 2).
[0117] For the data points with abnormalities identified, the corresponding labels are recorded, and the corresponding labels of the curve with the highest similarity (smallest first-order norm) among the selected similar curves are recorded as correction values for subsequent analysis.
[0118] The indicator value and each differential angle reflect the change of the indicator under different time spans. Therefore, the embodiment of the present application uses a voting mechanism to perform anomaly determination, which can significantly improve the accuracy of anomaly identification.
[0119] In one embodiment of the present application, when the index data does not have periodicity, the first-order norm (i.e., absolute value difference) can also be used to select the most similar data points from the history, and the number should be equal to the number of data points in the preset period. These data points are then used to perform the unsupervised clustering anomaly identification provided by the embodiment of the present application.
[0120] Figure 7 A flowchart of anomaly identification in an application scenario in an embodiment of the present application is shown.
[0121] like Figure 7 As shown in the figure, in actual business scenarios, even discrete and sparse indicator data show good periodicity (for example, daily cycle) after aggregation, so the year-on-year analysis of the daily cycle curve based on this shows good value. The aggregated data after smoothing has good year-on-year stability, which provides a reasonable prerequisite for the clustering algorithm.
[0122] The comparison is only carried out between similar year-on-year curve segments screened out by the above method, thus eliminating the influence of irrelevant records in historical data. The algorithm itself only evaluates whether the indicator change pattern at that time of day can be found in historical data. Therefore, it can also quickly capture new regular patterns or value ranges that have emerged recently.
[0123] When intercepting curve segments, a reasonable length selection can make this comparison focus on the stage-by-stage indicator changes. For discrete value indicators (multiple reasonable value clusters), clustering algorithms can effectively identify outliers between multiple clusters. Comparing high and low similar curve segments at the same time can prevent the algorithm from misidentifying current data that is only slightly higher than the historical cluster range.
[0124] In the final recognition stage, the parallel analysis of multi-segment differences and angles makes the pattern recognition of indicator changes more comprehensive and improves the overall accuracy.
[0125] In summary, the embodiment of the present application proposes an unsupervised clustering algorithm based on periodic discovery and similarity comparison of indicators for indicator monitoring and anomaly identification. Based on the above advantages and methods, this method has many advantages over traditional methods, such as higher anomaly identification accuracy / recall rate, fast running speed, low pre-preparation / later maintenance cost, and low dependence on manually configured parameters.
[0126] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0127] The following introduces an apparatus embodiment of the present application, which can be used to execute the anomaly identification method of time series data in the above-mentioned embodiment of the present application. Figure 8 The structure block diagram of the abnormality identification device for time series data provided by the embodiment of the present application is schematically shown. Figure 8 As shown, the abnormality identification device 800 for time series data includes:
[0128] An extraction module 810 is configured to extract multiple data point sequences from the time series data according to a preset detection length, where the detection length is a minimum sequence length for performing anomaly detection on the time series data;
[0129] A calculation module 820 is configured to calculate first-order difference values of the data point sequence according to at least two different difference distances to obtain multiple difference value sequences;
[0130] A clustering module 830 is configured to perform clustering processing on the data point sequence and the differential value sequence respectively to obtain a plurality of clustering results, wherein the clustering results are used to indicate whether each of the data point sequence and each of the differential value sequence is an isolated sequence;
[0131] The identification module 840 is configured to identify whether the data point sequence at the current time node is abnormal data based on the multiple clustering results.
[0132] In some embodiments of the present application, based on the above technical solution, the extraction module 810 includes:
[0133] A cycle acquisition module is configured to acquire a time series cycle of the time series data, wherein the time series cycle is a minimum time cycle for describing a law of value variation of the time series data;
[0134] a length determination module, configured to determine a detection length for performing anomaly detection according to the timing cycle and a preset extraction ratio;
[0135] The sequence extraction module is configured to extract multiple data point sequences from the time series data according to the detection length, the sequence length of each data point sequence is the detection length, and each data point sequence is at the same period node in the time series period.
[0136] In some embodiments of the present application, based on the above technical solution, the period acquisition module includes:
[0137] A data aggregation module is configured to perform aggregation processing on the time series data according to a preset sliding window and sliding step size to obtain aggregated time series data;
[0138] a periodicity detection module, configured to perform periodicity detection on the aggregated time series data to obtain a candidate period corresponding to the sliding window;
[0139] The period determination module is configured to determine the candidate period as the timing period of the time series data when the sliding window matches the candidate period.
[0140] In some embodiments of the present application, based on the above technical solution, the periodicity detection module is further configured to: map the aggregated time series data from the time domain space to the frequency domain space to obtain the distribution frequency of the aggregated time series data in the frequency domain space; if the distribution frequency successfully matches the sliding window, determine the candidate period corresponding to the sliding window according to the distribution frequency; if the distribution frequency fails to match the sliding window, calculate the fundamental frequency and autocorrelation score of the aggregated time series data according to the autocorrelation function, and when the autocorrelation score is greater than a preset score threshold, determine the candidate period corresponding to the sliding window according to the fundamental frequency.
[0141] In some embodiments of the present application, based on the above technical solution, the device further includes:
[0142] The aggregation module is configured to use the time series period as a sliding window and perform aggregation processing on the time series data according to a preset sliding step to obtain aggregated time series data.
[0143] In some embodiments of the present application, based on the above technical solution, the device further includes:
[0144] The smoothing processing module is configured to perform polynomial fitting on the data point sequence according to a preset smoothing processing window to obtain a smoothed data point sequence, wherein the window size of the smoothing processing window is larger than the differential distance.
[0145] In some embodiments of the present application, based on the above technical solution, the device further includes:
[0146] A sequence selection module is configured to respectively calculate the sequence similarity between each data point sequence and the data point sequence at the current time node;
[0147] A plurality of data point sequences and a differential value sequence corresponding to the data point sequences are selected for clustering processing according to the sequence similarity.
[0148] In some embodiments of the present application, based on the above technical solution, the clustering module 830 is further configured to: cluster the data point sequence according to a preset number of cluster clusters to obtain a target cluster cluster corresponding to the data point sequence where the current time node is located; if the number of elements of the target cluster cluster is equal to one, determine that the data point sequence where the current time node is located is an isolated sequence; if the number of elements of the target cluster cluster is greater than one, increase the number of cluster clusters and continue to cluster the data point sequence until the preset upper limit of the number of cluster clusters is reached.
[0149] In some embodiments of the present application, based on the above technical solution, the identification module 840 is further configured to: obtain the number of isolated results in the multiple clustering results, the isolated result indicates that the data point sequence or differential value sequence corresponding to the current time node is identified as an isolated sequence in the clustering results; if the number of isolated results is greater than half of the total number of clustering results, it is determined that the data point sequence at the current time node is abnormal data; if the number of isolated results is greater than zero and less than half of the total number of clustering results, then identify whether the data point sequence at the current time node is abnormal data based on the number of cluster clusters corresponding to the isolated results.
[0150] In some embodiments of the present application, based on the above technical solution, the identification module 840 is further configured to: determine a quantity threshold based on a preset upper limit on the number of clusters and a preset quantity ratio; if the number of clusters corresponding to the isolated result is less than the quantity threshold, then determine that the data point sequence at the current time node is abnormal data.
[0151] The specific details of the device provided in each embodiment of the present application have been described in detail in the corresponding method embodiment and will not be repeated here.
[0152] Fig. 9The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0153] It should be noted that Fig. 9 The computer system 900 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0154] like Fig. 9 As shown, the computer system 900 includes a central processing unit 901 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 902 (ROM) or the program loaded from the storage part 908 to the random access memory 903 (RAM). Various programs and data required for system operation are also stored in the random access memory 903. The central processing unit 901, the read-only memory 902 and the random access memory 903 are connected to each other through a bus 904. An input / output interface 905 (Input / Output interface, i.e., I / O interface) is also connected to the bus 904.
[0155] The following components are connected to the input / output interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed so that a computer program read therefrom is installed into the storage section 908 as needed.
[0156] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processor 901, various functions defined in the system of the present application are executed.
[0157] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0158] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0159] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0160] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0161] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0162] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for identifying anomalies in time series data, characterized in that: include: Extracting multiple data point sequences from the time series data according to a preset detection length, wherein the detection length is a minimum sequence length for performing anomaly detection on the time series data; Calculating first-order difference values of the data point sequence according to at least two different difference distances respectively to obtain multiple difference value sequences; Performing clustering processing on the data point sequence and the difference value sequence respectively to obtain a plurality of clustering results, wherein the clustering results are used to indicate whether each of the data point sequence and each of the difference value sequence is an isolated sequence; It is determined whether the data point sequence at the current time node is abnormal data according to the plurality of clustering results.
2. The method according to claim 1, characterized in that Multiple data point sequences are extracted from the time series data according to the preset detection length, including: Acquire a time series period of the time series data, where the time series period is the minimum time period used to describe a law of value variation of the time series data; Determining a detection length for performing anomaly detection according to the timing cycle and a preset extraction ratio; A plurality of data point sequences are extracted from the time series data according to the detection length, the sequence length of each of the data point sequences is the detection length, and each of the data point sequences is at a same period node in the time series period.
3. The method according to claim 2, characterized in that Get the time series period of time series data, including: Aggregating the time series data according to a preset sliding window and sliding step size to obtain aggregated time series data; Performing periodicity detection on the aggregated time series data to obtain candidate periods corresponding to the sliding window; When the sliding window matches the candidate period, the candidate period is determined as the timing period of the time series data.
4. The method according to claim 3, characterized in that Performing periodic detection on the aggregated time series data includes: Mapping the aggregated time series data from the time domain space to the frequency domain space to obtain the distribution frequency of the aggregated time series data in the frequency domain space; If the distribution frequency successfully matches the sliding window, determining a candidate period corresponding to the sliding window according to the distribution frequency; If the distribution frequency fails to match the sliding window, the fundamental frequency and autocorrelation score of the aggregated time series data are calculated according to the autocorrelation function, and when the autocorrelation score is greater than a preset score threshold, the candidate period corresponding to the sliding window is determined according to the fundamental frequency.
5. The method according to claim 2, characterized in that: Before extracting a plurality of data point sequences from the time series data according to the detection length, the method further includes: The time series data is aggregated using the time series period as a sliding window according to a preset sliding step size to obtain aggregated time series data.
6. The method according to any one of claims 1 to 5, characterized in that Before respectively calculating first-order difference values for the data point sequence according to at least two different difference distances, the method further includes: A polynomial fitting is performed on the data point sequence according to a preset smoothing processing window to obtain a smoothed data point sequence, wherein the window size of the smoothing processing window is larger than the differential distance.
7. The method according to any one of claims 1 to 5, characterized in that Before clustering the data point sequence and the differential value sequence respectively, the method further includes: Calculate the sequence similarity between each data point sequence and the data point sequence at the current time node; A plurality of data point sequences and a differential value sequence corresponding to the data point sequences are selected for clustering processing according to the sequence similarity.
8. The method according to any one of claims 1 to 5, characterized in that Performing clustering processing on the data point sequence includes: Clustering the data point sequence according to a preset number of clusters to obtain a target cluster corresponding to the data point sequence where the current time node is located; If the number of elements of the target cluster is equal to one, determining that the data point sequence at the current time node is an isolated sequence; If the number of elements in the target cluster is greater than one, the number of clusters is increased and the data point sequence is continuously clustered until a preset upper limit of the number of clusters is reached.
9. The method according to any one of claims 1 to 5, characterized in that Identifying whether the data point sequence at the current time node is abnormal data according to the plurality of clustering results includes: Obtaining the number of isolated results in the plurality of clustering results, where an isolated result indicates that a data point sequence or a differential value sequence corresponding to the current time node is identified as an isolated sequence in the clustering results; If the number of isolated results is greater than one half of the total number of clustering results, then the data point sequence at the current time node is determined to be abnormal data; If the number of isolated results is greater than zero and less than half of the total number of clustering results, then it is identified whether the data point sequence at the current time node is abnormal data according to the number of clustering clusters corresponding to the isolated results.
10. The method according to claim 9, characterized in that Identifying whether the data point sequence at the current time node is abnormal data according to the number of clusters corresponding to the isolated result includes: Determine the quantity threshold according to a preset upper limit of the number of clusters and a preset quantity ratio; If the number of clusters corresponding to the isolated result is less than the number threshold, it is determined that the data point sequence at the current time node is abnormal data.
Citation Information
Cited By
Cell index poor quality detection method and device, computer equipment and storage medium
CN119815395A
