A similarity query method for indefinite long time series data

Through data envelope block and iSAX index tree technology, the problem of low query efficiency of high-dimensional time series is solved, unified query of indefinite long time series is realized, significantly reducing data storage overhead and improving query efficiency, supporting efficient query and accurate Obtaining results.

CN118245641BActive Publication Date: 2024-09-17DONGHAI LAB
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410383252.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-01
Publication Date
2024-09-17
Estimated Expiration
2044-04-01

AI Technical Summary

Technical Problem

Existing time series similarity query methods suffer from the 'curse of dimensionality' problem in high-dimensional or ultra-high-dimensional data, resulting in low query efficiency. In addition, traditional index methods have high computational complexity, low data scale scalability, and cannot effectively support variable lengths. Unified query of time series.

Method used

Using data envelope block construction and time series indexing technology based on symbolic representation, through segmented aggregation approximate representation and iSAX index tree construction, unified query of indefinite long time series is realized, reducing data storage overhead and improving query efficiency.

Benefits of technology

Significantly reduces the complexity of data storage space, improves query efficiency, supports efficient approximate and precise queries, has high robustness and query accuracy, and can quickly filter nodes that do not meet the requirements while maintaining a certain accuracy, improving query performance. speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118245641B
    Figure CN118245641B
Patent Text Reader

Abstract

The present invention discloses a similarity query method for indefinite long time series data, including three steps: data envelope block construction, data index construction, and query processing. First, the local features of subsequences of unequal lengths are extracted using a segmented representation method, and the upper and lower boundaries of the subsegment features are calculated; then, a symbolic aggregation approximate index structure is constructed for the envelope block data; finally, the candidate set is quickly filtered based on the lower bound distance to achieve approximate query and precise query. The data envelopment technology proposed in the present invention can effectively support the normalization of time series data, and can achieve unified and efficient query processing for query requirements of arbitrary length. The present invention reduces the spatial complexity of data storage, ensures the similarity of query results, significantly improves query efficiency, and has high robustness. It can play an important role in the fields of big data and data mining, artificial intelligence, databases, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of big data, database, data mining, etc., and specifically relates to a method for similarity query of indefinite long time series data. Background Art

[0002] Time series are widely present in people's daily lives and industrial production, such as real-time transaction data of funds or stocks, daily sales data of the retail market, sensor monitoring data of process industries, astronomical observation data, aerospace radar, satellite monitoring data, real-time weather temperature and air quality index, etc.

[0003] Time series similarity query, also known as time series sample retrieval, has a wide range of application needs in the industry. For example, in real-time trading in the stock market, traders want to query the most similar stock trend to the current stock trend from massive historical stock data. k The historical sequences are used as references to obtain valuable knowledge and inspiration and complete transactions. Obviously, the simplest way to solve this problem is to linearly scan the database. However, this method of comparing the query sequence with each sequence in the database one by one has a high time overhead. Therefore, the industry usually adopts spatial indexing methods such as R-tree, R*-tree, grid file, etc. However, the performance of most spatial indexing methods will degrade rapidly as the dimension of the time series increases, that is, the "dimensionality disaster" occurs. Therefore, before constructing a spatial index for the time series, the traditional query method will first use a specific data representation method to extract the features of the time series to achieve dimensionality reduction.

[0004] At present, the commonly used data representation methods in the industry can be divided into non-data adaptive methods and data adaptive methods. For the former, the transformation parameters are not affected by the individual time series and remain unchanged; this type of representation is mostly based on spectral decomposition, such as discrete Fourier transform, discrete wavelet transform, and discrete cosine transform. They mainly extract the main spectral coefficients as features by performing corresponding frequency domain transformations on the original time series; each of these methods has its own defects, such as discrete Fourier transform can only extract overall morphological features while ignoring local features, discrete wavelet transform can only process time series with an exponential length of 2, and the lower bound of discrete cosine transform features is too weak, resulting in very low query efficiency. Data adaptive representation means that the determination of transformation parameters needs to rely on the data itself; by adding data-sensitive selection processing, most non-data adaptive methods can be transformed into data adaptive methods. This type of method includes segmented clustering approximation, segmented linear approximation, symbolic clustering approximation, singular value decomposition, principal component analysis, etc. The first three methods need to segment the original time series first, and then process each sub-segment separately: segmented clustering approximation is to find the average value of each segment; segmented linear approximation is to fit each segment; symbolic clustering approximation is to discretize the average value of each segment into symbols based on segmented clustering approximation; according to the different approximation degrees of the original time series, their query performance will be different. Singular value decomposition and principal component analysis are achieved by performing a unified feature matrix decomposition on all time series; the typical defects of these two methods are that they have high computational complexity, and the decomposition process can only be completed in memory, and the scalability of data scale is very low.

