A fast retrieval method and device based on time series data
By constructing fast indexes and full-text indexes, filtering invalid data and accurately reading time series data, the problem of low retrieval efficiency under large data volumes is solved, and efficient and accurate data retrieval and utilization are achieved.
Patent Information
- Application Number
- CN202110691105.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-22
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-06-22
AI Technical Summary
In the case of large amounts of data, the existing technology takes a long time to retrieve and read data, resulting in low effective utilization and the inability to accurately filter relevant data within a time point.
Construct a fast index and a full-text index, first filter the invalid time data, and use the full-text index to read the data quickly and accurately to reduce disk IO waste and improve data utilization.
It achieves efficient reading of valid data, improves the accuracy and efficiency of data retrieval, reduces the reading of unnecessary data, and improves work efficiency.
Smart Images

Figure CN113268636B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage, retrieval and network statistics, and in particular to a fast retrieval method and device based on time series data. Background Art
[0002] In the network statistics project, many statistical tables will be generated. In the process of querying the statistical tables, there are two types: full data query and data retrieval. The former is to query all the data in the statistical table at this time point, and the latter is to retrieve the data in the statistical table at this time point that meets certain conditions.
[0003] For example, you need to retrieve an IP address from the IP session table at a certain point in time. The current common technical means are:
[0004] First traverse the time to find the time you want to retrieve, then read the data of the corresponding time from the disk, and then filter the desired data according to the search conditions.
[0005] In the current solution, some indexes are also built, such as time projection index, which can filter out invalid time points and improve retrieval performance.
[0006] However, the existing technology has a fatal flaw. When the amount of data is very large, data retrieval and reading are very time-consuming, which greatly affects work efficiency. The main reason is that when the amount of data is very large, it takes a long time to traverse the data and the data read is often not the data you want to retrieve, resulting in a very low effective utilization rate of the data. Even with a time projection index, it can only be filtered at the time level, and it is not possible to further read highly relevant data based on the filter within a time point.
[0007] Therefore, there is an urgent need for a fast retrieval method and device based on time series data. Summary of the invention
[0008] The purpose of the present invention is to provide a fast retrieval method and device based on time series data in order to overcome the defects of the prior art. The method of the present invention first filters out invalid time data to reduce the reading of invalid data; then, according to the full-text index of the record, the data is read quickly and accurately to avoid the waste of reading disk IO; thereby improving the effective utilization rate of the read data.
[0009] In one aspect, the present invention discloses:
[0010] A fast retrieval method based on time series data, the fast retrieval method at least includes: S1: when storing data, constructing a fast index and a full-text index, wherein the fast index is configured to be able to quickly locate the position of the full-text index, and the full-text index is configured to locate statistical data or data packets; S2: when retrieving data, first determine whether there is an index in the fast index, if there is an index, find the corresponding full-text index, and then read the statistical data or data packet according to the position recorded in the full-text index.
[0011] According to a preferred embodiment, the method for constructing a quick index and a full-text index in step S1 is: grouping the stored data according to a discrete pattern; saving the location information of the data in the group in the corresponding full-text index; aggregating the full-text index according to time characteristics and / or data size characteristics; storing the full-text index, and updating the storage location to the corresponding quick index.
[0012] According to a preferred embodiment, the fast index is memory data.
[0013] According to a preferred embodiment, the full-text index is disk data.
[0014] According to a preferred embodiment, the stored data, quick index and full-text index are set based on time series data.
[0015] According to a preferred embodiment, the full-text index includes an aggregation of data location information of several times corresponding to the key value.
[0016] On the other hand, the present invention further discloses: a rapid retrieval device based on time series data, the rapid retrieval device comprising a data processing unit, and the data processing unit is configured to operate according to the aforementioned rapid retrieval method.
[0017] The aforementioned main scheme of the present invention and its further options can be freely combined to form multiple schemes, all of which are schemes that can be adopted and claimed for protection by the present invention. After understanding the scheme of the present invention, those skilled in the art can understand that there are multiple combinations based on the prior art and common knowledge, all of which are technical schemes to be protected by the present invention, and they are not exhaustively listed here.
[0018] Beneficial effects of the present invention:
[0019] The technical solution of the present invention has a higher utilization rate of valid data read than the existing technology, and can read the desired data very accurately, rather than blindly traversing and reading all or a large amount of data. In addition, the existing technology needs to read all time ranges and the full amount of data within a time range; while the present invention only needs to read the time point where the search condition exists and the data that meets the search condition at that time point. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a schematic diagram of the rapid retrieval method of the present invention. DETAILED DESCRIPTION
[0021] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0022] It should be noted that in order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments.
[0023] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] Embodiment 1:
[0025] refer to Figure 1 As shown, the present invention discloses a rapid retrieval method based on time series data, and the rapid retrieval method includes at least the following steps.
[0026] Step S1: constructing a quick index and a full-text index when storing data, wherein the quick index is configured to quickly locate the position of the full-text index, and the full-text index is configured to locate statistical data or data packets.
[0027] Step S2: When retrieving data, first determine whether there is an index in the quick index. If there is an index, find the corresponding full-text index, and then read the statistical data or data packet according to the position recorded in the full-text index.
[0028] Full-text index: The IP session table contains a large amount of IP session data with IP pairs as key values. The full-text index is to build the relationship between each IP address and all IP session locations associated with this IP address.
[0029] Fast indexing: Each time a piece of full-text index data is stored, a relationship between the IP segment and the storage location of the full-text index on disk is built in memory.
[0030] Preferably, the method for constructing the quick index and full-text index in step S1 is: grouping the stored data according to a discrete pattern; saving the location information of the data in the group in the corresponding full-text index; aggregating the full-text index according to time characteristics and / or data size characteristics; storing the full-text index, and updating the storage location to the corresponding quick index.
[0031] Preferably, the stored data, quick index and full-text index are set based on time series data, that is, the index and data are time-ordered.
[0032] Preferably, the quick index is memory data, and the full-text index is disk data.
[0033] Preferably, the quick index can quickly locate the location of the corresponding full-text index on the disk, and the quick index can filter out key value information that does not exist during this period in advance.
[0034] Preferably, the full-text index contains the aggregation of data location information of several times corresponding to the key value, and the location of the full-text index can accurately locate the corresponding statistical data or data packet.
[0035] The data in the quick index and / or full-text index can locate whether there is data for the key value at that time point; the data in the quick index and / or full-text index can locate the precise position of the data corresponding to the key value.
[0036] The method of the present invention first filters out invalid time data to reduce the reading of invalid data; then, according to the full-text index of the record, the data is read quickly and accurately to avoid the waste of reading disk IO; thereby improving the effective utilization rate of the read data.
[0037] Embodiment 2:
[0038] On the basis of Example 1, the present invention further discloses a fast retrieval device based on time series data, wherein the fast retrieval device comprises a data processing unit. The data processing unit is configured to run according to the fast retrieval method described in Example 1.
[0039] The technical solution of the present invention has a higher utilization rate of valid data read than the existing technology, and can read the desired data very accurately, rather than blindly reading all or a large amount of data. In addition, the existing technology needs to read all time ranges and the full amount of data within a time range; while the present invention only needs to read the time point where the search condition exists and the data that meets the search condition at the time point.
[0040] The above basic examples of the present invention and their further selected examples can be freely combined to form multiple embodiments, all of which are embodiments that can be adopted and claimed by the present invention. In the scheme of the present invention, each selected example can be arbitrarily combined with any other basic example and selected example. Those skilled in the art will know that there are many combinations.
[0041] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A fast retrieval method based on time series data, characterized in that: The rapid retrieval method at least comprises: S1: when storing data, construct a quick index and a full-text index, wherein the quick index is configured to quickly locate the position of the full-text index, and the full-text index is configured to locate statistical data or data packets; The method for constructing the quick index and the full-text index in step S1 is: grouping the stored data according to a discrete mode; saving the location information of the data in the group in the corresponding full-text index; aggregating the full-text index according to the time feature and / or the data size feature; storing the full-text index and updating the storage location to the corresponding quick index; S2: When searching for data, first determine whether there is an index in the quick index. If there is an index, find the corresponding full-text index, and then read the statistical data or data packet according to the position recorded in the full-text index; The stored data, quick index and full-text index are set based on time series data; The quick index is memory data; The full-text index is disk data; The full-text index contains an aggregation of data location information at several times corresponding to the key value.
2. A fast retrieval device based on time series data, characterized in that: The rapid retrieval device comprises a data processing unit, and the data processing unit is configured to operate according to the rapid retrieval method according to claim 1.
