A target point spatio-temporal range retrieval method
By optimizing the spatiotemporal point index using a spatiotemporal hash function and a two-level index structure, the problem of low efficiency in spatiotemporal retrieval in existing technologies is solved, achieving efficient and low-cost spatiotemporal range retrieval, which is suitable for indexing and querying massive spatiotemporal point data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU AEROSPACE INFORMATION RES INST
- Filing Date
- 2025-01-22
- Publication Date
- 2026-07-24
AI Technical Summary
Existing spatiotemporal retrieval methods are inefficient, especially with large-scale data, and cannot effectively support parallel operations and have poor scalability, failing to meet the needs of efficient indexing and retrieval of massive spatiotemporal point information.
A spatiotemporal hash function is used to divide spatiotemporal points into continuous and non-overlapping units, and a two-level index is constructed. The first-level index is based on the spatiotemporal hash value, and the second-level index is a high-dimensional tree index. The index structure is optimized by combining geohash encoding and timestamps to support parallel operations and efficient retrieval.
It improves the efficiency of spatiotemporal range retrieval, reduces hardware costs, supports high IO speed for hot data, and achieves efficient spatiotemporal target point indexing and retrieval.
Smart Images

Figure CN120104893B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information retrieval technology, specifically to a method for retrieving the spatiotemporal range of a target point. Background Technology
[0002] As the cost of global positioning systems such as BeiDou decreases, more and more mobile phones, wearable devices, and automobiles are equipped with positioning chips, generating massive amounts of spatiotemporal information, including latitude, longitude, altitude, and timestamps. In this technical solution, points containing at least latitude, longitude, timestamps, and optional altitude information are referred to as spatiotemporal points. How to efficiently and cost-effectively index and retrieve this spatiotemporal point information is a problem that needs to be solved.
[0003] Existing spatiotemporal retrieval technologies can be divided into two methods: one is to build separate indexes for the spatial and temporal dimensions and then perform retrieval; the other is to build a unified index for both the temporal and spatial dimensions. The first method requires separate spatial and temporal retrievals followed by intersection calculations, resulting in low efficiency. The second method, which considers both the temporal and spatial dimensions as a whole index, offers higher retrieval efficiency. Based on its fundamental principles, this method can be further divided into two main categories: dimensionality reduction methods based on space-filling curves and methods based on high-dimensional tree structures. Space-filling curve-based methods map coordinates in high-dimensional space to one-dimensional codes and perform retrieval by comparing these codes. This method has some drawbacks; to achieve the required accuracy, space-filling curve dimensionality reduction requires high-order curves for mapping, necessitating numerous computational steps. Both space-filling curve-based dimensionality reduction indexes and high-dimensional tree indexes share disadvantages, including a lack of support for parallel operations and inability to fully utilize modern multiprocessors. Furthermore, their scalability is poor; as the data size increases, the retrieval time quickly exceeds an acceptable threshold. Summary of the Invention
[0004] The purpose of this invention is to propose a method for retrieving the spatiotemporal range of a target point.
[0005] The technical solution for achieving the objective of this invention is: a method for retrieving the spatiotemporal range of a target point, comprising the following steps:
[0006] Step 1: Extract the time and space information from the target points to form the spatiotemporal points required for the index;
[0007] Step 2: Calculate the hash value of a spatiotemporal point using a spatiotemporal hash function. The spatiotemporal hash function can divide spatiotemporal space into continuous and non-overlapping spatiotemporal units and give a unique hash value to represent the corresponding spatiotemporal unit.
[0008] Step 3: Construct a first-level index based on the hash value of the spatiotemporal unit to store the address of the high-dimensional tree index of spatiotemporal points within the above-mentioned spatiotemporal unit range. Construct a second-level index using the tree index to insert the spatiotemporal point into the second-level index indicated by the corresponding index item in the first-level index.
[0009] Step 4: Find the first-level index item that intersects with the spatiotemporal range of the query. Further search for the spatiotemporal point to be queried on the second-level index indicated by the found first-level index item. If multiple first-level index items are found, take the intersection of all spatiotemporal points found by the corresponding second-level indexes as the query result.
[0010] Further, in step 2, the hash value of a spatiotemporal point is calculated using a spatiotemporal hash function. This spatiotemporal hash function can divide spacetime into continuous and non-overlapping spatiotemporal units, providing a unique hash value representing the corresponding spatiotemporal unit. The specific method is as follows:
[0011] Step 2.1: Calculate the spatial hash value according to the spatial hash function. The spatial hash function uses a geohash code of length n as the spatial hash value, which divides the geographic space into continuous and non-overlapping geographic spatial regions of different sizes. The longer the geohash code is, the more accurate the geographic spatial region it represents.
[0012] Step 2.2: Calculate the time hash value according to the time hash function. The time hash function uses the number of specified time units that have passed since the Unix timestamp zero point, i.e., starting from 00:00 on January 1, 1970, 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 based on the hash value of the spatiotemporal unit to store the addresses of high-dimensional tree-structured indexes of spatiotemporal points within the aforementioned spatiotemporal unit range. A second-level index is then constructed using the tree-structured index to insert the spatiotemporal point into the second-level index indicated by the corresponding index entry in the first-level index, wherein:
[0015] The first-level index is an index that can retrieve values based on keys. The key is the hash value of the spatiotemporal unit generated in step 2, and the value is the address of a high-dimensional tree index that can uniquely locate spatiotemporal points within the aforementioned spatiotemporal unit range. When storing spatiotemporal points, the index entry of the spatiotemporal point in the first-level index is searched based on the hash value. If there is no corresponding index entry, the hash value is used as the key, a new index entry is created and 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 based on the hash value of the spatiotemporal unit to store the addresses of high-dimensional tree-structured indexes of spatiotemporal points within the aforementioned spatiotemporal unit range. A second-level index is then constructed using the tree-structured index to insert the spatiotemporal point into the second-level index indicated by the corresponding index entry in the first-level index, wherein:
[0017] The second-level index is constructed using a tree-like index.
[0018] Further, in step 4, find the first-level index item that intersects with the spatiotemporal range being queried. Then, further search for the spatiotemporal point to be queried on the second-level index indicated by the found first-level index item. If multiple first-level index items are found, the intersection of all spatiotemporal points found by the corresponding second-level indexes is taken as the query result. The specific method is as follows:
[0019] Step 4.1: Obtain the spatial range to be queried, that is, find all geohashes of length n that intersect or overlap with the spatial range to be retrieved;
[0020] Step 4.2: Obtain the query time range and find all time units that intersect or overlap with the search time range;
[0021] Step 4.3: Take the Cartesian product of the spatial hash value and the temporal hash value obtained in Steps 4.1 and 4.2 to obtain a list of spatiotemporal hash values. The key in the first-level index is the index item that appears in the spatiotemporal hash value list. This is the first-level index item that needs to be searched.
[0022] Step 4.4: On the second-level index indicated by the first-level index entry, first calculate the latitude and longitude range of the minimum outer boundary of the spatial range to be queried, and then search on the tree index according to this range. The spatiotemporal point that intersects with the queried spatial range is used as the result of the second-level index.
[0023] Step 4.5: If multiple first-level index items are found, the intersection of all spatiotemporal points found by the corresponding second-level indexes is taken as the query result.
[0024] Furthermore, different secondary indexes are stored on different storage media or devices, including:
[0025] (1) When focusing on the movement of target points within a day, frequently search for target points within a single day, store the corresponding index items for the day in a 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 relevant target points in a certain region, the secondary index corresponding to the spatiotemporal unit of the region is stored in a high-speed storage medium to obtain higher retrieval efficiency;
[0027] (3) Periodically count the number of times each secondary index is retrieved within a unit of time, move the secondary indexes with the top N access counts to high-speed storage media, and move the secondary indexes with access counts not in the top N to other index media as needed.
[0028] Furthermore, for large-scale centralized writing of data, a batch writing method is adopted. That is, for a batch of data, the spatiotemporal hash value of all target points is calculated first, the target points with the same spatiotemporal hash value are grouped together, and then each group of target points is written to the corresponding second-level index in parallel.
[0029] A target point spatiotemporal range retrieval system, implementing the target point spatiotemporal range retrieval method to achieve target point spatiotemporal range retrieval, includes 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, it implements the target point spatiotemporal range retrieval method to achieve target point spatiotemporal range retrieval.
[0031] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the target point spatiotemporal range retrieval method is implemented to achieve target point spatiotemporal range retrieval.
[0032] Compared with existing technologies, the significant advantages of this invention are: 1) Pruning based on the first-level spatiotemporal hash index is more efficient than the pruning strategy used in traditional multidimensional tree indexes; 2) During querying, the query range is routed to several sub-indexes based on the spatiotemporal hash of the first-level index, and these sub-indexes can be queried in parallel, which also greatly improves retrieval efficiency; 3) It can provide higher IO speed for hot spatiotemporal data, improving the overall retrieval performance at a lower cost; 4) It proposes a new range retrieval method for 4-dimensional spatiotemporal target points with limited time period, limited elevation range, and limited geographical range. Attached Figure Description
[0033] Figure 1 This is a diagram illustrating a two-level index;
[0034] Figure 2 This is a schematic diagram of the geographical scope of spatial hashing and retrieval criteria. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0036] A method for retrieving the spatiotemporal range of a target point includes the following steps:
[0037] Step 1: Extract the time and space information from the target points to form the spatiotemporal points required for the index.
[0038] Step 2: Calculate the hash value of a spatiotemporal point using a spatiotemporal hash function. The spatiotemporal hash function can divide spatiotemporal space into continuous and non-overlapping spatiotemporal units and give a unique hash value to represent the corresponding spatiotemporal unit.
[0039] Step 2.1: Calculate the spatial hash value using a spatial hash function. This function divides space into continuous, non-overlapping regions, each with a unique hash value. Preferably, a geohash code of length n is used as the spatial hash value. Geohash is a spatial partitioning and encoding scheme; the geohash algorithm can divide geographic space into continuous, non-overlapping geographic spatial regions of varying sizes, and the longer the geohash code, the more accurate the geographic spatial region represented.
[0040] Step 2.2: Calculate the time hash value using a time hash function. This function divides time into continuous, non-overlapping regions, each with a distinct hash value. Preferably, the hash value is the number of specified time units elapsed since the Unix timestamp zero, i.e., from 00:00 on January 1, 1970.
[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 spatiotemporal unit. This first-level index is an index that allows retrieval of values based on keys. The key is the hash value of the spatiotemporal unit generated in Step 2, and the value is the address that uniquely locates a high-dimensional tree-structured index used to store spatiotemporal points within the aforementioned spatiotemporal unit range. Preferably, the first-level index can be a hash index.
[0043] When storing space points, the index entry of the space point in the first-level index is found based on the hash value. If there is no corresponding index entry, the hash value is used as the key to create a new index entry and insert it into the first-level index. At the same time, a corresponding second-level index is created.
[0044] Step 4: Construct a second-level index using a kd-tree, and insert the spatiotemporal point into the second-level index indicated by the corresponding index entry in the first-level index.
[0045] Step 5: Find the first-level index entry that intersects with the spatiotemporal range of the query.
[0046] Step 5.1: Obtain the spatial range to be queried, that is, find all spatial regions divided in Step 2 that intersect or overlap with the retrieval spatial range. Preferably, find all geohashes of length n that intersect or overlap with the retrieval spatial range.
[0047] Step 5.2: Obtain the query time range and calculate all time regions divided in Step 2 that intersect or overlap with the desired query time and space range. Preferably, find all time units that intersect or overlap with the retrieval time and space range.
[0048] Step 5.3: Take the Cartesian product of the spatial hash value and the temporal hash value obtained in Steps 5.1 and 5.2 to obtain a list of spatiotemporal hash values. The key in the first-level index is the index item that appears in the list, which is the index item that needs to be searched.
[0049] Step 6: Perform a further search on the second-level index indicated by the first-level index entry found in Step 5 to find the spatiotemporal point to be queried.
[0050] Step 7: Combine the results from Step 6 into the final result.
[0051] Example
[0052] To verify the effectiveness of the present invention, the following experimental design was conducted to demonstrate its application in the spatiotemporal range retrieval of target points of aircraft type. 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 according to the data shown in Table 1, a spatiotemporal range retrieval will be performed according to the given query conditions.
[0053] Query criteria: Query all target points that appear within 10 minutes after 8:05 AM Beijing time on June 2, 2024, within a radius of 10 km of location O (120.6597078, 30.9348386) and at an altitude between 10,000 and 20,000 meters.
[0054] Table 1 Example target point data
[0055] point longitude latitude Height (meters) 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 in steps 5-7.
[0057] Let's take point A as an example to describe the process of building an index.
[0058] Step 1: Obtain the spatiotemporal information from the data, convert the time information into a Unix timestamp in milliseconds, and implement a spatiotemporal point type based on the Point type in the Lucene library, creating a spatiotemporal point object P corresponding to the spatiotemporal information of target point A. A P A It contains the primary key, longitude, latitude, altitude, and time information of the target point.
[0059] Step 2: Calculate the hash value of the spatiotemporal point. Select one day as the time unit and 3 as the length of the geohash encoding. At this time, the spatial unit near the equator is approximately a region with a side length of about 150 kilometers.
[0060] Step 2.1: First calculate P A A geohash value of length 3 is used as the spatial hash value, i.e., P. A The spatial hash value is "wtt". In this embodiment, the spatial hash is calculated not by altitude, but only by latitude and longitude. In other embodiments, altitude can also be used as a parameter for calculating the spatial hash.
[0061] Step 2.2: Then calculate P A Spatial hash, which is the number of days that have elapsed since January 1, 1970, i.e., P. A The time hash value is "19875".
[0062] Step 2.3: Obtain P based on time hash and spatial hash. A The spatiotemporal hash value is "19875-wtt".
[0063] Step 3: Find or create P A The corresponding first-level index item.
[0064] Since there is no index entry for "19875-wtt" in the first-level index, a new index entry is first created in the first-level index with the key "19875-wtt" and the value corresponding to the second-level index directory "19875-wtt". Then, a second-level index is created in the above directory, using a kd-tree index. In this embodiment, a four-dimensional spatiotemporal tree index is implemented based on the kd-tree in the Apache Lucene library as the second-level index. Preferably, different second-level indexes can be stored on different storage media or devices. For example, in one embodiment, more attention is paid to the movement of target points within a single day, and target points within a single day are frequently retrieved. The index items corresponding to the current day can be stored in a high-speed storage medium according to time. A new index is created 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 another embodiment, it is often necessary to query target points related to Southeast Asia. Southeast Asia is a hotspot area, so the secondary index corresponding to the spatiotemporal unit of Southeast Asia is stored in the high-speed storage medium to obtain higher retrieval efficiency. Or, in yet another embodiment, the number of times each secondary index is retrieved within a unit of time is counted periodically. The secondary indexes with the top N access counts are moved to the high-speed storage medium, and the secondary indexes with access counts not in the top N are moved to other index media as needed.
[0065] Step 4: Insert PA into the second-level index.
[0066] 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, target points B, C, D, and E are also written into the index according to the method described in steps 1-4, ultimately resulting in the following: Figure 1 The diagram illustrates a two-level index structure. Preferably, for writing large datasets, a batch write method can be used. That is, for a batch of data, first calculate the spatiotemporal hash value of all target points, group target points with the same spatiotemporal hash value into a group, and then write each group of target points into the corresponding second-level index in parallel.
[0068] Step 5: Find the first-level index item that intersects with the desired spatiotemporal range. The desired spatiotemporal range includes geographic spatial range, altitude range, and time range information. In this embodiment, it is the range within a 10KM radius of location O (120.6597078, 30.9348386), with an altitude between 10,000 and 20,000 meters, and the time range from 8:05 AM Beijing time on June 2, 2024 to 10 minutes thereafter, denoted as Q.
[0069] First, calculate the time hash value using the same time hash function as in step 2. The time hash value is "19876".
[0070] Then, calculate the spatial hash value using the same spatial hash function as in step 2, again choosing a geohash encoding method with a length of 3. For example... Figure 2 As shown, by decoding the geographic range, we can obtain two geohash values, "wtt" and "wtm", which means that the geographic range to be queried intersects with the two areas represented by "wtt" and "wtm".
[0071] The spatiotemporal hash code is calculated using time hashing and spatial hashing, resulting in "19867-wtt" and "19876-wtm". Then, by searching these two keys, an entry with the key "19876-wtm" is found in the first-level index. That is, the target point to be retrieved exists in the second-level index indicated by the index entry "19876-wtm".
[0072] Step 6: Perform spatiotemporal retrieval on all second-level indexes corresponding to the first-level index items obtained in step 5.
[0073] This implementation uses Lucene to implement a second-level index for retrieval, specifically, retrieving all target points within the index that meet certain criteria based on time, altitude, and geographic information. Since the kd-tree is partitioned according to multiple dimensions, the search needs to be performed within the range of values for each dimension. Therefore, the latitude and longitude range of the minimum bounding boundary of the geographic space in Q is first calculated. The search is then performed within this range on the kd-tree, and finally, the spatiotemporal points in the search results that intersect with the geographic space in Q are calculated as the results retrieved by this second-level index. Figure 2 As shown, points A and B are within the geographic space. Based on time and altitude information, the search ultimately finds point B, which belongs to the range mentioned by Q, in the secondary index corresponding to "19876-wtm" in this example.
[0074] Step 7: Merge the search results of all second-level indexes involved in Step 6.
[0075] Since step 6 only involves a second-level index, the point B detected by the second-level index corresponding to the index item "19876-wtm" is the target point corresponding to the entire spatiotemporal range.
[0076] Based on the results of steps 1-7, among the target points formed by points AE, the target point belonging to the spatiotemporal range Q is point B.
[0077] In summary, this implementation scheme leverages the spatiotemporal distribution characteristics of target points to achieve a two-level spatiotemporal index, resulting in higher efficiency in target point index creation and spatiotemporal range retrieval compared to the two existing schemes. It also significantly reduces hardware costs under the same data scale and retrieval time threshold constraints. The main advantages are achieved by utilizing the locality of spatiotemporal range queries to design an index structure more suitable for efficient pruning, and by improving parallelism through spatiotemporal partitioning. The principle is as follows:
[0078] (i) Related targets typically exhibit spatiotemporal clustering:
[0079] Typically, spatiotemporal range queries focus on a limited time and space. For example, if a ship in a certain sea area experiences an emergency and requests assistance from nearby vessels, the possible spatiotemporal query range would be other ship targets that appeared within a 100-nautical-mile radius of the ship within the last hour. Similarly, in civil aviation, the vertical range of approach control airspace is below 6000 meters, and the horizontal range typically has a radius of 50 kilometers. If searching for targets within a specific approach control airspace, the query range would be the spatial range below 6000 meters in altitude with a center point radius of 50 kilometers. These examples demonstrate that spatiotemporally relevant targets naturally cluster in space and time, conforming to natural laws; therefore, spatiotemporal range retrieval also focuses on a limited space-time area. Based on these natural laws, this solution optimizes the physical structure of the index according to the spatiotemporal clustering characteristics of target points, improving the efficiency of indexing and spatiotemporal range retrieval for large-scale spatiotemporal target points and shortening retrieval response time.
[0080] (ii) This scheme's spatiotemporal partitioning method is more efficient:
[0081] Geohash-based spatial partitioning is highly efficient because each layer of Geohash divides the entire geographic space into 32 parts. Using two or three layers, the world can be divided into 1024 or 32768 regions. Furthermore, it can be further fragmented based on time or altitude dimensions to form a first-level index structure. This method of pruning the first-level index before searching is more efficient than a purely tree-structured index.
[0082] (iii) This scheme improves parallelism through spatiotemporal partitioning:
[0083] Because the spatiotemporal partitioning of the first-level index is continuous and non-repeating, the second-level indexes can be fully parallelized. This technical solution fully utilizes the parallel capabilities of modern multiprocessors during both writing and retrieval. Furthermore, different second-level indexes can be stored on different storage media or devices, achieving higher spatiotemporal retrieval speeds by storing hot data on high-speed storage media or devices.
[0084] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for retrieving the spatiotemporal range of a target point, characterized in that, Includes the following steps: Step 1: Extract the time and space information from the target points to form the spatiotemporal points required for the index; Step 2: Calculate the hash value of a spatiotemporal point using a spatiotemporal hash function. The spatiotemporal hash function can divide spatiotemporal space into continuous and non-overlapping spatiotemporal units and give a unique hash value to represent the corresponding spatiotemporal unit. Step 3: Construct a first-level index based on the hash value of the spatiotemporal unit to store the address of the high-dimensional tree index of spatiotemporal points within the above-mentioned spatiotemporal unit range. Construct a second-level index using the tree index to insert the spatiotemporal point into the second-level index indicated by the corresponding index item in the first-level index. Step 4: Find the first-level index item that intersects with the spatiotemporal range of the query. Further search for the spatiotemporal point to be queried on the second-level index indicated by the found first-level index item. If multiple first-level index items are found, take the union of all spatiotemporal points found by the corresponding second-level indexes as the query result. in, Step 2: Calculate the hash value of a spatiotemporal point using a spatiotemporal hash function. This spatiotemporal hash function can divide spacetime into continuous and non-overlapping spatiotemporal units, providing a unique hash value representing the corresponding spatiotemporal unit. The specific method is as follows: Step 2.1: Calculate the spatial hash value according to the spatial hash function. The spatial hash function uses a geohash code of length n as the spatial hash value, which divides the geographic space into continuous and non-overlapping geographic spatial regions of different sizes. The longer the geohash code is, the more accurate the geographic spatial region it represents. Step 2.2: Calculate the time hash value according to the time hash function. The time hash function uses the number of specified time units that have passed since the Unix timestamp zero point, i.e., starting from 00:00 on January 1, 1970, as the time hash value. Step 2.3: Combine the spatial hash and the temporal hash into a spatiotemporal hash value; Step 3: Construct a first-level index based on the hash value of the spatiotemporal unit to store the addresses of high-dimensional tree-structured indexes of spatiotemporal points within the aforementioned spatiotemporal unit range. Then, construct a second-level index using the tree-structured index to insert the spatiotemporal point into the second-level index indicated by its corresponding index entry in the first-level index, wherein: The first-level index is an index that can retrieve values based on keys. The key is the hash value of the spatiotemporal unit generated in step 2, and the value is the address of a high-dimensional tree index that can uniquely locate spatiotemporal points within the aforementioned spatiotemporal unit range. When storing spatiotemporal points, the index entry of the spatiotemporal point in the first-level index is searched based on the hash value. If there is no corresponding index entry, the hash value is used as the key, a new index entry is created and inserted into the first-level index, and a corresponding second-level index is created at the same time. in: The second-level index is constructed using a KD-tree; Step 4: Find the first-level index item that intersects with the spatiotemporal range of the query. Further search for the desired spatiotemporal point on the second-level index indicated by the found first-level index item. If multiple first-level index items are found, use the union of all spatiotemporal points found by the corresponding second-level indexes as the query result. The specific method is as follows: Step 4.1: Obtain the spatial range to be queried, that is, find all geohashes of length n that intersect or overlap with the spatial range to be retrieved; Step 4.2: Obtain the query time range and find all time units that intersect or overlap with the search time range; Step 4.3: Take the Cartesian product of the spatial hash value and the temporal hash value obtained in Steps 4.1 and 4.2 to obtain a list of spatiotemporal 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 that needs to be searched. Step 4.4: On the second-level index indicated by the first-level index entry, first calculate the latitude and longitude range of the minimum outer boundary of the spatial range to be queried, and then search on the tree index according to this range. The spatiotemporal point that intersects with the queried spatial range is used as the result of the second-level index. Step 4.5: If multiple first-level index items are found, use the union of all spatiotemporal points found by the corresponding second-level indexes as the query result; Different secondary indexes are stored on different storage media or devices, including: (1) When focusing on the movement of target points within a day, frequently search for target points within a single day, store the corresponding index items for the day in a 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 region, the secondary index corresponding to the spatiotemporal unit of the region is stored in a high-speed storage medium to obtain higher retrieval efficiency; (3) Periodically count the number of times each secondary index is retrieved within a unit of time, move the secondary indexes with the top N access counts to high-speed storage media, and move the secondary indexes with access counts not in the top N to other index media as needed; For writing large batches of data, a batch writing method is adopted. That is, for a batch of data, the spatiotemporal hash value of all target points is calculated first, the target points with the same spatiotemporal hash value are grouped together, and then each group of target points is written to the corresponding second-level index in parallel.
2. A target point spatiotemporal range retrieval system, characterized in that, The target point spatiotemporal range retrieval method according to claim 1 is implemented to achieve target point spatiotemporal range retrieval, including a spatiotemporal point hash value calculation module, a secondary index storage module, and a target point query module.
3. 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, it implements the target point spatiotemporal range retrieval method of claim 1 to achieve target point spatiotemporal range retrieval.
4. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the target point spatiotemporal range retrieval method of claim 1, thereby realizing target point spatiotemporal range retrieval.