[0005] Most of the indexing methods used by the industry so far are tree-based spatial indexing methods. B-trees were first used to index one-dimensional data and are the basis of many hierarchical index structures; R-tree series, such as R*-tree, R + -tree, etc., use the minimum bounding rectangle to organize data, but the minimum bounding rectangle will cover a large amount of space without data, resulting in a large number of "false hits" in the query results, thereby reducing query efficiency; A-tree uses vector approximation files to store the upper and lower boundaries of the minimum bounding rectangle and the virtual bounding rectangle, thereby ensuring low index overhead and high query completeness. Since time series in industrial production have high-dimensional or ultra-high-dimensional characteristics, even if dimensionality reduction is performed within an acceptable range of precision loss, it may still have a very high dimension. Therefore, tree-based indexing methods are prone to the "dimensionality disaster" problem. Summary of the invention

[0006] In order to solve the shortcomings of the prior art, achieve the purpose of significantly reducing the space complexity of data storage and improving query efficiency, the present invention adopts the following technical solutions:

[0007] A similarity query method for indefinite long time series data includes the following steps:

[0008] (1) Data envelope block construction: Split the time series data within the query length range, perform segmented aggregation approximation on the obtained subsequence data of unequal lengths, obtain the eigenvalues ​​of the subsegments corresponding to each subsequence, and construct an envelope block based on the eigenvalues;

[0009] (2) Data index construction: Obtain the symbolic representation of each envelope block boundary and construct a time series index based on the symbolic representation for all envelope blocks. The envelope block-based indexing technology enables unified query of time series of various lengths, reduces data storage overhead, and improves query efficiency.

[0010] (3) Query processing: The query sequence is represented approximate by segmented symbols, and the lower bound distance to each node in the time series index is calculated in turn. The data contained in the group of nodes with the smallest lower bound distance is used as the approximate query result. Compared with the precise query that requires disk I / O to query and compare the original data, this part is performed in memory and is faster. In addition, the method itself can quickly filter out nodes that do not meet the requirements and their corresponding subtrees or child nodes while maintaining a certain query accuracy to obtain approximate query results.

[0011] Furthermore, in step (3), the original data contained in the leaf nodes whose lower bound distance is less than the query threshold are read in sequence, the Euclidean distance between each original data and the query sequence is calculated, and the original data less than the query threshold is used as the accurate query result. After the leaf nodes are quickly filtered, the original data is accurately queried and compared through disk I / O, thereby improving efficiency while ensuring query accuracy.

[0012] Furthermore, the step (1) includes the following sub-steps:

[0013] (1.1) Use a sliding window to split the time series data within the query length range to obtain subsequence data sets of unequal lengths;

[0014] (1.2) Divide each subsequence into subsegments of equal length and obtain the eigenvalues ​​of the subsegments;

[0015] (1.3) Obtain the maximum and minimum values ​​of the corresponding sub-segment feature values ​​between sub-sequences and construct the sub-segment envelope block.

[0016] Furthermore, in the step (1.2), a sub-segment length is preset, each sub-sequence is segmented, and a sequence number is set for the segmented sub-segments. If the final sub-segment length is less than the preset sub-segment length, the sub-segment is discarded. In the step (1.3), the maximum and minimum values ​​of the characteristic values ​​of the sub-segments with the same sequence number of all sub-sequences are obtained as the upper and lower boundaries to construct a sub-segment envelope block.

[0017] Furthermore, the normalization process in step (1.2) is: z - Normalization processing is performed to make each subsequence conform to Gaussian distribution. The average value of each subsegment is calculated as its characteristic value. According to statistical principles, the subsequence conforms to Gaussian probability distribution, and each subsegment on the subsequence also conforms to Gaussian probability distribution;

[0018] Furthermore, in step (2), the binary symbol representation of each envelope block boundary is calculated, and a binary symbol representation of each envelope block boundary is constructed for all envelope blocks. i SAX indexing includes the following sub-steps:

