Time series data retrieval method and device, terminal equipment and storage medium

By uniformly sampling time-series data groups and constructing a skip list with a breadth-first storage layout, the problem of poor adaptability in existing technologies is solved, enabling efficient retrieval of both uniform and non-uniform data, and improving query efficiency and performance.

CN122045281APending Publication Date: 2026-05-15ELECTRIC POWER RES INST OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ELECTRIC POWER RES INST OF GUANGDONG POWER GRID CO LTD
Filing Date
2026-02-10
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing technologies cannot achieve optimal performance across all scenarios, have poor adaptability, and cannot effectively utilize the uniform or non-uniform distribution characteristics of time-series data, resulting in high query latency.

Method used

By uniformly sampling the time-series data group, the distribution status is determined. If it is uniform, interpolation is used for positioning. If it is not uniform, a skip list with a breadth-first storage layout is constructed to perform tree search and binary search, thereby realizing an adaptive retrieval strategy.

Benefits of technology

It enables efficient retrieval of both uniform and non-uniform data, significantly improving query efficiency and achieving optimal performance across all scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122045281A_ABST
    Figure CN122045281A_ABST
Patent Text Reader

Abstract

The invention discloses a time sequence data retrieval method and device, terminal equipment and a storage medium, and belongs to the field of data retrieve.The method comprises the steps that a time sequence data set is obtained and evenly sampled, and a plurality of check points are obtained; calculating an actual interval between the check points, and judging a data distribution state of the time sequence data set; if the time sequence data set is uniformly distributed, performing interpolation positioning on the time sequence data set according to a target timestamp, and outputting a pointer corresponding to a target data element; and if the time sequence data set is non-uniformly distributed, carrying out secondary sampling on the time sequence data set, constructing a skip list of breadth-first storage layout according to the sampled elements, carrying out tree search, positioning to a target data interval, carrying out binary search, and outputting a pointer corresponding to a target data element. The problems that in the prior art, the whole scene cannot be covered to give play to the optimal performance, and adaptability is poor can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data retrieval, and in particular to a time-series data retrieval method, apparatus, terminal device, and storage medium. Background Technology

[0002] In the time-series databases of modern power systems, efficient point lookup of ordered timestamp sequences is a core fundamental capability. Its performance directly determines the efficiency of point lookup and range lookup, and thus affects the real-time query experience and throughput of the entire database system.

[0003] Currently, the mainstream technical solutions include: basic binary search, skip list binary search, and database indexing. Basic binary search is suitable for small-scale data or scenarios without special distribution characteristics. Skip list binary search and database indexing both employ a time complexity of O(logN), failing to utilize the distribution characteristics of timestamps approximating an arithmetic sequence, thus failing to achieve the theoretical efficiency of interpolation search and resulting in high query latency. Furthermore, existing solutions all use fixed strategies, employing the same retrieval logic regardless of whether the data distribution is uniform or non-uniform, failing to cover all scenarios and achieve optimal performance. Summary of the Invention

[0004] This invention provides a time-series data retrieval method, apparatus, terminal device, and storage medium, which can solve the technical problems of existing technologies that cannot cover all scenarios and achieve optimal performance and have poor adaptability.

[0005] This invention provides a time-series data retrieval method, comprising: Acquire a time series data set and perform uniform sampling on the time series data set to obtain several checkpoints; Calculate the actual interval between each checkpoint, and determine the data distribution state of the time-series data group based on the actual interval; wherein, the data distribution state includes: uniform distribution and non-uniform distribution; If the time series data group is uniformly distributed, then the time series data group is interpolated and located according to the target timestamp, and the corresponding pointer is output after the target data element is located in the uniformly distributed time series data group. If the time-series data group is non-uniformly distributed, the time-series data group is sampled a second time. A skip list with a breadth-first storage layout is constructed based on the sampled elements. A tree search is performed on the skip list with the breadth-first storage layout based on the target timestamp to locate the target data interval. A binary search is performed in the target data interval. After the target data element is found in the target data interval, the corresponding pointer is output.

[0006] As a preferred embodiment, the step of acquiring a time-series data set and uniformly sampling the time-series data set to obtain several checkpoints includes: Obtain a time-series data set; wherein the time-series data set includes several data elements, each of which includes: a timestamp and a data value; Based on the timestamp of the data element, a preset step size is set, and the data elements in the time series data group are uniformly sampled according to the preset step size to obtain several uniformly distributed data elements as checkpoints.

[0007] As a preferred embodiment, the step of calculating the actual interval between each checkpoint and determining the data distribution status of the time-series data group based on the actual interval includes: Calculate the actual interval between each checkpoint based on the timestamp of the data element corresponding to each checkpoint; Calculate the error between the actual interval and the preset theoretical interval; If the error is less than a preset threshold, then the time series data group is determined to be uniformly distributed; If the error is greater than or equal to a preset threshold, then the time series data group is determined to be non-uniformly distributed.

[0008] As a preferred embodiment, after the step of interpolating and positioning the time-series data group, the method further includes: If the target data element is not located in a uniformly distributed time series data set, perform a binary search on the uniformly distributed time series data set based on the target timestamp. If, during the binary search process, the pointer corresponding to the target data element is found in a uniformly distributed time-series data set, then the pointer corresponding to the target data element is output. If, during the binary search process, the pointer corresponding to the target data element is not found in the uniformly distributed time-series data set, a null pointer is output.

[0009] As a preferred embodiment, the step of performing secondary sampling on the time-series data group and constructing a skip list with a breadth-first storage layout based on the sampled elements includes: Based on the preset skip list size, the sampling step size is calculated, and based on the sampling step size, the time series data group is sampled at equal intervals to obtain sampling elements; wherein, each sampling element includes a corresponding index and an element timestamp value; Based on the breadth-first storage layout, an initial skip list is constructed, and the sampled elements are filled into the initial skip list to obtain the final skip list of the breadth-first storage layout.

