A method, apparatus, device and medium for repairing abnormal timing data

By using first-order difference processing and TopK calculation of a balanced binary tree, the continuous abnormal intervals of the time series are repaired using the normal subsequences on both sides, which solves the problem that traditional methods cannot repair continuous abnormalities and improves the repair effect.

CN116204345BActive Publication Date: 2026-05-19STATE GRID ZHEJIANG ELECTRIC POWER CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID ZHEJIANG ELECTRIC POWER CO LTD
Filing Date
2023-01-09
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing time series anomaly detection methods cannot effectively repair continuous abnormal intervals. Traditional methods are limited by the memorylessness of the SCREEN algorithm, resulting in poor repair performance.

Method used

A first-order difference processing method combined with a balanced binary tree and TopK calculation method is used to obtain the velocity constraint interval from the subsequence of the velocity sequence, and the continuous abnormal interval is repaired by the normal subsequences on the left and right sides.

Benefits of technology

It achieves effective repair of continuous abnormal intervals, improves the quality of time series, and avoids the problem of inaccurate repair caused by the lack of memory in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116204345B_ABST
    Figure CN116204345B_ABST
Patent Text Reader

Abstract

The application discloses a method, device, equipment and medium for repairing abnormal time series data, and the method comprises the following steps: performing first-order difference processing on a target time series to obtain a speed sequence; obtaining a speed constraint interval from each subsequence of the speed sequence according to the calculation mode of TopK based on a balanced binary tree, and the length of each subsequence is a preset length; detecting the time series based on the speed constraint interval to obtain a detection result; and if the detection result represents continuous abnormality of the time series, repairing the continuous abnormal interval of the time series based on the subsequences on the left and right sides of the abnormal interval, so as to repair the continuous abnormal interval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data analysis technology, and in particular to a method, apparatus, device and medium for repairing abnormal time-series data. Background Technology

[0002] Anomaly detection and diagnosis of real-time device data is a very important issue. This issue can be summarized as anomaly detection and quality improvement and repair of time series data. Among them, the speed trend of most device real-time data analysis has certain limitations and patterns. Therefore, it is very important to study the quality improvement and repair of time series with stable speed.

[0003] Constraint-based time series anomaly detection and diagnosis, which has emerged in recent years, aims to use the patterns of adjacent sequences or adjacent timestamps within a sequence to form assertions, determine whether anomalies have occurred, and repair the anomalous data. Traditional methods are limited by the "memoryless" nature of the SCREEN algorithm, and therefore can only repair a single point using points of a certain length to its left and right, and cannot repair continuous anomalous intervals. Summary of the Invention

[0004] To address the aforementioned issues, this application provides a method, apparatus, device, and medium for repairing abnormal time-series data, thereby repairing abnormal data within continuous abnormal intervals.

[0005] The embodiments of this application disclose the following technical solutions:

[0006] In a first aspect, this application provides a method for repairing anomalous time series data, the method comprising:

[0007] The target time series is subjected to first-order differencing to obtain the velocity series;

[0008] Based on the balanced binary tree and the TopK calculation method, the velocity constraint interval is obtained from each subsequence of the velocity sequence, and the length of each subsequence is a preset length;

[0009] The time series is detected based on the velocity constraint interval, and the detection results are obtained.

[0010] If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval of the time series is repaired based on the subsequences on the left and right sides of the anomaly interval.

[0011] Optionally, the balanced binary tree is a splay tree.

[0012] Optionally, if the detection result indicates a continuous anomaly in the time series, the abnormal interval of the time series is repaired based on the subsequences on both sides of the abnormal interval, including:

[0013] If the detection result indicates a continuous anomaly in the time series, a first velocity constraint interval is obtained in the subsequence to the left of the anomaly interval based on a preset method, and a second velocity constraint interval is obtained in each second subsequence to the right of the anomaly interval. The length of the subsequences on the left and right sides of the anomaly interval is a second preset length.

[0014] Repairing continuous abnormal intervals in the time series based on the first and second velocity constraint intervals.

[0015] Optionally, the step of obtaining the corresponding velocity constraint interval from each subsequence of the velocity sequence based on the balanced binary tree and the TopK calculation method, wherein the length of each subsequence is a preset length, includes:

[0016] Sort the elements in each of the subsequences in descending order;

[0017] Based on the balanced binary tree and the TopK calculation method, we obtain the first set consisting of the top K values ​​and the second set consisting of the bottom K values ​​in each subsequence;

