Data decomposition method, device and storage medium
Through the online periodic trend decomposition algorithm, linear equation systems are constructed and factorization results are used to accelerate calculations, which solves the problem of high computational complexity of the traditional STD method under high acquisition frequency, and realizes efficient decomposition of massive time series data and real-time abnormal detection, improving the system's operation security and resource scheduling capabilities.
Patent Information
- Application Number
- CN202310194926.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-02-27
AI Technical Summary
The traditional STD method cannot adapt to the processing of massive time series data at high acquisition frequency, has high computational complexity and low decomposition efficiency, and cannot meet the needs of real-time abnormal detection and prediction.
The online periodic trend decomposition algorithm is adopted to accelerate calculation by constructing linear equation systems and using factorization results to reduce the computational complexity and improve the decomposition efficiency.
It realizes efficient periodic trend decomposition of massive time series data, supports real-time abnormal detection and future data prediction, and improves the system's operation security and resource scheduling capabilities.
Smart Images

Figure CN116185692B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a data decomposition method, device and storage medium. Background Art
[0002] With the rapid development of the Internet of Things (IoT) and cloud computing, systems can now collect massive amounts of time series data generated during system operation to monitor their health. In some practical applications, the frequency of data collection may be high, such as at the minute or even second level. By performing anomaly detection or prediction on this time series data, system anomalies can be detected in real time or future failures can be prevented.
[0003] Time series data can be decomposed into period, trend, and residual components through a certain seasonal trend decomposition (STD) method. Based on the decomposition results, anomaly detection tasks and prediction tasks of future time data values can be processed.
[0004] The STD method was originally proposed in the field of economics and is widely used to observe the current state of the economy and predict future economic trends. However, the sampling frequency of time series data in economics is very low, often collecting one point per week, month, or even quarter, and the number of time series that need to be analyzed is often limited. Consequently, traditional STD methods are often offline or batch processing methods. This involves taking a complete time series data point as input and decomposing it into a trend component, a cycle component, and a residual component. When data at a new time point is collected, the STD method must be recalculated based on the newly added data, resulting in a high computational complexity and a long processing time. However, with the rapid development of sensor and storage technologies, many application scenarios can now collect large amounts of time series data at a higher frequency. Traditional offline methods are no longer suitable for processing such massive amounts of data. Summary of the Invention
[0005] The embodiments of the present invention provide a data decomposition method, device and storage medium, which reduce the complexity of calculation and improve the decomposition efficiency.
[0006] In a first aspect, an embodiment of the present invention provides a data decomposition method, the method comprising:
[0007] At a first time, obtaining first time series data collected from a target object after a second time, and a periodic component vector corresponding to second time series data collected from the target object before the first time, wherein the second time is earlier than the first time, the first time series data includes the target data collected at the first time, and the time length corresponding to the second time series data is a set period length;
[0008] Constructing a first linear equation system for performing periodic trend decomposition on the target data based on the first time series data, the set first weight vector, the second weight vector, and the periodic component vector, wherein the first linear equation system includes a first coefficient matrix;
[0009] Obtaining a target submatrix from a factorization result of a second coefficient matrix, where the second coefficient matrix is a coefficient matrix included in a second system of linear equations for performing periodic trend decomposition on data collected at a third time, the third time being a collection time preceding the first time, and the target submatrix is determined based on a common value region in the first coefficient matrix and the second coefficient matrix;
[0010] The first coefficient matrix is factorized according to the target submatrix to solve the first linear equation group according to the factorization result of the first coefficient matrix to determine the period component and trend component corresponding to the target data.
[0011] In a second aspect, an embodiment of the present invention provides an electronic device comprising: a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the data decomposition method as described in the first aspect.
[0012] In a third aspect, an embodiment of the present invention provides a non-temporary machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor executes the data decomposition method as described in the first aspect.
[0013] In the data decomposition method provided by an embodiment of the present invention, in order to perform periodic trend decomposition on the target data collected at the current first time, a first linear equation group for performing periodic trend decomposition on the target data is first established, and then the first linear equation group is solved by an accelerated calculation method to determine the periodic component and trend component corresponding to the target data.
[0014] Specifically, by obtaining first time series data collected from the target object from the second time to the current first time, and obtaining a period component vector corresponding to second time series data collected from the target object before the first time, with a time length equal to the period length, the first linear equation system is constructed based on the first time series data, the set first weight vector, the second weight vector, and the obtained period component vector. The first linear equation system includes a first coefficient matrix.
[0015] In the process of solving the first linear equation system, the process includes factoring the first coefficient matrix and finally determining the variables to be solved based on the factorization result of the first coefficient matrix, wherein the variables to be solved include the period component and the trend component corresponding to the target data. In the process of factoring the first coefficient matrix, based on the feature that there are some regions with the same values between the first coefficient matrix in the first linear equation system corresponding to the current first time and the second coefficient matrix in the second linear equation system corresponding to the previous acquisition time (third time), the factorization result of the second coefficient matrix can be used to accelerate the factorization process of the current first coefficient matrix. Specifically, the target submatrix in the factorization result of the second coefficient matrix can be obtained, and the target submatrix is included in the factorization result of the first coefficient matrix. That is, in the factorization process of the first coefficient matrix, the target submatrix in the factorization result of the previous second coefficient matrix can be directly reused. This part does not need to be calculated, and only the values of other elements in the factorization result of the first coefficient matrix need to be determined, which reduces the amount of calculation, thereby improving the speed of solving the first linear equation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 A flowchart of a data decomposition method provided by an embodiment of the present invention;
[0018] Figure 2a A diagram illustrating a structure of a second coefficient matrix provided in an embodiment of the present invention;
[0019] Figure 2b A diagram illustrating a structure of a first coefficient matrix provided in an embodiment of the present invention;
[0020] Figure 3 A flowchart of a method for predicting future set time data collection provided by an embodiment of the present invention;
[0021] Figure 4 A flowchart of an anomaly detection and processing method provided by an embodiment of the present invention;
[0022] Figure 5 A flowchart of a method for solving a system of linear equations provided by an embodiment of the present invention;
[0023] Figure 6 An overall flow chart of a data decomposition method provided by an embodiment of the present invention;
[0024] Figure 7 A schematic diagram of a data decomposition device provided by an embodiment of the present invention;
[0025] Figure 8 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0027] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0028] With the rapid development of sensor and storage technologies, systems can now collect large amounts of time series data at ever-shorter acquisition frequencies (e.g., seconds or minutes). Traditional offline / batch processing methods for periodic trend decomposition are no longer suitable for processing massive amounts of data. This high acquisition frequency requires real-time (i.e., online) periodic trend decomposition of newly acquired data. One approach to bringing these offline algorithms online is to select a time window W and perform offline periodic trend decomposition on only the W time points within that window, thus obtaining the decomposition result for the last data point. However, this approach is still inherently offline and has a computational complexity of at least O(W), increasing with increasing W. Assuming the period length of the time series data is T, W generally needs to be greater than 3T to obtain a more accurate decomposition result, so the computational complexity of these algorithms can be considered O(T). In other words, these algorithms are computationally expensive and cannot cost-effectively handle the decomposition of massive amounts of time series data.
[0029] Later, to adapt to the decomposition of massive amounts of time series data, faster online periodic trend decomposition algorithms were proposed, such as the OnlineSTL algorithm. These online algorithms improve computational speed but sacrifice decomposition accuracy. Furthermore, their computational complexity remains O(T), so they are still slow for long-period data.
[0030] Therefore, the embodiment of the present invention provides a method for performing periodic trend decomposition on massive time series data with lower complexity and higher efficiency.
[0031] The solution provided by the embodiments of the present invention can be used to perform periodic trend analysis on time series data collected from a target object, such as an application system such as a database system, or a user-friendly application. Taking a database system as an example, the collected time series data can be important indicators used to evaluate the database system's operating status, such as CPU utilization, number of connections, number of accesses per second, disk usage, and so on. The sampling frequency can be one data point every minute or even every 15 seconds.
[0032] By performing period-trend decomposition on collected time series data, we can derive the periodic, trend, and residual components corresponding to each data point. Based on these decomposition results, we can perform operational safety checks on the corresponding database system. For example, we can determine whether the data collected at the current moment is an outlier, thereby detecting system failures in real time and implementing timely repairs. Another example is predicting the data that the database system is likely to output at a certain time in the future. This allows us to anticipate changes in the database system's operational status in advance, allowing us to schedule resources in a timely manner, such as when the load increases or decreases in the future.
[0033] Figure 1 A flow chart of a data decomposition method provided by an embodiment of the present invention is as follows: Figure 1 As shown, the method includes the following steps:
[0034] 101. At a first time, obtain first time series data collected from the target object after a second time, and a periodic component vector corresponding to second time series data collected from the target object before the first time, wherein the second time is earlier than the first time, the first time series data includes the target data collected at the first time, and the time length corresponding to the second time series data is the set period length.
[0035] 102. Construct a first linear equation group for performing periodic trend decomposition on the target data based on the first time series data, the set first weight vector, the second weight vector and the periodic component vector, wherein the first linear equation group includes a first coefficient matrix.
[0036] 103. Obtain a target submatrix from the factorization result of the second coefficient matrix, where the second coefficient matrix is a coefficient matrix included in a second set of linear equations for performing periodic trend decomposition on data collected at a third time, where the third time is a collection time immediately before the first time, and the target submatrix is determined based on the same value range in the first coefficient matrix and the second coefficient matrix.
[0037] 104. Factorize the first coefficient matrix according to the target submatrix to solve the first linear equation group according to the factorization result of the first coefficient matrix to determine the period component and trend component corresponding to the target data.
[0038] In practical applications, for the sake of convenience, it is assumed that after the target object starts running, its certain indicators are collected according to the set collection frequency, thus forming a complete time series data. The target object is, for example, a database system, an application program, or other application objects, and the above-mentioned indicator can be a set indicator that reflects the real-time operating status of the target object. i Represents the data collected at the i-th collection time.
[0039] The time series data decomposition method of the present invention can be divided into two stages, wherein the first stage is: the first stage of periodic trend decomposition using the traditional offline / batch processing method, and the second stage of online decomposition of periodic trend decomposition of data collected in real time after the first stage.
[0040] Roughly speaking, in the time series data illustrated above, with collection time t0 as the boundary, the periodic trend decomposition task for data collected before this time belongs to the first stage, and the periodic trend decomposition task for data collected after this time belongs to the second stage. However, in practice, data collected at a set number of collection times after collection time t0 can also be included in the periodic trend decomposition task of the first stage, for example, data collected at the next four collection times. The reason for this will be explained below.
[0041] It is understood that the above-mentioned time series data is actually periodic data with a corresponding cycle length. This cycle length can be input by the user or obtained by performing period detection on data collected over a period of time. Given this, in practical applications, the above-mentioned collection time t0 can generally be set to a multiple of the cycle length, such as 3 or 4 times, to ensure the accuracy of the cyclic trend decomposition results of each data in the first stage.
[0042] In summary, through the processing of the first stage, part of the input information required for the periodic trend decomposition processing of the data collected in the second stage can be obtained.
[0043] The periodic trend decomposition task to be completed in the first stage can be implemented by a traditional batch processing method. In the present invention, the periodic trend decomposition task to be completed in the first stage can be implemented by the following process:
[0044] Acquire a plurality of data collected from the target object before a second time, wherein a time length corresponding to the plurality of data is a multiple of the period length;
[0045] acquiring a set number of data collected from the target object at a set number of collection times after the second time;
[0046] A batch processing period trend decomposition method is adopted to decompose the plurality of data collected before the second time and a set number of data collected after the second time.
[0047] Combined with the time series data in the example above, the second time is the collection time t0, and the multiple data collected from the target object before the second time is The set amount of data collected from the target object at the set amount of collection time after the second time is, for example: Here, the set number is assumed to be 4.
[0048] In simple terms, the so-called batch processing cycle trend decomposition method is, for example, to set a time window (assuming it is 100), then For the first 1000 data in this time series data, a certain periodic trend decomposition algorithm is executed once to obtain the periodic component, trend component and residual component corresponding to each of the 1000 data. After the 1001th data is collected, the time window is shifted one position to the right to obtain another set of data containing the 1001th data. This periodic trend decomposition algorithm is executed again for this set of 1000 data to obtain the periodic component, trend component and residual component corresponding to each of the 1000 data, and so on.
[0049] As can be seen, this batch processing approach requires a large number of decomposition results to be output each time, matching the size of the time window. For example, if the time window is 1000, the number of decomposition results to be output each time is 2000, including 1000 period components and 1000 trend components corresponding to 1000 data points. Based on the period components and trend components corresponding to a data point, the residual component of the data can be calculated.
[0050] In the above way After the period component, trend component and residual component corresponding to this data are obtained, the second stage can be executed. Based on this, the second stage is based on As the starting point.
[0051] In the second stage, the acquisition time can be expressed as t0+M, where M≥5. t It represents the data collected at the first time t, t = t0 + M, so y t It can also be expressed as
[0052] Figure 1 The illustrated embodiment is a process for executing the periodic trend decomposition task in the second stage.
[0053] In summary, in step 101 , the first time is, for example, each acquisition time after t0+5, and the second time is t0.
[0054] When executing the periodic trend decomposition task in the second phase, first, in step 101, the first time series data collected from the target object from the second time to the current first time is obtained, which is expressed as: Where M ≥ 5, and the first time t = t0 + M. In addition, it is necessary to obtain the periodic component vector corresponding to the second time series data collected from the target object before the first time. The time length corresponding to the second time series data is the set period length. In other words, the collection time range corresponding to the second time series data is: t0 + M-1-T to t0 + M-1.
[0055] In this embodiment, a vector v is set to represent a periodic component vector of a recently generated periodic length. That is, the vector sequentially stores periodic components corresponding to data collected within a recently generated periodic length.
[0056] When M=5, the periodic components corresponding to the corresponding second time series data are determined in the first stage. When M is greater than 5, after the periodic component of the latest collected data is calculated in the second stage, the periodic component can be updated to the periodic component vector v.
[0057] In fact, the cycle trend decomposition task that needs to be completed in the second stage is to solve the following optimization problem:
[0058]
[0059] Among them, τ represents the trend component, s represents the period component, and data y j Can be decomposed into periodic components s j , trend component τ j and the residual component r j sum.
[0060] The above λ1 and λ2 are preset coefficients.
[0061] It can be seen that the optimization problem consists of four items. The first item means to minimize the residual error, that is, to make the sum of the period component and the trend component of the data as close as possible to the value of the data. Specifically, because the data y j It can be decomposed into trend component, period component and residual component. Minimizing the residual component is to make the trend component τ j and the periodic component s j The sum of j The difference is the smallest.
[0062] The meaning of the second item is to ensure the smoothness of the periodic component, that is, the periodic component s of the data collected at the current moment j The periodic component v of another data that is one period away from the previous one j%T For example, if 24 hours is used as a data collection period, then the data collected at 10:00 today and the data collected at 10:00 the previous day should be exactly one period apart, and the period component decomposition results of the two data should reflect this period feature. j%T , represents the j%Tth element in the above periodic component vector v, where % is the modulo operator and T is the period length.
[0063] The meaning of the third and fourth terms is to ensure the smoothness of the trend component and to tolerate the trend mutation phenomenon, where |τ j -τ j-1 | and |τ j -2τ j-1 +τ j-2 | is the L1 regularization term. The third term performs a first-order differencing operation on the trend component, and the fourth term performs a second-order differencing operation on the trend component. Trend abruptness refers to the fact that the collected data may exhibit some sudden glitches, i.e., sudden increases or decreases in data values that last only a short time. It is hoped that the final decomposition results of the periodic trend decomposition algorithm can reflect these trend abruptness (i.e., tolerate trend abruptness) and not smooth them out.
[0064] The solution to the above optimization problem can be solved by converting it into a problem of solving the following linear equation system Ax=b.
[0065] In the linear system Ax=b:
[0066] A is a coefficient matrix with a dimension of 2M×2M, specifically expressed as:
[0067]
[0068] b is a constant vector with a dimension of 2M, specifically expressed as:
[0069]
[0070] in,
[0071]
[0072]
[0073]
[0074]
[0075] In the above formulas (1) and (2), T represents the transposition operator, λ1 and λ2 are pre-set coefficients, and vector p and vector q represent the first weight vector and the second weight vector, respectively, and their dimensions are M-1 and M-2, respectively.
[0076] From the dimensions of C3 and C4 in the above formula, we can see that the value of M is at least greater than 2. In fact, generally speaking, the value of M is set to be greater than or equal to 5. Based on this, the first stage of the periodic trend decomposition task includes data collected at the four collection times t0+1 to t0+4.
[0077] x is a variable vector consisting of unknown variables to be solved. Specifically, it is a vector of 2M dimensions, with M odd-numbered items representing trend components and M even-numbered items representing period components, corresponding to the M data collected at M times from t0+1 to t0+M. Specifically, for example, at time t0+1, x contains two components to be solved. The first is the trend component. The second is the periodic component s t0+1 .
[0078] The vector y in formula (2) contains M data collected from M moments from t0+1 to the current first time t0+M.
[0079] The dimension of the vector u in formula (2) is M, and the vector v is the periodic component vector mentioned above, with the dimension being the period length T. Specifically, the vector v is: It should be noted that, assuming T = 100 and M = 5, then vector u only has 5 data points, and only the first 5 data points are needed from the 100 data points contained in vector v. If T = 100 and M = 1000, then the transposition of vector v needs to be repeated 10 times to form a vector u with 1000 data points.
[0080] In summary, in practical applications, at the current first time t0+M (for example, M=6), the first time series data collected from the target object (such as a database system) after the second time t0 is obtained. and the periodic component vector corresponding to the second time series data collected from the target object before the first time t0+M Afterwards, the first linear equation group Ax=b for performing periodic trend decomposition on the target data collected at the first time t0+M can be constructed based on the first time series data y, the set first weight vector p, the second weight vector q and the periodic component vector v. The first linear equation group not only contains the first coefficient matrix A, but also contains the variable vector x to be solved and the constant vector b.
[0081] After establishing the first linear equation group corresponding to the current first time, it is necessary to solve the first linear equation group to determine the values of the last two elements in the vector x. The values of these last two elements are the trend component and periodic component corresponding to the target data collected at the first time.
[0082] The process of solving the first linear equation system includes: factorizing the first coefficient matrix, and finally solving the values of the last two elements of the vector x by Gaussian elimination based on the factorization result of the first coefficient matrix.
[0083] Among them, the factorization method can be, for example, the Doolittle decomposition method, the Cholesky decomposition method, etc. In the case of the Doolittle method, the first coefficient matrix can actually be decomposed into a lower triangular matrix L, a diagonal matrix D and an upper triangular matrix L T The product of, where L T represents the transpose of L.
[0084] It should be noted that for the first acquisition time in the second stage, M = 5, after establishing the linear equations corresponding to that acquisition time, conventional solution methods are used to solve the equations. This involves completely factoring the coefficient matrix generated at that time, and then determining the trend and cycle components corresponding to the data collected at that time based on the factorization results. However, starting with M = 6, the factorization results of the coefficient matrix corresponding to the previous acquisition time can be used to accelerate the solution of the linear equations corresponding to the current acquisition time, for example, assuming the factorization of the current coefficient matrix.
[0085] Specifically, assuming that for a first time t0+M, M=6, when factoring the first coefficient matrix in the first linear equation system corresponding to the acquisition time, the factorization results of the second coefficient matrix in the second linear equation system obtained by performing periodic trend decomposition on data acquired at the acquisition time immediately before the first time (i.e., the third time t0+M-1) are first obtained, and then a target submatrix is determined from the factorization results of the second coefficient matrix to accelerate the factorization of the first coefficient matrix using the target submatrix. As described above, the factorization results of the coefficient matrix can actually include a lower triangular matrix L and a diagonal matrix D, so the target submatrix can include these two types of matrices.
[0086] The accelerated computing effect of the above-mentioned target submatrix is mainly reflected in the fact that the factorization result of the first coefficient matrix actually contains the above-mentioned target submatrix. Therefore, in the process of factorizing the first coefficient matrix, only a partial factorization process is actually required, and a complete factorization process is not required, because the above-mentioned target submatrix can be directly assigned to the factorization result of the first coefficient matrix.
[0087] The reason why starting from M=6, the solution of the first linear equation group corresponding to the current acquisition time can be accelerated based on the factorization result of the second coefficient matrix corresponding to the previous acquisition time is because the first coefficient matrix and the second coefficient matrix actually have some sub-matrices with the same values.
[0088] In this embodiment, the target submatrix is determined based on the same value region in the first coefficient matrix and the second coefficient matrix because the target submatrix can actually be regarded as a partial result of the factorization results of this part of the same value region.
[0089] For ease of understanding, for example, the structure diagram of the second coefficient matrix (when M=5) can be found in Figure 2a , the structure example diagram of the first coefficient matrix (when M=6) can be found in Figure 2b .according to Figure 2a and Figure 2b It can be seen that if the coefficient matrix is divided into four parts according to the dotted lines in the figure, the upper left corners of the two are exactly the same. After adding two columns and two rows of zeros to the upper right and lower left corners of the second coefficient matrix, they are also the same. Only the matrix of the lower right corner is different. Based on this feature, it can be found that the factorization result of the first coefficient matrix actually has the same values in some areas as the factorization result of the second coefficient matrix. In other words, the factorization result of the second coefficient matrix can be used to accelerate the factorization process of the first coefficient matrix.
[0090] In fact, the factorization of the coefficient matrix is to decompose from the upper left corner element to the lower right corner element of the coefficient matrix. Therefore, when factoring the second coefficient matrix, the Figure 2a The decomposition results of the lower triangular matrix and the diagonal matrix obtained in the lower right corner area are saved. When the first coefficient matrix needs to be factored later, the saved decomposition results correspond to Figure 2b The decomposition results corresponding to the upper left corner, lower right corner, and upper left corner are obtained when the lower right corner is decomposed. The saved decomposition result is the target submatrix mentioned above.
[0091] For example, assuming that the third time is M=5, that is, t0+5, the second coefficient matrix A2 in the corresponding second linear equation system is decomposed into A2=L2D2L2 T , intercept the sub-matrix of the first target area in L2, intercept the sub-matrix of the second target area in D2, and use the two intercepted sub-matrices as the target sub-matrices.
[0092] At the first time after that, M=6, i.e., t0+6, it is assumed that the first coefficient matrix A1 in the corresponding first linear equation system is decomposed into A1=L1D1L1 T , a sub-matrix of the third target area is intercepted in L1, and a sub-matrix of the fourth target area is intercepted in D1. The two intercepted sub-matrices correspond to the above-mentioned target sub-matrices intercepted at the previous acquisition time.
[0093] In practice, because the coefficient matrix is 2M × 2M, the dimensions of the factorized matrices are also 2M × 2M. Therefore, when M = 5, the dimensions of L2 and D2 are both 10 × 10, and when M = 6, the dimensions of L1 and D1 are both 12 × 12. After removing the two upper-left rows and two columns from L1, the submatrix for the first target region is obtained as the submatrix for the third target region in L1. After removing the two upper-left rows and two columns from D1, the submatrix for the second target region is obtained as the submatrix for the fourth target region in D1. That is to say, after factoring the coefficient matrix corresponding to M=6, after removing the two rows and two columns in the upper left corner of the lower triangular matrix, the sub-matrix of the first target area is cut out, and this sub-matrix corresponds to the sub-matrix of the first target area in the lower triangular matrix in the factorization result of the coefficient matrix corresponding to M=5; after removing the two rows and two columns in the upper left corner of the diagonal matrix in the factorization result of the coefficient matrix corresponding to M=6, the sub-matrix of the second target area is cut out, and this sub-matrix corresponds to the sub-matrix of the second target area in the diagonal matrix in the factorization result of the coefficient matrix corresponding to M=5.
[0094] Similarly, when M=7, after factoring the coefficient matrix corresponding to M=7, the four rows and four columns at the upper left corner of the lower triangular matrix are removed, and the submatrix of the first target area is extracted. This submatrix corresponds to the submatrix of the first target area extracted when M=6. After factoring the coefficient matrix corresponding to M=7, the four rows and four columns at the upper left corner of the diagonal matrix are removed, and the submatrix of the second target area is extracted. This submatrix corresponds to the submatrix of the second target area extracted when M=6. And so on.
[0095] Based on the above example, it can be seen that after obtaining the factorization result of the coefficient matrix corresponding to the previous time, the target sub-matrix of the specific position area is determined therefrom and can be directly used in the factorization process of the coefficient matrix corresponding to the next time.
[0096] In fact, the computational complexity of the factorization that actually needs to be performed on the first coefficient matrix is a constant that is independent of M, the cycle length T, etc., that is, the computational complexity is O(1).
[0097] In summary, when factoring the first coefficient matrix corresponding to the current acquisition time based on the target submatrix, it is not necessary to completely factorize the first coefficient matrix. Instead, it is sufficient to directly use the target submatrix to partially factorize the first coefficient matrix. In other words, the final factorization result of the current first coefficient matrix will include the target submatrix, and the previous result can be directly used. The remaining part other than the target submatrix is what needs to be factorized. This can accelerate the factorization calculation speed of the coefficient matrix, thereby improving the speed of solving the linear equation system, and helping to achieve the effect of outputting the corresponding periodic trend decomposition results in real time as data is acquired.
[0098] Figure 3 A flowchart of a method for predicting future set time data collection provided by an embodiment of the present invention is shown as follows: Figure 3 As shown, the method includes:
[0099] 301. At the current first time, obtain the first time series data collected from the target object after the second time, and the periodic component vector corresponding to the second time series data collected from the target object before the first time, wherein the second time is earlier than the first time, the first time series data includes the target data collected at the first time, and the time length corresponding to the second time series data is the set period length.
[0100] 302. Construct a first linear equation group for performing periodic trend decomposition on the target data based on the first time series data, the set first weight vector, the second weight vector, and the periodic component vector, wherein the first linear equation group includes a first coefficient matrix.
[0101] 303. Obtain a target submatrix from the factorization result of the second coefficient matrix, where the second coefficient matrix is a coefficient matrix included in a second set of linear equations for performing periodic trend decomposition on data collected at a third time, where the third time is a collection time immediately before the first time, and the target submatrix is determined based on the same value range in the first coefficient matrix and the second coefficient matrix.
[0102] 304. Factorize the first coefficient matrix according to the target submatrix to solve the first linear equation group according to the factorization result of the first coefficient matrix to determine the period component and trend component corresponding to the target data.
[0103] 305. Update the periodic component vector according to the periodic component corresponding to the target data.
[0104] 306. Predict data collected at a set time in the future based on the trend component corresponding to the target data and the updated period component vector.
[0105] In practical applications, for the first time t0+M, after determining the period component and trend component corresponding to the target data in step 304, for example, assuming that the period component is The original periodic component vector is Then update it to According to the trend component corresponding to the target data and the updated period component vector, the data collected at the future set time is predicted. Specifically, the data collected at the future set time Here, i refers to a future collection time that is i collection times away from the current first time t.
[0106] The present invention updates the periodic component vector based on the periodic component corresponding to the target data, and predicts data collected at a set time in the future based on the trend component corresponding to the target data and the updated periodic component vector. This allows for early prediction of operational changes in the target object at a certain time in the future, facilitating timely and better resource scheduling based on these changes. For example, if the target object is a database system and the collected data is page views, if the above method predicts a surge in page views at a certain time in the future, more resources can be promptly expanded (e.g., increasing the database system's available memory capacity, number of processor cores, etc.) to cope with this page view change.
[0107] Figure 4A flowchart of an abnormality detection and processing method provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the method includes:
[0108] 401. At the current first time, obtain the first time series data collected from the target object after the second time, and the periodic component vector corresponding to the second time series data collected from the target object before the first time, wherein the second time is earlier than the first time, the first time series data includes the target data collected at the first time, and the time length corresponding to the second time series data is the set period length.
[0109] 402. Construct a first linear equation group for performing periodic trend decomposition on the target data based on the first time series data, the set first weight vector, the second weight vector, and the periodic component vector, wherein the first linear equation group includes a first coefficient matrix.
[0110] 403. Obtain a target submatrix from the factorization result of the second coefficient matrix, where the second coefficient matrix is a coefficient matrix included in a second set of linear equations for performing periodic trend decomposition on data collected at a third time, where the third time is a collection time immediately before the first time, and the target submatrix is determined based on the same value range in the first coefficient matrix and the second coefficient matrix.
[0111] 404. Factorize the first coefficient matrix according to the target submatrix to solve the first linear equation group according to the factorization result of the first coefficient matrix to determine the period component and trend component corresponding to the target data.
[0112] 405. Determine the residual component corresponding to the target data based on the period component and trend component corresponding to the target data.
[0113] 406. Perform anomaly detection processing on the target data according to the residual component.
[0114] It should be understood that the target data can be decomposed into a period component, a trend component and a residual component. Therefore, after determining the period component and the trend component corresponding to the target data in step 404, the target data y collected at the first time can be used to calculate the target data. t Subtract the periodic component s corresponding to the current moment t and the trend component τ t Get the residual component r t , specifically, the residual component r t =y t ―s t ―τ tAfter determining the residual component corresponding to the target data, the target data can be processed for anomaly detection based on the residual component. For example, the N-sigma algorithm can be used for anomaly detection. When implementing it, the anomaly score of the data collected at the current moment can be determined first. The anomaly score = (r t -e) / σ, where e is the average of the residual components corresponding to all data collected up to the first moment, and σ is the variance corresponding to this average. After obtaining the anomaly score of the target data collected at the current first moment, if the anomaly score is greater than a preset threshold, the target data collected at the current first moment is determined to be an outlier and requires corresponding anomaly handling. Conversely, if the anomaly score is less than the preset threshold, the target data collected at the current first moment is determined to be normal.
[0115] The present invention determines the residual component corresponding to the target data based on the periodic component and trend component corresponding to the target data, and performs anomaly detection processing on the target data based on the residual component. It can determine whether the data collected at the current moment is an abnormal value, so that system faults can be discovered in real time and timely repair processing can be performed.
[0116] In practical applications, the first linear equation system is generally solved using multiple iterations. During the multiple iterations, the first weight vector and the second weight vector are initialized in the first iteration, with each element of the first weight vector and the second weight vector being initialized to have a value of 1. During each iteration, the solution for the variable vector x corresponding to the current iteration is output, and the first weight vector and the second weight vector are updated based on the solution for x for use in the next iteration.
[0117] Since the first weight vector and the second weight vector are updated after each iteration, the first coefficient matrix is also updated after each iteration, and the corresponding first linear equation group is also updated after each iteration. It can be seen that for the periodic trend decomposition task of the target data collected at the first time, multiple first linear equation groups are actually established and solved, and the periodic component and trend component of the target data are determined by the solution of x of the last linear equation group (i.e., the last iteration). The differences between these multiple first linear equation groups are reflected in the differences in the coefficient matrix A. The number of iterations is a preset value greater than 1, such as 3, 6, etc.
[0118] In summary, in the (i+1)th iteration process, the element values corresponding to the first time in the first weight vector and the second weight vector are updated according to the target solution result of the first linear equation group corresponding to the (i)th iteration process, and the first linear equation group corresponding to the (i+1)th iteration process is constructed according to the updated first weight vector and the second weight vector for solution; wherein the target solution result includes the trend components corresponding to the data collected at the first time and the two previous collection times.
[0119] For ease of understanding, the execution of multiple iterations is specifically described by taking the current first time t=t0+M, M=6 as an example:
[0120] During the first iteration:
[0121] The first weight vector p and the second weight vector q are initialized to have the value of each element be one. According to the above description, the first linear equation system corresponding to the first iteration process is established. Solving the first linear equation system, the target solution corresponding to the first iteration process is obtained: the trend component τ of the target data collected at the first time t t and the periodic component s t , the trend component τ corresponding to the data collected at the previous collection time t-1 t―1 , and the trend component corresponding to the data collected at the previous collection time t-2: τ t―2 .
[0122] Afterwards, the first weight vector p and the second weight vector q are updated according to the following formulas (3) and (4).
[0123]
[0124]
[0125] In formula (3), p t Refers to the value in the first weight vector p corresponding to the current first moment t, that is, the last value. t It refers to the value in the second weight vector q corresponding to the current first moment t, that is, the last value.
[0126] It can be seen from this that each time the first weight vector p and the second weight vector q are updated, only the value of the last element thereof needs to be updated, and the values of the other elements remain unchanged.
[0127] Second iteration process:
[0128] After completing the update of the first weight vector p and the second weight vector q, the first linear equation group corresponding to the second iteration process is established according to the updated first weight vector p and the second weight vector q, and the first linear equation group at this time is solved to obtain the target solution result corresponding to the second iteration process: the trend component τ of the target data collected at the first time t t and the periodic component s t , the trend component τ corresponding to the data collected at the previous collection time t-1 t―1 , and the trend component corresponding to the data collected at the previous collection time t-2: τ t―2 It is understandable that the solution results of these four components at this time will be different from the solution results obtained in the previous iteration process. Afterwards, the last element value in the first weight vector p and the second weight vector q is updated according to the above formulas (3) and (4).
[0129] Then the third iteration process is carried out. Similarly, when the last iteration process is executed, the first linear equation group corresponding to the iteration process is solved to finally determine the trend component τ of the target data collected at the first time t t and the periodic component s t .
[0130] From the above, we can see that in each iterative solution process, only the four components of the variable vector x in the first linear system need to be solved. The other components do not need to be solved, thus reducing the number of variables that need to be solved. The method described above to accelerate the factorization process of the first coefficient matrix based on the target submatrix in the factorization result of the second coefficient matrix can be used in each of the above iterations.
[0131] The following introduces a method for optionally factorizing the first coefficient matrix based on the target submatrix and a method for finally determining the periodic trend decomposition result of the target data collected at the first time through Gaussian elimination method based on the factorization result.
[0132] Figure 5 A flowchart of a method for solving a system of linear equations provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the following steps may be included:
[0133] 501. Obtain a difference sub-matrix between a first coefficient matrix and a second coefficient matrix.
[0134] 502. Construct a third matrix of the first type and a fourth matrix of the second type, determine a third submatrix in the third matrix to assign the first submatrix to the third submatrix, and determine a fourth submatrix in the fourth matrix to assign the second submatrix to the fourth submatrix, wherein the third dimensions of the third matrix and the fourth matrix are determined according to the bandwidth of the first coefficient matrix, the first coefficient matrix is a banded matrix, the dimension of the third submatrix is the first dimension, the dimension of the fourth submatrix is the second dimension, and the remaining element values in the third matrix and the fourth matrix are initialized to zero.
[0135] 503. Based on the assigned third matrix, fourth matrix, and difference submatrix, update the remaining element values in the third matrix and the fourth matrix using a set factorization algorithm; the factorization result of the first coefficient matrix includes the updated third matrix and fourth matrix.
[0136] 504. Update the first sub-matrix and the second sub-matrix according to the updated third matrix and the fourth matrix, so as to factorize the next first coefficient matrix.
[0137] 505. Obtain a first constant subvector composed of element values of the first length at the rear end of the constant vector of the first linear equation group, obtain the current second constant subvector, concatenate the first constant subvector and the second constant subvector into a third constant subvector, the dimension of the second constant subvector being the set second length, and the second constant subvector being initialized to the trend component and the period component corresponding to the two data collected after the second time.
[0138] 506. Update the element values in the third constant subvector using Gaussian elimination method based on the updated third matrix and fourth matrix, and determine the period component and trend component corresponding to the target data collected at the first time based on the updated third constant subvector.
[0139] 507. Update the second constant subvector according to the updated third constant subvector.
[0140] The solution method provided in this embodiment includes inputs of A*, b*, L O 、D O 、b O , where the meaning of each input item can be found below and will not be explained here. The output of this solution method includes: the periodic component s corresponding to the target data collected at the first time t t , trend component τ t and the residual component r t .
[0141] To facilitate understanding, a specific example of this solution is given below, where the meaning of each line is explained in detail below:
[0142]
[0143] In this embodiment, assuming that the current first time t is t0+6 (i.e., M=6), then the previous acquisition time is t0+5 (i.e., M=5). As mentioned above, the periodic trend decomposition task executed in the second stage is performed on the data collected at time t0+5 and each acquisition time thereafter. Moreover, when performing periodic trend decomposition processing on the data collected at time t0+5, after establishing the corresponding second linear equation group, the conventional multiple iterative solution process is sampled to finally determine the periodic component, trend component, and residual component of the data collected at this time. The factorization result of the second coefficient matrix contained therein in the last iterative process can be obtained, and the target submatrix can be initialized with the factorization result.
[0144] In practical applications, the second coefficient matrix corresponding to t = t0 + 5 (ie, M = 5) is factorized so that the second coefficient matrix becomes the product of three matrices, i.e., A2 = L2D2L2 T , where A2 represents the second coefficient matrix, L2 is the lower triangular matrix, D2 is the diagonal matrix, L2 T It represents the transpose of L2, which is an upper triangular matrix. The dimensions of these three matrices are 2M×2M=10×10.
[0145] The target submatrix includes a first submatrix L of the first type O and the second submatrix D of the second type O , the first type is a lower triangular matrix, and the second type is a diagonal matrix. Among them, the first submatrix L O With a fixed first dimension of 8×4, the second submatrix D O It has a fixed second dimension of 4×4. Specifically, after obtaining the above L2 and D2, the 8 rows and 4 columns of the upper left corner of L2 can be cut out to form the initial first submatrix L O , extract the 4 rows and 4 columns in the upper left corner from D2 to form the initial second submatrix D O .
[0146] In addition, after finally determining the value of the variable vector x in the second linear equation system, the first four elements are taken out to initialize the second constant subvector b. O , where the first four elements are the trend component and period component corresponding to the data collected at the two acquisition times t=t0+1 and t=t0+2. The second constant subvector b O The dimensions are fixed size: 4.
[0147] After completing the above initialization processing based on the solution of the second linear equation system constructed at time t0+5, at the current first time t0+6, after establishing the corresponding first linear equation system, assuming that the first coefficient matrix contained therein is A1, the difference submatrix A between the first coefficient matrix A1 and the above second coefficient matrix A2 can be obtained first. * For easier understanding, see Figure 2a and Figure 2b ,in, Figure 2a is a specific example diagram of the first coefficient matrix A1, Figure 2b is a specific example diagram of the second coefficient matrix A2, then the difference sub-matrix A at this time * See Figure 2a The 6×6 matrix in the lower right corner. Difference submatrix A * The dimension is fixed to 6×6, that is, the 6×6 matrix in the lower right corner is cut out from the current first coefficient matrix, which is the difference submatrix A. * .
[0148] In addition, the first length (value of 6) of the element value at the rear end of the constant vector b included in the first linear equation system is cut off to form the first constant subvector b*. That is, the dimension of the first constant subvector b* is a fixed size of 6.
[0149] Afterwards, the third matrix of the first type is constructed and a fourth matrix of the second type The third matrix and the fourth matrix It has a third dimension, for example, 10 × 10. It should be noted that the first coefficient matrix A1 is a banded matrix, and the size of the third dimension of the third matrix and the fourth matrix is mapped to the bandwidth of the banded matrix. Therefore, the third dimension of the third matrix and the fourth matrix can be determined according to the bandwidth.
[0150] Then, as shown in the second and third lines of the above method example, the third matrix is initialized first. and the fourth matrix The element values in are all 0. The above zeros(10,10) means that the values of 10×10 elements are all set to 0. Then determine the third matrix The third submatrix in and the fourth matrix The fourth submatrix in The first sub-matrix is assigned to the third sub-matrix, and the second sub-matrix is assigned to the fourth sub-matrix, where: Represents the third matrix 1 to 8, columns 1 to 4. Same thing.
[0151] As shown in the fourth line of the above method example: the second constant subvector b O and the first constant subvector b* to form the third constant subvector The dimension size is 10.
[0152] Afterwards, according to the third matrix after assignment The Fourth Matrix and the difference matrix A * , update the third matrix through the set factorization algorithm and the fourth matrix The remaining element values in can complete the factorization of the first coefficient matrix A1, and the factorization process corresponds to the 5th to 7th and 9th to 10th lines of the above method example. For example, since the third matrix It is a 10×10 matrix, in which the 8×4 third submatrix is composed of the first submatrix L O After assigning values to them, the values of these elements remain unchanged, and only the remaining 2×6 data need to be factored, which significantly reduces the amount of calculation. Moreover, since the sizes of the above matrices and vectors are fixed and do not change with the acquisition time (M), and are also independent of the cycle length, the computational complexity of factoring the coefficient matrix is actually O(1). The factorization algorithm illustrated in the above method example is the Doolittle algorithm, but other algorithms can also be applied.
[0153] Further, as shown in line 17 of the above method example, after obtaining the third matrix and the fourth matrix After the remaining element values in , based on the third matrix obtained at this time and the fourth matrix Update the first submatrix L O and the second submatrix D O , for factoring the next first coefficient matrix (such as the coefficient matrix in the linear equation system established in the next iterative process).
[0154] The above describes the process of performing a single factorization of the first coefficient matrix. Based on this, it can be seen that, by utilizing the factorization results of the coefficient matrix of the linear equation system corresponding to the previous acquisition time, when solving the linear equation system corresponding to the current first time, only the current first coefficient matrix needs to be partially factorized.
[0155] The following describes the process of determining the periodic component and trend component corresponding to the target data through Gaussian elimination method based on the factorization results.
[0156] Specifically, according to the updated third matrix and the fourth matrix (i.e. the element values are determined), and the third constant subvector is updated by Gaussian elimination The element values in are based on the updated third constant subvector Determine the period component and trend component corresponding to the target data collected at the first time. The execution process of the Gaussian elimination method corresponds to lines 8 and 11-16 of the above method example.
[0157] Finally, the third constant subvector is determined After the values of each element in , we can calculate the value of the third constant vector based on Determine the target data y t The corresponding periodic component s t and the trend component τ t . In line 18 of the above method example, the third constant subvector The last two elements in are the periodic components s t and the trend component τ t .
[0158] In addition, refer to line 17 of the above method example, the third constant subvector After the update is completed, according to the third constant subvector at this time Update the second constant subvector b O , so that the subsequent update of the second constant sub-vector b O Proceed to the next calculation.
[0159] In summary, the computational complexity of the coefficient matrix factorization and Gaussian elimination method is O(1), significantly reducing the amount of computation and improving the efficiency of periodic trend decomposition. In applications where frequent data collection generates massive amounts of data, this method can achieve the effect of outputting the periodic trend decomposition results corresponding to the latest collected data in real time.
[0160] In order to more intuitively understand the data decomposition method provided by the embodiment of the present invention, Figure 6 The overall process of the data decomposition method is schematically illustrated.
[0161] like Figure 6 As shown in , the method can be divided into the following three stages: (1) initializing historical data; (2) online decomposition of each newly collected data; (3) performing downstream anomaly detection and / or prediction task processing on the decomposition results of each data.
[0162] Among them, the main processing in stage (1) is as follows: 1. Decompose the historical data using the offline period trend decomposition algorithm and initialize two weight vectors p and q. This process corresponds to the above The decomposition process of each data in this time series data. p and q are initialized as vectors with values of 1.
[0163] In stage (2), the following processing is mainly completed:
[0164] 2. Determine whether the set cycle number threshold is reached. If not, execute step 3; otherwise, execute step 6.
[0165] 3. Use the newly collected data point y t As well as p and q, construct A and b.
[0166] As mentioned above, for the data point y collected at the first time t When performing multiple rounds of iterative decomposition, a loop number threshold is pre-set. During each loop, a new linear equation system is constructed, that is, a new coefficient matrix A and constant vector b are constructed. The specific construction process is described in the above embodiment.
[0167] 4. Use the online decomposition algorithm to solve Ax=b and obtain the period and trend components.
[0168] 5. Update p and q using the period and trend components. Then proceed to the next iteration.
[0169] 6. Output the final decomposed cycle, trend and residual components.
[0170] In stage (3), the following processing is mainly completed:
[0171] 7. Perform anomaly detection on the residual components.
[0172] 8. Use cycle and trend components to predict future data.
[0173] Figure 7 A schematic diagram of a data decomposition device provided by an embodiment of the present invention is shown in FIG. Figure 7 As shown, the device includes: a data acquisition module 11, an equation construction module 12, a matrix acquisition module 13 and an equation solving module 14.
[0174] The data acquisition module 11 is configured to acquire, at a first time, first time series data collected from a target object after a second time, and a periodic component vector corresponding to second time series data collected from the target object before the first time, wherein the second time is earlier than the first time, the first time series data includes the target data collected at the first time, and the time length corresponding to the second time series data is a set period length;
[0175] an equation construction module 12 for constructing a first linear equation system for performing periodic trend decomposition on the target data based on the first time series data, the set first weight vector, the second weight vector, and the periodic component vector, wherein the first linear equation system includes a first coefficient matrix;
[0176] a matrix acquisition module 13, configured to acquire a target submatrix from a factorization result of a second coefficient matrix, where the second coefficient matrix is a coefficient matrix included in a second linear equation system for performing periodic trend decomposition on data collected at a third time, the third time being a collection time immediately preceding the first time, and the target submatrix is determined based on a common value region in the first coefficient matrix and the second coefficient matrix;
[0177] The equation solving module 14 is used to factorize the first coefficient matrix according to the target sub-matrix, so as to solve the first linear equation group according to the factorization result of the first coefficient matrix, so as to determine the period component and trend component corresponding to the target data.
[0178] Optionally, the device further includes: a data prediction module, configured to update a periodic component vector according to a periodic component corresponding to the target data; and predict data collected at a set time in the future according to a trend component corresponding to the target data and the updated periodic component vector.
[0179] Optionally, the device further includes: an anomaly detection module, configured to determine a residual component corresponding to the target data based on a periodic component and a trend component corresponding to the target data; and perform anomaly detection processing on the target data based on the residual component.
[0180] Optionally, the device also includes: a decomposition and processing module, used to obtain multiple data collected from the target object before the second time, the time length corresponding to the multiple data is a multiple of the cycle length; obtain a set number of data collected from the target object at a set number of collection times after the second time, the first time differs from the second time by at least a set number of collection times; and use a batch processing cycle trend decomposition method to decompose and process the multiple data collected before the second time and the set number of data collected after the second time.
[0181] Optionally, the first linear equation group is solved for a set number of iterations; the first weight vector and the second weight vector are initialized so that the value of each element is one; wherein, in the (i+1)th iteration process, the element values corresponding to the first time in the first weight vector and the second weight vector are updated according to the target solution result of the first linear equation group corresponding to the (i)th iteration process, and the first linear equation group corresponding to the (i+1)th iteration process is constructed based on the updated first weight vector and the second weight vector for solution; wherein the target solution result includes the trend component corresponding to the data collected at the first time and the previous two collection times.
[0182] Optionally, the target submatrix includes a first submatrix of the first type and a second submatrix of the second type, the first submatrix has a first dimension, and the second submatrix has a second dimension; the equation solving module 14 is also used to: obtain a difference submatrix between the first coefficient matrix and the second coefficient matrix; construct a third matrix of the first type and a fourth matrix of the second type, the third dimension of the third matrix and the fourth matrix is determined according to the bandwidth of the first coefficient matrix, and the first coefficient matrix is a banded matrix; determine a third submatrix in the third matrix to assign the first submatrix to the third submatrix, and determine a fourth submatrix in the fourth matrix to assign the second submatrix to the fourth submatrix, the dimension of the third submatrix is the first dimension, the dimension of the fourth submatrix is the second dimension, and the remaining element values in the third matrix and the fourth matrix are initialized to zero; according to the assigned third matrix, fourth matrix and difference submatrix, the remaining element values in the third matrix and the fourth matrix are updated through the set factorization algorithm; the factorization result of the first coefficient matrix includes the updated third matrix and fourth matrix. And, obtain a first constant subvector composed of element values of the first length at the rear end of the constant vector of the first linear equation group; obtain the current second constant subvector, the dimension of the second constant subvector is the set second length, and the second constant subvector is initialized to the trend component and periodic component corresponding to the two data collected after the second time; splice the first constant subvector and the second constant subvector into a third constant subvector; update the element values in the third constant subvector according to the updated third matrix and the fourth matrix through the Gaussian elimination method; determine the periodic component and trend component corresponding to the target data according to the updated third constant subvector.
[0183] Optionally, the apparatus further includes: a matrix updating module, configured to update the first sub-matrix and the second sub-matrix according to the updated third matrix and the fourth matrix, so as to factorize the next first coefficient matrix.
[0184] Optionally, the device further includes: a vector updating module, configured to update the second constant subvector according to the updated third constant subvector.
[0185] An embodiment of the present invention provides an electronic device, such as Figure 8 As shown, the electronic device may include: a processor 21, a memory 22, and a communication interface 23. The memory 22 stores executable codes, which, when executed by the processor 21, enable the processor 21 to execute the data decomposition method in the aforementioned embodiment.
[0186] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor executes the data decomposition method in the aforementioned embodiment.
[0187] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Those skilled in the art can understand and implement the present invention without inventive effort.
[0188] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by a combination of hardware and software. Based on this understanding, the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0189] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A data decomposition method, characterized in that: include: At a first time, first time series data collected from a target object after a second time, and a period component vector corresponding to second time series data collected from the target object before the first time are obtained, wherein the second time is earlier than the first time, the first time series data includes the target data collected at the first time, and the time length corresponding to the second time series data is a set period length; the collected time series data is an indicator for evaluating the operation status of the database system, and the indicator includes CPU utilization, number of connections, number of accesses per second, and disk usage; Constructing a first linear equation system for performing periodic trend decomposition on the target data based on the first time series data, the set first weight vector, the second weight vector, and the periodic component vector, wherein the first linear equation system includes a first coefficient matrix; Obtaining a target submatrix from a factorization result of a second coefficient matrix, where the second coefficient matrix is a coefficient matrix included in a second system of linear equations for performing periodic trend decomposition on data collected at a third time, the third time being a collection time preceding the first time, and the target submatrix is determined based on a common value region in the first coefficient matrix and the second coefficient matrix; factoring the first coefficient matrix according to the target submatrix to solve the first linear equations according to the factorization results of the first coefficient matrix to determine the period component and the trend component corresponding to the target data; Solving the first linear equations according to the factorization result of the first coefficient matrix to determine the period component and the trend component corresponding to the target data includes: Obtain a first constant subvector composed of element values of a first length at the rear end of the constant vector of the first linear equation group; Obtaining a current second constant subvector, where the dimension of the second constant subvector is a set second length, and the second constant subvector is initialized to the trend component and the period component corresponding to the two data collected after the second time; splicing the first constant subvector and the second constant subvector into a third constant subvector; updating the element values in the third constant subvector by Gaussian elimination according to the updated third matrix and fourth matrix; Determine the period component and trend component corresponding to the target data according to the updated third constant subvector; Based on the periodic component and the trend component, performing a task of detecting the operational safety of the corresponding database system; The detection tasks include: Determine whether the data currently collected is an outlier, so as to detect system failures in real time and perform repairs; and Predict the data that the database system may output at a certain time in the future to predict changes in the operating status of the database system.
2. The method according to claim 1, characterized in that The method further comprises: Updating the periodic component vector according to the periodic component corresponding to the target data; According to the trend component corresponding to the target data and the updated period component vector, data collected at a set time in the future is predicted.
3. The method according to claim 1, characterized in that The method further comprises: Determining a residual component corresponding to the target data according to a period component and a trend component corresponding to the target data; Anomaly detection processing is performed on the target data according to the residual component.
4. The method according to claim 1, wherein The method further comprises: Acquire a plurality of data collected from the target object before the second time, where a time length corresponding to the plurality of data is a multiple of the period length; Acquire a set amount of data collected from the target object at a set number of collection times after the second time, wherein the first time differs from the second time by at least the set number of collection times; A batch processing period trend decomposition method is adopted to decompose the plurality of data collected before the second time and the set number of data collected after the second time.
5. The method according to claim 1, characterized in that Solving the first linear equation system for a set number of iterations; initializing the first weight vector and the second weight vector so that the value of each element is 1; wherein, in the (i+1)th iteration process, the element values corresponding to the first time in the first weight vector and the second weight vector are updated according to the target solution result of the first linear equation group corresponding to the (i)th iteration process, and the first linear equation group corresponding to the (i+1)th iteration process is constructed based on the updated first weight vector and the second weight vector for solution; The target solution result includes trend components corresponding to the data collected at the first time and the two previous collection times.
6. The method according to any one of claims 1 to 5, characterized in that The target submatrix includes a first submatrix of a first type and a second submatrix of a second type, the first submatrix having a first dimension, and the second submatrix having a second dimension; The factorizing the first coefficient matrix according to the target submatrix includes: Obtaining a difference submatrix between the first coefficient matrix and the second coefficient matrix; constructing a third matrix of the first type and a fourth matrix of the second type, wherein the third dimensions of the third matrix and the fourth matrix are determined according to the bandwidth of the first coefficient matrix, and the first coefficient matrix is a band matrix; Determine a third submatrix in the third matrix to assign the first submatrix to the third submatrix, and determine a fourth submatrix in the fourth matrix to assign the second submatrix to the fourth submatrix, wherein the dimension of the third submatrix is the first dimension, the dimension of the fourth submatrix is the second dimension, and the remaining element values in the third matrix and the fourth matrix are initialized to zero; According to the assigned third matrix, the fourth matrix and the difference submatrix, the remaining element values in the third matrix and the fourth matrix are updated through the set factorization algorithm; the factorization result of the first coefficient matrix includes the updated third matrix and fourth matrix.
7. The method according to claim 6, characterized in that The method further comprises: The first sub-matrix and the second sub-matrix are updated according to the updated third matrix and the fourth matrix, so as to be used for factorizing the next first coefficient matrix.
8. The method according to claim 1, characterized in that The method further comprises: The second constant subvector is updated according to the updated third constant subvector.
9. An electronic device, characterized in that: include: A memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the data decomposition method according to any one of claims 1 to 8.
10. A non-transitory machine-readable storage medium, characterized in that The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor is caused to perform the data decomposition method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Tensor data decomposition method and system
CN111143762A
Periodicity detection and period length estimation in time series
CN112989266A