[0010] As a preferred embodiment, the step of performing a tree search on the skip list of the breadth-first storage layout based on the target timestamp to locate the target data interval includes: Starting from the highest-level node in the skip list of the breadth-first storage layout, the target index range is located sequentially from the index and element timestamp value, combined with the target timestamp. Based on the target index range, locate the timestamp range on the skip list of the breadth-first storage layout as the target data range.

[0011] As a preferred embodiment, the step of performing a binary search in the target data interval, and outputting the corresponding pointer after finding the target data element in the target data interval, includes: A binary search is performed in the target data interval to match the timestamp and corresponding data value that are the same as the target timestamp in the target data interval, thereby obtaining the target data element; Output the pointer corresponding to the target data element.

[0012] The present invention also provides a time-series data retrieval device, comprising: an acquisition module, a judgment module, a uniform module, and a non-uniform module; The acquisition module is used to acquire a time series data group and uniformly sample the time series data group to obtain a number of check points; The judgment module is used to calculate the actual interval between each checkpoint and, based on the actual interval, determine the data distribution state of the time-series data group; wherein, the data distribution state includes: uniform distribution and non-uniform distribution; The uniformity module is used to perform interpolation positioning on the time series data group according to the target timestamp if the time series data group is uniformly distributed, and output the corresponding pointer after locating the target data element in the uniformly distributed time series data group. The non-uniform module is used to perform secondary sampling on the time-series data group if the time-series data group is non-uniformly distributed, construct a skip list with a breadth-first storage layout based on the sampled elements, perform a tree search on the skip list with the breadth-first storage layout based on the target timestamp, locate the target data interval, perform a binary search in the target data interval, and output the corresponding pointer after finding the target data element in the target data interval.

[0013] As a preferred embodiment, the step of acquiring a time-series data set and uniformly sampling the time-series data set to obtain several checkpoints includes: Obtain a time-series data set; wherein the time-series data set includes several data elements, each of which includes: a timestamp and a data value; Based on the timestamp of the data element, a preset step size is set, and the data elements in the time series data group are uniformly sampled according to the preset step size to obtain several uniformly distributed data elements as checkpoints.

[0014] As a preferred embodiment, the step of calculating the actual interval between each checkpoint and determining the data distribution status of the time-series data group based on the actual interval includes: Calculate the actual interval between each checkpoint based on the timestamp of the data element corresponding to each checkpoint; Calculate the error between the actual interval and the preset theoretical interval; If the error is less than a preset threshold, then the time series data group is determined to be uniformly distributed; If the error is greater than or equal to a preset threshold, then the time series data group is determined to be non-uniformly distributed.

[0015] As a preferred embodiment, after the step of interpolating and positioning the time-series data group, the method further includes: If the target data element is not located in a uniformly distributed time series data set, perform a binary search on the uniformly distributed time series data set based on the target timestamp. If, during the binary search process, the pointer corresponding to the target data element is found in a uniformly distributed time-series data set, then the pointer corresponding to the target data element is output. If, during the binary search process, the pointer corresponding to the target data element is not found in the uniformly distributed time-series data set, a null pointer is output.

[0016] As a preferred embodiment, the step of performing secondary sampling on the time-series data group and constructing a skip list with a breadth-first storage layout based on the sampled elements includes: Based on the preset skip list size, the sampling step size is calculated, and based on the sampling step size, the time series data group is sampled at equal intervals to obtain sampling elements; wherein, each sampling element includes a corresponding index and an element timestamp value; Based on the breadth-first storage layout, an initial skip list is constructed, and the sampled elements are filled into the initial skip list to obtain the final skip list of the breadth-first storage layout.

[0017] As a preferred embodiment, the step of performing a tree search on the skip list of the breadth-first storage layout based on the target timestamp to locate the target data interval includes: Starting from the highest-level node in the skip list of the breadth-first storage layout, the target index range is located sequentially from the index and element timestamp value, combined with the target timestamp. Based on the target index range, locate the timestamp range on the skip list of the breadth-first storage layout as the target data range.

[0018] As a preferred embodiment, the step of performing a binary search in the target data interval, and outputting the corresponding pointer after finding the target data element in the target data interval, includes: A binary search is performed in the target data interval to match the timestamp and corresponding data value that are the same as the target timestamp in the target data interval, thereby obtaining the target data element; Output the pointer corresponding to the target data element.

[0019] The present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the time-series data retrieval method as described in any of the above.

[0020] The present invention also provides a computer-readable storage medium, comprising: a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the time-series data retrieval method as described in any of the preceding claims.

[0021] The following benefits can be obtained by implementing the present invention: This invention acquires a time-series data set, performs uniform sampling on the data set to obtain several checkpoints, and then calculates the actual interval between each checkpoint. This determines whether the time-series data set is uniformly or non-uniformly distributed, thereby determining different retrieval schemes. For uniformly distributed time-series data sets, interpolation is used to directly locate the target data element and output the corresponding pointer. For non-uniformly distributed time-series data sets, a skip list with a breadth-first storage layout is constructed to quickly converge to a target data interval in the original time-series data set. A binary search is then performed within the target data interval to locate the corresponding target data element and output the corresponding pointer. This achieves an adaptive strategy for time-series data retrieval, improving retrieval efficiency for both uniform and non-uniform data, and achieving optimal performance across all scenarios. Attached Figure Description

[0022] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating a time-series data retrieval method according to an embodiment of the present invention; Figure 2 This is a flowchart of data uniformity determination provided in an embodiment of the present invention; Figure 3 This is a flowchart of skip list construction provided in an embodiment of the present invention; Figure 4 This is a flowchart of time-series data retrieval provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a time-series data retrieval device provided in an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.

[0026] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0028] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0029] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).

[0030] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.

[0031] Example 1 See Figure 1 To address the technical problems of existing technologies that cannot cover all scenarios and have poor adaptability, an embodiment of the present invention provides a time-series data retrieval method, comprising the following steps S101-S104: S101: Acquire a time series data set and perform uniform sampling on the time series data set to obtain several checkpoints.