[0018] The upper limit of the speed constraint interval is obtained based on the average value of each value in the first set, and the lower limit of the speed constraint interval is obtained based on the average value of each value in the second set.

[0019] Optionally, after obtaining the velocity constraint interval from each subsequence of the velocity sequence based on the TopK calculation method using a balanced binary tree, and after the length of each subsequence is a preset length, the method further includes:

[0020] By comparing the speed constraint interval with the preset speed constraint interval, it is determined whether the target time series is a stationary time series.

[0021] Optionally, if the detection result indicates a continuous anomaly in the time series, the method of repairing the continuous anomaly interval of the time series based on the subsequences on both sides of the anomaly interval includes:

[0022] If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval is repaired based on the probability density function of the Gaussian distribution corresponding to the subsequences on the left and right sides of the anomaly interval and a preset confidence threshold.

[0023] Secondly, this application provides an apparatus for repairing abnormal time series data, the apparatus comprising: a processing module, an acquisition module, a detection module, and a repair module;

[0024] The processing module is used to perform first-order difference processing on the target time series to obtain a velocity series;

[0025] The acquisition module is used to obtain the velocity constraint interval from each subsequence of the velocity sequence based on the TopK calculation method of the balanced binary tree, wherein the length of each subsequence is a preset length;

[0026] The detection module is used to detect time series based on velocity constraint intervals and obtain detection results;

[0027] The repair module is used to repair the continuous abnormal interval of the time series based on the subsequences on the left and right sides of the abnormal interval if the detection result indicates a continuous abnormality in the time series.

[0028] Optionally, the balanced binary tree is a splay tree.

[0029] Optionally, the repair module is specifically used for:

[0030] If the detection result indicates a continuous anomaly in the time series, a first velocity constraint interval is obtained in the subsequence to the left of the anomaly interval based on a preset method, and a second velocity constraint interval is obtained in each second subsequence to the right of the anomaly interval. The length of the subsequences on the left and right sides of the anomaly interval is a second preset length.

[0031] Repairing continuous abnormal intervals in the time series based on the first and second velocity constraint intervals.

[0032] Optionally, the acquisition module is specifically used for:

[0033] Sort the elements in each of the subsequences in descending order;

[0034] Based on the balanced binary tree and the TopK calculation method, we obtain the first set consisting of the top K values ​​and the second set consisting of the bottom K values ​​in each subsequence;

[0035] The upper limit of the speed constraint interval is obtained based on the average value of each value in the first set, and the lower limit of the speed constraint interval is obtained based on the average value of each value in the second set.

[0036] Optionally, the device further includes: a determination module;

[0037] The judgment module is used to determine whether the target time series is a stationary time series by comparing the speed constraint interval with the preset speed constraint interval.

[0038] Optionally, the repair module is further configured to:

[0039] If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval is repaired based on the probability density function of the Gaussian distribution corresponding to the subsequences on the left and right sides of the anomaly interval and a preset confidence threshold.

[0040] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a method for repairing anomalous data of a time series as described in any of the first aspects.

[0041] Fourthly, this application provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to perform a method for repairing abnormal time-series data as described in any of the first aspects.

[0042] First, the target time series is subjected to first-order differencing to obtain the velocity series. Second, based on a balanced binary tree and using the TopK calculation method, velocity constraint intervals are obtained from each subsequence of the velocity series, with each subsequence having a preset length. Then, the time series is detected based on the velocity constraint intervals to obtain the detection results. Finally, if the detection results indicate continuous anomalies in the time series, the continuous anomaly intervals of the time series are repaired based on the subsequences on the left and right sides of the anomaly interval.

[0043] Compared with the prior art, this application has the following advantages:

[0044] The repair method adopted in this application is to repair abnormal data in continuous abnormal intervals from both ends to the middle. That is, the abnormal data on the left is repaired using the normal subsequence on the left, and the abnormal sequence on the right is repaired using the normal subsequence on the right, thus realizing the repair of continuous abnormal intervals. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 A flowchart illustrating a method for repairing abnormal time-series data provided in this application embodiment;

[0047] Figure 2 A splay tree provided in this application embodiment;

[0048] Figure 3 The diagram shows the effect of a method for repairing abnormal time-series data provided in this application embodiment;

[0049] Figure 4 A flowchart illustrating another method for repairing abnormal timing data provided in this application embodiment;

