A spatio-temporal data index query method and system based on GPU ray tracing, medium and equipment
By mapping two-dimensional space and time to three-dimensional coordinates and using GPU ray tracing technology, combined with a baseline layer and incremental layer index architecture, the performance bottleneck of traditional indexes during dynamic updates is solved, enabling efficient spatiotemporal data querying and updating.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF INFORMATION SCI & TECH
- Filing Date
- 2026-05-11
- Publication Date
- 2026-07-31
AI Technical Summary
Existing CPU-based tree spatial indexes suffer from computation and memory access bottlenecks when handling massive concurrent requests. Learning indexes are inefficient in multi-dimensional spatial queries and have poor dynamic data adaptability. Existing GPU ray tracing indexes experience performance degradation during dynamic updates.
The two-dimensional spatial coordinates and time dimension are uniformly mapped to three-dimensional coordinates. The bounding volume hierarchy is used for indexing and querying, and a two-layer indexing architecture including a baseline layer and an incremental layer is adopted. GPU ray tracing technology is used for querying and updating.
It achieves high-performance point and range queries, reduces the cost of dynamic updates, improves query throughput, and maintains low latency.
Smart Images

Figure CN122173695B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a spatiotemporal data indexing and querying method, system, medium, and device based on GPU ray tracing, belonging to the field of spatial data indexing technology. Background Technology
[0002] Spatial data indexing is a core technology in geographic information systems, location services, and spatial databases. When faced with massive concurrent requests, traditional CPU-based (Central Processing Unit) tree-structured spatial indexes require traversing nodes layer by layer, involving extensive random access to non-contiguous memory and deep pointer jumps. This results in low processor cache hit rates, easily pushing query throughput to the hardware computing bottleneck. On the other hand, while learning-based indexes, which have emerged in recent years, attempt to replace tree-structured search with model inference, they often require forcibly discretizing continuous multi-dimensional spaces into multiple one-dimensional intervals when handling multi-dimensional spatial range queries. This not only introduces significant boundary transformation overhead but also makes the model less adaptable to dynamic data, leading to high retraining costs. Therefore, overcoming the computational and memory access bottlenecks of traditional CPU architectures and exploring new indexing schemes with extremely high concurrency processing capabilities has become a pressing technical challenge in this field.
[0003] To overcome the aforementioned throughput limitations, leveraging the massively parallel computing capabilities of GPUs (Graphics Processing Units) has become a crucial research direction. In this process, given the high degree of isomorphism between spatial data querying and ray tracing computation in computer graphics at the underlying geometric logic level, utilizing the dedicated ray tracing hardware architecture in modern GPUs to handle spatial indexing has become a groundbreaking solution. However, existing ray tracing acceleration structures were initially designed for relatively static graphics rendering scenarios, resulting in extremely rigid structures. When directly applied to dynamic spatial data scenarios with frequently changing objects, even minor changes in node positions trigger cumbersome underlying tree structure reconstruction, dense copying of video memory data, and global synchronization. This extremely high dynamic maintenance cost leads to a precipitous drop in system update throughput, becoming a new bottleneck restricting overall performance.
[0004] Therefore, there is an urgent need for a spatiotemporal data indexing and querying method and system based on GPU ray tracing, which can not only successfully leverage dedicated GPU ray tracing hardware to achieve an order-of-magnitude leap in spatial query throughput, but also effectively avoid the performance defects of its native structure during dynamic updates, thus achieving a balance between high query throughput and low-latency updates. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a spatiotemporal data indexing query method, system, medium and device based on GPU ray tracing, which maps two-dimensional spatial coordinates and time dimension to a three-dimensional coordinate system, and uses the bounding volume hierarchy and its corresponding geometric acceleration structure to realize hardware acceleration of spatiotemporal indexing query.
[0006] To achieve the above objectives, the present invention is implemented using the following technical solution:
[0007] In a first aspect, the present invention provides a spatiotemporal data indexing and querying method based on GPU ray tracing, comprising:
[0008] In response to a point query request, the query coordinates, query time, and target object identifier in the point query request are obtained. A vertical ray is emitted along a preset direction starting from the query coordinates and the starting height. The nearest intersection point traversal of the vertical ray is performed by GPU ray tracing using a pre-established spatiotemporal index structure. The intersecting geometric primitive with the smallest ray parameter, whose object identifier matches the target object identifier and is a valid data record is returned as the query result of the point query request.
[0009] The method for establishing the spatiotemporal index structure includes:
[0010] A set of spatiotemporal data objects is obtained, each object containing two-dimensional spatial coordinates, object identifier and time information. The time information is mapped to Z-axis coordinates and combined with the two-dimensional spatial coordinates to form a three-dimensional spatiotemporal point. The preset direction is the negative direction of the Z-axis, and the starting height is the Z-axis coordinate corresponding to the query time.
[0011] Each 3D spatiotemporal point is expanded along the Z-axis into a 3D axis-aligned bounding box with a preset thickness. A bounding volume hierarchy is constructed on the GPU based on all 3D axis-aligned bounding boxes, and the bounding volume hierarchy is used as a spatiotemporal index structure.
[0012] Furthermore, in response to an object update request, the identifier of the object to be updated, its old spatial location, its new spatial location, and its update time are obtained from the object update request.
[0013] The failure marker record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the failure marker record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the old spatial position.
[0014] The valid data record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the valid data record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the new spatial position.
[0015] The failure marker record is used to geometrically occlude older data records with the same object identifier but smaller Z-axis coordinates in vertical ray queries.
[0016] Furthermore, in response to the range query request, the three-dimensional spatiotemporal range in the range query request is obtained, and the three-dimensional spatiotemporal range is decomposed into a two-dimensional spatial projection and a one-dimensional time interval. The query result is obtained by combining forward filtering and reverse parallel completion.
[0017] Furthermore, the step of combining forward filtering and reverse parallel completion to obtain query results includes:
[0018] Project the 3D axis-aligned bounding boxes of all data objects onto a 2D plane along the Z-axis, and construct a 2D acceleration structure based on the projection results.
[0019] For the square query box corresponding to the two-dimensional spatial projection, emit two diagonal rays of the query box, and use the two-dimensional acceleration structure to find the intersection, and obtain the data objects that intersect with the diagonal rays as the first candidate set;
[0020] By traversing all data objects through GPU parallel kernel functions, checking whether each data object is located within the two-dimensional spatial projection range and whether the Z-axis coordinate of the data object is not greater than the upper limit of the one-dimensional time interval, the data objects that meet the conditions are selected as the second candidate set.
[0021] Merge the first candidate set and the second candidate set, and after deduplication by object identifier, select the valid record with the largest Z-axis coordinate as the query result.
[0022] Furthermore, the spatiotemporal index structure includes:
[0023] The first baseline layer is used to store immutable, historically stable data; and...
[0024] The second incremental layer is used to store dynamically added incremental update data and failure marker records;
[0025] Specifically, when executing a point query request or a range query request, the first baseline layer and the second incremental layer are merged to construct a single bounding body hierarchy.
[0026] Furthermore, it also includes:
[0027] When the number of records in the second incremental layer reaches a preset number threshold, the survival time reaches a preset time threshold, or the failure mark ratio reaches a preset ratio threshold, a merge and compression operation is triggered.
[0028] When performing the merge compression operation, the latest valid record of each object identifier is extracted from the first baseline layer and the second incremental layer, written back to the first baseline layer and the second incremental layer is cleared.
[0029] Secondly, the present invention provides a spatiotemporal data indexing and querying system based on GPU ray tracing, comprising:
[0030] The point query module is used to respond to a point query request, obtain the query coordinates, query time and target object identifier in the point query request, emit a vertical ray along a preset direction with the query coordinates and starting height as the starting point, perform GPU ray tracing nearest intersection traversal on the vertical ray using a pre-established spatiotemporal index structure, and return the intersecting geometric primitive with the smallest ray parameter, object identifier matching the target object identifier and being a valid data record, as the query result of the point query request;
[0031] Mapping and Construction Module: Used to obtain a set of spatiotemporal data objects. Each object contains two-dimensional spatial coordinates, object identifier and time information. The time information is mapped to the Z-axis coordinate in a three-dimensional Cartesian coordinate system. The two-dimensional spatial coordinates are used as the X-axis and Y-axis coordinates in the three-dimensional Cartesian coordinate system and combined with the Z-axis coordinate to form a three-dimensional spatiotemporal point. The preset direction is the negative direction of the Z-axis and the starting height is the Z-axis coordinate corresponding to the query time.
[0032] Each 3D spatiotemporal point is expanded along the Z-axis into a 3D axis-aligned bounding box with a preset thickness. A bounding volume hierarchy is constructed on the GPU based on all 3D axis-aligned bounding boxes, and the bounding volume hierarchy is used as a spatiotemporal index structure.
[0033] Furthermore, it also includes:
[0034] The dynamic update module is used to respond to object update requests and obtain the object identifier to be updated, old spatial location, new spatial location, and update time from the object update request;
[0035] The failure marker record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the failure marker record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the old spatial position.
[0036] The valid data record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the valid data record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the new spatial position.
[0037] The failure marker record is used to geometrically occlude older data records with the same object identifier but smaller Z-axis coordinates in vertical ray queries;
[0038] The range query module is used to respond to a range query request, obtain the three-dimensional spatiotemporal range in the range query request, reduce the three-dimensional spatiotemporal range to a two-dimensional spatial projection and a one-dimensional time interval, and obtain the query result by combining forward filtering and reverse parallel completion.
[0039] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0040] Fourthly, the present invention provides a computer device, comprising:
[0041] Memory, used to store computer programs / instructions;
[0042] A processor for executing the computer program / instructions to implement the steps of any of the methods described above.
[0043] Fifthly, the present invention provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of any of the methods described above.
[0044] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0045] This invention provides a spatiotemporal data indexing and querying method and system based on GPU ray tracing. It unifies the mapping of two-dimensional spatial coordinates and the time dimension to three-dimensional coordinates, constructs a three-dimensional axis-aligned bounding box for each data entry, and utilizes the GPU to construct a hierarchical structure of bounding volumes as the underlying index. For point queries, a vertical ray is emitted from the query point along the negative Z-axis, and the nearest intersection mechanism of the ray tracing hardware is used to automatically match the data. During data updates, an invalidation marker is inserted at the old position to form geometric occlusion, eliminating the physical deletion overhead of old data. For range queries, the three-dimensional query is reduced to a two-dimensional spatial projection and a one-dimensional temporal determination. A candidate set is obtained through a combination of forward ray filtering and reverse parallel completion, and the result with the largest Z-value is selected based on the object ID.
[0046] This invention provides a spatiotemporal data indexing and querying method and system based on GPU ray tracing. It adopts a two-layer index architecture including a baseline layer and an incremental layer to achieve append-only updates and periodic compression, thereby significantly improving the performance of point queries and range queries with extremely low update costs. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the index construction process of a spatiotemporal data index query method based on GPU ray tracing provided in an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of the bounding volume hierarchy in a spatiotemporal data indexing and querying method based on GPU ray tracing provided in an embodiment of the present invention;
[0049] Figure 3 This is a schematic diagram of the midpoint query process of a spatiotemporal data index query method based on GPU ray tracing provided in an embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram of a query and range query scenario in a spatiotemporal data index query method based on GPU ray tracing provided in an embodiment of the present invention;
[0051] Figure 5 This is a schematic diagram of the index update process in a spatiotemporal data index query method based on GPU ray tracing provided in an embodiment of the present invention;
[0052] Figure 6 This is a flowchart illustrating a spatiotemporal data indexing and querying method based on GPU ray tracing provided in an embodiment of the present invention. Detailed Implementation
[0053] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments and specific features in the embodiments are detailed descriptions of the technical solution of the present application, rather than limitations thereof. In the absence of conflict, the embodiments and technical features in the embodiments can be combined with each other.
[0054] In this article, 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, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0055] Example 1:
[0056] Figure 6 This is a flowchart of a spatiotemporal data indexing and querying method based on GPU ray tracing, according to Embodiment 1 of the present invention. The spatiotemporal data indexing and querying method based on GPU ray tracing provided in this embodiment can be applied to a terminal and can be executed by a spatiotemporal data indexing and querying system based on GPU ray tracing. This system can be implemented in software and / or hardware and can be integrated into the terminal, such as any smartphone, tablet, or computer device with communication capabilities. See also... Figure 6 The method implemented in this way specifically includes the following steps:
[0057] In response to a point query request, the query coordinates, query time, and target object identifier in the point query request are obtained. A vertical ray is emitted along a preset direction starting from the query coordinates and the starting height. The nearest intersection point traversal of the vertical ray is performed by GPU ray tracing using a pre-established spatiotemporal index structure. The intersecting geometric primitive with the smallest ray parameter, whose object identifier matches the target object identifier and is a valid data record is returned as the query result of the point query request.
[0058] The method for establishing the spatiotemporal index structure includes:
[0059] A set of spatiotemporal data objects is obtained, each object containing two-dimensional spatial coordinates, object identifier and time information. The time information is mapped to Z-axis coordinates and combined with the two-dimensional spatial coordinates to form a three-dimensional spatiotemporal point. The preset direction is the negative direction of the Z-axis, and the starting height is the Z-axis coordinate corresponding to the query time.
[0060] Each 3D spatiotemporal point is expanded along the Z-axis into a 3D axis-aligned bounding box with a preset thickness. A bounding volume hierarchy is constructed on the GPU based on all 3D axis-aligned bounding boxes, and the bounding volume hierarchy is used as a spatiotemporal index structure.
[0061] Furthermore, in response to an object update request, the identifier of the object to be updated, its old spatial location, its new spatial location, and its update time are obtained from the object update request.
[0062] The failure marker record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the failure marker record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the old spatial position.
[0063] The valid data record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the valid data record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the new spatial position.
[0064] The failure marker record is used to geometrically occlude older data records with the same object identifier but smaller Z-axis coordinates in vertical ray queries.
[0065] Furthermore, in response to the range query request, the three-dimensional spatiotemporal range in the range query request is obtained, and the three-dimensional spatiotemporal range is decomposed into a two-dimensional spatial projection and a one-dimensional time interval. The query result is obtained by combining forward filtering and reverse parallel completion.
[0066] Furthermore, the step of combining forward filtering and reverse parallel completion to obtain query results includes:
[0067] Project the 3D axis-aligned bounding boxes of all data objects onto a 2D plane along the Z-axis, and construct a 2D acceleration structure based on the projection results.
[0068] For the square query box corresponding to the two-dimensional spatial projection, emit two diagonal rays of the query box, and use the two-dimensional acceleration structure to find the intersection, and obtain the data objects that intersect with the diagonal rays as the first candidate set;
[0069] By traversing all data objects through GPU parallel kernel functions, checking whether each data object is located within the two-dimensional spatial projection range and whether its Z-axis coordinate is not greater than the upper limit of the one-dimensional time interval, the data objects that meet the conditions are selected as the second candidate set.
[0070] Merge the first candidate set and the second candidate set, and after deduplication by object identifier, select the valid record with the largest Z-axis coordinate as the query result.
[0071] Furthermore, the spatiotemporal index structure includes:
[0072] The first baseline layer is used to store immutable, historically stable data; and...
[0073] The second incremental layer is used to store dynamically added incremental update data and failure marker records;
[0074] Specifically, when executing a point query request or a range query request, the first baseline layer and the second incremental layer are merged to construct a single bounding body hierarchy.
[0075] Furthermore, it also includes:
[0076] When the number of records in the second incremental layer reaches a preset number threshold, the survival time reaches a preset time threshold, or the failure mark ratio reaches a preset ratio threshold, a merge and compression operation is triggered.
[0077] When performing the merge compression operation, the latest valid record of each object identifier is extracted from the first baseline layer and the second incremental layer, written back to the first baseline layer, and the second incremental layer is cleared.
[0078] The spatiotemporal data indexing and querying method based on GPU ray tracing provided in this embodiment involves the following steps in its application process:
[0079] Step S1: Read the spatial data object to be indexed; for each data object, extract its two-dimensional spatial coordinates (X,Y), object identifier and corresponding time information, and map the time information to the Z-axis coordinate, thereby uniformly mapping the two-dimensional spatial data to three-dimensional spatiotemporal points;
[0080] Step S2: Expand each three-dimensional spatiotemporal point into a three-dimensional axis-aligned bounding box with a preset thickness. The preset thickness is a configurable small positive number, preferably one-thousandth, so that each data object corresponds to a three-dimensional geometric primitive that can be detected by GPU ray tracing hardware.
[0081] Step S3: Based on the three-dimensional axis-aligned bounding box, construct a bounding volume hierarchy or geometric acceleration structure on the GPU, which is used as a spatiotemporal index structure, where the Z-axis represents the temporal evolution order of the data;
[0082] Step S4: When responding to a point query request, based on the query coordinates, query time, and target object identifier, a vertical ray is emitted along the negative Z-axis starting from the Z-axis coordinates corresponding to the query coordinates and query time. During GPU ray tracing, the nearest intersection selection mechanism is used to obtain the intersecting geometric primitive with the smallest ray parameter. Since the ray propagates along the negative Z-axis, the smallest ray parameter corresponds to the largest Z-axis coordinate, so the nearest intersection geometric primitive naturally corresponds to the latest data object at the query time.
[0083] Step S5: In the intersection test phase, the target object identifier is transmitted through the ray load; only geometric primitives whose object identifiers match the target object identifier are reported as intersecting, in order to avoid mutual occlusion between different objects;
[0084] Step S6: When responding to an object update request, a failure marker record is appended to the old spatial location of the object. The Z-axis coordinate of the failure marker record is set to the update time and marked as a failure state. At the same time, a valid data record is appended to the new spatial location of the object. The Z-axis coordinate of the valid data record is also set to the update time and marked as a valid state. Since the Z-axis coordinate of the failure marker is greater than the Z-axis coordinate of the old data, the vertical ray will hit the failure marker first. When a failure state is detected in the most recent hit processing stage, the record will not be returned, thereby achieving geometric occlusion filtering of the old data.
[0085] Step S7: When responding to a range query request, the three-dimensional spatiotemporal range judgment is decomposed into a two-dimensional spatial projection judgment and a one-dimensional time interval judgment; after flattening the bounding boxes of all data objects to zero in the third dimension, a two-dimensional accelerated structure is constructed; forward filtering and reverse completion are performed on the query box: forward filtering obtains the first candidate set by emitting two two-dimensional diagonal rays of the query box and finding their intersection with the two-dimensional accelerated structure; reverse completion obtains the second candidate set by traversing all data objects through the GPU parallel kernel function to check whether they are within the query box space and whether their Z-axis coordinate is not greater than the query time.
[0086] Step S8: Group the candidate set obtained by forward filtering and reverse completion according to the object identifier, and select the record with the largest third-dimensional coordinate in each group; if the record with the largest Z-axis coordinate is in an invalid state, discard the object; otherwise, output the record as the range query result.
[0087] Furthermore, in the implementation, the spatiotemporal data index adopts a two-layer index structure, including a first-layer baseline tree for storing baseline data and a second-layer update tree for storing incremental update data and failure markers; the first layer is an immutable baseline index, and the second layer is an append-write index; during querying, the second layer and the first layer are merged to construct a single geometric acceleration structure.
[0088] Furthermore, when the number of records in the second layer reaches a preset threshold, the survival time reaches a preset threshold, or the proportion of invalidation markers reaches a preset threshold, a compression operation is triggered; during compression, the latest valid record of each object identifier is extracted from the second layer and the first layer, written back to the first layer, and the second layer is cleared.
[0089] Furthermore, the starting height can be set to the third-dimensional coordinate value corresponding to the query time, or set to a preset upper limit value greater than all known times, in order to query the current latest status.
[0090] Furthermore, the candidate set for the range query is allocated an independent buffer and counter for each query request, and candidate records are appended through atomic operations to ensure multi-threaded parallel safety.
[0091] Furthermore, the two-dimensional diagonal rays connect the opposite vertices of the query box to cover the main spatial area of the query box.
[0092] The following describes the content involved in the above embodiments with reference to a specific example.
[0093] The runtime environment of this embodiment includes a CPU, GPU, system memory, and GPU memory. The CPU is used for data loading, task scheduling, and result integration; the GPU is used to execute bounding box intersection traversal, intersection procedures, hit procedures, and parallel kernel functions; system memory is used to store raw data and query results; and GPU memory is used to store the index structure and intermediate buffers. The GPU ray tracing engine in this embodiment uses the NVIDIA OptiX framework, and the GPU model is an RTX series graphics card that supports ray tracing core (RT Core) hardware acceleration.
[0094] The index building process is as follows Figure 1As shown, the process begins by reading raw data from the data source. Each record contains two-dimensional spatial coordinates and an object identifier. For the initially imported baseline data, the third-dimensional coordinate is uniformly set to zero. For data generated through subsequent updates, it is mapped to the third-dimensional coordinate based on the update time. The mapping method can be linear mapping, normalized mapping, or direct use of the floating-point representation of the timestamp, as long as the temporal order is maintained.
[0095] Next, for each data point, construct a corresponding 3D axis-aligned bounding box (AABB) based on its spatial coordinates and third-dimensional coordinates. The boundary formula of the bounding box is shown in formula (1).
[0096] (1);
[0097] in, Here, P represents the bounding box boundary value, P is a 3D spatiotemporal point, and ε is a preset thickness parameter (ε=0.001 in this embodiment). This thickness transforms the zero-volume point object into a tiny geometry detectable by the GPU ray tracing hardware, while ensuring that different time levels are distinguishable on the Z-axis. X and Y are 2D spatial coordinates. This formula ensures that each zero-volume spatiotemporal point is expanded into a 3D bounding box with a tiny volume, thus enabling detection by the AABB intersection test of the GPU ray tracing hardware.
[0098] After organizing all bounding boxes into an array, the GPU ray tracing engine's accelerated structure construction interface is called to build the bounding volume hierarchy on the GPU, as shown below. Figure 2 As shown. The construction parameters are set to prioritize query speed optimization. After construction, a handle to the accelerated structure is returned for subsequent queries. For the initial dataset, a single accelerated structure is built as the first-level baseline tree index. For subsequent updated data, it is appended to the second-level update tree index, and the two levels are merged to build a unified accelerated structure before the query. Figure 2 In the baseline tree, the root node is n1, representing the overall bounding area of the initial dataset. n1 is divided into two child nodes, n2 and n3. n3 is a leaf node directly associated with an AABB bounding box. n2 is an internal node, further divided into two leaf nodes, n4 and n5. Leaf nodes n4 and n5 are each associated with an AABB bounding box. Leaf nodes n3, n4, and n5 store the actual geometric data, while the root node n1 and internal node n2 are used to accelerate traversal. The root node of the update tree is n6, representing the overall bounding area of all updated data. n6 is divided into two leaf nodes, n7 and n8, each associated with an AABB bounding box and additionally carrying a geometric occlusion.
[0099] The point query process is as follows Figure 3As shown. Based on the query request, query time, and target object identifier, a vertical ray is constructed. The ray's starting point is the third-dimensional coordinate corresponding to the query coordinates and query time, and the ray's direction is along the negative third dimension. When querying the latest current state, the third-dimensional coordinate of the starting point can be set to an upper bound greater than all known times.
[0100] Define a ray payload structure that includes the coordinates of the query result, the object identifier, the target object identifier, and a flag indicating whether a valid result was found. Write the target object identifier into the ray payload, and initialize the flag to "not found".
[0101] On the GPU side, when a ray intersects with a bounding box, an intersection test procedure is executed. This procedure reads the data object corresponding to the bounding box and checks if the object identifier is equal to the target object identifier in the ray payload. If the object identifiers match, the ray parameters are calculated and the intersection is reported. Object identifier filtering prevents erroneous occlusion caused by different objects in the same spatial location, such as... Figure 4 As shown.
[0102] The ray tracing engine automatically selects the intersection point with the smallest ray parameter as the most recent hit. Since rays propagate along the negative third dimension, the smallest ray parameter corresponds to the largest third-dimensional coordinate, so the most recent hit naturally corresponds to the object with the most recent time level.
[0103] The formula for calculating the ray parameter t is: t = (ray origin Z-coordinate - intersection Z-coordinate) / ray direction Z-component. Since the ray direction is (0, 0, -1), t = ray origin Z-coordinate - intersection Z-coordinate. The larger the Z-coordinate of an object, the smaller its corresponding t value. Therefore, the nearest intersection point automatically selected by the GPU hardware naturally corresponds to the latest version object with the largest Z-coordinate.
[0104] In the recent hit handler, the data of the hit object is read, and the failure status flag is checked. If the data is valid, the object coordinates and identifier are written to the ray load, and the flag is set to "found". If the flag is "failed", the flag is kept as "not found", indicating that the location has failed. After ray tracing is complete, the flag in the ray load is checked. If the object is found, the result is returned; otherwise, it indicates that no valid object was found.
[0105] The object update process includes the following steps:
[0106] The system receives update requests and creates records. When an object's location changes, the system receives an update request containing the object identifier, old coordinates, new coordinates, and update time. A failure marker record is created at the old spatial location, setting its object identifier, Z-axis coordinate to the update time, and failure status flag to true. A valid data record is created at the new spatial location, setting its object identifier, Z-axis coordinate to the update time, and failure status flag to false.
[0107] Append to the incremental layer. Failure marker records and valid data records are appended to the end of the data array in the second-level incremental tree. This does not require modifying the data in the first-level baseline tree, nor does it require immediate reconstruction of the accelerated structure. After accumulating a certain number of updates, construct the bounding volume hierarchy for the second-level incremental tree.
[0108] Geometric occlusion filtering mechanism. Because the Z-axis coordinate of the failure marker is greater than that of the old data, the vertical ray emitted from above will hit the failure marker first. The GPU hardware automatically selects the object with the largest Z-axis coordinate as the nearest hit point, and the failure marker is selected first. If the failure status flag is detected as true during the nearest hit processing phase, the record is not returned, thus achieving automatic filtering of old data. The entire process does not require physical deletion of old data. The update process is as follows: Figure 5 As shown.
[0109] The range query process is as follows Figure 4 As shown. The query conditions include spatial range and query time. First, the bounding boxes of all data objects are flattened to zero in the third dimension, preserving the spatial range, and a two-dimensional accelerated structure is constructed. This two-dimensional accelerated structure is only used for spatial projection judgment and does not consider the time level.
[0110] For each query box, two 2D diagonal rays are emitted, connecting the opposite vertices of the query box. In the intersection test, candidate objects are checked to ensure they meet the following conditions: their spatial coordinates are within the query box and their third-dimensional coordinates are not greater than the query time. Objects meeting these conditions are appended to the query's candidate buffer via atomic operations. Each query has an independent candidate buffer and counter to avoid data races that occur when multiple queries share the same buffer.
[0111] The GPU parallel kernel function is launched, with each thread processing one data object and checking if it meets the above conditions. Objects that meet the conditions are also appended to the candidate buffer. The purpose of this step is to complete the list of objects that might have been missed by the forward filtering, i.e., objects that are inside the query box but do not intersect with the diagonal. The forward filtering utilizes GPU ray tracing hardware acceleration, while the backward completion utilizes the GPU's parallel computing capabilities.
[0112] In the post-processing stage, the candidate set is grouped by object identifier, and the record with the largest third-dimensional coordinate in each group is retained. If the failure status flag of the record is true, the object is discarded. Otherwise, the record is output as the final result.
[0113] The two-level index management works as follows: The first level, the baseline tree, stores the initially imported data or compressed stable data. Only one record is retained for each object, and the third dimension coordinate is zero or the base time. This level is immutable. The second level stores newly generated records and expiration markers, using an append-only write method. The third dimension coordinate is greater than the base time and monotonically increases. During queries, the two levels of data are logically connected to build a unified, accelerated structure.
[0114] When the number of records in the second layer reaches 20% of that in the first layer, the lifespan exceeds 300 seconds, or the failure flag ratio exceeds 50%, a compression operation is triggered. The specific steps of the compression operation are as follows: (1) Traverse all records in the first-layer baseline tree and the second-layer incremental tree, and build a hash table according to the object identifier; (2) For each object identifier, find the record with the largest Z-axis coordinate and the failure status flag is false among all its corresponding records; (3) Write the filtered record set back to the data array of the first-layer baseline tree; (4) Reconstruct the first-layer bounding volume hierarchy based on the new data array; (5) Clear the data array and acceleration structure of the second-layer incremental tree. After compression, the first layer contains the latest valid status of all objects, and the second layer is empty and can continue to receive new update operations.
[0115] This invention is applicable to indexing scenarios involving versioned geographic information data, time-series location data, real-time trajectory data, digital twin object status data, and other scenarios requiring the return of the latest visible spatial objects at a given query time. Practical application verification was conducted on ten million atmospheric and oceanic observation data points. The test scenario simulated a dynamic environment where 10% of the data was updated, meaning one million records had their location or status updated and written to the incremental layer before the query. Under these conditions, in a point query scenario, the average query time for ten thousand query requests was 18.4 milliseconds; in a range query scenario, the average query time for ten thousand query requests was 1552.8 milliseconds. These results demonstrate that this invention maintains efficient query response capabilities even in dynamic scenarios with continuously updated data. It should be noted that the above performance data is only used to illustrate the effectiveness of the invention and does not constitute any limitation on the scope of protection of this invention.
[0116] In other implementations, the third-dimensional coordinate can represent either a strictly monotonically increasing sequence number or a proportionally mapped physical timestamp, logical clock, or batch number. The starting height of the vertical ray for a point query can be set to either the third-dimensional coordinate value corresponding to the query time or a preset maximum height value. The number of two-dimensional rays used for forward filtering in a range query can be adjusted according to the query box scale, data density, and throughput requirements, and is not limited to two. This invention does not impose any limitations on this.
[0117] Example 2:
[0118] This embodiment provides a spatiotemporal data indexing and query system based on GPU ray tracing, including:
[0119] The point query module is used to respond to a point query request, obtain the query coordinates and target object identifier in the point query request, emit a vertical ray along a preset direction starting from the query coordinates and the starting height, perform GPU ray tracing nearest intersection traversal on the vertical ray using a pre-established spatiotemporal index structure, and return the intersecting geometric primitive with the smallest ray parameter, whose object identifier matches the target object identifier and is a valid data record, as the query result of the point query request;
[0120] Mapping and Construction Module: Used to obtain a set of spatiotemporal data objects. Each object contains two-dimensional spatial coordinates, object identifier and time information. The time information is mapped to the Z-axis coordinate in a three-dimensional Cartesian coordinate system. The two-dimensional spatial coordinates are used as the X-axis and Y-axis coordinates in the three-dimensional Cartesian coordinate system and combined with the Z-axis coordinate to form a three-dimensional spatiotemporal point. The preset direction is the negative direction of the Z-axis and the starting height is the Z-axis coordinate corresponding to the query time.
[0121] Each 3D spatiotemporal point is expanded along the Z-axis into a 3D axis-aligned bounding box with a preset thickness. A bounding volume hierarchy is constructed on the GPU based on all 3D axis-aligned bounding boxes, and the bounding volume hierarchy is used as a spatiotemporal index structure.
[0122] Furthermore, it also includes:
[0123] The dynamic update module is used to respond to object update requests and obtain the object identifier to be updated, old spatial location, new spatial location, and update time from the object update request;
[0124] The failure marker record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the failure marker record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the old spatial position.
[0125] The valid data record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the valid data record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the new spatial position.
[0126] The failure marker record is used to geometrically occlude older data records with the same object identifier but smaller Z-axis coordinates in vertical ray queries;
[0127] The range query module is used to respond to a range query request, obtain the three-dimensional spatiotemporal range in the range query request, reduce the three-dimensional spatiotemporal range to a two-dimensional spatial projection and a one-dimensional time interval, and obtain the query result by combining forward filtering and reverse parallel completion.
[0128] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.
[0129] Example 3:
[0130] This embodiment provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in Embodiment 1.
[0131] Example 4:
[0132] This embodiment provides a computer device, including:
[0133] Memory, used to store computer programs / instructions;
[0134] A processor for executing the computer program / instructions to implement the steps of the method described in Embodiment 1.
[0135] Example 5:
[0136] This embodiment provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the method described in Embodiment 1.
[0137] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
[0138] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0139] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.
[0140] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0141] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure and not to limit its protection scope. Although this disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that after reading this disclosure, they can still make various changes, modifications or equivalent substitutions to the specific implementation of the invention, but these changes, modifications or equivalent substitutions are all within the protection scope of the pending claims.
Claims
1. A GPU ray tracing based spatio-temporal data index query method, characterized in that, include: In response to a point query request, the query coordinates, query time, and target object identifier in the point query request are obtained. A vertical ray is emitted along a preset direction starting from the query coordinates and the starting height. The nearest intersection point traversal of the vertical ray is performed by GPU ray tracing using a pre-established spatiotemporal index structure. The intersecting geometric primitive with the smallest ray parameter, whose object identifier matches the target object identifier and is a valid data record is returned as the query result of the point query request. The method for establishing the spatiotemporal index structure includes: A set of spatiotemporal data objects is obtained. Each object contains two-dimensional spatial coordinates, an object identifier, and time information. The time information is mapped to the Z-axis coordinate in a three-dimensional Cartesian coordinate system. The two-dimensional spatial coordinates are used as the X-axis and Y-axis coordinates in the three-dimensional Cartesian coordinate system and combined with the Z-axis coordinate to form a three-dimensional spatiotemporal point. The preset direction is the negative direction of the Z-axis, and the starting height is the Z-axis coordinate corresponding to the query time. Each 3D spatiotemporal point is expanded along the Z-axis into a 3D axis-aligned bounding box with a preset thickness. A bounding volume hierarchy is constructed on the GPU based on all 3D axis-aligned bounding boxes, and the bounding volume hierarchy is used as a spatiotemporal index structure. The spatiotemporal index structure includes: The first baseline layer is used to store immutable, historically stable data; and... The second incremental layer is used to store dynamically added incremental update data and failure marker records; Specifically, when executing a point query request or a range query request, the first baseline layer and the second incremental layer are merged to construct a single bounding body hierarchy. 2.The GPU-based ray tracing spatio-temporal index query method of claim 1, wherein, Also includes: In response to an object update request, retrieve the object identifier to be updated, the old spatial location, the new spatial location, and the update time from the object update request; The failure marker record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the failure marker record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the old spatial position. The valid data record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the valid data record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the new spatial position. The failure marker record is used to geometrically occlude older data records with the same object identifier but smaller Z-axis coordinates in vertical ray queries. 3.The GPU-based ray tracing spatio-temporal index query method of claim 2, wherein, Also includes: In response to a range query request, the three-dimensional spatiotemporal range in the range query request is obtained. The three-dimensional spatiotemporal range is then decomposed into a two-dimensional spatial projection and a one-dimensional time interval. The query result is obtained by combining forward filtering and reverse parallel completion. 4.The GPU-based ray tracing spatio-temporal index query method of claim 3, wherein, The method of obtaining query results by combining forward filtering and reverse parallel completion includes: Project the 3D axis-aligned bounding boxes of all data objects onto a 2D plane along the Z-axis, and construct a 2D acceleration structure based on the projection results. For the square query box corresponding to the two-dimensional spatial projection, emit two diagonal rays of the square query box, and use the two-dimensional acceleration structure to find the intersection, and obtain the data objects that intersect with the diagonal rays as the first candidate set; By traversing all data objects through GPU parallel kernel functions, checking whether each data object is located within the two-dimensional spatial projection range and whether the Z-axis coordinate of each data object is not greater than the upper limit of the one-dimensional time interval, the data objects that meet the conditions are selected as the second candidate set. Merge the first candidate set and the second candidate set, and after deduplication by object identifier, select the valid record with the largest Z-axis coordinate as the query result.
5. The spatiotemporal data indexing and query method based on GPU ray tracing according to claim 1, characterized in that, Also includes: When the number of records in the second incremental layer reaches a preset number threshold, the survival time reaches a preset time threshold, or the failure mark ratio reaches a preset ratio threshold, a merge and compression operation is triggered. When performing the merge compression operation, the latest valid record of each object identifier is extracted from the first baseline layer and the second incremental layer, written back to the first baseline layer and the second incremental layer is cleared.
6. A spatiotemporal data indexing and query system based on GPU ray tracing, characterized in that, include: The point query module is used to respond to a point query request, obtain the query coordinates, query time and target object identifier in the point query request, emit a vertical ray along a preset direction with the query coordinates and starting height as the starting point, perform GPU ray tracing nearest intersection traversal on the vertical ray using a pre-established spatiotemporal index structure, and return the intersecting geometric primitive with the smallest ray parameter, object identifier matching the target object identifier and being a valid data record, as the query result of the point query request; The mapping and construction module is used to obtain a set of spatiotemporal data objects. Each object contains two-dimensional spatial coordinates, object identifier and time information. The time information is mapped to the Z-axis coordinate in a three-dimensional rectangular coordinate system. The two-dimensional spatial coordinates are used as the X-axis and Y-axis coordinates in the three-dimensional rectangular coordinate system and combined with the Z-axis coordinate to form a three-dimensional spatiotemporal point. The preset direction is the negative direction of the Z-axis and the starting height is the Z-axis coordinate corresponding to the query time. Each 3D spatiotemporal point is expanded along the Z-axis into a 3D axis-aligned bounding box with a preset thickness. A bounding volume hierarchy is constructed on the GPU based on all 3D axis-aligned bounding boxes, and the bounding volume hierarchy is used as a spatiotemporal index structure. The spatiotemporal index structure includes: The first baseline layer is used to store immutable, historically stable data; and... The second incremental layer is used to store dynamically added incremental update data and failure marker records; Specifically, when executing a point query request or a range query request, the first baseline layer and the second incremental layer are merged to construct a single bounding body hierarchy.
7. A spatiotemporal data indexing and query system based on GPU ray tracing according to claim 6, characterized in that, Also includes: The dynamic update module is used to respond to object update requests and obtain the object identifier to be updated, old spatial location, new spatial location, and update time from the object update request; The failure marker record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the failure marker record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the old spatial position. The valid data record carrying the identifier of the object to be updated is inserted into the spatiotemporal index structure as a new geometric primitive, and the spatial position of the valid data record is the three-dimensional spatiotemporal point after the update time is replaced by the Z-axis coordinate in the new spatial position. The failure marker record is used to geometrically occlude older data records with the same object identifier but smaller Z-axis coordinates in vertical ray queries. The range query module is used to respond to a range query request, obtain the three-dimensional spatiotemporal range in the range query request, reduce the three-dimensional spatiotemporal range to a two-dimensional spatial projection and a one-dimensional time interval, and obtain the query result by combining forward filtering and reverse parallel completion.
8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-5.
9. A computer device, comprising: include: Memory, used to store computer programs / instructions; A processor for executing the computer program / instructions to implement the steps of the method according to any one of claims 1-5.