[0032] As a preferred embodiment, the step of acquiring a time-series data set and uniformly sampling the time-series data set to obtain several checkpoints includes: Obtain a time-series data set; wherein the time-series data set includes several data elements, each of which includes: a timestamp and a data value; Based on the timestamp of the data element, a preset step size is set, and the data elements in the time series data group are uniformly sampled according to the preset step size to obtain several uniformly distributed data elements as checkpoints.

[0033] It is understandable that the beneficial effects of "acquiring a time-series data set and uniformly sampling the time-series data set to obtain several checkpoints" are as follows: by acquiring a time-series data set containing timestamps and uniformly sampling based on a preset step size set by the timestamps, uniformly distributed checkpoints are generated, thereby significantly reducing data redundancy, improving processing efficiency, reducing storage overhead, and ensuring that the checkpoints are highly representative, which is convenient for subsequent time series analysis, anomaly detection or model training, and achieving more reliable and efficient data monitoring and decision support.

[0034] In this embodiment, the time-series data group includes several data elements, which are data distributed in the time dimension. Each data element includes a corresponding timestamp and data value.

[0035] In this embodiment, by determining the timestamp of a data element, the sampling time step for uniformly sampling data elements in a time-series data group can be determined, thereby uniformly sampling multiple checkpoints in the time-series data group. For example, this can be set at the beginning and end positions, 1 / 4, 1 / 2, 3 / 4, etc., of the time-series data group.

[0036] S102: Calculate the actual interval between each checkpoint, and determine the data distribution state of the time series data group based on the actual interval; wherein the data distribution state includes: uniform distribution and non-uniform distribution.

[0037] As a preferred embodiment, the step of calculating the actual interval between each checkpoint and determining the data distribution status of the time-series data group based on the actual interval includes: Calculate the actual interval between each checkpoint based on the timestamp of the data element corresponding to each checkpoint; Calculate the error between the actual interval and the preset theoretical interval; If the error is less than a preset threshold, then the time series data group is determined to be uniformly distributed; If the error is greater than or equal to a preset threshold, then the time series data group is determined to be non-uniformly distributed.

[0038] It is understandable that the beneficial effect of "calculating the actual interval between each checkpoint and judging the data distribution status of the time series data group based on the actual interval" is as follows: by calculating the error between the actual time interval between each checkpoint and the preset theoretical interval, and comparing it with the preset threshold, the distribution characteristics (uniform or non-uniform) of the time series data group can be automatically and efficiently judged. This provides an objective and quantitative reliable basis for the selection of subsequent data processing or analysis strategies, effectively avoids the complexity of manual judgment, and improves the accuracy and process efficiency of time series data quality assessment.

[0039] In this embodiment, the preset theoretical interval can be set manually according to actual needs and specific circumstances, or the theoretical uniform interval can be calculated based on the total time range of the current time series data group and used as the preset theoretical interval.

[0040] In this embodiment, each data element corresponding to each checkpoint has a corresponding timestamp. The timestamp interval between each checkpoint is calculated as the actual interval, and then the error between the actual interval and the preset theoretical interval is calculated. Preferably, it can be the maximum relative error. If the maximum relative error of all sampling points is less than the preset threshold (preferably, it can be set to 15%, and the specific size can be set according to the actual situation), it is determined to be uniformly distributed; otherwise, it is determined to be non-uniformly distributed.

[0041] Furthermore, for time series data sets with few data points or a time range of zero, they can be directly treated as uniformly distributed data.

[0042] For example, to Figure 2 As shown, when the number of data points in a time series data set is less than 3, the time series data set is determined to be uniformly distributed. When the time range in the time series data set is zero, the time series data set is also directly determined to be uniformly distributed. For other time series data sets, the maximum relative error is calculated by setting a theoretical uniform interval and sampling at multiple checkpoints. The maximum relative error is then compared with a preset threshold to determine whether the time series data set is uniformly distributed.

[0043] S103: If the time series data group is uniformly distributed, then according to the target timestamp, the time series data group is interpolated and located, and after the target data element is located in the uniformly distributed time series data group, the corresponding pointer is output.

[0044] As a preferred embodiment, after the step of interpolating and positioning the time-series data group, the method further includes: If the target data element is not located in a uniformly distributed time series data set, perform a binary search on the uniformly distributed time series data set based on the target timestamp. If, during the binary search process, the pointer corresponding to the target data element is found in a uniformly distributed time-series data set, then the pointer corresponding to the target data element is output. If, during the binary search process, the pointer corresponding to the target data element is not found in the uniformly distributed time-series data set, a null pointer is output.

[0045] The beneficial effects of "when the target data element is not located in a uniformly distributed time-series data set, perform a binary search on the uniformly distributed time-series data set based on the target timestamp; if a pointer to the target data element is found in the uniformly distributed time-series data set during the binary search, output the pointer to the target data element; if no pointer to the target data element is found in the uniformly distributed time-series data set during the binary search, output a null pointer" are as follows: By implementing a binary search algorithm in a uniformly distributed time-series data set, the data element is quickly located based on the target timestamp. The uniform distribution characteristic greatly improves the search efficiency and significantly reduces the time complexity. When the search is successful, the pointer to the target data element is accurately returned; when it fails, a null pointer is explicitly returned, ensuring the rigor of the search logic and the predictability of the results, providing an efficient and reliable data access mechanism for subsequent operations.

[0046] In this embodiment, the first step is to perform boundary checks on the time series data group, checking the validity of parameters such as the target timestamp input by the user, that is, checking whether the target timestamp is within the data range, and handling the case of empty arrays in the time series data group.

[0047] In this embodiment, for uniformly distributed time series data groups, interpolation is used to quickly locate the target time series data.

[0048] Understandably, the core of interpolation search is to replace binary search with interpolation, reducing the mapping cost of "time-row number-disk offset" to O(1). As long as the data is locally monotonic and equidistant within blocks, it can achieve precise positioning at any point in time within milliseconds, and is naturally compatible with common time-series database optimizations such as compression, aggregation, and caching. Compared to existing binary search (O(logN)), the performance is improved by 5 times, and the search time for 1 million data points is reduced from 100 nanoseconds to 20 nanoseconds, far exceeding the mainstream level in the industry.

