Target point space-time range retrieval method
Through the spatiotemporal hash function and two-level index structure, the existing spatiotemporal retrieval technology is solved, and efficient and parallel spatiotemporal range retrieval is achieved, which improves the performance and scalability of the system.
Patent Information
- Application Number
- CN202510099968.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-10-22
- Filing Date
- 2025-01-22
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2045-01-22
AI Technical Summary
The existing spatiotemporal search technology has problems such as low efficiency, no parallel operation, and poor scalability, making it difficult to efficiently index and retrieve massive spatiotemporal point information.
A spatial-temporal range search method for target points is proposed. The hash value of the space-time point is calculated through the space-time hash function, and a two-level index structure is constructed. The first level index is used to store the hash value of the space-time unit, and the second level index uses a high-dimensional tree structure to store the space-time points, which supports parallel query.
It improves the efficiency of space-time search, supports parallel operations, enhances the scalability of the system, and provides efficient retrieval performance at lower costs.
Smart Images

Figure CN120104893A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of information retrieval and relates to a target point spatiotemporal range retrieval method. Background Art
[0002] As the cost of global positioning systems such as Beidou decreases, more and more mobile phones, wearable devices, cars, etc. are equipped with positioning chips, which in turn generates a large amount of spatiotemporal information, which includes latitude and longitude, altitude, timestamp and other information. In this technical solution, points that contain at least latitude and longitude, timestamp and optional altitude information are called spatiotemporal points. How to efficiently and cost-effectively index and retrieve these spatiotemporal point information is a problem that needs to be solved.
[0003] Existing spatiotemporal retrieval and search technologies can be divided into two methods: one is to establish indexes in spatial and temporal dimensions separately and then search; the other is to establish indexes and search in temporal and spatial dimensions uniformly. The first method needs to perform spatial retrieval and temporal retrieval separately and then find the intersection when performing spatial retrieval, which is inefficient. The second method considers the temporal dimension and the spatial dimension as the entire index, which has a higher retrieval efficiency. According to the basic principle, it can be divided into two categories: the method based on space filling curve dimensionality reduction and the method based on high-dimensional tree structure. The method based on space filling curve maps the coordinates of high-dimensional space into one-dimensional encoding, and performs retrieval by comparing the encoding. This method has some shortcomings. In order to meet the accuracy requirements, the method of space filling curve dimensionality reduction requires a higher order curve for mapping, which requires more calculation steps. The common disadvantages of space filling curve dimensionality reduction index and high-dimensional tree index also include not supporting parallel operations and not being able to fully utilize modern multi-processors. In addition, their scalability is poor, and the retrieval time will increase rapidly to above the acceptable threshold as the data scale grows. Summary of the invention
[0004] The purpose of the present invention is to provide a target point spatiotemporal range retrieval method.
[0005] The technical solution to achieve the purpose of the present invention is: a method for searching the time and space range of a target point, comprising the following steps:
[0006] Step 1: extract the time and space information of the target point to form the time and space points required for indexing;
[0007] Step 2, calculating the hash value of the space-time point by a space-time hash function, wherein the space-time hash function can divide the space-time into continuous and non-overlapping space-time units, and giving a unique hash value to represent the corresponding space-time unit;
[0008] Step 3: construct a first-level index according to the hash value of the space-time unit, which is used to store the address of the high-dimensional tree index of the space-time point within the range of the above space-time unit, and use the tree index to construct a second-level index, which is used to insert the space-time point into the second-level index indicated by the corresponding index item in the first-level index;
[0009] Step 4, search for the first-level index items that intersect with the queried space-time range, and further search for the space-time points to be queried on the second-level index indicated by the found first-level index items. If multiple first-level index items are found, the intersection of all space-time points found by the corresponding second-level indexes is used as the query result.
[0010] Further, in step 2, the hash value of the space-time point is calculated by the space-time hash function, and the space-time hash function can divide the space-time into continuous and non-overlapping space-time units, and give a unique hash value to represent the corresponding space-time unit. The specific method is:
[0011] Step 2.1: Calculate a spatial hash value according to a spatial hash function, wherein the spatial hash function uses a geohash code of length n as the spatial hash value, divides the geographic space into continuous and non-overlapping geographic space regions of different sizes, and the longer the length of the geohash code, the more accurate the geographic space region represented;
[0012] Step 2.2: Calculate the time hash value according to the time hash function, wherein the time hash function uses the number of specified time units that have passed since 0:00 on January 1, 1970, from the Unix timestamp zero point as the time hash value;
[0013] Step 2.3: Combine the spatial hash and the temporal hash into a spatiotemporal hash value.
[0014] Further, in step 3, a first-level index is constructed according to the hash value of the space-time unit, which is used to store the address of the high-dimensional tree index of the space-time point within the range of the above space-time unit, and a second-level index is constructed using the tree index, which is used to insert the space-time point into the second-level index indicated by the corresponding index item in the first-level index, wherein:
[0015] The first-level index is an index that can obtain values based on a key, where the key is the hash value of the space-time unit generated in step 2, and the value is the address of a high-dimensional tree index that can uniquely locate the space-time points within the range of the space-time unit. When storing space-time points, the index item of the space-time point in the first-level index is searched based on the hash value. If there is no corresponding index item, the hash value is used as the key, a new index item is inserted into the first-level index, and a corresponding second-level index is created at the same time.
[0016] Further, in step 3, a first-level index is constructed according to the hash value of the space-time unit, which is used to store the address of the high-dimensional tree index of the space-time point within the range of the above space-time unit, and a second-level index is constructed using the tree index, which is used to insert the space-time point into the second-level index indicated by the corresponding index item in the first-level index, wherein:
[0017] The second-level index is constructed using a tree index.
[0018] Further, in step 4, the first-level index items that intersect with the queried spatiotemporal range are searched, and the spatiotemporal points to be queried are further searched on the second-level index indicated by the found first-level index items. If multiple first-level index items are found, the intersection of all the spatiotemporal points found by the corresponding second-level indexes is used as the query result. The specific method is:
[0019] Step 4.1: Get the spatial scope to be queried, that is, find all geohash of length n that intersect or overlap with the retrieval space-time scope;
[0020] Step 4.2: Get the query time range, and find all time units that intersect or overlap with the search time and space range;
[0021] Step 4.3: Take the Cartesian product of the spatial hash value obtained in step 4.1 and step 4.2 and the temporal hash value to obtain a list of temporal and spatial hash values. The key in the first-level index is the index item that appears in the list of temporal and spatial hash values, which is the first-level index item to be searched.
[0022] Step 4.4: On the second-level index indicated by the first-level index item found, first calculate the latitude and longitude range of the minimum circumscribed boundary of the spatial range to be queried, and then search on the tree index according to this range to find the spatiotemporal point that intersects with the query spatial range as the result of the second-level index detection;
[0023] Step 4.5: If multiple first-level index items are found, the intersection of all the space-time points found by the corresponding second-level indexes is taken as the query result.
[0024] Furthermore, different secondary indexes are stored in different storage media or devices, including:
[0025] (1) When paying attention to the movement of the target point within the day, frequently search for the target point within a single day, store the corresponding index items of the day in the high-speed storage medium according to the time, create a new index for the new date in the high-speed storage medium every day, and move the index of the previous day to other media as needed;
[0026] (2) When it is necessary to query the relevant target points in a certain area, the secondary index corresponding to the corresponding spatiotemporal unit of the area is stored in a high-speed storage medium, thereby achieving higher retrieval efficiency;
[0027] (3) Regularly count the number of times each secondary index is retrieved within a unit time, move the secondary indexes with the top N access times to high-speed storage media, and move the secondary indexes with access times that are not in the top N to other index media as needed.
[0028] Furthermore, for centralized writing of large batches of data, a batch writing method is adopted, that is, for a batch of data, the spatiotemporal hash values of all target points are first calculated, the target points with the same spatiotemporal hash value are grouped into a group, and then each group of target points is written into the corresponding second-level index in parallel.
[0029] A target point spatiotemporal range retrieval system implements the target point spatiotemporal range retrieval method to achieve target point spatiotemporal range retrieval, comprising a spatiotemporal point hash value calculation module, a secondary index storage module and a target point query module.
[0030] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the target point spatiotemporal range retrieval method is implemented to achieve the target point spatiotemporal range retrieval.
[0031] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the target point spatiotemporal range retrieval method is implemented to achieve the target point spatiotemporal range retrieval.
[0032] Compared with the prior art, the present invention has the following significant advantages: 1) Pruning is performed according to the first-level spatiotemporal hash index, which is more efficient than the pruning strategy used in the traditional multidimensional tree index; 2) During query, the query range is routed to several sub-indexes according to the spatiotemporal hash of the first-level index. These several indexes can be queried in parallel, which will greatly improve the retrieval efficiency; 3) Higher IO speed can be provided for hotspot spatiotemporal data, thereby improving the overall retrieval performance at a lower cost; 4) A new range retrieval method for 4-dimensional spatiotemporal target points with a limited time period, a limited elevation range, and a limited geographic range is proposed. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a schematic diagram of a two-level index;
[0034] Figure 2 It is a schematic diagram of the geographical scope of spatial hashing and retrieval conditions. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0036] A method for retrieving a target point's spatiotemporal range comprises the following steps:
[0037] Step 1: Extract the time and space information of the target point to form the time and space points required for indexing.
[0038] Step 2: Calculate the hash value of the space-time point through the space-time hash function, which can divide the space-time into continuous and non-overlapping space-time units and give a unique hash value to represent the corresponding space-time unit.
[0039] Step 2.1: Calculate the spatial hash value according to the spatial hash function, which refers to the spatial hash function that can divide the space into continuous and non-overlapping areas in a certain way, and each area has a different hash value. Preferably, a geohash code with a length of n is used as the spatial hash value. Geohash is a spatial division and encoding scheme. The geohash algorithm can divide the geographic space into continuous and non-overlapping geographic space areas of different sizes, and the longer the length of the geohash code, the more accurate the geographic space area represented.
[0040] Step 2.2: Calculate the time hash value according to the time hash function, where the time hash function can divide the time into continuous and non-overlapping regions in a certain way, and each region has a different hash value. Preferably, the number of specified time units passed from the Unix timestamp zero point, that is, from zero point on January 1, 1970, is used as the hash value.
[0041] Step 2.3: Combine the spatial hash and the temporal hash into a spatiotemporal hash value.
[0042] Step 3: Construct a first-level index based on the hash value of the space-time unit, wherein the first-level index is an index that can obtain a value based on a key, wherein the key is the hash value of the space-time unit generated in step 2, and the value is an address that can uniquely locate a high-dimensional tree index for storing space-time points within the range of the space-time unit. Preferably, the first-level index can use a hash index.
[0043] When storing spatial points, the index item of the time-space point in the first-level index is searched according to the hash value. If there is no corresponding index item, the hash value is used as the key to create a new index item and insert it into the first-level index. At the same time, a corresponding second-level index is created.
[0044] Step 4: Use the kd tree to construct the second-level index, and insert the space-time point into the second-level index indicated by its corresponding index item in the first-level index.
[0045] Step 5: Find the first-level index items that intersect the query's spatiotemporal range.
[0046] Step 5.1: Obtain the spatial range to be queried, that is, find all spatial regions that intersect or overlap with the search space-time range, divided in step 2. Preferably, find all geohash of length n that intersect or overlap with the search space-time range.
[0047] Step 5.2: Obtain the query time range, and calculate all time regions that intersect or overlap with the query time and space range, divided in step 2. Preferably, all time units that intersect or overlap with the query time and space range are searched.
[0048] Step 5.3: Take the Cartesian product of the spatial hash value obtained in step 5.1 and step 5.2 and the temporal hash value to obtain a list of temporal and spatial hash values. The key in the first-level index is the index item that appears in the list, which is the index item to be searched.
[0049] Step 6: Perform further search for the space-time point to be queried on the second-level index indicated by the first-level index item found in step 5.
[0050] Step 7: Combine the results of step 6 into the final result.
[0051] Example
[0052] In order to verify the effectiveness of the scheme of the present invention, the following experimental design is carried out to give the application of the scheme in performing spatiotemporal range retrieval of aircraft type target points. Apache Lucene is an open source library that provides indexing and retrieval functions. Lucene provides kd tree related components. This embodiment will be based on Lucene and perform spatiotemporal range retrieval according to the data shown in Table 1 and the given query conditions.
[0053] Query conditions: query location O (120.6597078, 30.9348386) within a radius of 10KM, with an altitude between 10,000 meters and 20,000 meters, and all target points that appear within 10 minutes after 8:05 on June 2, 2024, Beijing time.
[0054] Table 1 Example target point data
[0055] point longitude latitude Height (m) Timestamp A 120.7062260 30.9382928 12750 2024-6-1T10:05:45.832+08:00 B 120.6723823 31.0206255 11000 2024-6-2T8:05:55.987+08:00 C 121.3329602 31.2214452 8600 2024-6-2T9:05:55.828+08:00 D 121.5885795 30.0582033 15000 2024-6-2T9:05:55.870+08:00 E 121.5751344 29.9849555 9150 2024-6-2T10:05:55.888+08:00
[0056] First, write the target point into the spatiotemporal point index according to the process described in steps 1-4, and then search for the target point within the specified spatiotemporal range according to the process described in steps 5-7.
[0057] Let's take point A as an example to describe the process of building an index.
[0058] Step 1: Get the spatiotemporal information in the data, convert the time information into a Unix timestamp in milliseconds, implement the spatiotemporal point type based on the Point type in the Lucene library, and create a spatiotemporal point object P corresponding to the spatiotemporal information of the target point A. A .P A Contains the primary key, longitude, latitude, altitude, and time information of the target point.
[0059] Step 2: Calculate the hash value of the space-time point, select the time unit as one day, and the length of the geohash code as 3. At this time, the space unit near the equator is approximately an area with a side length of about 150 kilometers.
[0060] Step 2.1: First calculate P A The length of the geohash encoding value of 3 is used as the spatial hash value, that is, P A The spatial hash value of is "wtt". In this embodiment, the spatial hash is calculated without division according to the altitude, but only according to the latitude and longitude. In other embodiments, the altitude can also be used as a parameter for calculating the spatial hash.
[0061] Step 2.2: Then calculate P A Spatial hash, that is, the number of days since January 1, 1970, or P A The time hash value is "19875".
[0062] Step 2.3: Obtain P based on time hash and space hash A The space-time hash value of "19875-wtt".
[0063] Step 3: Find or create a new P A The corresponding first-level index item.
[0064] Since there is no "19875-wtt" index item in the first-level index, a new index item is first created in the first-level index, whose key is "19875-wtt" and whose value is a secondary index directory corresponding to "19875-wtt". Then a new second-level index is created in the above directory, and the second-level index adopts a kd tree index. In this embodiment, a tree index supporting four-dimensional space-time is implemented based on the kd tree in the Apache Lucene library as the second-level index. Preferably, different secondary indexes can be stored in different storage media or devices. For example, in a certain embodiment, more attention is paid to the movement of target points within the day, and target points within a single day are frequently retrieved. The corresponding index items of the day can be stored in a high-speed storage medium according to time, and a new index is established in the high-speed storage medium for each new date, and the index of the previous day is moved to other media as needed; or in a certain embodiment, it is often necessary to query relevant target points in Southeast Asia, and Southeast Asia is a hot area. The secondary index corresponding to the space-time unit corresponding to Southeast Asia is stored in a high-speed storage medium, so as to obtain higher retrieval efficiency; or, in a certain embodiment, the number of times each secondary index is retrieved per unit time is regularly counted, and the secondary indexes with the top N access times are moved to the high-speed storage medium, and the secondary indexes with not the top N access times are moved to other index media as needed.
[0065] Step 4: Insert PA into the second level index.
[0066] The target point P A Insert the second-level index, which is the target point index tree implemented based on the kd tree in the Lucene library.
[0067] Similarly, the target points B, C, D and E are also written into the index according to the method described in steps 1-4, and finally the following is obtained: Figure 1 Preferably, a batch writing method can be used for centralized writing of large batches of data, that is, for a batch of data, the spatiotemporal hash values of all target points are first calculated, the target points with the same spatiotemporal hash value are grouped together, and then each group of target points is written into the corresponding second-level index in parallel.
[0068] Step 5: Find the first-level index item that intersects with the time and space range to be searched. The time and space range to be searched includes geographic space range, altitude range and time range information. In this embodiment, it is within a radius of 10KM from location O (120.6597078, 30.9348386), with an altitude between 10,000 meters and 20,000 meters, and the time range from 8:05 on June 2, 2024 to 10 minutes thereafter, Beijing time, recorded as Q.
[0069] First, calculate the time hash value using the same time hash function as in step 2, and the time hash value can be calculated to be "19876".
[0070] Then, use the same spatial hash function as in step 2 to calculate the spatial hash value, and also select a geohash encoding method with a length of 3. Figure 2 As shown, by decoding the geographic range, two geohash code values "wtt" and "wtm" can be obtained, that is, the geographic range to be queried intersects with the two areas represented by "wtt" and "wtm".
[0071] According to the time hash and space hash, the time-space hash code is calculated to obtain "19867-wtt" and "19876-wtm". Then, by searching the above two keys, it is found that the first-level index has an item with the key "19876-wtm". That is, the target point to be retrieved exists in the second-level index indicated by the "19876-wtm" index item.
[0072] Step 6: Perform spatiotemporal retrieval on all second-level indexes corresponding to the first-level index items obtained in step 5.
[0073] The search function of the second-level index is realized based on Lucene, that is, all eligible target points in this index are obtained through time, altitude and geographic information. Because the kd tree is divided according to the values of multiple dimensions, it is necessary to search according to the value range of each dimension. Therefore, the latitude and longitude range of the minimum external boundary of the geographic space range in Q is calculated first, and the kd tree is searched according to this range. Then, the time and space points that intersect with the geographic space in Q in the search results are calculated as the results of the second-level index detection. Figure 2 As shown, point A and point B are within the geographic space range, and are retrieved based on time and altitude information. Finally, in this example, the target point found in the secondary index corresponding to "19876-wtm" that is within the range specified by Q is point B.
[0074] Step 7: Merge the retrieval results of all second-level indexes involved in step 6.
[0075] Because step 6 only involves one second-level index, point B detected by the second-level index corresponding to the "19876-wtm" index item is the corresponding target point in the entire space-time range.
[0076] Based on the implementation results of steps 1-7, in the target point set formed by points AE, the target point belonging to the space-time range Q is point B.
[0077] In summary, this implementation scheme utilizes the temporal and spatial distribution characteristics of the target points, realizes a two-level temporal and spatial index, and obtains higher target point index establishment and temporal and spatial range retrieval efficiency than the two existing schemes, significantly reducing hardware costs under the same data scale and retrieval time threshold. It mainly utilizes the locality of temporal and spatial range queries to design an index structure that is more suitable for efficient pruning, and improves parallelism through temporal and spatial division to obtain beneficial technical effects. The principle is as follows:
[0078] 1) Related targets are usually clustered in time and space:
[0079] Usually, spatiotemporal range queries are concentrated in a limited time and space range. For example, if an emergency occurs on a ship in a certain sea area and the ship hopes to be rescued by nearby ships, the scope of the spatiotemporal query may be other ship targets that appeared within 100 nautical miles around the ship in the last hour. For another example, in the field of civil aviation, the vertical range of the approach control airspace is below 6,000 meters, and the horizontal range is usually 50 kilometers in radius. If you need to retrieve a target in a certain approach control airspace, the query range is a spatial range with an altitude of less than 6,000 meters and a center point radius of 50KM. According to the above two examples, it can be seen that spatiotemporal targets with spatiotemporal correlation naturally have clustering in time and space, which conforms to the laws of nature. Therefore, spatiotemporal range retrieval is also focused on a limited time and space. Based on the above natural laws, this scheme optimizes the physical structure of the index according to the spatiotemporal clustering characteristics of the target points, improves the efficiency of indexing and spatiotemporal range retrieval of large-scale spatiotemporal target points, and shortens the retrieval response time.
[0080] 2) This solution’s time and space division method is more efficient:
[0081] Spatial partitioning based on geohash is highly efficient, as each geohash layer divides the entire geographic space into 32 parts. Using 2 or 3 layers can divide the world into 1024 or 32768 regions. In addition, it is partitioned according to the time dimension or the height dimension to form a first-level index structure. This pruning based on the first-level index is more efficient in searching than an index that uses a complete tree structure.
[0082] 3) This solution improves parallelism through time and space division:
[0083] Because the time and space division of the first-level index is continuous and non-repetitive, the second-level indexes can be completely parallel. This technical solution can fully utilize the parallel capabilities of modern multi-processors when writing and retrieving. In addition, different second-level indexes can also be stored in different storage media or storage devices, and a higher time and space range retrieval speed can be obtained by storing hot spot data in high-speed storage media or storage devices.
[0084] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0085] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A target point spatiotemporal range retrieval method, characterized in that: The steps include: Step 1: extract the time and space information of the target point to form the time and space points required for indexing; Step 2, calculating the hash value of the space-time point by a space-time hash function, wherein the space-time hash function can divide the space-time into continuous and non-overlapping space-time units, and giving a unique hash value to represent the corresponding space-time unit; Step 3: construct a first-level index according to the hash value of the space-time unit, which is used to store the address of the high-dimensional tree index of the space-time point within the range of the above space-time unit, and use the tree index to construct a second-level index, which is used to insert the space-time point into the second-level index indicated by the corresponding index item in the first-level index; Step 4, search for the first-level index items that intersect with the queried space-time range, and further search for the space-time points to be queried on the second-level index indicated by the found first-level index items. If multiple first-level index items are found, the intersection of all space-time points found by the corresponding second-level indexes is used as the query result.
2. The target point spatiotemporal range retrieval method according to claim 1, characterized in that: Step 2, calculate the hash value of the space-time point by the space-time hash function, the space-time hash function can divide the space-time into continuous and non-overlapping space-time units, and give a unique hash value to represent the corresponding space-time unit. The specific method is: Step 2.1: Calculate a spatial hash value according to a spatial hash function, wherein the spatial hash function uses a geohash code of length n as the spatial hash value, divides the geographic space into continuous and non-overlapping geographic space regions of different sizes, and the longer the length of the geohash code, the more accurate the geographic space region represented; Step 2.2: Calculate the time hash value according to the time hash function, wherein the time hash function uses the number of specified time units that have passed since 0:00 on January 1, 1970, from the Unix timestamp zero point as the time hash value; Step 2.3: Combine the spatial hash and the temporal hash into a spatiotemporal hash value.
3. The target point spatiotemporal range retrieval method according to claim 1, characterized in that: Step 3: construct a first-level index based on the hash value of the space-time unit, which is used to store the address of the high-dimensional tree index of the space-time point within the range of the above space-time unit, and use the tree index to construct a second-level index, which is used to insert the space-time point into the second-level index indicated by the corresponding index item in the first-level index, where: The first-level index is an index that can obtain values based on a key, where the key is the hash value of the space-time unit generated in step 2, and the value is the address of a high-dimensional tree index that can uniquely locate the space-time points within the range of the space-time unit. When storing space-time points, the index item of the space-time point in the first-level index is searched based on the hash value. If there is no corresponding index item, the hash value is used as the key, a new index item is inserted into the first-level index, and a corresponding second-level index is created at the same time.
4. The target point spatiotemporal range retrieval method according to claim 1, characterized in that: Step 3: construct a first-level index based on the hash value of the space-time unit, which is used to store the address of the high-dimensional tree index of the space-time point within the range of the above space-time unit, and use the tree index to construct a second-level index, which is used to insert the space-time point into the second-level index indicated by the corresponding index item in the first-level index, where: The second-level index is constructed using a KD tree.
5. The target point spatiotemporal range retrieval method according to claim 2, characterized in that: Step 4: Find the first-level index items that intersect with the queried spatiotemporal range, and further search for the spatiotemporal points to be queried on the second-level index indicated by the found first-level index items. If multiple first-level index items are found, the intersection of all the spatiotemporal points found by the corresponding second-level indexes is used as the query result. The specific method is as follows: Step 4.1: Get the spatial scope to be queried, that is, find all geohash of length n that intersect or overlap with the retrieval space-time scope; Step 4.2: Get the query time range, and find all time units that intersect or overlap with the search time and space range; Step 4.3: Take the Cartesian product of the spatial hash value obtained in step 4.1 and step 4.2 and the temporal hash value to obtain a list of temporal and spatial hash values. The key in the first-level index is the index item that appears in the list, which is the first-level index item to be searched. Step 4.4: On the second-level index indicated by the first-level index item found, first calculate the latitude and longitude range of the minimum circumscribed boundary of the spatial range to be queried, and then search on the tree index according to this range to find the spatiotemporal point that intersects with the query spatial range as the result of the second-level index detection; Step 4.5: If multiple first-level index items are found, the intersection of all the space-time points found by the corresponding second-level indexes is taken as the query result.
6. The target point spatiotemporal range retrieval method according to claim 1, characterized in that: Different secondary indexes are stored in different storage media or devices, including: (1) When paying attention to the movement of the target point within the day, frequently search for the target point within a single day, store the corresponding index items of the day in the high-speed storage medium according to the time, create a new index for the new date in the high-speed storage medium every day, and move the index of the previous day to other media as needed; (2) When it is necessary to query the relevant target points in a certain area, the secondary index corresponding to the corresponding spatiotemporal unit of the area is stored in a high-speed storage medium, thereby achieving higher retrieval efficiency; (3) Regularly count the number of times each secondary index is retrieved within a unit time, move the secondary indexes with the top N access times to high-speed storage media, and move the secondary indexes with access times that are not in the top N to other index media as needed.
7. The target point spatiotemporal range retrieval method according to claim 1, characterized in that: For centralized writing of large batches of data, a batch writing method is adopted, that is, for a batch of data, the spatiotemporal hash values of all target points are first calculated, the target points with the same spatiotemporal hash value are grouped together, and then each group of target points is written into the corresponding second-level index in parallel.
8. A target point spatiotemporal range retrieval system, characterized in that: The target point spatiotemporal range retrieval method described in any one of claims 1 to 7 is implemented to realize the target point spatiotemporal range retrieval, including a spatiotemporal point hash value calculation module, a secondary index storage module and a target point query module.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the target point spatiotemporal range retrieval method according to any one of claims 1 to 7 is implemented to realize the target point spatiotemporal range retrieval.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for searching the target point in time and space according to any one of claims 1 to 7 is implemented to achieve the search for the target point in time and space.
Citation Information
Patent Citations
Method and device for rendering mass moving targets
CN103927933A
Hbase-based time-space data management method
CN108614836A
Space-time index establishment method based on Hash and PCA
CN110134693A
Data processing method and equipment
CN114357313A
Air traffic control data distributed storage and rapid query method based on space-time coding
CN116610672A
Cited By
GPU ray tracing-based spatio-temporal data index query method and system, medium and equipment
CN122173695A
A spatio-temporal data index query method and system based on GPU ray tracing, medium and equipment
CN122173695B