[0019] (2.1) Based on the Gaussian probability distribution, the real number interval is divided into several subintervals with equal probability, and each subinterval is encoded with a continuous binary number. According to the interval where the upper and lower boundary values ​​of the envelope block are located, it is represented in a binary encoding form. The upper and lower boundary values ​​of the envelope block are the maximum and minimum values ​​of the eigenvalues ​​in the envelope block;

[0020] (2.2) According to the binary codes of the upper and lower boundaries of each subsequence envelope block, insert them into the upper boundary respectively. i SAX index trees and lower bounds i The SAX index tree splits the child nodes in sequence according to the order of the binary encoding of each sub-segment from back to front until the leaf node.

[0021] Furthermore, in step (3), the query sequence symbol representation is calculated in sequence i The lower bound distance of each node in the SAX index tree is used to quickly filter leaf nodes and output the data contained in the leaf node with the smallest lower bound distance as the approximate query result, including the following sub-steps:

[0022] (3.1) According to steps (1.2) and (2.1), the query sequence is approximately represented by segmented symbol aggregation, and the upper and lower i On the SAX boundary index tree, the distance between each child node and the symbolic representation of the query sequence is calculated in sequence starting from the root node. If the distance is greater than the threshold, the search for the subtree after the corresponding child node is terminated until the index tree is traversed and the leaf node that meets the threshold is returned;

[0023] (3.2) Sort the leaf nodes from small to large according to the distance value, output the first few leaf nodes that meet the query quantity threshold, and use the subsequences they contain as the approximate query results;

[0024] (3.3) Through disk I / O, read the original data contained in the leaf nodes whose lower bound distance is less than the query threshold in turn, calculate their Euclidean distance with the query sequence, and output the data less than the query threshold as the accurate query result.

[0025] The advantages and beneficial effects of the present invention are:

[0026] 1. The traditional similarity query method for indefinite long time series requires the construction of multiple data indexes for various predetermined lengths, while the present invention only needs to construct one index to realize similarity query of any length, which not only greatly reduces the space complexity of data storage, but also significantly improves the query efficiency;

[0027] 2. Traditional similarity query methods for indefinite long time series cannot support data normalization processing, resulting in invalid similarity measurement results and query results. The indexing technology based on data envelopment blocks proposed in the present invention introduces a unified lower bound distance for normalized subsequences of unequal lengths, effectively ensuring the similarity of query results and query efficiency.

[0028] 3. The present invention supports both efficient approximate and exact queries, and k Neighbor queries and range queries have high availability and are highly robust to query length and dataset size. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a flow chart of a method in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0031] like Figure 1 As shown in the figure, a similarity query method for indefinite long time series data is used for the intraday minute-level stock price time series data of a listed company in 2023 (about 250 stock price series with a length of 240), and a similarity query of any length within the range of 60 to 80 minutes is realized. Specifically, the following steps are included:

[0032] (1) Constructing data envelope blocks: Split the time series data within the query length range, perform segmented aggregation approximation on the obtained subsequence data of unequal lengths, calculate the maximum and minimum values ​​of the characteristic values ​​of the subsegments with the same sequence number to construct an envelope block, which specifically includes the following sub-steps:

[0033] (1.1) Use a sliding window to split the time series data within the query length range to obtain subsequence data sets of unequal lengths;

[0034] In the embodiment of the present invention, a sliding window with a length of 60 to 80 is used to split each stock price sequence with a length of 240 to obtain a data set of stock price subsequences of unequal lengths;

[0035] (1.2) Normalize each subsequence and divide it into equal-length subsegments, and calculate the average value of each subsegment as the eigenvalue;

[0036] In the embodiment of the present invention, each subsequence is respectively z - Normalization processing, then according to the preset sub-segment length 20, each sub-sequence is divided into equal-length sub-segments. If the final sub-segment length is less than 20, the sub-segment is discarded; at the same time, the average value of each sub-segment is calculated as its characteristic value;

[0037] (1.3) Obtain the maximum and minimum values ​​of the characteristic values ​​of the sub-segments with the same sequence number of all sub-sequences, and construct the sub-segment envelope block.