[0049] It should be noted that interpolation search maps the time of time series data to row numbers. Within the target block, a linear or quadratic interpolation is performed using 2–4 known sampling points to directly calculate the target row number. Since uniformly distributed time series data is usually locally monotonic, the error is generally less than 5 rows. Even if the deviation is 20 rows, it can be corrected with only one sequential scan, and the input / output is still much smaller than that of binary search.

[0050] S104: If the time-series data group is non-uniformly distributed, the time-series data group is sampled a second time. A skip list with a breadth-first storage layout is constructed based on the sampled elements. A tree search is performed on the skip list with the breadth-first storage layout based on the target timestamp to locate the target data interval. A binary search is performed in the target data interval. After the target data element is found in the target data interval, the corresponding pointer is output.

[0051] As a preferred embodiment, the step of performing secondary sampling on the time-series data group and constructing a skip list with a breadth-first storage layout based on the sampled elements includes: Based on the preset skip list size, the sampling step size is calculated, and based on the sampling step size, the time series data group is sampled at equal intervals to obtain sampling elements; wherein, each sampling element includes a corresponding index and an element timestamp value; Based on the breadth-first storage layout, an initial skip list is constructed, and the sampled elements are filled into the initial skip list to obtain the final skip list of the breadth-first storage layout.

[0052] Understandably, the beneficial effects of "performing secondary sampling of the time-series data group and constructing a skip list with a breadth-first storage layout based on the sampled elements" are as follows: the sampling step size is dynamically calculated by pre-setting the skip list size, and the time-series data group is sampled with equidistant indexes based on this to ensure that key data points are captured efficiently; then, the skip list is constructed with a breadth-first storage layout, and the sampled elements are systematically filled into it, which significantly optimizes the locality of data storage and cache hit rate, greatly improves the efficiency of range queries and sequential access, and reduces the complexity of index maintenance, providing a stable and efficient foundation for the rapid retrieval and real-time analysis of large-scale time-series data.

[0053] In this embodiment, for non-uniformly distributed time-series data groups, the data is reorganized according to the data distribution characteristics to prepare for subsequent query optimization. That is, by determining the number of elements in the non-uniformly distributed time-series data group, the size of the pre-allocated skip list array, etc., initial verification is performed, including checking the validity of the original array pointer, verifying whether the skip list size is a power of 2 (32, 64, etc.), and confirming that the skip list array has been pre-allocated. Then, the sampling step size is calculated according to the preset skip list size, that is, jump_table_size elements are uniformly sampled from the original array, and the sampling step size is calculated as: step = (count - 1) / (jump_table_size - 1), and elements are sampled according to the equidistant index; where jump_table_size corresponds to the preset skip list size, count is the number of data elements, and step is the sampling step size.

[0054] After sampling, sampled elements are obtained, and each sampled element is assigned an index. The value of each sampled element can be regarded as the element's timestamp.

[0055] In this embodiment, an initial skip list is constructed based on the breadth-first storage layout (Eytzinger), and then the sampled elements are filled into the initial skip list to build a balanced binary search tree. Then, the tree is stored according to the Eytzinger layout (breadth-first storage layout).

[0056] Understandably, the design of the Eytzinger layout skip list is based on equidistant sampling and breadth-first binary tree storage. It combines branchless search and prefetch optimization to maximize cache utilization. The sampled elements of the skip list are converted into a breadth-first binary tree array (Eytzinger layout skip list) according to the rule of "root node index 1, left child node 2i, right child node 2i+1", and adapted to branchless search.

[0057] As a preferred embodiment, the step of performing a tree search on the skip list of the breadth-first storage layout based on the target timestamp to locate the target data interval includes: Starting from the highest-level node in the skip list of the breadth-first storage layout, the target index range is located sequentially from the index and element timestamp value, combined with the target timestamp. Based on the target index range, locate the timestamp range on the skip list of the breadth-first storage layout as the target data range.

[0058] Understandably, the beneficial effects of "performing a tree search on the skip list of the breadth-first storage layout based on the target timestamp to locate the target data range" are as follows: by utilizing the skip list structure of the breadth-first storage layout, the index and timestamp values ​​are compared layer by layer from top to bottom, quickly converging the index range where the target timestamp is located, efficiently locking the precise timestamp range in the underlying physical storage, significantly optimizing the range retrieval performance of large-scale time-series data, reducing disk I / O and computational overhead, and fully leveraging the hierarchical advantages of the skip list and the locality characteristics of breadth-first storage, providing accurate data location support for efficient range queries and aggregation analysis.

[0059] In this embodiment, after constructing a skip list with a breadth-first storage layout, the interval of the leaf node (the lowest level node) is determined on the skip list of the breadth-first storage layout. For the leaf node, the interval is determined by the sampling interval: if a sampling point corresponds to the original array index i and the sampling interval is k, then: left boundary = i, right boundary = min(i + k - 1, array end index), where the root node index of the skip list of the Eytzinger layout is 0, the left child node is 2*i + 1, and the right child node is 2*i + 2.

[0060] Then, a tree search SearchJumpTableExact is performed on the skip list in the breadth-first storage layout. Starting from the root node of the skip list in the Eytzinger layout, an exact match check is performed. The target timestamp is compared with the value (timestamp) corresponding to the node index in the jump_table[index].timestamp skip list. If they are equal, it means that an exact match has been found. The exact matching index is found in the skip list, and the same timestamp is located in the original time series data group. When the target timestamp is less than the value corresponding to the node index in the skip list, `high_bound` is updated, and analysis continues on the left subtree node. When the target timestamp is greater than the value corresponding to the node index in the skip list, `low_bound` is updated, and analysis continues on the right subtree node. Simultaneously, `low_bound` is ensured to be less than or equal to `high_bound`, and a safety margin is added to ensure the boundary remains within its effective range. By performing a tree search on the skip list with the Eytzinger layout, the system can quickly converge to a small interval within the original time-series data set, i.e., the target data interval.