[0050] Figure 5 The effect diagram corresponding to another method for repairing abnormal time-series data provided in the embodiments of this application;

[0051] Figure 6 This is a schematic diagram of a device for repairing abnormal timing data provided in an embodiment of this application. Detailed Implementation

[0052] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.

[0053] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0054] As described earlier, the current SCREEN algorithm is a "memoryless" algorithm, so it is difficult for the algorithm to identify a continuous anomaly. This causes the algorithm to frequently go to extremes on this data when repairing it, that is, to make decisions close to the upper and lower limits of the speed constraint range. Such extreme repair values ​​are difficult to get close to the true values, and even after repairing this data, it may regret that it will incorrectly identify the subsequent correct data as anomalies based on this poorly repaired data.

[0055] In view of this, this application proposes a method for repairing abnormal data in time series. First, the target time series is subjected to first-order differencing to obtain a velocity sequence. Second, based on a balanced binary tree and calculated using the TopK algorithm, velocity constraint intervals are obtained from each subsequence of the velocity sequence, with each subsequence having a preset length. Then, the time series is detected based on the velocity constraint intervals to obtain detection results. Finally, if the detection results indicate continuous anomalies in the time series, the continuous anomaly intervals of the time series are repaired based on the subsequences on the left and right sides of the anomaly interval.

[0056] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0057] Stationary time series: Given a time series T = t1, t2, ..., tN, if the following conditions are met:

[0058] The mean of all subsequences Ts,l of length L of T (1≤s≤NL) Equal; Variance equal.

[0059] If the correlation coefficient r between any two Ts1,L and Ts2,L in the above subsequences is only related to the time difference |s1-s2|, and decays rapidly to 0 as the time difference increases, then we call T a stationary time series.

[0060] See Figure 1 The figure is a flowchart of a method for repairing abnormal time series data provided in an embodiment of this application.

[0061] like Figure 1 As shown, the method includes:

[0062] S101: Perform first-order difference processing on the target time series to obtain the velocity series.

[0063] As an example, suppose the given target time series is T = t1, t2, ..., tN, which is called a one-dimensional time series of length N, where {1, ..., N} are its timestamps, and the first difference of T constitutes the "velocity sequence" V = t2-t1, t3-t2, ..., tN-tN-1. For all subsequences of length L of V, Vs, L (1 ≤ s ≤ NL).

[0064] S102: Based on the balanced binary tree and the TopK calculation method, the velocity constraint interval is obtained from each subsequence of the velocity sequence, and the length of each subsequence is a preset length.

[0065] Specifically, the elements in each subsequence are sorted in descending order;

[0066] Based on the balanced binary tree and the TopK calculation method, we obtain the first set consisting of the top K values ​​and the second set consisting of the bottom K values ​​in each subsequence;

[0067] The upper limit of the speed constraint interval is obtained based on the average value of each value in the first set, and the lower limit of the speed constraint interval is obtained based on the average value of each value in the second set.

[0068] A subsequence Vs,k can refer to a shorter time series consisting of consecutive timestamps of length k starting from time i. Generally speaking, Vs,k = t2-t1, t3-t2, ..., tk-tk-1. It should be noted that the length of the subsequence can be set according to actual needs.

[0069] TopK can be an algorithm that finds the K largest or K smallest numbers in a sequence.

[0070] In an optional embodiment, a velocity sequence may have multiple subsequences. In each subsequence, a Top-K algorithm is used to obtain a first set consisting of the K largest values ​​and a second set consisting of the K smallest values. For ease of understanding, this application will use the example of obtaining the first and second sets using a Top-K algorithm within a subsequence.

[0071] As an example, the subsequence Vs,k = {5,3,7,1,8,2,9,4,7,2,6,6}, where K is 5. First, the values ​​in Vs,k are sorted to obtain Vs,k = {9,8,7,7,6,6,5,4,3,2,1}. Using the TopK algorithm, the five largest numbers are used to form the first set G1 = {9,8,7,7,6}; the five smallest numbers are used to form the first set G2 = {5,4,3,2,1}. The average of the values ​​in G1 and G2 is then taken to obtain the velocity constraint interval [3,7,4].

[0072] In an optional embodiment, to avoid losing information from the previous sorting, we use a balanced binary search tree to store it. The best balanced binary search tree for maintaining and searching the k-th max is the splay tree. This type of search tree changes its structure with each search. Its core idea is that... Figure 2 As shown, the node being searched is rotated to the root node through a zig-zag operation, which reduces the depth of the accessed object. However, it can be noted that the size relationship between p, x, g and the subtree remains unchanged.