[0038] In the embodiment of the present invention, the maximum eigenvalue and the minimum eigenvalue are obtained as envelope boundaries in all sub-segment sets with sub-sequence numbers 1, 2, 3, and 4, respectively, and envelope blocks are constructed for the sub-segment sets with four numbers.

[0039] (2) Data index construction, calculate the binary symbol representation of each envelope block boundary, and construct i SAX indexing includes the following sub-steps:

[0040] (2.1) Based on the Gaussian probability distribution, the real number interval is divided into several subintervals with equal probability, and each subinterval is encoded with a continuous binary number. According to the interval where the upper and lower boundary values ​​of the envelope block are located, it is represented in binary code form;

[0041] In the embodiment of the present invention, based on the Gaussian probability distribution, the real number interval is divided into four subintervals with equal probability, and each subinterval is encoded in turn into a binary representation {00, 01, 10, 11}, and according to the interval where the upper and lower boundary values ​​of the envelope block are located, it is represented in a binary encoding form, such as {(01, 00), (11, 10), (11, 01), (10, 01)};

[0042] (2.2) According to the binary codes of the upper and lower boundaries of each subsequence envelope block, insert them into the upper boundary respectively. i SAX index trees and lower bounds i The SAX index tree splits the child nodes in sequence according to the order of the binary code of each sub-segment from back to front until the leaf node;

[0043] In the embodiment of the present invention, the lower and upper boundaries of each subsequence envelope block are binary coded, such as the lower and upper boundaries of the subsequence envelope containing 3 subsegments are represented as (11-01-10, 01-00-10), which are inserted into the upper boundary respectively. i SAX index trees and lower bounds i The SAX index tree splits the child nodes in sequence according to the order of the binary code of each sub-segment from back to front until the leaf node;

[0044] (3) Query processing: perform segmented symbolic approximation on the query sequence and calculate its i The lower bound distance of each node in the SAX index tree is used to quickly filter leaf nodes; the data contained in the leaf node with the smallest lower bound distance is output as the approximate query result; the original data contained in the leaf nodes with lower bound distances less than the query threshold are read in sequence, the Euclidean distance between each data and the query sequence is calculated, and the data less than the query threshold is returned as the precise query result, which specifically includes the following sub-steps:

[0045] (3.1) According to steps (1.2) and (2.1), the query sequence is approximately represented by segmented symbol aggregation, and the two i On the SAX boundary index tree, the distance between each child node and the symbolic representation of the query sequence is calculated in sequence starting from the root node. If the distance is greater than the threshold, the search for the subtree after the corresponding child node is terminated until the index tree is traversed and the leaf node that meets the threshold is returned;

[0046] In this embodiment of the present invention, given a query sequence of length 70, it is represented as a binary code sequence 10-00-11 according to steps (1.2) and (2.1). i On the SAX boundary index tree, starting from the root node, calculate the distance between each child node and 10-00-11. If the distance is greater than the threshold, terminate the search for the subtree after the corresponding child node until the index tree is traversed and the leaf nodes that meet the threshold are returned (assuming 10);

[0047] (3.2) Sort the leaf nodes from small to large according to the distance value, output the first few leaf nodes that meet the query quantity threshold, and use the subsequences they contain as the approximate query results;

[0048] In the embodiment of the present invention, the 10 leaf nodes are sorted from small to large according to the distance value. n If the number of subsequences contained in (≤10) leaf nodes is greater than the query result quantity threshold, then the output n -1 leaf node contains the subsequence as the approximate query result;

[0049] (3.3) Through disk I / O, read the original data contained in the leaf nodes whose lower bound distance is less than the query threshold in turn, calculate their Euclidean distance with the query sequence, and output the data less than the query threshold as the accurate query result.

[0050] In the embodiment of the present invention, the original data contained in 10 leaf nodes are read in sequence through disk I / O. If the length is equal to 70, the Euclidean distance between the original query sequence and the original query sequence is calculated, and all subsequences less than the distance threshold are output as accurate query results.

[0051] Aiming at the problem of similarity query of arbitrary length of time series, the present invention proposes a similarity query method of indefinite long time series data, which can effectively support data normalization through data envelope block technology and ensure the validity of query results. At the same time, the indexing technology based on envelope blocks realizes the unified query of time series of various lengths, significantly reduces the data storage overhead and improves the query efficiency. The present invention can be widely used in time series data mining tasks in industrial production and daily life.