[0061] In this embodiment, with Figure 3 For example, by calculating the sampling step size and sampling at equal intervals, we obtain the sampling elements at equal intervals, thereby constructing the Eytzinger layout skip list and filling the skip list array to verify the order of the skip list.

[0062] In one specific embodiment, the Eytzinger layout skip list is as follows: Eytzinger layout skip lists can exponentially compress the search space into a cache-friendly straight line, and a single tree traversal can converge the candidate interval to within a few rows, thus obtaining a target data interval.

[0063] Eytzinger layout skip lists improve CPU cache hit rate by 60% due to their memory access continuity, reduce lookup time by 60% compared to ordinary array skip lists, and reduce memory usage by 33%.

[0064] This case does not improve the skip list lookup of the Eytzinger layout; it is only used as a means of performing skip list tree lookups.

[0065] As a preferred embodiment, the step of performing a binary search in the target data interval, and outputting the corresponding pointer after finding the target data element in the target data interval, includes: A binary search is performed in the target data interval to match the timestamp and corresponding data value that are the same as the target timestamp in the target data interval, thereby obtaining the target data element; Output the pointer corresponding to the target data element.

[0066] Understandably, the beneficial effects of "performing a binary search within the target data interval and outputting the corresponding pointer after finding the target data element within the target data interval" are as follows: By performing a binary search within the target data interval pre-filtered by the skip list, the data value corresponding to the target timestamp is accurately matched, achieving fast retrieval with sublinear time complexity; combining the interval compression advantage of the skip list's initial positioning with the efficiency of binary search, invalid data traversal is significantly reduced, greatly improving query response speed while ensuring result accuracy; and by directly outputting the data element pointer, redundant data copying is avoided, providing core capabilities of low latency and high throughput for real-time data access and processing.

[0067] In this embodiment, a precise local binary search is performed within the range defined by the skip list: (1) If an exact match is found, return a pointer to the corresponding target data element.

[0068] (2) If not found, return a null pointer directly. For example... Figure 4As shown, after checking the validity of the parameters, it is determined whether the data is within the range, and then a path search and retrieval are performed. For uniformly distributed data, interpolation search is used, while for non-uniformly distributed data, a skip list tree search is performed, followed by a local binary search, and finally, the pointer corresponding to the exact matching target data element is output.

[0069] If an exact match cannot be found, a null pointer is returned. For uniformly distributed data, interpolation is used for searching. If the first search fails to find the target data element, a binary search is performed to improve the success rate of time-series data retrieval.

[0070] It is understandable that this invention addresses the technical problems of not being able to cover all scenarios to achieve optimal performance and poor adaptability. Therefore, through the above-mentioned dual-path processing method, it realizes the search of uniformly distributed data and non-uniformly distributed data. It performs interpolation search on uniformly distributed data and skip list tree search on non-uniformly distributed data, and then performs local binary search, thereby improving the applicability of this invention.

[0071] Implementing the embodiments of the present invention has the following beneficial effects: This invention acquires a time-series data set, performs uniform sampling on the data set to obtain several checkpoints, and then calculates the actual interval between each checkpoint. This determines whether the time-series data set is uniformly or non-uniformly distributed, thereby determining different retrieval schemes. For uniformly distributed time-series data sets, interpolation is used to directly locate the target data element and output the corresponding pointer. For non-uniformly distributed time-series data sets, a skip list with a breadth-first storage layout is constructed to quickly converge to a target data interval in the original time-series data set. A binary search is then performed within the target data interval to locate the corresponding target data element and output the corresponding pointer. This achieves an adaptive strategy for time-series data retrieval, improving retrieval efficiency for both uniform and non-uniform data, and achieving optimal performance across all scenarios.

[0072] Example 2 like Figure 5 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; One embodiment of the present invention provides a time-series data retrieval device, comprising: an acquisition module 201, a judgment module 202, a uniform module 203, and a non-uniform module 204; The acquisition module 201 is used to acquire a time series data group and perform uniform sampling on the time series data group to obtain a number of check points; The judgment module 202 is used to calculate the actual interval between each checkpoint and, based on the actual interval, determine the data distribution state of the time-series data group; wherein, the data distribution state includes: uniform distribution and non-uniform distribution; The uniformity module 203 is used to perform interpolation positioning on the time series data group according to the target timestamp if the time series data group is uniformly distributed, and output the corresponding pointer after locating the target data element in the uniformly distributed time series data group. The non-uniform module 204 is used to perform secondary sampling on the time-series data group if the time-series data group is non-uniformly distributed, construct a skip list with a breadth-first storage layout based on the sampled elements, perform a tree search on the skip list with the breadth-first storage layout based on the target timestamp, locate the target data interval, perform a binary search in the target data interval, and output the corresponding pointer after finding the target data element in the target data interval.

[0073] As a preferred embodiment, the acquisition module includes: a time-series data group acquisition unit and a checkpoint acquisition unit; The time-series data group acquisition unit is used to acquire a time-series data group; wherein, the time-series data group includes several data elements, and each data element includes: a timestamp and a data value; The checkpoint acquisition unit is used to set a preset step size according to the timestamp of the data element, and to uniformly sample the data elements in the time-series data group according to the preset step size to obtain a number of uniformly distributed data elements as checkpoints.

[0074] Understandably, by acquiring time-series data sets containing timestamps and performing uniform sampling based on preset step sizes set by the timestamps, uniformly distributed checkpoints are generated, thereby significantly reducing data redundancy, improving processing efficiency, reducing storage overhead, and ensuring strong representativeness of checkpoints, which facilitates subsequent time-series analysis, anomaly detection, or model training, thus achieving more reliable and efficient data monitoring and decision support.

[0075] As a preferred embodiment, the judgment module includes: an actual interval calculation unit, an error calculation unit, a uniform distribution judgment unit, and a non-uniform distribution judgment unit; The actual interval calculation unit is used to calculate the actual interval between each checkpoint based on the timestamp of the data element corresponding to each checkpoint. The error calculation unit is used to calculate the error between the actual interval and the preset theoretical interval; The uniform distribution judgment unit is used to determine that the time series data group is uniformly distributed when the error is less than a preset threshold. The non-uniform distribution judgment unit is used to determine that the time series data group is non-uniformly distributed when the error is greater than or equal to a preset threshold.