[0073] The Splay tree simultaneously maintains the size of the left subtree of each node. The sorting order of the current value is calculated by adding 1 to the left subtree size (the sorting calculation for nodes in the right subtree also requires adding the sizes of all left subtrees of the root node). In application, after differencing, building the Splay tree first requires inserting the first L elements sequentially, an operation with a time complexity of O(L*logL). Whenever a new timestamp tnew arrives, we perform the following operations: access the timestamp once, then delete and null the node containing the tnew-l element. This operation has a time complexity of O(logL); then, insert tnew, an operation with a time complexity of O(logL); finally, using the left subtree size stored in each node, we find the k-th max and return a set {G1, G2}, with a time complexity of O(logL).

[0074] The operations on the new elements described above are at the O(logL) level. Since there are O(N) new elements, the final computation time complexity of {G1} and {G2} is O(logL*N) + O(L*logL) = O(logL*N).

[0075] Based on the k-th max selection method described above, it is possible to determine whether the input time series T is a velocity-dominant class and to estimate its parameters.

[0076] S103: Detect the time series based on the velocity constraint interval and obtain the detection results.

[0077] Specifically, the upper and lower limits of the speed constraint interval are compared with the elements in the speed sequence. If the element is within the speed constraint interval, the element in the speed sequence is determined to be normal; if the element is outside the speed constraint interval, the element in the speed sequence is determined to be abnormal. Furthermore, if the accumulated length is greater than the preset length, the continuous interval is determined to be continuously abnormal.

[0078] S104: If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval of the time series is repaired based on the subsequences on the left and right sides of the anomaly interval.

[0079] Specifically, if the detection result indicates a continuous anomaly in the time series, a first velocity constraint interval is obtained in the subsequence to the left of the anomaly interval based on a preset method, and a second velocity constraint interval is obtained in each second subsequence to the right of the anomaly interval. The length of the subsequences on the left and right sides of the anomaly interval is a second preset length.

[0080] The continuous abnormal intervals of the time series are repaired based on the first velocity constraint interval and the second velocity constraint interval, respectively.

[0081] As an example, suppose there are 9 subsequences of length L to the left of the abnormal interval. Following the method described in the previous question, a velocity constraint interval [G1, G2] can be obtained in each subsequence. That is, 9 velocity constraint intervals can be obtained, totaling 18 values: G1, G2, G3, G4, G5, G6, G7, G8, G9, G10, G11, G12, G13, G14, G15, G16, G17, and G18. These 18 values ​​are sorted, and the middle value is taken as the repair value for the abnormal interval on the left to repair the abnormal value. It can be understood that if there is an even number of values, the average of the two middle values ​​should be used as the repair value to repair the abnormal value; if there is an odd number of values, the middle value is directly used as the repair value.

[0082] Experiments were conducted on bearing temperature. The algorithm's performance is as follows: within a time stamp range of 50-100, the algorithm classifies it as a continuous error, a judgment caused by the excessively long time domain. To address the issue of consequential errors, we propose an advanced screen (adscreen) with bidirectional weighting and local memory, which yields results closer to the true values ​​than the standard screen. The experimental results are as follows: Figure 3 As shown.

[0083] In an optional embodiment, if the detection result is only a single point, the abnormal point is repaired based on the normal subsequences on the left and right sides of that point.

[0084] First, the target time series is subjected to first-order differencing to obtain a velocity sequence. Second, based on a balanced binary tree and using the TopK algorithm, velocity constraint intervals are obtained from each subsequence of the velocity sequence, with each subsequence having a preset length. Then, the time series is detected based on these velocity constraint intervals to obtain detection results. Finally, if the detection results indicate continuous anomalies in the time series, the continuous anomaly intervals are repaired based on the subsequences on both sides of the anomaly interval. A method from both ends to the middle is used to repair the abnormal data in the continuous anomaly intervals; that is, the left side uses the normal subsequences on the left to repair the abnormal data, and the right side uses the normal subsequences on the right to repair the abnormal sequence, thus achieving the repair of continuous anomaly intervals.

[0085] See Figure 4 The figure is a flowchart of another method for repairing abnormal time series data provided in an embodiment of this application.

[0086] like Figure 4 As shown, the method includes:

[0087] S401: Perform first-order difference processing on the target time series to obtain the velocity series.

