A method for optimizing spatial query performance in a geographic information system

By combining lock-free concurrent memory grid indexing, minimum spanning tree spatial pruning algorithm and deep Q network, the query performance degradation problem of geographic information system under high-concurrency streaming spatial data input scenario is solved, and efficient spatial query performance and load balancing are achieved.

CN122173531APending Publication Date: 2026-06-09JINING ZHONGHANG SURVEYING & MAPPING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JINING ZHONGHANG SURVEYING & MAPPING CO LTD
Filing Date
2026-03-18
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In scenarios with high-concurrency streaming spatial data input, the spatial query performance of Geographic Information Systems (GIS) decreases sharply as the data scale increases. Existing technologies suffer from problems such as thread blocking caused by mutex locks, high computational cost of full-map traversal algorithms, invalid memory loading due to row-based storage, and the inability of static routing strategies to detect dynamic changes in node load.

Method used

By employing a lock-free concurrent memory grid index and a multi-version concurrency control mechanism, combined with the minimum spanning tree space pruning algorithm, three-dimensional Hilbert spatiotemporal filling curve encoding, and a spatiotemporal load routing decision model based on deep Q-networks, lock-free operation for high-concurrency writes, topology graph preprocessing, efficient encoding and storage of spatiotemporal data, dynamic load balancing, and intelligent routing decision-making are achieved.

Benefits of technology

It effectively eliminates thread blocking during high-concurrency writes, reduces query computing power consumption, maintains the proximity of spatiotemporal data, achieves dynamic load balancing of computing nodes, and improves the system's query throughput and response latency stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122173531A_ABST
    Figure CN122173531A_ABST
Patent Text Reader

Abstract

The application provides a spatial query performance optimization method in a geographic information system, and belongs to the technical field of geographic information systems.The application adopts three-dimensional Hilbert space-time filling curve coding and memory level columnar storage format to maintain the locality of space-time data and reduce invalid memory loading, introduces a consistent hash and adaptive space grid dynamic partitioning load balancing strategy to migrate hotspot tiles to idle nodes, adaptively distributes query requests based on a deep Q network artificial intelligence space-time load routing decision model, and dynamically adjusts the strategy update mode through an adaptive exploration rate adjustment function, triggers a repartitioning process when the query response delay exceeds a threshold, and performs garbage collection on a low-frequency version chain, thereby solving the technical problem that the spatial query performance of the geographic information system rapidly decreases with the increase of the data scale in a high-concurrency streaming spatial data input scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of geographic information system technology, and more specifically, relates to a method for optimizing spatial query performance in geographic information systems. Background Technology

[0002] Geographic Information Systems (GIS) are widely used in smart cities, traffic navigation, and real-time trajectory tracking. Spatial query performance is a core indicator of system capability. In existing technologies, spatial indexes typically employ disk-based tree-structured indexes such as R-trees and quadtrees. Concurrent write operations rely on mutex locks to protect index nodes, spatial road network queries depend on full-map traversal algorithms, spatiotemporal trajectory data uses row-based storage, and query routing between distributed computing nodes relies on static hashing or round-robin strategies. These solutions are applicable to offline batch processing scenarios and are widely deployed in low-concurrency scenarios such as traditional map services and cadastral management. However, with the rapid expansion of IoT terminals, the concurrent write volume of real-time trajectory stream data far exceeds the capacity of traditional index structures. Mutex lock mechanisms cause severe thread blocking during high-concurrency writes, full-map traversal algorithms consume significant computing power in large-scale road networks, row-based storage generates a large amount of invalid memory loading during multi-dimensional filtering, and static routing strategies cannot detect dynamic changes in node load, leading to some nodes being overloaded while others remain idle. In other words, existing technologies present a technical problem where the spatial query performance of geographic information systems decreases sharply as the data scale increases in scenarios with high-concurrency streaming spatial data input. Summary of the Invention

[0003] In view of this, the present invention provides a method for optimizing spatial query performance in geographic information systems, which can solve the technical problem in the prior art where the spatial query performance of geographic information systems decreases sharply as the data scale increases under high-concurrency streaming spatial data input scenarios.

[0004] This invention is implemented as follows: This invention provides a method for optimizing spatial query performance in a geographic information system, comprising the following steps:

[0005] Construct a lock-free concurrent memory grid index, use a multi-version concurrency control mechanism to manage concurrent write transactions, write spatial data update operations into the version chain of the lock-free concurrent memory grid index, and periodically flush the lock-free concurrent memory grid index data to disk through an asynchronous batch persistence disk mechanism;

[0006] The minimum spanning tree spatial pruning algorithm is used to preprocess the spatial road network topology graph. The spatial object vertices are used as graph nodes and the geometric distance is used as the edge weight. The closed loop redundant edges are removed through disjoint set iteration, and the backbone topology network is retained. The backbone topology network is used as the pre-index structure for subsequent spatial queries.

[0007] The spatiotemporal trajectory data is encoded using three-dimensional Hilbert spatiotemporal filling curve encoding. The time dimension and two-dimensional spatial dimension are jointly mapped to a one-dimensional encoding sequence. The spatial attribute column and the time attribute column are stored separately in a memory-level columnar storage format. When performing a spatial query, the spatial attribute column and the time attribute column are independently calculated and filtered, and the intersection is taken to obtain the query result.

[0008] A load balancing strategy based on consistent hashing and adaptive spatial grid dynamic partitioning is introduced to monitor the node load index of each computing node in real time. When the node load index of a computing node exceeds the preset load threshold, the hot spot tile subset on the computing node is migrated to an idle computing node whose node load index is lower than the preset load threshold.

[0009] A spatiotemporal load routing decision model is used to analyze the node load indicators and real-time query task flow of each computing node, output the target node routing decision, distribute the query request to the corresponding computing node for execution based on the target node routing decision, and calculate the adaptive exploration rate adjustment function value based on the query throughput and response latency standard deviation in the current statistical window. When the adaptive exploration rate adjustment function value belongs to different intervals, different exploration rate parameters are used to update the strategy network of the spatiotemporal load routing decision model.

[0010] After performing a spatial query, the query response latency and cache hit rate of each computing node are statistically analyzed. When the query response latency exceeds the preset latency threshold, the repartitioning process of the 3D Hilbert spatiotemporal filling curve encoding is triggered. The 3D Hilbert spatiotemporal filling curve encoding and arrangement of the current spatiotemporal trajectory data distribution are re-executed, and garbage collection is performed on the version chains with low access frequency in the lock-free concurrent memory grid index to release memory resources.

[0011] Specifically, the lock-free concurrent memory grid index refers to a spatial range covered by planar grid cells of fixed size. Each planar grid cell maintains a linked list of space object pointers that uses atomic compare-and-swap instructions to achieve lock-free concurrent access. Write operations are completed through atomic compare-and-swap instructions, without the need for mutex locks.

[0012] Specifically, the multi-version concurrency control mechanism refers to generating a new data version and attaching a timestamp for each write operation, and reading operations read the latest consistent version before the start of the transaction, so that read operations and write operations do not block each other.

[0013] Specifically, the asynchronous batch persistence mechanism refers to the fact that write operations are not immediately written to the disk synchronously, but are accumulated in memory to a set quantity or reach a set time window before being written to the disk in batches by a background thread, thus transforming a large number of random small write operations into sequential large block write operations.