[0076] It is understandable that the beneficial effect of "calculating the actual interval between each checkpoint and judging the data distribution status of the time series data group based on the actual interval" is as follows: by calculating the error between the actual time interval between each checkpoint and the preset theoretical interval, and comparing it with the preset threshold, the distribution characteristics (uniform or non-uniform) of the time series data group can be automatically and efficiently judged. This provides an objective and quantitative reliable basis for the selection of subsequent data processing or analysis strategies, effectively avoids the complexity of manual judgment, and improves the accuracy and process efficiency of time series data quality assessment.

[0077] In this embodiment, the preset theoretical interval can be set manually according to actual needs and specific circumstances, or the theoretical uniform interval can be calculated based on the total time range of the current time series data group and used as the preset theoretical interval.

[0078] In this embodiment, each data element corresponding to each checkpoint has a corresponding timestamp. The timestamp interval between each checkpoint is calculated as the actual interval, and then the error between the actual interval and the preset theoretical interval is calculated. Preferably, it can be the maximum relative error. If the maximum relative error of all sampling points is less than the preset threshold (preferably, it can be set to 15%, and the specific size can be set according to the actual situation), it is determined to be uniformly distributed; otherwise, it is determined to be non-uniformly distributed.

[0079] For example, when the number of data points in a time series data set is less than 3, the time series data set is determined to be uniformly distributed. When the time range in the time series data set is zero, the time series data set is also directly determined to be uniformly distributed. For other time series data sets, the maximum relative error is calculated by setting a theoretical uniform interval and sampling at multiple checkpoints. The maximum relative error is then compared with a preset threshold to determine whether the time series data set is uniformly distributed.

[0080] As a preferred embodiment, after the step of interpolating and positioning the time-series data group, the method further includes: If the target data element is not located in a uniformly distributed time series data set, perform a binary search on the uniformly distributed time series data set based on the target timestamp. If, during the binary search process, the pointer corresponding to the target data element is found in a uniformly distributed time-series data set, then the pointer corresponding to the target data element is output. If, during the binary search process, the pointer corresponding to the target data element is not found in the uniformly distributed time-series data set, a null pointer is output.

[0081] The beneficial effects of "when the target data element is not located in a uniformly distributed time-series data set, perform a binary search on the uniformly distributed time-series data set based on the target timestamp; if a pointer to the target data element is found in the uniformly distributed time-series data set during the binary search, output the pointer to the target data element; if no pointer to the target data element is found in the uniformly distributed time-series data set during the binary search, output a null pointer" are as follows: By implementing a binary search algorithm in a uniformly distributed time-series data set, the data element is quickly located based on the target timestamp. The uniform distribution characteristic greatly improves the search efficiency and significantly reduces the time complexity. When the search is successful, the pointer to the target data element is accurately returned; when it fails, a null pointer is explicitly returned, ensuring the rigor of the search logic and the predictability of the results, providing an efficient and reliable data access mechanism for subsequent operations.

[0082] In this embodiment, the first step is to perform boundary checks on the time series data group, checking the validity of parameters such as the target timestamp input by the user, that is, checking whether the target timestamp is within the data range, and handling the case of empty arrays in the time series data group.

[0083] In this embodiment, for uniformly distributed time-series data groups, interpolation search is used to quickly locate the target time-series data. It can be understood that the core of interpolation search is to replace binary search with interpolation, reducing the mapping cost of "time-row number-disk offset" to O(1). As long as the data is locally monotonic and equidistant within blocks, accurate location at any time point can be achieved in milliseconds, and it is naturally compatible with common time-series database optimizations such as compression, aggregation, and caching. Compared to existing binary search (O(logN)), the performance is improved by 5 times, and the search time for 1 million data points is reduced from 100 nanoseconds to 20 nanoseconds, far exceeding the industry mainstream level.

[0084] It should be noted that interpolation search maps the time of time series data to row numbers. Within the target block, a linear or quadratic interpolation is performed using 2–4 known sampling points to directly calculate the target row number. Since uniformly distributed time series data is usually locally monotonic, the error is generally less than 5 rows. Even if the deviation is 20 rows, it can be corrected with only one sequential scan, and the input / output is still much smaller than that of binary search.

[0085] As a preferred embodiment, the step of performing secondary sampling on the time-series data group and constructing a skip list with a breadth-first storage layout based on the sampled elements includes: Based on the preset skip list size, the sampling step size is calculated, and based on the sampling step size, the time series data group is sampled at equal intervals to obtain sampling elements; wherein, each sampling element includes a corresponding index and an element timestamp value; Based on the breadth-first storage layout, an initial skip list is constructed, and the sampled elements are filled into the initial skip list to obtain the final skip list of the breadth-first storage layout.

[0086] It is understandable that the beneficial effects of "subsampling the time-series data group a second time and constructing a skip list with a breadth-first storage layout based on the sampled elements" are as follows: the sampling step size is dynamically calculated by pre-setting the skip list size, and the time-series data group is sampled with equidistant indexes based on this to ensure that key data points are captured efficiently; then, the skip list is constructed with a breadth-first storage layout, and the sampled elements are systematically filled into it, which significantly optimizes the locality of data storage and cache hit rate, greatly improves the efficiency of range queries and sequential access, and reduces the complexity of index maintenance, providing a stable and efficient foundation for the rapid retrieval and real-time analysis of large-scale time-series data.

[0087] As a preferred embodiment, the step of performing a tree search on the skip list of the breadth-first storage layout based on the target timestamp to locate the target data interval includes: Starting from the highest-level node in the skip list of the breadth-first storage layout, the target index range is located sequentially from the index and element timestamp value, combined with the target timestamp. Based on the target index range, locate the timestamp range on the skip list of the breadth-first storage layout as the target data range.