[0088] S402: Based on a balanced binary tree and using the TopK calculation method, the velocity constraint interval is obtained from each subsequence of the velocity sequence, and the length of each subsequence is a preset length.

[0089] S403: Determine whether the target time series is a stationary time series by comparing the speed constraint interval with the preset speed constraint interval.

[0090] The preset velocity constraint interval can be [0,0]. If the velocity constraint interval of each subsequence is the same as the preset interval, it means that the target time series is a stationary time series.

[0091] Let x = Ts1,l and y = Ts1 + k,l represent two subsequences of the same length l from the input time series T, differing only in their starting points. Then the k-th lag autocorrelation coefficient is defined by the following formula:

[0092]

[0093] Based on this statistic, we designed the Ljung-Box test to determine the stationarity of the time series.

[0094] The Ljung-Box test is a test for the randomness of time series variation around the mean, or a statistical test for the presence of lagged correlations in a time series.

[0095] The null and alternative hypotheses for the LB test are as follows:

[0096] H0: The original data were all independent, meaning the overall correlation coefficient was 0. Any observable correlations arose solely from random sampling errors. Where h is given by the user.

[0097] Ha: The original data was not independent; that is, at least one of them existed. It cannot be explained by randomness, where k≤h.

[0098] The constructed statistic is:

[0099]

[0100] Where n is the number of samples. It is the correlation coefficient of the sample with k-th lag, and this statistic follows a chi-square distribution with h degrees of freedom.

[0101] For a system-preset or user-defined significance level α, the rejection region is Accepting the null hypothesis means that the original series is a stationary time series; otherwise, the series is considered to be correlated.

[0102] Observing the formula for the statistical measure, we can see that as the lag time interval k increases, the denominator gradually decreases. Therefore, the importance of the Q statistic gradually increases. If this value is very small, it aligns with our understanding that the correlation of a stationary time series rapidly decays to zero as the time difference increases. The significance of this statistic lies in the fact that we no longer need to directly observe the decay of the autocorrelation curve, but instead solve the anomaly detection problem through the relationship between a quantity and a threshold.

[0103] S404: Detect time series data based on velocity constraint intervals to obtain detection results.

[0104] S405: If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval is repaired based on the probability density function of the Gaussian distribution corresponding to the subsequences on the left and right sides of the anomaly interval and a preset confidence threshold.

[0105] As an example, a stationary time series can be viewed as a random process with constant mean and variance; therefore, it is essentially a process of continuously selecting points from a Gaussian distribution. The probability density function of the Gaussian distribution is:

[0106]

[0107] Clearly, this function is only related to |x-μ|. Therefore, by setting the confidence threshold, we can obtain the corresponding confidence interval: [μ-d, μ+d]. Thus, the repair values ​​can all be set to the values ​​with the highest probability, which is μ.

[0108] Existing methods exhibit repair lag and a degree of "sluggishness," similar to those used in screen methods. However, the method employed in this embodiment, considering only single-point values, avoids these problems. Figure 5 As shown, the left side is the experimental effect diagram corresponding to the prior art, and the right side is the effect diagram corresponding to the method used in this embodiment.

[0109] See Figure 6 The figure is a schematic diagram of the structure of an apparatus for repairing abnormal time series data provided in an embodiment of this application.

[0110] like Figure 6 As shown, the device includes: a processing module 601, an acquisition module 602, a detection module 603, and a repair module 604;

[0111] Processing module 601 is used to perform first-order difference processing on the target time series to obtain a velocity series;

[0112] The acquisition module 602 is used to obtain the velocity constraint interval from each subsequence of the velocity sequence based on the TopK calculation method of the balanced binary tree, and the length of each subsequence is a preset length;

[0113] The detection module 603 is used to detect time series based on velocity constraint intervals and obtain detection results;

[0114] The repair module 604 is used to repair the continuous abnormal interval of the time series based on the subsequences on the left and right sides of the abnormal interval if the detection result indicates a continuous abnormality in the time series.

[0115] Alternatively, the balanced binary tree is a splay tree.

[0116] Optionally, repair module 604 is specifically used for:

[0117] If the detection result indicates a continuous anomaly in the time series, a first velocity constraint interval is obtained in the subsequence to the left of the anomaly interval based on a preset method, and a second velocity constraint interval is obtained in each second subsequence to the right of the anomaly interval. The length of the subsequences on the left and right sides of the anomaly interval is a second preset length.