[0014] Specifically, the minimum spanning tree spatial pruning algorithm abstracts the spatial road network into an undirected weighted graph and uses a disjoint-set data structure to iteratively process all edges according to their geometric distance from smallest to largest. If adding an edge would cause two graph nodes to be in the same connected component in the disjoint-set, then the added edge is determined to form a closed-loop redundant edge and is removed, retaining only the minimum set of edges that maintains the connectivity of the entire graph.

[0015] Specifically, the three-dimensional Hilbert spatiotemporal filling curve encoding refers to quantizing the three dimensions of spatial longitude, spatial latitude, and timestamp into discrete grid coordinates of equal precision, and then using the recursive spatial filling rule of the three-dimensional Hilbert curve to map the three-dimensional discrete grid coordinates into one-dimensional integer codes.

[0016] Specifically, the memory-level columnar storage format refers to storing the spatial attribute columns and temporal attribute columns in the spatiotemporal trajectory data consecutively in independent memory blocks, so that filtering operations for a single dimension only need to read the memory area of ​​the corresponding column.

[0017] The node load metric specifically refers to the combined metric of processor utilization and memory utilization of each computing node; the consistent hashing specifically refers to mapping computing nodes and hot tile subsets to the same hash ring, so that when a node goes online or offline, only the hot tile subsets of adjacent intervals on the hash ring need to be migrated.

[0018] Specifically, the hotspot tile subset refers to a set of spatial grid cells under adaptive spatial grid dynamic partitioning where the node load index of a single computing node exceeds a preset load threshold due to the high aggregation of spatiotemporal trajectory data in hotspot areas. These cells are identified through real-time monitoring of node load indexes and then used as migration targets.

[0019] The spatiotemporal load routing decision model adopts a deep Q network architecture. The state vector is formed by concatenating the processor utilization rate, memory utilization rate and current query queue length of each computing node. The action value estimate of each candidate computing node is output through a multi-layer fully connected network. The policy network selects the computing node with the highest action value as the target node routing decision output.

[0020] The training dataset for the spatiotemporal load routing decision model is established by collecting processor utilization, memory utilization, query queue length, query response latency and query throughput data of each computing node in the historical operation log of the cluster. The state vector before and after each target node routing decision, the selected computing node number, the query throughput reward value after the query is completed and the state vector at the next moment are combined into a quadruple sample and accumulated into the experience replay pool.

[0021] The training of the spatiotemporal load routing decision model involves randomly sampling batches of quadruples from the experience replay pool, calculating the maximum action value of the next state vector using the target network and discounting and accumulating the query throughput reward value to obtain the target Q value, calculating the predicted Q value of the action corresponding to the selected computing node number under the current state vector using the policy network, calculating the mean squared error loss of the difference between the target Q value and the predicted Q value and backpropagating to update the policy network parameters, and copying the policy network parameters to the target network after a fixed number of update steps.

[0022] Among them, the adaptive exploration rate adjustment function value The calculation formula is ,in This represents the query throughput within the current statistics window. As a benchmark query throughput, The standard deviation of response delay within the current statistical window. The standard deviation of the baseline response delay is given.

[0023] Among them, when When, the exploration rate parameter takes the first exploration rate value; when When, the exploration rate parameter takes the second exploration rate value; when At that time, the exploration rate parameter takes the third exploration rate value; the first exploration rate value is less than the second exploration rate value, and the second exploration rate value is less than the third exploration rate value.

[0024] The benchmark query throughput and the benchmark response latency standard deviation are both derived from statistical data in the cluster's historical operation logs. They are extracted from and fixedly stored in the cluster's historical operation logs during the establishment of the training dataset for the spatiotemporal load routing decision model.

[0025] The disjoint-set data structure refers to a data structure that maintains information about element groups. It supports determining whether two graph nodes belong to the same connected component and merging the two groups in approximately constant time complexity. It is used to identify closed-loop redundant edges in the minimum spanning tree space pruning algorithm.

[0026] This invention employs a combination of lock-free concurrent memory grid indexing and multi-version concurrency control mechanisms to eliminate thread blocking during high-concurrency writes, ensuring that read and write operations do not block each other. It utilizes a minimum spanning tree spatial pruning algorithm to remove closed-loop redundant edges in the road network topology, significantly reducing the number of graph nodes traversed in subsequent queries, and substantially reducing computational consumption as the search space shrinks. Furthermore, this invention uses 3D Hilbert spatiotemporal filling curve encoding and a memory-level columnar storage format to maintain the continuity of adjacent spatiotemporal data in the encoded sequence. Filtering operations only require reading the memory region of the corresponding column, reducing fragmented random access and invalid cache loading. A spatiotemporal load routing decision model based on a deep Q-network continuously senses the load status of cluster nodes and adaptively adjusts the routing allocation of query requests, avoiding the imbalance between node overload and resource idleness. In summary, this invention solves the technical problem of the sharp decline in spatial query performance of geographic information systems (GIS) as the data scale increases under high-concurrency streaming spatial data input scenarios. Attached Figure Description

[0027] Figure 1 This is a flowchart of the method of the present invention.

[0028] Figure 2 Cache the hit rate trend chart for each statistical window.

[0029] Figure 3 A comparison of the backbone topology before and after pruning using the minimum spanning tree space pruning algorithm.

[0030] Figure 4 This is a graph showing the relationship between the adaptive exploration rate adjustment function value and the exploration rate parameter. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below.

[0032] like Figure 1 The diagram shown is a flowchart of a spatial query performance optimization method in a geographic information system provided by the present invention. This method includes the following steps:

[0033] S01. Construct a lock-free concurrent memory grid index, use a multi-version concurrency control mechanism to manage concurrent write transactions, write spatial data update operations into the version chain of the lock-free concurrent memory grid index, and periodically flush the lock-free concurrent memory grid index data to disk through an asynchronous batch persistence disk mechanism.

[0034] S02. The minimum spanning tree spatial pruning algorithm is used to preprocess the spatial road network topology graph. The spatial object vertex is used as the graph node and the geometric distance is used as the edge weight. The closed loop redundant edges are eliminated through disjoint set iteration, and the backbone topology network is retained. The backbone topology network is used as the pre-index structure for subsequent spatial queries.

[0035] S03. The spatiotemporal trajectory data is encoded using three-dimensional Hilbert spatiotemporal filling curve encoding. The time dimension and two-dimensional spatial dimension are jointly mapped to a one-dimensional encoding sequence. The spatial attribute column and the time attribute column are stored separately in a memory-level columnar storage format. When performing a spatial query, the spatial attribute column and the time attribute column are independently calculated and filtered, and the intersection is taken to obtain the query result.

[0036] S04. Introduce a load balancing strategy based on consistent hashing and adaptive spatial grid dynamic partitioning, monitor the node load index of each computing node in real time, and when the node load index of a computing node exceeds the preset load threshold, migrate the hot tile subset on the computing node to an idle computing node whose node load index is lower than the preset load threshold.