[0088] Understandably, the beneficial effects of "performing a tree search on the skip list of the breadth-first storage layout based on the target timestamp to locate the target data range" are as follows: by utilizing the skip list structure of the breadth-first storage layout, the index and timestamp values ​​are compared layer by layer from top to bottom, quickly converging the index range where the target timestamp is located, efficiently locking the precise timestamp range in the underlying physical storage, significantly optimizing the range retrieval performance of large-scale time-series data, reducing disk I / O and computational overhead, and fully leveraging the hierarchical advantages of the skip list and the locality characteristics of breadth-first storage, providing accurate data location support for efficient range queries and aggregation analysis.

[0089] As a preferred embodiment, the step of performing a binary search in the target data interval, and outputting the corresponding pointer after finding the target data element in the target data interval, includes: A binary search is performed in the target data interval to match the timestamp and corresponding data value that are the same as the target timestamp in the target data interval, thereby obtaining the target data element; Output the pointer corresponding to the target data element.

[0090] Understandably, by performing a binary search within the target data range pre-selected by the skip list, the data value corresponding to the target timestamp is accurately matched, achieving fast retrieval with sublinear time complexity. Combining the interval compression advantage of the skip list's initial positioning with the efficiency of binary search, invalid data traversal is significantly reduced, greatly improving query response speed while ensuring result accuracy. Furthermore, by directly outputting data element pointers, redundant data copying is avoided, providing core capabilities of low latency and high throughput for real-time data access and processing.

[0091] In this embodiment, for non-uniformly distributed time-series data groups, the data is reorganized according to its distribution characteristics to prepare for subsequent query optimization. This involves initial verification by determining the number of elements in the non-uniformly distributed time-series data group and the size of the pre-allocated skip list array. This includes checking the validity of the original array pointers, verifying that the skip list size is a power of 2 (32, 64, etc.), and confirming that the skip list array has been pre-allocated. Then, the sampling step size is calculated based on the preset skip list size. Specifically, `jump_table_size` elements are uniformly sampled from the original array, and the sampling step size is calculated as: `step = (count - 1) / (jump_table_size - 1)`. Elements are sampled at equal intervals. Here, `jump_table_size` corresponds to the preset skip list size, `count` is the number of data elements, and `step` is the sampling step size. After sampling, sampled elements are obtained, and each sampled element is assigned an index. The value of each sampled element can be considered as an element timestamp.

[0092] In this embodiment, an initial skip list is constructed based on the breadth-first search layout (Eytzinger). Sampled elements are then filled into the initial skip list to build a balanced binary search tree, which is then stored according to the Eytzinger layout (breadth-first search layout). It can be understood that the Eytzinger layout skip list is designed with equidistant sampling and breadth-first binary tree storage. Combined with branchless search and prefetch optimization, it maximizes cache utilization. The sampled elements of the skip list are converted into a breadth-first binary tree array (Eytzinger layout skip list) according to the rule "root node index 1, left child node 2i, right child node 2i+1", and adapted for branchless search.

[0093] In this embodiment, after constructing a skip list with a breadth-first storage layout, the interval of the leaf node (the lowest level node) is determined on the skip list of the breadth-first storage layout. For the leaf node, the interval is determined by the sampling interval: if a sampling point corresponds to the original array index i and the sampling interval is k, then: left boundary = i, right boundary = min(i + k - 1, array end index), where the root node index of the skip list of the Eytzinger layout is 0, the left child node is 2*i + 1, and the right child node is 2*i + 2.

[0094] Then, a tree search SearchJumpTableExact is performed on the skip list in the breadth-first storage layout. Starting from the root node of the skip list in the Eytzinger layout, an exact match check is performed. The target timestamp is compared with the value (timestamp) corresponding to the node index in the jump_table[index].timestamp skip list. If they are equal, it means that an exact match has been found. The exact matching index is found in the skip list, and the same timestamp is located in the original time series data group. When the target timestamp is less than the value corresponding to the node index in the skip list, `high_bound` is updated, and analysis continues on the left subtree node. When the target timestamp is greater than the value corresponding to the node index in the skip list, `low_bound` is updated, and analysis continues on the right subtree node. Simultaneously, `low_bound` is ensured to be less than or equal to `high_bound`, and a safety margin is added to ensure the boundary remains within its effective range. By performing a tree search on the skip list with the Eytzinger layout, the system can quickly converge to a small interval within the original time-series data set, i.e., the target data interval.

[0095] In this embodiment, by calculating the sampling step size and then sampling at equal intervals, equal-interval sampling elements are obtained, thereby constructing an Eytzinger layout skip list and filling the skip list array to verify the order of the skip list.

[0096] In one specific embodiment, the Eytzinger layout skip list is as follows: Eytzinger layout skip lists can exponentially compress the search space into a cache-friendly straight line, and a single tree traversal can converge the candidate interval to within a few rows, thus obtaining a target data interval.

[0097] Eytzinger layout skip lists improve CPU cache hit rate by 60% due to their memory access continuity, reduce lookup time by 60% compared to ordinary array skip lists, and reduce memory usage by 33%.

[0098] This case does not improve the skip list lookup of the Eytzinger layout; it is only used as a means of performing skip list tree lookups.

[0099] In this embodiment, a precise local binary search is performed within the range defined by the skip list. If an exact match is found, a pointer to the corresponding target data element is returned. If no match is found, a null pointer is returned directly. Figure 4As shown, after checking the validity of the parameters, it determines whether the data is within the range and performs path-specific searches and retrievals. For uniformly distributed data, interpolation search is used, while for non-uniformly distributed data, a skip list tree search is performed, followed by a local binary search, ultimately outputting a pointer to the exact matching target data element. If an exact match cannot be found, a null pointer is returned. Specifically, for uniformly distributed data, if the first search fails to match the target data element, a further binary search is performed to improve the success rate of time-series data retrieval.

[0100] It is understandable that this invention addresses the technical problems of not being able to cover all scenarios to achieve optimal performance and poor adaptability. Therefore, through the above-mentioned dual-path processing method, it realizes the search of uniformly distributed data and non-uniformly distributed data. It performs interpolation search on uniformly distributed data and skip list tree search on non-uniformly distributed data, and then performs local binary search, thereby improving the applicability of this invention.

