Database native time sequence decomposition method and system
By converting the database native time series decomposition problem into linear equation solution problem, and using decomposition pre-calculation algorithm and backward substitution calculation, the problems of large query overhead and low efficiency in the existing technology are solved, and efficient time series decomposition query is achieved.
Patent Information
- Application Number
- CN202411802221.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-12-09
AI Technical Summary
When querying the decomposition results of time series in the database, the query overhead is huge, inefficient, and it is easy to cause repeated calculations due to the needs of different decomposition tasks.
The database native time series decomposition problem is converted into linear equation solving problems based on the preset single-round periodic trend decomposition algorithm, and the parameter matrix is determined, and the decomposition pre-calculation algorithm is used to perform forward substitution calculations on the time series data of a single page to obtain the pre-calculation result. Recalculate according to the query scope, and obtain the decomposition result of the database native time series through backward substitution calculation.
It significantly improves the query efficiency of time series decomposition results, reduces duplicate calculations, and can quickly respond to user's decomposition query requests.
Smart Images

Figure CN119862219A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database technology, and in particular to a database native time series decomposition method and system. Background Art
[0002] With the rapid development of Internet of Things technology, a large number of sensors and devices have generated massive amounts of time series data. These data contain rich feature information. Through periodic trend decomposition, trend features, periodic features and residual features can be extracted, providing key support for downstream applications such as prediction and anomaly detection. Existing periodic trend decomposition methods fail to fully consider the storage characteristics of the database. When querying the decomposition results of the time series in the database, it is usually necessary to decompose the time series data from scratch, which not only leads to huge query overhead, but also easily generates repeated calculations on the same data part due to the needs of different decomposition tasks. Summary of the invention
[0003] The present invention provides a database native time series decomposition method and system to solve the defects of huge query overhead and low query efficiency in the prior art. The present invention can quickly respond to the user's decomposition query request, thereby significantly improving the decomposition result query efficiency.
[0004] The present invention provides a database native time series decomposition method, comprising: based on a preset single-cycle trend decomposition algorithm, converting the database native time series decomposition problem into a linear equation solving problem, and determining the parameter matrix of the linear equation; according to the parameter matrix, based on a preset decomposition pre-calculation algorithm, performing forward substitution calculation on the time series data of a single page in the database to obtain a pre-calculation result; the calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of the single page; according to a query range, based on a preset recalculation algorithm, recalculating the pre-calculation results of the first and last parts of the query range to obtain the recalculated pre-calculation results; based on the preset query decomposition algorithm, performing backward substitution calculation on the recalculated pre-calculation results to obtain the decomposition result of the database native time series.
[0005] According to a database native time series decomposition method provided by the present invention, the database native time series decomposition problem is: , in, For time series x In time i The value of For time series in time i Trend items, For time series in time i The periodic term of For time series in timei The residual term of N is the length of the time series, M is the length of the cycle, is the smoothing parameter, is a first-order difference operator, is the second-order difference operator, is the periodic difference operator, For time series in time i +1 trend value, For time series in time i A trend value of -1, is the baseline period term, i For time.
[0006] According to a database native time series decomposition method provided by the present invention, the database native time series decomposition problem is converted into a linear equation solving problem based on a preset single-round periodic trend decomposition algorithm. After determining the parameter matrix of the linear equation, it also includes: decomposing the parameter matrix based on a preset pruning matrix decomposition algorithm to obtain a decomposed parameter matrix, so as to perform the forward substitution calculation step according to the decomposed parameter matrix.
[0007] A database native time series decomposition method provided by the present invention also includes: pre-calculating the missing data in the page according to a preset page missing data supplement algorithm.
[0008] A database native time series decomposition method provided according to the present invention also includes: recalculating the pre-calculated results of the data at the connection of adjacent pages based on the preset recalculation algorithm to merge adjacent pages; the adjacent pages include adjacent pages, separated pages and overlapping pages.
[0009] According to a database native time series decomposition method provided by the present invention, the decomposition pre-calculation algorithm satisfies the relationship: , in, is the pre-calculated result, i For time, is the start timestamp, L is the lower triangular parameter matrix, b is the constant term vector in the linear equation, is the intermediate vector in the forward substitution process, For vector b The i elements, for No. k Quantity, For the matrixL No. i - Row, No. k - Elements of a column.
[0010] According to a database native time series decomposition method provided by the present invention, the recalculation algorithm satisfies the relationship: , in, is the pre-calculated result after recalculation, is the forward substitution operator, For the m -1 The starting timestamp of the page, m is the page number, L is the lower triangular parameter matrix, b is the constant term vector in the linear equation, is the intermediate vector in the forward substitution process.
[0011] According to a database native time series decomposition method provided by the present invention, the query decomposition algorithm satisfies the following relationship: , in, For database native time series i The decomposition results, is the backward substitution operator, The timestamp at the end of the query range. L is the lower triangular parameter matrix, d is the parameter matrix D Elements of is the intermediate vector in the forward substitution process, y is the decomposition result of the native time series of the database, is the pre-calculated result, is the parameter matrix D No. i elements, N is the length of the time series, l is the parameter matrix L Elements of y k for y No. k A quantity.
[0012] The present invention also provides a database native time series decomposition system, comprising: a conversion module, used to convert the database native time series decomposition problem into a linear equation solving problem based on a preset single-round periodic trend decomposition algorithm, and determine the parameter matrix of the linear equation; a pre-calculation module, used to perform forward substitution calculation on the time series data of a single page in the database based on the parameter matrix and a preset decomposition pre-calculation algorithm to obtain a pre-calculation result; the calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of the single page; a recalculation module, used to recalculate the pre-calculation results of the first and last parts of the query range based on a preset recalculation algorithm according to the query range, and obtain the recalculated pre-calculation results; a query module, used to perform backward substitution calculation on the recalculated pre-calculation results based on a preset query decomposition algorithm to obtain the decomposition result of the database native time series.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, any one of the database native time series decomposition methods described above is implemented.
[0014] The present invention provides a database native time series decomposition method and system, the method comprising: based on a preset single-cycle trend decomposition algorithm, converting the database native time series decomposition problem into a linear equation solving problem, determining the parameter matrix of the linear equation; based on the parameter matrix, performing forward substitution calculation on the time series data of a single page in the database based on a preset decomposition pre-calculation algorithm to obtain a pre-calculation result; the calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of the single page; based on the query range, recalculating the pre-calculation results of the first and last parts of the query range based on a preset recalculation algorithm to obtain the recalculated pre-calculation results; performing backward substitution calculation on the recalculated pre-calculation results based on a preset query decomposition algorithm to obtain the decomposition result of the database native time series. The present invention can quickly respond to the user's decomposition query request, thereby significantly improving the decomposition result query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 creative work.
[0016] Figure 1 It is a flow chart of the database native time series decomposition method provided by the present invention.
[0017] Figure 2It is a schematic diagram of the principle of the time series database paging storage diagram provided by the present invention.
[0018] Figure 3 It is a schematic diagram of the principle of the pruned matrix decomposition algorithm provided by the present invention.
[0019] Figure 4 It is the pruned version of the single cycle trend decomposition method provided by the present invention. Flowchart of the decomposition algorithm.
[0020] Figure 5 It is a schematic diagram of the principle of the pre-calculated intermediate result merging process provided by the present invention.
[0021] Figure 6 It is a schematic diagram of the principle of deploying the native time series decomposition method provided by the present invention in a database.
[0022] Figure 7 It is a structural schematic diagram of the database native time series decomposition system provided by the present invention.
[0023] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0025] Please refer to Figure 1 , Figure 1 A schematic flow chart of the database native time series decomposition method provided by the present invention.
[0026] Please refer to Figure 2 , Figure 2 A schematic diagram of the principle of the time series database paging storage diagram provided by the present invention.
[0027] In order to solve the problem that the existing time series period trend decomposition methods are difficult to be directly applied to databases, and to make full use of the storage characteristics of databases to improve the decomposition efficiency, the present invention provides a database native time series decomposition method and deploys it in the open source time series database Apache IoTDB.
[0028] The cycle trend decomposition method converts time series It can be decomposed into three parts: trend term, cycle term and residual term.
[0029] Among them, the trend item Describes a long-term upward or downward trend; a cyclical term Describe the cycle as M The periodic characteristics of Describes short-term stochastic fluctuations.
[0030] i. Time series databases often use the LSM-Tree (Log-Structured Merge-Tree) structure to store time series data in batches as unmodifiable page files.
[0031] Sequences within the same page are sorted in chronological order, and sequences on different pages can be divided into three categories: adjacent, separated, and overlapping, according to the timestamp range.
[0032] The present invention provides a database native time series decomposition method, comprising: 101: Based on the preset single-cycle trend decomposition algorithm, the database native time series decomposition problem is converted into a linear equation solving problem, and the parameter matrix of the linear equation is determined.
[0033] Please refer to Figure 3. Figure 3 A schematic diagram of the principle of the pruned matrix decomposition algorithm provided by the present invention.
[0034] Please refer to Figure 4 , Figure 4 A schematic flow chart of the decomposition algorithm after pruning of the single-cycle trend decomposition method provided by the present invention.
[0035] In this embodiment, the database native time series decomposition problem is defined so that it can be converted into a linear equation solution problem, thereby achieving rapid decomposition results through a single cycle. In addition, a matrix representation of the decomposition problem is provided, and the sparsity and repeatability of the parameter matrix are fully utilized to perform pruning optimization on the linear equation solution process, thereby significantly improving the solution efficiency. The decomposition result can be generated by scanning the data only once, laying the foundation for its expansion into a pre-calculation method.
[0036] Specifically, the preset single-cycle trend decomposition algorithm needs to meet the following requirements: low noise, i.e. random fluctuations Minimize; periodicity, differences in periodic components at the same phase Small; smoothness, trend changes Smoother.
[0037] As a preferred embodiment, the database native time series decomposition problem is: , in, For time series x In time i The value of For time series in time i Trend items, For time series in time i The periodic term of For time series in time i The residual term of N is the length of the time series, M is the length of the cycle, is the smoothing parameter, is a first-order difference operator, is the second-order difference operator, is the periodic difference operator, For time series in time i +1 trend value, For time series in time i A trend value of -1, is the baseline period term, i For time.
[0038] The database native time series decomposition problem is converted into a linear equation solving problem. The linear equation is , . The parameter matrices are: , The parameter matrix A It is expressed as: , in, is the set of real numbers, is a periodic parameter vector, A 1. A 2 and A 3 is the matrix A sub-matrix of .
[0039] Then the parameter matrix A It exhibits two important properties: Sparsity: A is a banded matrix with a bandwidth of 4, that is: , in, For the matrix A No. i Line j The elements of the column, i is the row index, j is the column index, N is the length of the input time series.
[0040] Repetitiveness: Except for the first row and the last four rows, the elements in the remaining rows present an alternating and repeating pattern, namely: , in, , is the second-order diagonal difference operator, For the matrix A No. i -2 lines j -2 elements of the column.
[0041] As a preferred embodiment, based on a preset single-round periodic trend decomposition algorithm, the database native time series decomposition problem is converted into a linear equation solving problem. After the parameter matrix of the linear equation is determined, it also includes: decomposing the parameter matrix based on a preset pruning matrix decomposition algorithm to obtain a decomposed parameter matrix, and performing a forward substitution calculation step according to the decomposed parameter matrix.
[0042] In this embodiment, in order to solve the linear equation , the parameter matrix A This breaks down into: , Considering the parameter matrix A The sparsity and repetitiveness of L (The factorized parameter matrix) has similar sparsity and convergence properties.
[0043] Sparsity: L is a lower triangular matrix with bandwidth 4, that is: , in, is the parameter matrix L No. i Line j Elements of a column.
[0044] Convergence: and Converges, that is, for any positive real number , all exist , so that for all Both exist: .
[0045] in, is the parameter matrix L No. i +2 lines j +2 columns of elements, is the parameter matrix D No. i+2 lines j +2 columns of elements, is the parameter matrix D No. i Line j The elements of the column, is a set of natural numbers.
[0046] Based on the above two properties, the pruned version of the single-cycle trend decomposition method is given. Decomposition algorithm: Input parameter matrix A ; Start traversing from the first row; initialize the decomposition matrix L , D ; Calculate the matrix D Next row of elements; calculate the matrix L Next row elements; judgment matrix L , D Whether it converges; In the case where the two matrices converge, the matrix L and D Assign the same value to every other row; if the two matrices do not converge, return to the step to calculate the matrix D The next row of elements is repeated and iterated until the two matrices converge. Determine whether to traverse to the last four rows; if the last four rows are calculated, output the parameter matrix L and D ; If the last four rows are not calculated, return to the matrix L and D Assign the same value to every other row and repeat the iteration until the last four rows are traversed.
[0047] 102: According to the parameter matrix, a forward substitution calculation is performed on the time series data of a single page in the database based on a preset decomposition pre-computation algorithm to obtain a pre-computation result; the calculation parameters of the decomposition pre-computation algorithm correspond to the timestamp of the time series data of the single page.
[0048] In this embodiment, the forward substitution process in the single-round cycle trend decomposition method is calculated by decomposing the pre-calculation algorithm, and the intermediate results obtained by the calculation are stored in the database. On this basis, combined with the cycle and trend information contained in the decomposition results of the historical time series, the missing values appearing in the pre-calculation process are processed using the features obtained by local decomposition, so that the decomposition method can adapt to actual application scenarios containing missing values.
[0049] Specifically, since the pages in the database are stored in different locations, it is necessary to precompute the data on each page independently. Since the calculation only involves a single page, the start and end timestamps are defined as and Then, according to the parameter matrix, the time series data of a single page in the database is forward-substituted and calculated based on the preset decomposition pre-calculation algorithm to obtain the pre-calculation result. The calculation parameters in the decomposition pre-calculation algorithm and the timestamp of the time series data of a single page correspond.
[0050] As a preferred embodiment, the decomposition pre-calculation algorithm satisfies the relationship: , in, To precompute the results, i For time, is the start timestamp, L is the lower triangular parameter matrix, b is the constant term vector in the linear equation, is the intermediate vector in the forward substitution process, For vector b The i elements, for No. k Quantity, For the matrix L No. i - Row, No. k - Elements of a column.
[0051] As a preferred embodiment, it also includes: pre-calculating the missing data in the page according to a preset page missing data supplement algorithm.
[0052] In this embodiment, for non-header data, since there is sufficient valid historical information, by utilizing the historical decomposition feature, a preset page missing data supplement algorithm can be used to process the missing data in the page. The calculation method is: , in, for No. j Quantity, for y No. j Quantity, for No.2 i - 1 serving, for y No.2 i - 3 servings, For the i The periodic component, for No.2 i Quantity, is the parameter matrix L i - j Line k - j Elements of a column.
[0053] Through the above calculation process, a supplementary pre-calculation result value is obtained.
[0054] 103: According to the query range, the pre-calculated results of the first and last parts of the query range are recalculated based on a preset recalculation algorithm to obtain a recalculated pre-calculated result.
[0055] As a preferred embodiment, the recalculation algorithm satisfies the relationship: , in, is the pre-calculated result after recalculation, is the forward substitution operator, For the m -1 The starting timestamp of the page, m is the page number, L is a lower triangular matrix, b is the constant term vector in the linear equation, is the intermediate vector in the forward substitution process, b i For vector b The i elements, for No. k Quantity, For the matrix L No. i - Row, No. k - Elements of a column.
[0056] As a preferred embodiment, it also includes: recalculating the pre-calculated results of the connection data of adjacent pages based on a preset recalculation algorithm to merge adjacent pages; the adjacent pages include adjacent pages, separated pages and overlapping pages.
[0057] Please refer to Figure 5 , Figure 5 A schematic diagram of the principle of the pre-calculated intermediate result merging process provided by the present invention.
[0058] Considering the requirements of periodic trend decomposition: time series are collected at equal time intervals, there are no missing values in the data, and timestamps are arranged in chronological order. However, these assumptions are often difficult to meet in practical applications. Time series data is usually stored in a time series database based on LSM-Tree. This type of database stores data in units of data pages, and the timestamps between different data pages may not be continuous, and there may even be data arriving out of order. In addition, due to reasons such as sensor or network failures, missing values often appear in time series data.
[0059] In this embodiment, a method for efficiently merging decomposed intermediate results is proposed in combination with the storage characteristics of the database. A corresponding pre-calculated intermediate result merging strategy is designed for the three situations of adjacency, separation, and overlap of timestamp ranges caused by out-of-order data arrival between different pages of the database. Only part of the data at the intersection between pages is recalculated without recalculating all the data, which can effectively process out-of-order data and significantly reduce the overhead of merging calculations.
[0060] Specifically, with respect to the page structure used by the database when storing data, and the disk page merge operation that may be triggered as the data scale increases, in this embodiment, in the storage organization structure used by LSM-Tree, each page stores a time series x A fragment of a page. The larger the page number, the newer its data. Due to missing values and out-of-order arrival, different pages may appear in timestamps as follows: the timestamps of adjacent pages (page 1 and page 2) are continuous; there are gaps between the timestamps of separated pages (page 2 and page 3), such as the interval caused by missing values or delayed values; the delayed value of the timestamp of the overlapping pages (page 3 and page 4) will supplement the incomplete data in the previous page with a smaller number. In order to reconstruct the time series x Pre-computed intermediate results, these pages with different relationships need to be merged.
[0061] For adjacent pages, recalculate the data at the connection based on the preset recalculation algorithm until Converge to , that is, for any positive integer ,exist ,for ,have , merge adjacent pages.
[0062] For separated pages, if and only if there are missing values between the two pages, m -1 page and m The page is a separate page. x and z There are deficiencies, for middle ,for middle If both are missing, it is necessary to use the page missing data supplement algorithm mentioned above to process the missing data, and then use the same method for adjacent pages to converge and recalculate to merge adjacent separated pages.
[0063] For overlapping pages, In case of overlap, first extract all data within the overlapping timestamps. If the same timestamp data exists on both pages, keep the data with the larger page code. Then recalculate all intermediate results of the overlapping part. Finally, use the above convergence to recalculate the m Based on the page pre-calculation results, adjacent overlapping pages are merged.
[0064] Please refer to Figure 6 , Figure 6 A schematic diagram of the principle of deploying the native time series decomposition method provided by the present invention in a database.
[0065] In this embodiment, the beginning of the data within the query range is recalculated, and the starting point of the pre-calculated result is adjusted from the beginning of the page to the beginning of the query range; secondly, the end of the data within the query range is recalculated, and the ending point of the pre-calculated result is adjusted from the end of the page to the end of the query range.
[0066] The head recalculation process is: ; The tail recalculation process is: ; in, is the pre-calculated result after the head is recalculated. is the pre-calculated result after the tail is recalculated, The timestamp for the start of the query range.
[0067] 104: Perform a backward substitution calculation on the recalculated pre-calculated result based on a preset query decomposition algorithm to obtain a decomposition result of the database native time series.
[0068] As a preferred embodiment, the query decomposition algorithm satisfies the following relationship: , in, The database native time series i decomposition results, when i is an odd number, ; When i is an even number, ; is the backward substitution operator, The timestamp at the end of the query range. L is the lower triangular parameter matrix, d is the parameter matrix D Elements of is the intermediate vector in the forward substitution process, y is the decomposition result of the native time series of the database, To precompute the results, is the parameter matrix D No. i elements, N is the length of the time series, l is the parameter matrix L Elements of y k for y No. k A quantity.
[0069] In this embodiment, backward substitution calculation is performed based on the preset query decomposition algorithm, the head recalculation result, and the tail recalculation result to obtain the decomposition result of the database native time series, which can quickly respond to the user's decomposition query request and quickly generate the complete decomposition result of the queried time series, thereby significantly improving the decomposition result query efficiency.
[0070] The database native time series decomposition system provided by the present invention is described below. The database native time series decomposition system described below and the database native time series decomposition method described above can be referenced to each other.
[0071] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of the database native time series decomposition system provided by the present invention.
[0072] The present invention also provides a database native time series decomposition system, including: a conversion module 701, which is used to convert the database native time series decomposition problem into a linear equation solving problem based on a preset single-round periodic trend decomposition algorithm, and determine the parameter matrix of the linear equation; a pre-calculation module 702, which is used to perform forward substitution calculation on the time series data of a single page in the database based on the parameter matrix and a preset decomposition pre-calculation algorithm to obtain a pre-calculation result; the calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of a single page; a recalculation module 703, which is used to recalculate the pre-calculation results of the first and last parts of the query range based on a preset recalculation algorithm according to the query range, and obtain the recalculated pre-calculation results; a query module 704, which is used to perform backward substitution calculation on the recalculated pre-calculation results based on the preset query decomposition algorithm to obtain the decomposition result of the database native time series.
[0073] Figure 8 An example of a structural diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 communicate with each other through the communication bus 804. The processor 801 may call the logic instructions in the memory 803 to execute the database native time series decomposition method, which includes: converting the database native time series decomposition problem into a linear equation solving problem based on a preset single-round cycle trend decomposition algorithm, and determining the parameter matrix of the linear equation; performing forward substitution calculation on the time series data of a single page in the database based on the preset decomposition pre-calculation algorithm according to the parameter matrix to obtain the pre-calculation result; the calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of a single page; recalculating the pre-calculation results of the head and tail parts of the query range based on the preset recalculation algorithm according to the query range to obtain the recalculated pre-calculation result; performing backward substitution calculation on the recalculated pre-calculation result based on the preset query decomposition algorithm to obtain the decomposition result of the database native time series.
[0074] In addition, the logic instructions in the above-mentioned memory 803 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.
[0075] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the database native time series decomposition method provided by the above methods, which includes: based on a preset single-round periodic trend decomposition algorithm, converting the database native time series decomposition problem into a linear equation solving problem, and determining the parameter matrix of the linear equation; based on the parameter matrix, performing forward substitution calculation on the time series data of a single page in the database based on a preset decomposition pre-calculation algorithm to obtain a pre-calculation result; the calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of a single page; based on the query range, recalculating the pre-calculation results of the first and last parts of the query range based on a preset recalculation algorithm to obtain the recalculated pre-calculation results; performing backward substitution calculation on the recalculated pre-calculation results based on the preset query decomposition algorithm to obtain the decomposition result of the database native time series.
[0076] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the database native time series decomposition method provided by the above-mentioned methods, the method comprising: converting the database native time series decomposition problem into a linear equation solving problem based on a preset single-round periodic trend decomposition algorithm, and determining a parameter matrix of the linear equation; performing forward substitution calculation on the time series data of a single page in the database based on the parameter matrix based on a preset decomposition pre-calculation algorithm to obtain a pre-calculation result; the calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of a single page; recalculating the pre-calculation results of the first and last parts of the query range based on a preset recalculation algorithm based on the query range to obtain the recalculated pre-calculation results; performing backward substitution calculation on the recalculated pre-calculation results based on the preset query decomposition algorithm to obtain the decomposition result of the database native time series.
[0077] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0078] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0079] 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 embodiments of the present invention.
Claims
1. A database native time series decomposition method, characterized in that: include: Based on a preset single-cycle trend decomposition algorithm, the database native time series decomposition problem is converted into a linear equation solving problem, and a parameter matrix of the linear equation is determined; According to the parameter matrix, a forward substitution calculation is performed on the time series data of a single page in the database based on a preset decomposition pre-calculation algorithm to obtain a pre-calculation result; The calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of the single page; According to the query range, recalculate the precalculated results of the first and last parts of the query range based on a preset recalculation algorithm to obtain recalculated precalculated results; Based on a preset query decomposition algorithm, a backward substitution calculation is performed on the recalculated pre-calculated result to obtain a decomposition result of the database native time series.
2. The database native time series decomposition method according to claim 1, characterized in that: The database native time series decomposition problem is: , in, For time series x In time i The value of For time series in time i Trend items, For time series in time i The periodic term of For time series in time i The residual term of N is the length of the time series, M is the length of the cycle, is the smoothing parameter, is a first-order difference operator, is the second-order difference operator, is the periodic difference operator, For time series in time i +1 trend value, For time series in time i A trend value of -1, is the baseline period term, i For time.
3. The database native time series decomposition method according to claim 1, characterized in that: The method converts the database native time series decomposition problem into a linear equation solving problem based on a preset single-cycle trend decomposition algorithm, and after determining the parameter matrix of the linear equation, further includes: The parameter matrix is decomposed based on a preset pruning matrix decomposition algorithm to obtain a decomposed parameter matrix, so as to perform the forward substitution calculation step according to the decomposed parameter matrix.
4. The database native time series decomposition method according to claim 1, characterized in that: Also includes: The missing data in the page is supplemented and pre-calculated according to the preset page missing data supplement algorithm.
5. The database native time series decomposition method according to claim 1, characterized in that: Also includes: Recalculating the precalculated results of the data at the connection of adjacent pages based on the preset recalculation algorithm to merge the adjacent pages; The adjacent pages may be in the form of adjoining pages, separated pages, and overlapping pages.
6. The database native time series decomposition method according to claim 1, characterized in that: The decomposition pre-calculation algorithm satisfies the relationship: , in, is the pre-calculated result, i For time, is the start timestamp, L is the lower triangular parameter matrix, b is the constant term vector in the linear equation, is the intermediate vector in the forward substitution process, For vector b The i elements, for No. k Quantity, For the matrix L No. i - Row, No. k - Elements of a column.
7. The database native time series decomposition method according to claim 1, characterized in that: The recalculation algorithm satisfies the relationship: , in, is the pre-calculated result after recalculation, is the forward substitution operator, For the m -1 The starting timestamp of the page, m is the page number, L is the lower triangular parameter matrix, b is the constant term vector in the linear equation, is the intermediate vector in the forward substitution process.
8. The database native time series decomposition method according to any one of claims 1 to 7, characterized in that: The query decomposition algorithm satisfies the relationship: , in, For database native time series i The decomposition results, is the backward substitution operator, The timestamp at the end of the query range. L is the lower triangular parameter matrix, d is the parameter matrix D Elements of is the intermediate vector in the forward substitution process, y is the decomposition result of the native time series of the database, is the pre-calculated result, is the parameter matrix D No. i elements, N is the length of the time series, l is the parameter matrix L Elements of y k for y No. k A quantity.
9. A database native time series decomposition system, characterized in that: include: A conversion module, used to convert the database native time series decomposition problem into a linear equation solving problem based on a preset single-cycle trend decomposition algorithm, and determine a parameter matrix of the linear equation; A pre-calculation module, used to perform forward substitution calculation on the time series data of a single page in the database according to the parameter matrix and based on a preset decomposition pre-calculation algorithm to obtain a pre-calculation result; The calculation parameters of the decomposition pre-calculation algorithm correspond to the timestamp of the time series data of the single page; A recalculation module, configured to recalculate the precalculation results of the first and last parts of the query range based on a preset recalculation algorithm according to the query range to obtain the recalculated precalculation results; The query module is used to perform backward substitution calculation on the recalculated pre-calculated result based on a preset query decomposition algorithm to obtain a decomposition result of the database native time series.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the database native time series decomposition method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Hybrid processing method and device for unit and multivariate time series data and computer equipment
CN115630100A
Time sequence prediction method based on decomposition mechanism and attention mechanism
CN116579447A
Method and system for characterizing time series
US11061934B1
Multi-corporation venture plan validation and inclusion of time series geospatial markers in analyses employing an advanced decision platform
WO2018112374A1