[0037] S05. The spatiotemporal load routing decision model is used to analyze the node load index and real-time query task flow of each computing node, output the target node routing decision, distribute the query request to the corresponding computing node for execution according to the target node routing decision, and calculate the adaptive exploration rate adjustment function value based on the query throughput and response latency standard deviation in the current statistical window. When the adaptive exploration rate adjustment function value belongs to different intervals, different exploration rate parameters are used to update the strategy network of the spatiotemporal load routing decision model.

[0038] S06. After executing the spatial query, the query response latency and cache hit rate of each computing node are statistically analyzed. When the query response latency exceeds the preset latency threshold, the repartitioning process of the three-dimensional Hilbert spatiotemporal filling curve encoding is triggered. The three-dimensional Hilbert spatiotemporal filling curve encoding arrangement is re-executed on the current spatiotemporal trajectory data distribution. Garbage collection is performed on the version chain with low access frequency in the lock-free concurrent memory grid index to release memory resources.

[0039] The lock-free concurrent memory grid index refers to covering a spatial range with planar grid cells of fixed size. Each planar grid cell maintains a linked list of space object pointers that uses atomic compare-and-swap instructions to achieve lock-free concurrent access. Write operations are completed through atomic compare-and-swap instructions, without the need for mutex locks, thereby eliminating thread blocking caused by locking mechanisms during high-concurrency streaming space data input.

[0040] The multi-version concurrency control mechanism refers to generating a new data version and attaching a timestamp for each write operation, and reading operations read the latest consistent version before the start of the transaction, so that read operations and write operations do not block each other.

[0041] The asynchronous batch persistence disk writing mechanism refers to the fact that write operations in the lock-free concurrent memory grid index are not immediately written to the disk synchronously, but are accumulated in memory to a set number or reach a set time window before being written to the disk in batches by a background thread. This transforms a large number of random small write operations into sequential large block write operations, thereby hiding disk input / output latency.

[0042] The principle of the minimum spanning tree spatial pruning algorithm is as follows: The spatial road network is abstracted as an undirected weighted graph. A disjoint-set data structure is used to iteratively process all edges according to their geometric distance from smallest to largest. If adding an edge would cause two graph nodes to be in the same connected component in the disjoint-set, then that edge is considered a closed-loop redundant edge and is removed. Only the minimum set of edges that maintains the connectivity of the entire graph is retained, i.e., the backbone topology network. In the preprocessing stage, the minimum spanning tree spatial pruning algorithm removes a large number of closed-loop redundant edges from the spatial road network topology graph, significantly reducing the total number of graph nodes that need to be traversed during subsequent spatial queries. This causes the computational power consumption for spatial queries to decrease exponentially as the search space shrinks.

[0043] The three-dimensional Hilbert spatiotemporal filling curve encoding refers to quantizing the three dimensions of spatial longitude, spatial latitude, and timestamp into discrete grid coordinates of equal precision, and then using the recursive spatial filling rules of the three-dimensional Hilbert curve to map the three-dimensional discrete grid coordinates into one-dimensional integer codes. The one-dimensional integer codes keep the spatiotemporal trajectory data points of neighboring locations in the three-dimensional space as continuous as possible in the one-dimensional encoding sequence, thereby reducing fragmented random access and lowering memory bus bandwidth consumption during storage and retrieval.

[0044] The memory-level columnar storage format refers to storing the spatial attribute columns and temporal attribute columns in the spatiotemporal trajectory data in separate memory blocks, so that filtering operations for a single dimension only need to read the memory area of ​​the corresponding column, reducing the invalid loading of caches at all levels.

[0045] The node load metric refers to the combined metric of processor utilization and memory utilization of each computing node, which is used to characterize the real-time load status of the computing node.

[0046] Consistent hashing refers to mapping compute nodes and hotspot tile subsets to the same hash ring. When a node goes online or offline, only the hotspot tile subsets in adjacent intervals on the hash ring need to be migrated, thus reducing the total amount of hotspot tile subset migration. Node going online refers to the process of adding servers (expanding capacity) to the cluster to cope with high concurrency query pressure; node going offline refers to a compute node ceasing service due to hardware failure, network interruption (passive offline), or system maintenance, downsizing, or voluntary offline.

[0047] The hot spot tile subset refers to the set of spatial grid cells in which the node load index of a single computing node exceeds a preset load threshold due to the high aggregation of spatiotemporal trajectory data in hot spot areas under adaptive spatial grid dynamic partitioning. The hot spot tile subset is identified as a migration object after real-time monitoring of node load index.

[0048] The specific structure of the spatiotemporal load routing decision model is as follows: The spatiotemporal load routing decision model adopts a deep Q-network architecture. The state vector is formed by concatenating the processor utilization rate, memory utilization rate, and current query queue length of each computing node. This state vector is then passed through a multi-layer fully connected network to output the action value estimate for each candidate computing node. The policy network selects the computing node with the highest action value as the target node routing decision output. The target network provides a stable action value estimation benchmark using a delayed update method. The experience replay pool stores a quadruple sample consisting of historical state vectors, target node routing decisions, query throughput reward values, and the next state vector, and randomly samples these samples for batch gradient updates. The steps for establishing the training dataset for the spatiotemporal load routing decision model specifically include: collecting the processor utilization rate, memory utilization rate, query queue length, and query response rate of each computing node from the cluster's historical operation logs. Based on latency and query throughput data, the state vector before and after each target node routing decision, the selected computing node number, the query throughput reward value after the query is completed, and the state vector at the next moment are combined into a quadruple sample and accumulated in the experience replay pool. The specific steps of training the spatiotemporal load routing decision model include: randomly sampling a batch of quadruple samples from the experience replay pool; calculating the maximum action value of the next state vector with the target network and discounting and accumulating the query throughput reward value to obtain the target Q value; calculating the predicted Q value of the action corresponding to the selected computing node number under the current state vector with the policy network; calculating the mean squared error loss of the difference between the target Q value and the predicted Q value and backpropagating to update the policy network parameters; copying the policy network parameters to the target network after a fixed number of update steps; and iterating to enable the spatiotemporal load routing decision model to automatically determine the target node routing decision for query request forwarding in milliseconds. The spatiotemporal load routing decision model encodes the multidimensional state of the node load indicators of each computing node into action value estimates. As the node load indicators of each computing node dynamically change with the migration of hot spot tile subsets, it continuously senses the cluster status and adjusts the target node routing decision in a timely manner. This makes the distribution of query requests among the computing nodes tend to be balanced, avoiding the situation where some computing nodes experience a sudden increase in query response latency due to overload of node load indicators, while other computing nodes are idle. This improves the overall query throughput and query response latency stability of the cluster.

[0049] The adaptive exploration rate adjustment function is used to adjust the exploration rate parameter of the spatiotemporal load routing decision model. The formula for the value α of the adaptive exploration rate adjustment function is as follows:

[0050] ;

[0051] in This represents the query throughput within the current statistics window, expressed in queries per second. The baseline query throughput is expressed in queries per second. The standard deviation of response latency within the current statistical window, in milliseconds; α is the standard deviation of the baseline response delay, in milliseconds; α is the dimensionless adaptive exploration rate adjustment function value; when α≥1, the exploration rate parameter takes the first exploration rate value to fully utilize the target node routing decision strategy already learned by the spatiotemporal load routing decision model; when α∈[0.5,1), the exploration rate parameter takes the second exploration rate value to maintain a balance between utilizing the learned strategy and exploring new strategies; when α<0.5, the exploration rate parameter takes the third exploration rate value to drive the spatiotemporal load routing decision model to actively explore new target node routing decision strategies; the first exploration rate value is less than the second exploration rate value, and the second exploration rate value is less than the third exploration rate value.