[0101] Implementing the embodiments of the present invention has the following beneficial effects: This invention acquires a time-series data set, performs uniform sampling on the data set to obtain several checkpoints, and then calculates the actual interval between each checkpoint. This determines whether the time-series data set is uniformly or non-uniformly distributed, thereby determining different retrieval schemes. For uniformly distributed time-series data sets, interpolation is used to directly locate the target data element and output the corresponding pointer. For non-uniformly distributed time-series data sets, a skip list with a breadth-first storage layout is constructed to quickly converge to a target data interval in the original time-series data set. A binary search is then performed within the target data interval to locate the corresponding target data element and output the corresponding pointer. This achieves an adaptive strategy for time-series data retrieval, improving retrieval efficiency for both uniform and non-uniform data, and achieving optimal performance across all scenarios.

[0102] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the time-series data retrieval method provided by any of the above-described method embodiments of the present invention.

[0103] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0104] Based on the above-described embodiments of the time-series data retrieval method, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the time-series data retrieval method of any embodiment of the present invention.

[0105] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.

[0106] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0107] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting all parts of the terminal device via various interfaces and lines.

[0108] Based on the above-described method embodiments, another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the time-series data retrieval method described in any of the above-described method embodiments of the present invention.

[0109] The modules / units integrated in the device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0110] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A time-series data retrieval method, characterized in that, include: Acquire a time series data set and perform uniform sampling on the time series data set to obtain several checkpoints; Calculate the actual interval between each checkpoint, and determine the data distribution state of the time-series data group based on the actual interval; wherein, the data distribution state includes: uniform distribution and non-uniform distribution; If the time series data group is uniformly distributed, then the time series data group is interpolated and located according to the target timestamp, and the corresponding pointer is output after the target data element is located in the uniformly distributed time series data group. If the time-series data group is non-uniformly distributed, the time-series data group is sampled a second time. A skip list with a breadth-first storage layout is constructed based on the elements sampled a second time. A tree search is performed on the skip list with the breadth-first storage layout based on the target timestamp to locate the target data interval. A binary search is performed in the target data interval. After the target data element is found in the target data interval, the corresponding pointer is output.

2. The time-series data retrieval method as described in claim 1, characterized in that, The process of acquiring a time-series data set and uniformly sampling the time-series data set to obtain several checkpoints includes: Obtain a time-series data set; wherein the time-series data set includes several data elements, and each data element includes: a timestamp; Based on the timestamp of the data element, a preset step size is set, and the data elements in the time series data group are uniformly sampled according to the preset step size to obtain several uniformly distributed data elements as checkpoints.

3. The time-series data retrieval method as described in claim 2, characterized in that, The calculation of the actual interval between each checkpoint, and the determination of the data distribution status of the time-series data group based on the actual interval, includes: Calculate the actual interval between each checkpoint based on the timestamp of the data element corresponding to each checkpoint; Calculate the error between the actual interval and the preset theoretical interval; If the error is less than a preset threshold, then the time series data group is determined to be uniformly distributed; If the error is greater than or equal to a preset threshold, then the time series data group is determined to be non-uniformly distributed.

4. The time-series data retrieval method as described in claim 3, characterized in that, After the step of interpolating and locating the time-series data group, the method further includes: If the target data element is not located in a uniformly distributed time series data set, perform a binary search on the uniformly distributed time series data set based on the target timestamp. If, during the binary search process, the pointer corresponding to the target data element is found in a uniformly distributed time-series data set, then the pointer corresponding to the target data element is output. If, during the binary search process, the pointer corresponding to the target data element is not found in the uniformly distributed time-series data set, a null pointer is output.

5. The time-series data retrieval method as described in claim 4, characterized in that, The step of performing secondary sampling on the time-series data group and constructing a skip list with a breadth-first storage layout based on the sampled elements includes: Based on the preset skip list size, the sampling step size is calculated, and based on the sampling step size, the time series data group is sampled at equal intervals to obtain the sampled elements; Based on the breadth-first storage layout, an initial skip list is constructed, and the sampled elements are filled into the initial skip list to obtain the final skip list of the breadth-first storage layout.

6. The time-series data retrieval method as described in claim 5, characterized in that, The step of locating the target data range by performing a tree search on the skip list of the breadth-first storage layout based on the target timestamp includes: Starting from the highest-level node in the skip list of the breadth-first storage layout, the target index range is located sequentially based on the index and element timestamp value, combined with the target timestamp; wherein each sampled element includes a corresponding index and element timestamp value. Based on the target index range, locate the timestamp range on the skip list of the breadth-first storage layout as the target data range.

7. The time-series data retrieval method as described in claim 6, characterized in that, The step of performing a binary search within the target data interval and outputting the corresponding pointer after finding the target data element includes: A binary search is performed in the target data interval to match a timestamp and its corresponding data value that are the same as the target timestamp, thereby obtaining the target data element; each data element also includes: a data value; Output the pointer corresponding to the target data element.

8. A time-series data retrieval device, characterized in that, include: Acquisition module, judgment module, uniform module, and non-uniform module; The acquisition module is used to acquire a time series data group and uniformly sample the time series data group to obtain a number of check points; The judgment module is used to calculate the actual interval between each checkpoint and, based on the actual interval, determine the data distribution state of the time-series data group; wherein, the data distribution state includes: uniform distribution and non-uniform distribution; The uniformity module is used to perform interpolation positioning on the time series data group according to the target timestamp if the time series data group is uniformly distributed, and output the corresponding pointer after locating the target data element in the uniformly distributed time series data group. The non-uniform module is used to perform secondary sampling on the time-series data group if the time-series data group is non-uniformly distributed, construct a skip list with a breadth-first storage layout based on the sampled elements, perform a tree search on the skip list with the breadth-first storage layout based on the target timestamp, locate the target data interval, perform a binary search in the target data interval, and output the corresponding pointer after finding the target data element in the target data interval.

9. A terminal device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements the time-series data retrieval method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, include: A stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the time-series data retrieval method as described in any one of claims 1-7.