[0118] Repairing continuous abnormal intervals in the time series based on the first and second velocity constraint intervals.

[0119] Optionally, module 602 is used specifically for:

[0120] Sort the elements in each subsequence in descending order;

[0121] Based on the balanced binary tree and the TopK calculation method, we obtain the first set consisting of the top K values ​​and the second set consisting of the bottom K values ​​in each subsequence;

[0122] The upper limit of the speed constraint interval is obtained based on the average value of each value in the first set, and the lower limit of the speed constraint interval is obtained based on the average value of each value in the second set.

[0123] Optionally, the device further includes: a determination module;

[0124] The judgment module is used to determine whether the target time series is a stationary time series by comparing the speed constraint interval with the preset speed constraint interval.

[0125] Optionally, repair module 604 is also used for:

[0126] If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval is repaired based on the probability density function of the Gaussian distribution corresponding to the subsequences on the left and right sides of the anomaly interval and the preset confidence threshold.

[0127] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the apparatus, since it is basically similar to the method embodiments, the description is relatively simple, and relevant parts can be referred to the description of the method embodiments. The apparatus described above is merely illustrative, and the units described as separate components may or may not be physically separate. The components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0128] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for repairing abnormal time-series data, characterized in that, The method includes: The target time series is subjected to first-order differencing to obtain the velocity series; Based on the balanced binary tree and the TopK calculation method, the velocity constraint interval is obtained from each subsequence of the velocity sequence, and the length of each subsequence is a preset length; The time series is detected based on the velocity constraint interval, and the detection results are obtained. If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval of the time series is repaired based on the subsequences on the left and right sides of the anomaly interval.

2. The method as described in claim 1, characterized in that, The balanced binary tree is a splay tree.

3. The method as described in claim 1, characterized in that, If the detection result indicates a continuous anomaly in the time series, the abnormal interval of the time series is repaired based on the subsequences on both sides of the abnormal interval, including: If the detection result indicates a continuous anomaly in the time series, a first velocity constraint interval is obtained in the subsequence to the left of the anomaly interval based on a preset method, and a second velocity constraint interval is obtained in each second subsequence to the right of the anomaly interval. The length of the subsequences on the left and right sides of the anomaly interval is a second preset length. The continuous abnormal intervals of the time series are repaired based on the first velocity constraint interval and the second velocity constraint interval, respectively.

4. The method as described in claim 1, characterized in that, The method, based on a balanced binary tree and using TopK calculation, obtains the corresponding velocity constraint intervals from each subsequence of the velocity sequence. The length of each subsequence is a preset length, including: Sort the elements in each of the subsequences in descending order; Based on the balanced binary tree and the TopK calculation method, we obtain the first set consisting of the top K values ​​and the second set consisting of the bottom K values ​​in each subsequence; The upper limit of the speed constraint interval is obtained based on the average value of each value in the first set, and the lower limit of the speed constraint interval is obtained based on the average value of each value in the second set.

5. The method as described in claim 1, characterized in that, After obtaining the velocity constraint interval from each subsequence of the velocity sequence based on the TopK calculation method using a balanced binary tree, and after the length of each subsequence is a preset length, the method further includes: By comparing the speed constraint interval with the preset speed constraint interval, it is determined whether the target time series is a stationary time series.

6. The method as described in claim 5, characterized in that, If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval of the time series is repaired based on the subsequences on both sides of the anomaly interval, including: If the detection result indicates a continuous anomaly in the time series, the continuous anomaly interval is repaired based on the probability density function of the Gaussian distribution corresponding to the subsequences on the left and right sides of the anomaly interval and a preset confidence threshold.

7. An apparatus for repairing abnormal time-series data, characterized in that, The device includes: a processing module, an acquisition module, a detection module, and a repair module; The processing module is used to perform first-order difference processing on the target time series to obtain a velocity series; The acquisition module is used to obtain the velocity constraint interval from each subsequence of the velocity sequence based on the TopK calculation method of the balanced binary tree, wherein the length of each subsequence is a preset length; The detection module is used to detect time series based on velocity constraint intervals and obtain detection results; The repair module is used to repair the continuous abnormal interval of the time series based on the subsequences on the left and right sides of the abnormal interval if the detection result indicates a continuous abnormality in the time series.

8. The apparatus as claimed in claim 7, characterized in that, The balanced binary tree is a splay tree.

9. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method for repairing abnormal timing data as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to perform the method for repairing abnormal timing data as described in any one of claims 1 to 6.