[0052] The disjoint-set data structure refers to a data structure that maintains information about element groups. It supports determining whether two graph nodes belong to the same connected component and merging two groups in approximately constant time complexity. It is used to identify closed-loop redundant edges in the minimum spanning tree space pruning algorithm.

[0053] The benchmark query throughput and the benchmark response latency standard deviation are both derived from statistical data in the cluster's historical operation logs. They are extracted from and fixedly stored in the cluster's historical operation logs during the establishment of the training dataset for the spatiotemporal load routing decision model.

[0054] Optionally, the present invention also provides a method for implementing a spatial query performance optimization system in a geographic information system by means of a computer, wherein the computer is provided with a readable storage medium, the readable storage medium stores program instructions, and the program instructions are used to execute the above-described method when the computer is run.

[0055] The specific implementation of step S01 is as follows: The purpose of this step is to eliminate thread blocking caused by mutex locks during high-concurrency writes and to construct a memory index structure that supports high-throughput concurrent writes. The spatial range is divided into several planar grid cells of fixed size. Each planar grid cell maintains a linked list of space object pointers. All write operations are completed through atomic comparison and instruction swapping, without the need to acquire mutex locks. A multi-version concurrency control mechanism generates a new data version with an appended timestamp for each write operation and adds it to the version chain. Read operations locate the latest consistent version based on the timestamp at the start of the transaction, ensuring that read and write operations do not block each other under timestamp isolation. When the number of historical versions with low access frequency in the version chain exceeds a preset version accumulation threshold (the reference value is to retain the most recent 8 versions for each planar grid cell), a garbage collection process is triggered to clean up expired versions. The asynchronous batch persistence mechanism monitors the number of write operations accumulated in memory in a background thread. When the accumulated number exceeds the preset batch write threshold (reference value is 4096 records per batch) or the time since the last write exceeds the preset write time window (reference value is 200ms), the background thread writes the accumulated write operations to the disk in batches in sequence, transforming random small write operations into sequential large block write operations, thereby hiding disk input / output latency.

[0056] The specific implementation of step S02 is as follows: The purpose of this step is to remove closed-loop redundant edges in the spatial road network topology graph during the query preprocessing stage, thereby reducing the search space for subsequent spatial queries. The vertices of spatial objects in the spatial road network are abstracted as graph nodes, and an undirected weighted graph is constructed using the geometric distance between two graph nodes as the edge weight. Then, the minimum spanning tree spatial pruning algorithm is used to process the undirected weighted graph: a disjoint-set data structure is initialized, and all graph nodes are placed in independent connected components; all edges are sorted by geometric distance from smallest to largest and processed one by one. For each edge, it is checked whether the graph nodes at both ends belong to the same connected component in the disjoint-set data structure. If they belong to the same connected component, the edge is determined to be a closed-loop redundant edge and is removed; if they do not belong to the same connected component, the edge is retained and the connected components containing the graph nodes at both ends are merged in the disjoint-set data structure. The final retained minimum set of edges is the backbone topology network, which is persistently stored as the pre-index structure for subsequent spatial queries. The disjoint-set data structure employs path compression and rank-based merging optimization, making the time complexity of a single connected component judgment operation close to constant, ensuring the execution efficiency of the preprocessing stage.

[0057] The specific implementation of step S03 is as follows: The purpose of this step is to encode the spatiotemporal trajectory data into a storage structure that maintains spatiotemporal proximity on a one-dimensional sequence, thereby reducing fragmented random access during queries. The three dimensions of spatial longitude, spatial latitude, and timestamp in the spatiotemporal trajectory data are quantized into equally precise discrete grid coordinates, with the quantization precision reference value divided into... The system employs a recursive space-filling rule based on 3D Hilbert curves to map 3D discrete grid coordinates to one-dimensional integer codes. This recursive rule ensures that the encoded values ​​of neighboring spatiotemporal trajectory data points in 3D space are as close as possible in the one-dimensional integer code sequence, thus enabling the contiguous storage of spatiotemporally adjacent data on disk and in memory. A memory-level columnar storage format is used to store the spatial and temporal attribute columns of the spatiotemporal trajectory data in independent contiguous memory blocks. When performing a spatial query, the spatial attribute columns are first filtered separately to obtain a candidate set, and then the temporal attribute columns in the candidate set are filtered temporally. Finally, the intersection of the two filtering results is taken to obtain the query result. This ensures that each filtering operation loads only a single column of memory data, reducing invalid loading at each level of cache and memory bus bandwidth consumption.

[0058] The specific implementation of step S04 is as follows: The purpose of this step is to solve the problem of severe load unevenness among computing nodes caused by the high concentration of spatiotemporal trajectory data in hotspot areas. The processor utilization and memory utilization of each computing node are collected in real time, and the two are weighted and combined to obtain the node load index. The weight reference values ​​are 0.6 for processor utilization and 0.4 for memory utilization. Consistent hashing is used to map computing nodes and hotspot tile subsets onto a hash ring. When a node goes online or offline, only hotspot tile subsets in adjacent intervals on the hash ring are migrated to control the total migration amount. When the node load index of a computing node exceeds a preset load threshold (reference value 0.80), an adaptive spatial grid dynamic partitioning mechanism identifies the hotspot tile subset with the highest node load index on that computing node, and migrates the hotspot tile subset to an idle computing node with a node load index below the preset load threshold using consistent hashing, until the node load index of all computing nodes is below the preset load threshold, thereby eliminating the problem of resource exhaustion and resource idleness coexisting due to spatial distribution skew during parallel processing.

[0059] The specific implementation of step S05 is as follows: The purpose of this step is to automatically determine the optimal target node routing decision for query request forwarding at the millisecond level through the spatiotemporal load routing decision model, thereby maximizing the overall query throughput of the cluster. The state vector is constructed by concatenating the processor utilization rate, memory utilization rate, and current query queue length of each computing node. This state vector is then input into the policy network of the spatiotemporal load routing decision model. The policy network outputs an estimated action value for each candidate computing node, selecting the computing node with the highest action value as the target node routing decision and forwarding the query request to that computing node. After each statistical window ends, the query throughput within the current statistical window is extracted from the cluster's historical operation logs. (Unit: times / s) and standard deviation of response delay (Unit: milliseconds), combined with baseline query throughput Standard deviation of response delay from baseline Calculate the adaptive exploration rate adjustment function value α, and update the policy network according to the exploration rate parameter corresponding to the interval to which α belongs, so as to drive the spatiotemporal load routing decision model to actively explore new target node routing decision strategies when the load is unbalanced, and make full use of the learned strategies when the load is balanced.