[0052] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A similarity query method for indefinite long time series data, characterized in that The steps include: (1) Data envelope block construction: Split the time series data within the query length range, perform segmented aggregation approximation on the obtained subsequence data of unequal lengths, obtain the eigenvalues ​​of the subsegments corresponding to each subsequence, and construct an envelope block based on the eigenvalues; (2) Data index construction; Obtain the symbolic representation of each envelope block boundary, and construct a time series index based on the symbolic representation for all envelope blocks; Compute the binary symbolic representation of each envelope block boundary and construct a i SAX indexing includes the following sub-steps: (2.1) Based on the Gaussian probability distribution, the real number interval is divided into several subintervals with equal probability, and each subinterval is encoded with a continuous binary number. According to the interval where the upper and lower boundary values ​​of the envelope block are located, it is represented in a binary encoding form. The upper and lower boundary values ​​of the envelope block are the maximum and minimum values ​​of the eigenvalues ​​in the envelope block; (2.2) According to the binary codes of the upper and lower boundaries of each subsequence envelope block, insert them into the upper boundary respectively. i SAX index trees and lower bounds i The SAX index tree splits the child nodes in sequence according to the order of the binary code of each sub-segment from back to front until the leaf node; (3) Query processing; The query sequence is represented by segmented symbols, and the lower bound distance to each node in the time series index is calculated in turn. The data contained in the group of nodes with the smallest lower bound distance is taken as the approximate query result.

2. According to claim 1, a similarity query method for indefinite long time series data is characterized by: In step (3), the original data contained in the leaf nodes whose lower bound distance is less than the query threshold are read in sequence, the Euclidean distance between each original data and the query sequence is calculated, and the original data less than the query threshold is taken as the accurate query result.

3. A similarity query method for indefinite long time series data according to claim 1 or 2, characterized in that: The step (1) comprises the following sub-steps: (1.1) Use a sliding window to split the time series data within the query length range to obtain subsequence data sets of unequal lengths; (1.2) Divide each subsequence into subsegments of equal length and obtain the eigenvalues ​​of the subsegments; (1.3) Obtain the maximum and minimum values ​​of the corresponding sub-segment feature values ​​between sub-sequences and construct the sub-segment envelope block.

4. The method for similarity query of indefinite long time series data according to claim 3 is characterized by: In the step (1.2), a sub-segment length is preset, each sub-sequence is segmented, and a sequence number is set for the segmented sub-segments. If the final sub-segment length is less than the preset sub-segment length, the sub-segment is discarded. In the step (1.3), the maximum and minimum values ​​of the characteristic values ​​of the sub-segments with the same sequence number of all sub-sequences are obtained as the upper and lower boundaries to construct a sub-segment envelope block.

5. The method for similarity query of indefinite long time series data according to claim 3 is characterized by: The normalization process in step (1.2) is z - Normalization processing, calculate the average value of each sub-segment as its feature value.

6. The method for similarity query of indefinite long time series data according to claim 1, characterized in that: In step (3), the query sequence symbol representation is calculated in sequence i The lower bound distance of each node in the SAX index tree is filtered, and the data contained in the leaf node with the smallest lower bound distance is output as the approximate query result, including the following sub-steps: (3.1) The query sequence is approximately represented by segmented symbol aggregation, in the upper and lower i On the SAX boundary index tree, the distance between each child node and the symbolic representation of the query sequence is calculated in sequence starting from the root node. If the distance is greater than the threshold, the search for the subtree after the corresponding child node is terminated until the index tree is traversed and the leaf node that meets the threshold is returned; (3.2) Sort the leaf nodes from small to large according to the distance value, output the first few leaf nodes that meet the query quantity threshold, and use the subsequences they contain as the approximate query results; (3.3) Read the original data contained in the leaf nodes whose lower bound distance is less than the query threshold in turn, calculate their Euclidean distance with the query sequence, and output the data less than the query threshold as the precise query result.

Citation Information

Patent Citations

  • Time sequence similarity query method based on inverted indexes

    CN104182460A

  • Financial time series similarity query method based on K-chart expression

    CN104572886A

  • Method of constructing binary electric-power sequential data index based on Geohash

    CN107273471A

  • Geoword-based multivariate power time series data indexing method

    CN107329993A

  • Distributed index method for massive time series

    CN108319678A