[0060] The specific implementation of step S06 is as follows: The purpose of this step is to dynamically adjust the data distribution arrangement of the 3D Hilbert spatiotemporal filling curve encoding by continuously monitoring query response latency and cache hit rate, and to promptly reclaim expired version chains in the lock-free concurrent memory grid index, thereby maintaining the continuous and efficient operation of the system. After each statistical window ends, query response latency and cache hit rate are collected from each computing node. When the query response latency exceeds the preset latency threshold (reference value is 100ms), the repartitioning process of the 3D Hilbert spatiotemporal filling curve encoding is triggered. The current spatiotemporal trajectory data is re-executed according to the latest spatial distribution of the 3D Hilbert spatiotemporal filling curve encoding arrangement, so that the spatiotemporal trajectory data of hot spots can regain continuity in the one-dimensional integer encoding sequence, reducing fragmented random access during queries. When the cache hit rate is lower than the preset cache hit rate threshold (reference value is 0.70), garbage collection is performed on version chains in the lock-free concurrent memory grid index whose access frequency is lower than the preset frequency threshold (reference value is less than 3 accesses per statistical window), releasing memory resources and providing memory space for the cache residency of hot data.

[0061] The key technical concepts and their technical effects of this invention are analyzed as follows.

[0062] The first key technical approach is the combination of lock-free concurrent memory grid indexing and multi-version concurrency control (MVCC). Traditional R-tree indexes, during high-concurrency writes, require holding mutex locks due to frequent splitting and node reorganization, leading to thread blocking and a sharp drop in index write throughput. This invention replaces mutex locks with atomic compare-and-swap instructions, combined with an MVCC mechanism to achieve read-write timestamp isolation. This allows concurrent write operations to complete without blocking read operations, fundamentally eliminating thread waiting caused by lock contention and ensuring efficient space queries in high-concurrency scenarios.

[0063] The second key technical approach is the combination of three-dimensional Hilbert spatiotemporal filling curve encoding and a memory-level columnar storage format. Traditional one-dimensional spatial filling curves lose a significant amount of spatiotemporal proximity when mapping spatiotemporal trajectory data, resulting in the reading of a large number of irrelevant fragmented data blocks during queries. This invention maintains both spatial proximity and temporal continuity through three-dimensional recursive mapping, coupled with a columnar independent filtering mechanism, ensuring that each filtering operation reads only a single column of contiguous memory blocks. This fundamentally reduces the ineffective consumption of memory bus bandwidth and the pollution of caches at all levels.

[0064] The third key technical approach is the preprocessing reduction of the search space using the minimum spanning tree spatial pruning algorithm. Traditional spatial queries perform intersection tests on the entire road network, and the search space grows exponentially with the size of the road network. This invention uses a disjoint-set data structure to iteratively remove closed-loop redundant edges, compressing the road network into a backbone topology network. This allows subsequent queries to be performed only on a minimal topology, resulting in an exponential decrease in computational power consumption as the search space shrinks.

[0065] The synergistic effect of the three key technical approaches is reflected in the following aspects: the lock-free concurrent memory grid index ensures the real-time performance and consistency of the index structure during high-concurrency writes, providing a continuously updated, high-quality index foundation for the 3D Hilbert spatiotemporal filling curve encoding; the 3D Hilbert spatiotemporal filling curve encoding reduces the cache miss rate by maintaining spatiotemporal proximity, enabling the minimum spanning tree spatial pruning algorithm to fully utilize the continuous data blocks already loaded in the cache when performing intersection tests on the backbone topology network; the search space reduced by the minimum spanning tree spatial pruning algorithm, in turn, alleviates the data access pressure on the lock-free concurrent memory grid index and the 3D Hilbert spatiotemporal filling curve encoding. The three form a mutually beneficial synergistic effect, jointly improving the spatial query performance of the geographic information system from the three dimensions of writing, storage, and querying.

[0066] It should be noted that this invention also solves the following technical problem: In the prior art, the query routing strategy of distributed geographic information systems usually adopts a fixed weight or simple round-robin method, which cannot perceive the real-time load changes of each computing node at different times. When query requests for hot spatial areas flood in, the nodes carrying hot tiles experience a sharp increase in response latency due to overload, while the resources of other nodes are largely idle. The overall query throughput of the system is limited by the processing capacity limit of the overloaded nodes. In other words, the prior art suffers from the technical problem of low cluster resource utilization in distributed spatial query systems because the routing strategy cannot adaptively perceive the dynamic changes in node load. This invention encodes the processor utilization rate, memory utilization rate, and query queue length of each computing node into a state vector through a spatiotemporal load routing decision model. It trains a deep Q-network to continuously optimize the routing strategy using query throughput as the reward signal, and dynamically adjusts the balance between exploration and utilization based on the current throughput and the standard deviation of response latency through an adaptive exploration rate adjustment function. This allows the routing decision to converge to a new optimal allocation scheme in a timely manner when the cluster state changes, thereby improving the overall resource utilization and query throughput stability of the cluster and solving the above-mentioned technical problem.

[0067] Specifically, the principle of this invention is as follows: The fundamental reason why this invention can solve the above-mentioned technical problems lies in its synergistic effect on query performance bottlenecks from five dimensions: index concurrency control, topology search space compression, spatiotemporal data locality preservation, storage columnarization, and dynamic intelligent routing. The lock-free concurrent memory grid index replaces mutex locks with atomic comparison and exchange instructions, ensuring concurrency safety at the hardware instruction level and fundamentally eliminating thread blocking caused by lock contention. The multi-version concurrency control mechanism ensures that read operations read the stable version before the transaction begins, eliminating the need for read and write operations to wait for each other. The minimum spanning tree space pruning algorithm removes all closed-loop redundant edges in the road network during the preprocessing stage through disjoint-set data structures, and subsequent queries are only executed on the backbone topology network. The shrinking of the search space leads to an exponential decrease in computational power consumption. The three-dimensional Hilbert spatiotemporal filling curve encoding maintains the continuity of spatiotemporal proximity in one-dimensional encoding, and combined with columnar storage, makes memory access for filtering operations highly continuous. The routing decision model of the deep Q-network architecture continuously optimizes the node selection strategy through reinforcement learning, making the cluster load tend to be balanced. These mechanisms collectively ensure the stability of the system's query performance in high-concurrency, large-scale scenarios.

[0068] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0069] The specific implementation of step S01 is as follows: When constructing the lock-free concurrent memory grid index, a fixed-size planar grid cell covers the spatial range. Each planar grid cell maintains a linked list of spatial object pointers. Write operations are completed through atomic comparison and instruction swapping, without the need for mutex locks. A multi-version concurrency control mechanism generates a new data version and appends a timestamp for each write operation. Read operations read the latest consistent version before the start of the transaction, ensuring that read and write operations do not block each other. The asynchronous batch persistence mechanism accumulates data in memory to a set quantity or reaches a set time window, then a background thread sequentially writes it to disk in batches, transforming a large number of random small write operations into sequential large block write operations, hiding disk input / output latency. The empirical value for the set time window is 100ms, and the empirical value for the set quantity is... strip.

[0070] The specific implementation of step S02 is to preprocess the spatial road network topology graph using the minimum spanning tree spatial pruning algorithm, abstracting the spatial road network into an undirected weighted graph. ,in For a set of graph nodes, Let be the set of edges. Let be the set of edge weights, with vertices of spatial objects as graph nodes and geometric distances as edge weights. Let the total number of graph nodes be . Given a total of m edges, after sorting all edges in ascending order of geometric distance, a disjoint-set data structure is used for iterative processing to determine whether to add an edge. Whether to make and In a union-find set, components belonging to the same connected component are determined by the following criteria:

[0071] ;

[0072] In the formula, , These are the node numbers at both ends of the edge; This is a disjoint-set search function that returns the root node number of the connected component to which a graph node belongs, completing the search in approximately constant time complexity. If the above formula holds, then the edges... Redundant edges that form a closed loop are removed; otherwise, a disjoint-set union operation is performed. And retain the edge, where This is a set union function that merges two connected components in approximately constant time complexity. Finally, the minimum set of edges that maintains full graph connectivity is retained, forming the backbone topology. ,in and Subsequent space queries are only available on [the following]. By traversing upwards, the search space is significantly reduced.

[0073] The specific implementation of step S03 is to encode the spatiotemporal trajectory data using three-dimensional Hilbert spatiotemporal filling curve encoding, and to encode the spatial longitude. Spatial latitude With timestamp The three dimensions are uniformly quantized into discrete grid coordinates of equal precision. The quantification formula is expressed as follows:

[0074] ;

[0075] ;

[0076] ;

[0077] In the formula, Longitude is measured in degrees. , These represent the lower and upper limits of the longitude range, respectively, in degrees. Latitude is a spatial dimension, expressed in degrees (°). , These represent the lower and upper limits of the latitude range, respectively, in degrees. This is a timestamp, measured in seconds. , These represent the lower and upper limits of the time range, respectively, in seconds. The precision order is a dimensionless positive integer, with an empirical value of 16. This is the floor function; , , These are the dimensionless discrete grid coordinates corresponding to longitude, latitude, and timestamp, respectively. Dividing the numerator and denominator in the three equations yields a dimensionless ratio, which is then multiplied by a dimensionless integer. After rounding, both sides of the equation are dimensionless. Then, the recursive space-filling rule of the three-dimensional Hilbert curve is applied to... The mapping is expressed as a one-dimensional integer encoding, and the mapping formula is as follows:

[0078] ;

[0079] In the formula, It is a one-dimensional integer encoding, dimensionless, with a value range of 1 / 2. Integers in; For order is The three-dimensional Hilbert curve recursive mapping function maps the three-dimensional discrete grid coordinates. The mapping is done using one-dimensional integer encoding, which keeps neighboring data points in three-dimensional space as continuous as possible in the one-dimensional encoding sequence. This reduces fragmented random access and lowers memory bus bandwidth consumption during storage and retrieval. Spatial attribute columns and temporal attribute columns are stored contiguously in independent memory blocks using a memory-level columnar storage format. When performing a spatial query, the filtering ranges for the spatial attribute columns and temporal attribute columns are calculated independently, and their intersection is taken to obtain the query result set.

[0080] The specific implementation of step S04 involves introducing a load balancing strategy based on consistent hashing and adaptive spatial grid dynamic partitioning. This strategy maps both compute nodes and hotspot tile subsets to the same hash ring. When a node goes online or offline, only the hotspot tile subsets of adjacent intervals on the hash ring are migrated. Node load metrics for each compute node are monitored in real time. Its formula is expressed as follows:

[0081] ;

[0082] In the formula, For the first The node load metric for each computing node, dimensionless. , To calculate the total number of nodes; For the first Processor utilization rate of each computing node, in percentage (%) This is the normalized baseline value for processor utilization, which defaults to 100%. Having the same dimensions makes Dimensionless; For the first Memory utilization of each compute node, in percentage (%) This is the normalized baseline value for memory usage, which defaults to 100%. Having the same dimensions makes Dimensionless; , These are the weighting coefficients for processor utilization and memory utilization, respectively. They are dimensionless, with empirical values ​​of 0.6 and 0.4. Since both the numerator and denominator are dimensionless, therefore... It is dimensionless. When Exceeding the preset load threshold At that time, migrate the subset of hotspot tiles on the computing node to Idle computing nodes, among which The operations and maintenance personnel will use the cluster's historical operation logs as a reference. The statistical distribution is set with an empirical value of 0.8, which is dimensionless; Number the idle computing nodes. and .

[0083] The specific implementation of step S05 is to use a spatiotemporal load routing decision model to analyze the node load indicators of each computing node and the real-time query task flow, and output the target node routing decision. The state vector of each computing node Due to its processor utilization Memory usage With the current query queue length The assembly process is described in the following formula:

[0084] ;

[0085] In the formula, For the first The state vector of each computing node, with a dimension of 3, is a dimensionless column vector. For the first The length of the query queue for each compute node, in units of queues; The normalized baseline value for the query queue length, in units of rows, is an empirical value. strip, and Having the same dimensions makes Dimensionless; , , , The meaning is consistent with step S04; all three ratios are dimensionless, therefore It is a dimensionless column vector. The overall state vector of the cluster. By all It is formed by concatenating the state vectors of each computing node, as expressed in the following formula:

[0086] ;

[0087] In the formula, The overall state vector of the cluster has dimensions of , a dimensionless column vector; for The transpose of, with dimension dimensional row vectors; The meaning is consistent with step S04. The spatiotemporal load routing decision model is based on... As input, the algorithm outputs an action value estimation vector for each candidate computation node through a multi-layer fully connected network. The formula is expressed as follows:

[0088] ;

[0089] In the formula, Let be the action value estimation vector, with dimension . , a dimensionless column vector; For the first The estimated action value corresponding to each candidate computation node is dimensionless. The policy network selects the computational node with the highest action value as the target node for routing decisions. The target computational node is numbered... The formula for determining it is expressed as follows:

[0090] ;

[0091] In the formula, Number the selected target computation node; a dimensionless positive integer. To find the expression within the parentheses that maximizes the corresponding value. Value operators. The adaptive exploration rate adjustment function value is calculated based on the standard deviation of query throughput and response latency within the current statistics window. The formula is expressed as follows:

[0092] ;

[0093] In the formula, This represents the query throughput within the current statistics window, expressed in queries per second. The baseline query throughput is expressed in queries per second. Having the same dimensions makes Dimensionless; The standard deviation of response latency within the current statistical window, in milliseconds; The baseline response delay standard deviation is expressed in milliseconds (ms). Having the same dimensions makes Dimensionless; This is the dimensionless adaptive exploration rate adjustment function value, where both the numerator and denominator are dimensionless; and All data originates from statistical data in the cluster's historical operation logs. This data was extracted and permanently stored from the cluster's historical operation logs during the training dataset establishment phase of the spatiotemporal load routing decision model. When the exploration rate parameter is taken as the first exploration rate value, the target node routing decision strategy already learned by the spatiotemporal load routing decision model is fully utilized; when When the exploration rate parameter is taken as the second exploration rate value, a balance is maintained between utilizing learned strategies and exploring new strategies; when At that time, the exploration rate parameter takes the third exploration rate value, which drives the spatiotemporal load routing decision model to actively explore new target node routing decision strategies; the first exploration rate value is less than the second exploration rate value, the second exploration rate value is less than the third exploration rate value, and the empirical values ​​of the three exploration rates are 0.05, 0.2, and 0.5, respectively.

[0094] The specific implementation of step S06 is to calculate the query response latency of each computing node after performing the spatial query. With cache hit rate ,in For the first The query response latency per compute node, in milliseconds; For the first The cache hit rate of each compute node, dimensionless, with a value range of [value missing]. .when Exceeding the preset delay threshold At that time, the repartitioning process of the three-dimensional Hilbert spatiotemporal filling curve encoding is triggered, and the quantization and encoding arrangement described in step S03 is re-executed on the current spatiotemporal trajectory data distribution, so that the data distribution is re-aligned with the current query hotspot region, wherein... The preset latency threshold is in milliseconds (ms), with an empirical value of 200ms. Simultaneously, garbage collection is performed on the low-frequency version chains in the lock-free concurrent memory grid index, with a version chain access frequency threshold set to... The unit is times / s, and the empirical value is... times / s, for access frequency lower than The version chain is reclaimed to release memory resources and ensure stable system operation.

[0095] To better understand and implement this invention, a specific application scenario of the invention is provided below as an embodiment 2: To verify the effectiveness of the invention, technicians set up a test environment, using a city-level geographic information system platform as the test scenario. This platform is responsible for managing a coverage area of ​​approximately 12,000... The system collects urban road network and spatiotemporal trajectory data of mobile targets, including 180,000 mobile targets and 4.2 billion spatiotemporal trajectory records. The spatial road network topology graph contains 960,000 nodes and 2,380,000 edges. The cluster consists of 16 computing nodes, each configured with 64... With memory and a 32-core processor, the peak concurrent query requests are 28,000 per second. Technicians deploy and run the optimization method sequentially according to steps S01 to S06 of this invention. The specific implementation process is as follows.

[0096] In the implementation phase of step S01, the technicians divided the spatial area into planar grid cells with a side length of 500m, generating a total of 96,000 planar grid cells. Each planar grid cell maintains a linked list of spatial object pointers based on atomic comparison and exchange instructions. A multi-version concurrency control mechanism appends a nanosecond-level timestamp to each write operation and generates a new data version. Each planar grid cell retains the most recent 8 versions, and historical versions exceeding the version accumulation threshold are cleaned up during the garbage collection process. The asynchronous batch persistence mechanism sets a batch write threshold of 4096 records and a write time window of 200ms. Background threads sequentially write the accumulated write operations to disk in batches when any of the above conditions are met. Under high concurrency write pressure, read and write operations on each compute node do not block each other due to timestamp isolation, eliminating the thread blocking problem caused by node splitting and mutex locks in traditional R-tree indexes.

[0097] In the implementation phase of step S02, technicians input the 960,000 graph nodes and 2,380,000 edges from the spatial road network topology graph into the minimum spanning tree spatial pruning algorithm. The algorithm uses path compression and rank-based merging optimization with a data set. Edges are processed one by one, with geometric distance as the edge weight, from smallest to largest. Iteratively, it checks whether the graph nodes at both ends of each edge belong to the same connected component, gradually removing redundant edges that form closed loops. Finally, the backbone topology network is retained, such as... Figure 3 As shown, the number of edges in the final retained backbone topology network is significantly reduced compared to the original spatial road network topology. The backbone topology network is persistently stored as a pre-index structure for subsequent spatial queries. All subsequent path queries and intersection tests are performed on the backbone topology network, resulting in a significant compression of the search space.

[0098] In the implementation phase of step S03, technicians quantified the three dimensions of spatial longitude, spatial latitude, and timestamp of the 4.2 billion spatiotemporal trajectory data into... The system generates discrete grid coordinates at various levels, which are then mapped to one-dimensional integer codes using a recursive space-filling rule based on the three-dimensional Hilbert curve. Each computation node stores spatiotemporal trajectory data consecutively according to the one-dimensional integer code order. A memory-level columnar storage format stores spatial and temporal attribute columns in separate contiguous memory blocks. When performing a spatial query, the spatial attribute columns are filtered separately, followed by temporal filtering of the candidate set's temporal attribute columns. The intersection of these filters yields the query result. Since all query filters across all dimensions hit contiguous memory blocks, cache loading efficiency is significantly improved compared to traditional row-based storage formats.

[0099] In the implementation phase of step S04, technicians set the node load index weights to processor utilization of 0.6 and memory utilization of 0.4, with a preset load threshold of 0.80. Due to the high aggregation of spatiotemporal trajectory data in the core urban area, the node load index of some computing nodes exceeded the preset load threshold during peak periods. The adaptive spatial grid dynamic partitioning mechanism identified hotspot tile subsets on overloaded computing nodes and migrated these hotspot tile subsets to idle computing nodes with node load indices below the preset load threshold using consistent hashing. During the migration process, only the mapping relationship between adjacent intervals on the hash ring was adjusted; the mapping relationship of other hotspot tile subsets remained unaffected. The distribution of node load indices for each computing node after the migration is shown in Table 1.

[0100] Table 1. Comparison of Node Load Indicators Before and After Migration

[0101]

[0102] After the migration was completed, the node load index of all computing nodes was lower than the preset load threshold of 0.80, the overall load of the cluster tended to be balanced, and the problem of resource exhaustion and resource idleness coexisting due to the skewed spatial data distribution was eliminated.

[0103] In the implementation phase of step S05, the spatiotemporal load routing decision model concatenates the processor utilization rate and memory utilization rate of each computing node with the current query queue length to form a state vector. This vector is then processed by the policy network to output an estimated action value for each candidate computing node, forwarding the query request to the computing node with the highest action value. Technicians collect the query throughput within a preset statistical window of 10 seconds. With response delay standard deviation Benchmark query throughput Set to 22,000 times / s, with a baseline response delay standard deviation. Set to 15ms. During a certain peak period, For 16,000 times / s, The time interval is 28ms. The calculated adaptive exploration rate adjustment function value α is 0.41, where α < 0.5. The policy network adopts the third exploration rate value to actively explore new target node routing decision strategies. During the load balancing period, For 24,000 times / s, The time is 11ms, α is 1.17, α≥1, and the policy network uses the first exploration rate value to fully utilize the learned policy, such as Figure 4 As shown.

[0104] In the implementation phase of step S06, technicians set a preset latency threshold of 100ms, a preset cache hit rate threshold of 0.70, and a preset frequency threshold of less than 3 accesses per statistical window. After a peak access period, the query response latency of some computing nodes exceeded 100ms, triggering the repartitioning process of the 3D Hilbert spatiotemporal filling curve encoding. The current spatiotemporal trajectory data was re-encoded and rearranged according to the latest spatial distribution, ensuring the continuity of the spatiotemporal trajectory data in the hotspot area within the one-dimensional integer encoding sequence. Simultaneously, historical version chains with fewer than 3 accesses in the lock-free concurrent memory grid index were cleaned up by the garbage collection process, freeing up memory resources to provide space for the caching of hotspot data. The cache hit rate trend within each statistical window is as follows: Figure 2 As shown, the distribution of query response latency for each computing node is as follows: Figure 4 As shown.

[0105] From a technological advancement perspective, this invention achieves a fundamental breakthrough compared to traditional spatial query methods in the following aspects: Traditional R-tree indexes, due to node splitting and mutex lock mechanisms, force read and write operations to be executed serially during high-concurrency writes, and thread blocking is the root cause of query performance degradation. This invention eliminates lock contention at the data structure level by using atomic comparison and exchange instructions and a multi-version concurrency control mechanism, allowing read and write operations to proceed in parallel under timestamp isolation, fundamentally eliminating the conditions for thread blocking. Traditional space-filling curves only maintain proximity in two-dimensional space; the addition of the time dimension disperses neighboring spatiotemporal points in a one-dimensional sequence, leading to significant cache misses during queries. This invention's three-dimensional Hilbert spatiotemporal filling curve encoding maintains proximity in all three dimensions simultaneously. Combined with the single-column filtering mechanism of the memory-level columnar storage format, it eliminates the problem of loading invalid data across dimensions at the storage layout level. Traditional spatial road network queries are performed on the full graph structure, and the search space expands exponentially with the growth of the road network. The minimum spanning tree spatial pruning algorithm of this invention removes all closed-loop redundant edges in the preprocessing stage through disjoint-set data structure iteration, so that subsequent queries are performed only on the backbone topology network. From the perspective of graph theory, it compresses the search space to the theoretical minimum. The three technological advancements work together to improve the spatial query performance of geographic information systems in three dimensions: indexing, storage, and road network.

[0106] It should be noted that the variables involved in this invention are explained in detail in Table 2.

[0107] Table 2 Variable Explanation Table

[0108]

[0109] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for optimizing spatial query performance in a geographic information system, characterized in that, Includes the following steps: Construct a lock-free concurrent memory grid index, use a multi-version concurrency control mechanism to manage concurrent write transactions, write spatial data update operations into the version chain of the lock-free concurrent memory grid index, and periodically flush the lock-free concurrent memory grid index data to disk through an asynchronous batch persistence disk mechanism; The minimum spanning tree spatial pruning algorithm is used to preprocess the spatial road network topology graph. The spatial object vertices are used as graph nodes and the geometric distance is used as the edge weight. The closed loop redundant edges are removed through disjoint set iteration, and the backbone topology network is retained. The backbone topology network is used as the pre-index structure for subsequent spatial queries. The spatiotemporal trajectory data is encoded using three-dimensional Hilbert spatiotemporal filling curve encoding. The time dimension and two-dimensional spatial dimension are jointly mapped to a one-dimensional encoding sequence. The spatial attribute column and the time attribute column are stored separately in a memory-level columnar storage format. When performing a spatial query, the spatial attribute column and the time attribute column are independently calculated and filtered, and the intersection is taken to obtain the query result. A load balancing strategy based on consistent hashing and adaptive spatial grid dynamic partitioning is introduced to monitor the node load index of each computing node in real time. When the node load index of a computing node exceeds the preset load threshold, the hot spot tile subset on the computing node is migrated to an idle computing node whose node load index is lower than the preset load threshold. A spatiotemporal load routing decision model is used to analyze the node load indicators and real-time query task flow of each computing node, output the target node routing decision, distribute the query request to the corresponding computing node for execution based on the target node routing decision, and calculate the adaptive exploration rate adjustment function value based on the query throughput and response latency standard deviation in the current statistical window. When the adaptive exploration rate adjustment function value belongs to different intervals, different exploration rate parameters are used to update the strategy network of the spatiotemporal load routing decision model. After performing a spatial query, the query response latency and cache hit rate of each computing node are statistically analyzed. When the query response latency exceeds the preset latency threshold, the repartitioning process of the 3D Hilbert spatiotemporal filling curve encoding is triggered. The 3D Hilbert spatiotemporal filling curve encoding and arrangement of the current spatiotemporal trajectory data distribution are re-executed, and garbage collection is performed on the version chains with low access frequency in the lock-free concurrent memory grid index to release memory resources.

2. The method for optimizing spatial query performance in a geographic information system according to claim 1, characterized in that, The lock-free concurrent memory grid index specifically refers to a spatial range covered by planar grid cells of fixed size. Each planar grid cell maintains a linked list of space object pointers that uses atomic compare-and-swap instructions to achieve lock-free concurrent access. Write operations are completed through atomic compare-and-swap instructions, without the need for mutex locks.

3. The method for optimizing spatial query performance in a geographic information system according to claim 2, characterized in that, The multi-version concurrency control mechanism specifically refers to generating a new data version and attaching a timestamp for each write operation, and reading operations reading the latest consistent version before the start of the transaction, so that read operations and write operations do not block each other.

4. The method for optimizing spatial query performance in a geographic information system according to claim 3, characterized in that, The asynchronous batch persistence mechanism refers to the fact that write operations are not immediately written to the disk synchronously, but are accumulated in memory to a set number or a set time window, and then written to the disk in batches sequentially by a background thread, thus transforming a large number of random small write operations into sequential large block write operations.

5. The method for optimizing spatial query performance in a geographic information system according to claim 4, characterized in that, The minimum spanning tree spatial pruning algorithm specifically abstracts the spatial road network into an undirected weighted graph. It uses a disjoint-set data structure to iteratively process all edges according to their geometric distance from smallest to largest. If adding an edge would cause two graph nodes to be in the same connected component in the disjoint-set, the added edge is determined to form a closed-loop redundant edge and is removed. Only the minimum set of edges that maintains the connectivity of the entire graph is retained.

6. The method for optimizing spatial query performance in a geographic information system according to claim 5, characterized in that, The three-dimensional Hilbert spatiotemporal filling curve encoding specifically refers to quantizing the three dimensions of spatial longitude, spatial latitude, and timestamp into equally precise discrete grid coordinates, and then using the recursive spatial filling rules of the three-dimensional Hilbert curve to map the three-dimensional discrete grid coordinates into one-dimensional integer codes.

7. The method for optimizing spatial query performance in a geographic information system according to claim 6, characterized in that, The memory-level columnar storage format specifically refers to storing the spatial attribute columns and temporal attribute columns in the spatiotemporal trajectory data consecutively in independent memory blocks, so that filtering operations for a single dimension only require reading the memory area of ​​the corresponding column.

8. The method for optimizing spatial query performance in a geographic information system according to claim 7, characterized in that, The node load metric specifically refers to the combined metric of processor utilization and memory utilization of each computing node; the consistent hashing specifically refers to mapping computing nodes and hot tile subsets to the same hash ring, so that when a node goes online or offline, only the hot tile subsets of adjacent intervals on the hash ring need to be migrated.

9. The method for optimizing spatial query performance in a geographic information system according to claim 8, characterized in that, The hotspot tile subset specifically refers to the set of spatial grid cells under adaptive spatial grid dynamic partitioning, where the node load index of a single computing node exceeds a preset load threshold due to the high aggregation of spatiotemporal trajectory data in the hotspot area. These cells are identified through real-time monitoring of the node load index and then used as migration objects.

10. The method for optimizing spatial query performance in a geographic information system according to claim 9, characterized in that, The spatiotemporal load routing decision model adopts a deep Q network architecture. The state vector is formed by concatenating the processor utilization rate, memory utilization rate and current query queue length of each computing node. The action value estimate of each candidate computing node is output through a multi-layer fully connected network. The policy network selects the computing node with the highest action value as the target node routing decision output.