Grid space indexing method and system based on structured spatial relationships
By using a grid spatial indexing method based on structured spatial relationships, ground feature data is preprocessed into standardized objects. Spatial relationships are calculated by combining the influence range criterion, and rapid retrieval and multi-condition combination filtering are performed. This solves the problems of low response efficiency and high complexity of traditional GIS systems in high-concurrency scenarios, and achieves rapid response and efficient resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PEKING UNIV
- Filing Date
- 2026-03-04
- Publication Date
- 2026-06-09
AI Technical Summary
When faced with the high concurrency and low latency requirements of modern intelligent services, traditional GIS systems rely on real-time geometric calculations, resulting in low query response efficiency and difficulty in supporting high-concurrency requests. Furthermore, the computational complexity of complex spatial relationship queries is high, failing to meet the demand for rapid response.
A grid spatial indexing method based on structured spatial relationships is adopted. Through data preprocessing, ground features are standardized into point, line, and area objects. Spatial relationships are calculated by combining the influence range criteria of ground features, and the grid information of the influence range is associated with attribute data to achieve rapid retrieval and multi-condition combination filtering. A dynamic scoring method with multi-objective weight fusion is used for sorting.
It enables rapid response to spatial queries without real-time geometric calculations, supports high-concurrency requests, simplifies the expression and combination of complex spatial relationships, improves system response efficiency and resource utilization efficiency, and supports the direct application of spatial semantic information in AI models.
Smart Images

Figure CN122173493A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of geographic information systems, spatial data management and intelligent retrieval technology, specifically to a grid spatial indexing method and system based on structured spatial relationships. Background Technology
[0002] With the deep integration of geospatial information technology, artificial intelligence, and big data technology, the application scenarios of spatial data have expanded from traditional basic surveying and mapping and map visualization to diversified intelligent service fields such as smart city comprehensive governance, emergency response to sudden incidents, urban spatial planning, and intelligent question answering and recommendation. In these scenarios, spatial data is no longer just a carrier of location information, but has become the core basis for supporting understanding, reasoning, and decision-making. The accurate expression and efficient identification of spatial relationships are key prerequisites for realizing various intelligent services. For example, judging spatial semantic needs such as proximity to certain facilities, location in the vicinity of a specific area, and avoidance of risk areas has become a core functional requirement of many systems.
[0003] Traditional GIS systems generally rely on real-time geometric calculation methods such as spatial overlay, buffer analysis, and nearest neighbor search to handle spatial relationship query tasks, which gradually reveals their bottlenecks when facing the high concurrency and low latency requirements of modern intelligent services.
[0004] In large-scale, high-frequency spatial retrieval scenarios, the overhead of loading spatial objects in real time and performing complex geometric operations is huge, which can easily lead to system response delays, excessive resource consumption, and even lag, making it difficult to meet the service requirements for rapid response. At the same time, for spatial relationship queries with multiple conditions, traditional methods need to be implemented through multiple rounds of nested geometric calculations, which further increases the computational complexity and response time, making it unsuitable for the core requirement of intelligent services for efficient spatial retrieval. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a grid spatial indexing method and system based on structured spatial relationships. This solves the problem that existing technologies rely on real-time geometric calculations for spatial relationship analysis, which leads to low query response efficiency and difficulty in supporting high-concurrency requests.
[0006] To achieve the above objectives, the present invention provides a grid spatial indexing method based on structured spatial relationships, comprising the following steps: S1. Data preprocessing: Perform unified format conversion and geometric construction on basic administrative division and multi-source feature data, and standardize the features into point, line and surface spatial objects; S2. Calculation of spatial relationships in grids: Based on the standard geometric features and administrative division data generated in S1, spatial relationships are calculated by combining the feature influence range criteria. The feature influence range criteria are an adaptive calculation method based on feature type, administrative level and service radius. S3. Data storage and entry: The original ground feature data and its attribute information are uniformly stored in the database, and a unique identifier is assigned to each ground feature; S4. Association of Influence Range Grid and Land Feature Attribute Data: The influence range grid information stored in S2 is associated with the original land feature attribute data entered in S3 through the land feature ID; S5, Fast Retrieval and Multi-Condition Combination Filtering: Through the spatial semantic query transformation mechanism, user needs are parsed into structured query conditions, and retrieval and filtering are completed based on the related data of S4.
[0007] Preferably, in step S2, the calculation of the grid spatial relationship includes the following steps: S201. Determine the impact level of land features: Based on the land feature level division rules, the impact level of land features is divided according to the attribute characteristics of land features. The land feature level includes provincial, municipal, county, town, village and general service facility levels. S202. Determine the scope of influence: Based on the influence level of the land feature, combined with the administrative division scope and the corresponding hierarchical distance, determine the scope of influence of the land feature; S203. Determine the grid of influence range: Based on the influence range determined in S202, encode the influence range to obtain the grid codes corresponding to the influence range; S204. Storage of influence range grid information: The influence range grid generated in S203 is stored in a structured manner. Each grid record contains the unique identifier of the associated ground feature, the grid's position relative to the center of the ground feature, the spatial distance from the center of the ground feature, and other optional attributes.
[0008] Preferably, in step S3, the data storage and entry into the database specifically includes the following steps: S301. Determine the extent of land features: Clarify the spatial extent covered by each land feature; S302. Determine the coding level: Select an appropriate grid coding level based on application requirements for spatial partitioning; S303, Grid Coding Processing: Combine the spatial extent of ground features with the specified level to perform grid coding on ground features; S304. Attribute Information Storage: Store all types of field attributes of land features into the database. The field attributes include land feature ID, two-dimensional grid code, and other information fields.
[0009] Preferably, in step S5, the spatial semantic query transformation mechanism includes the following steps: S501, Semantic parsing: Identify spatial semantic elements, map distance-type semantics to interval queries of distance classification fields, type-type semantics to value or fuzzy queries of attribute fields, direction-type semantics to matching queries of orientation code fields, and administrative affiliation semantics to filtering conditions of administrative relationship fields. S502, Query Location and Retrieval: Locate the grid area where the user is located or specified and its corresponding grid code in the grid spatial relationship table, and retrieve all candidate land features associated with the grid through a pre-built index; S503, Multi-condition combination filtering: Based on the query conditions set by the user, candidate land features are efficiently filtered through attribute field indexing; S504. Scoring and Ranking: A dynamic scoring method with multi-objective weight fusion is adopted to calculate and rank the comprehensive score of each candidate land feature. S505. Result Return: Returns a list of land feature IDs that meet the criteria and their comprehensive scores. It supports obtaining complete land feature attribute data based on the land feature ID.
[0010] Preferably, in S2, the criteria for the influence range of land features include: For features with administrative management attributes, the scope of influence is the union of the entire administrative region to which the feature belongs and the buffer zone centered on the feature, with the buffer zone radius determined according to the administrative level; for general service facilities, the scope of influence is a fixed-radius buffer zone centered on the feature.
[0011] Preferably, in step S2, discretized orientation coding, hierarchical distance coding, and bit identifier topology coding are used to transform the geometric relationship between spatial objects and grid cells into structured attribute fields.
[0012] Preferably, in step S2, when determining the grid of the area of influence, the coding rule adopts a hierarchical grid division method based on latitude and longitude. By dividing the Earth's surface into layers with a preset precision, a multi-scale grid system is formed. Each grid corresponds to a unique coding identifier, and the coding contains the spatial location information of the grid, supporting cross-level grid association queries and spatial positioning.
[0013] Preferably, in step S5, the multi-condition combination filtering process is completed through the logical combination of structured fields.
[0014] Preferably, in step S4, after the influence range grid is associated with the land feature attribute data, the range of the affected grid cells is automatically identified by monitoring changes in incremental spatial data, and their spatial relationship attributes are synchronously corrected, with only the affected grid cells being updated and maintained.
[0015] A grid spatial indexing system based on structured spatial relationships, characterized by comprising the following modules: The data preprocessing module is used to perform unified format conversion and geometric construction on basic administrative division and multi-source geographic feature data; The grid spatial relationship calculation module is used to calculate spatial relationships based on standard geometric features and administrative division data, combined with the influence range criteria of features. The data storage and entry module is used to uniformly store the original ground feature data and its attribute information into the database; The data association module is used to associate the grid information of the affected area with the original land feature attribute data through the land feature ID, and establish a mapping relationship between the two. The retrieval and filtering module is used to parse user needs into structured query conditions through a spatial semantic query transformation mechanism, and to complete fast retrieval, multi-condition combination filtering, scoring and sorting, and result return based on related data; The dynamic maintenance module is used to monitor incremental spatial data changes, automatically identify the affected grid cell range, and synchronously correct spatial relationship attributes.
[0016] This invention provides a grid spatial indexing method and system based on structured spatial relationships. It has the following beneficial effects: 1. This invention adopts a technical solution that combines spatial relationship attribute pre-computation with grid indexing, which moves complex spatial calculations to the data preprocessing stage and stores them in structured fields. This achieves the technical effect of quickly responding to spatial queries without real-time geometric calculations. Compared with the existing technology that relies on real-time geometric calculations for spatial relationship analysis, this invention solves the problems of low query response efficiency and difficulty in supporting high concurrency requests.
[0017] 2. This invention adopts a technical solution of adaptive grading of ground feature influence and standardized coding of multi-dimensional spatial relationships, which realizes the unified expression and flexible combination and screening of complex spatial relationships. Compared with the technical solution of realizing multi-condition spatial relationship analysis through nested geometric calculation in the prior art, it solves the problems of difficult expression of complex spatial relationships, cumbersome combination and screening logic and high implementation cost.
[0018] 3. This invention adopts a structured spatial relation attribute organization and cross-system compatibility technical solution, which enables spatial semantic information to be directly used as the knowledge base of AI models. It achieves the technical effect of realizing spatial semantic reasoning without relying on traditional GIS modules. Compared with the existing technical solutions with strong system closure and difficulty in integrating with AI semantic systems, this invention solves the problems of spatial semantics being difficult to integrate into intelligent systems and limited knowledge modeling and reasoning capabilities.
[0019] 4. This invention adopts a semantic-driven adaptive grid maintenance technology solution, which optimizes resource allocation by dynamically adjusting the grid granularity. This achieves the technical effect of providing fine-grained services in high-load areas and saving storage and computing resources in low-load areas. Compared with the existing technology that uses a uniform grid resolution, this invention solves the problem of the difficulty in balancing the accuracy of spatial object representation and update efficiency.
[0020] 5. The present invention adopts a coding enhancement technology solution that integrates network structure features, combining geometric spatial relationships with network reachability features, achieving the technical effect of upgrading spatial queries from geometric distance to real-world network reachability. Compared with the existing technology that only expresses spatial relationships based on geometric distance, this invention solves the problem that it is difficult to fit the actual spatial features of urban scenarios. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the process of the present invention;
[0022] Figure 2 This is a simplified example diagram illustrating the relationship between the grid and ground features within the scope of influence of this invention.
[0023] Figure 3 This is a schematic diagram of the fast retrieval process of the present invention. Detailed Implementation
[0024] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0025] Please see the appendix Figure 1 -Appendix Figure 3 This invention provides a grid spatial indexing method based on structured spatial relationships, comprising the following steps: S1. Data preprocessing: Perform unified format conversion and geometric construction on basic administrative division and multi-source feature data, and standardize the features into point, line and surface spatial objects; Specifically, the basic administrative division data covers five levels of administrative boundaries: province, city, county, town, and village. Multi-source feature data includes features with administrative attributes and general service facilities. First, all types of data undergo format verification and cleaning to remove duplicates, errors, and invalid data. Then, data from different formats are uniformly converted to the WGS84 latitude and longitude coordinate format. Through a geometric construction process, individual facilities are standardized into point objects, linear features such as roads and pipelines are standardized into line objects, and regional features such as administrative divisions, parks, and school campuses are standardized into area objects. This ensures unified data format and standardized geometric shapes, providing a standardized data foundation for subsequent grid spatial relationship calculations.
[0026] S2, Grid Spatial Relationship Calculation: Based on the standard geometric features and administrative division data generated in S1, spatial relationships are calculated by combining the feature influence range criterion. The feature influence range criterion is an adaptive calculation method based on feature type, administrative level and service radius. In S2, the calculation of grid spatial relationships includes the following steps: S201. Determine the impact level of land features: Based on the land feature level division rules, the impact level of land features is divided according to the attribute characteristics of land features. The land feature level includes provincial, municipal, county, town, village and general service facility levels. S202. Determine the scope of influence: Based on the influence level of the land feature, combined with the administrative division scope and the corresponding hierarchical distance, determine the scope of influence of the land feature; S203. Determine the grid of influence range: Based on the influence range determined in S202, encode the influence range to obtain the grid codes corresponding to the influence range; S204. Storage of influence range grid information: The influence range grid generated in S203 is stored in a structured manner. Each grid record contains the unique identifier of the associated ground feature, the grid's position relative to the center of the ground feature, the spatial distance from the center of the ground feature, and other optional attributes. In S2, the criteria for the scope of land cover impact include: For features with administrative management attributes, the scope of influence is the union of the entire administrative region to which the feature belongs and the buffer zone centered on the feature, with the buffer zone radius determined according to the administrative level; for general service facilities, the scope of influence is a fixed-radius buffer zone centered on the feature.
[0027] In S2, discretized orientation coding, hierarchical distance coding, and bit identifier topology coding are used to transform the geometric relationship between spatial objects and grid cells into structured attribute fields.
[0028] In S2, when determining the grid of the area of influence, the coding rule adopts a hierarchical grid division method based on latitude and longitude. By dividing the Earth's surface into layers with a preset precision, a multi-scale grid system is formed. Each grid corresponds to a unique coding identifier, and the coding contains the spatial location information of the grid, supporting cross-level grid association queries and spatial positioning.
[0029] Specifically, the buffer radius is clearly defined according to administrative level: 200 kilometers for provincial level, 50 kilometers for municipal level, 20 kilometers for county level, 10 kilometers for town level, and 5 kilometers for village level. The fixed radius buffer for general service facilities can be flexibly set according to actual application scenarios, such as 500 meters for convenience stores and 1 kilometer for basketball courts. Discretized directional coding adopts an 8-directional or 16-directional coding rule. The 8-directional includes east, south, west, north, northeast, southeast, northwest, and southwest. The 16-directional adds subdivisions such as northeast-east and southeast-south to the 8-directional. The hierarchical distance coding adopts a logarithmic or linear hierarchical method. For example, the linear hierarchical method divides 0-10 kilometers into three levels: 0-2 kilometers, 2-5 kilometers, and 5-10 kilometers. The bit-identification topology coding uses binary bits to identify the topological relationship between the grid and the ground features, such as overlap, adjacency, and containment. The hierarchical grid is divided into layers according to a preset precision, from coarse to fine. For example, the highest-level grid has a side length of 10 kilometers, and the next level grid is further divided into four grids with a side length of 5 kilometers, and so on, forming a multi-scale grid system. The coding identifier is composed of a latitude and longitude interval identifier and a level identifier, such as 116.30-116.40-39.90-39.95-10, where 116.30-116.40 is the longitude interval, 39.90-39.95 is the latitude interval, and 10 is the level identifier. The spatial location of the grid can be directly located through the coding, and it supports correlation query and spatial positioning operations between different levels of grids.
[0030] S3. Data storage and entry: The original ground feature data and its attribute information are uniformly stored in the database, and a unique identifier is assigned to each ground feature; In S3, the data storage and loading process specifically includes the following steps: S301. Determine the extent of land features: Clarify the spatial extent covered by each land feature; S302. Determine the coding level: Select an appropriate grid coding level based on application requirements for spatial partitioning; S303, Grid Coding Processing: Combine the spatial extent of ground features with the specified level to perform grid coding on ground features; S304. Attribute Information Storage: Store all types of field attributes of land features into the database. Field attributes include land feature ID, two-dimensional grid code, and other information fields. Specifically, when determining the extent of ground features, the minimum bounding rectangle or actual coverage area is calculated using the geometric boundary coordinates of the ground features to clarify the spatial boundaries of the ground features themselves. When determining the coding level, the selection is based on the accuracy requirements and data volume of the application scenario. For example, in emergency response scenarios that require high-precision positioning, a 1-kilometer grid coding level is selected, while in macro-regional planning scenarios, a 5-kilometer grid coding level can be selected.
[0031] During grid coding, based on the spatial extent of the feature and the selected coding level, inclusion or intersection relationship judgments are used to determine the entire grid covered by the feature, and a corresponding grid code is assigned to each feature. In the attribute information storage stage, a database compatible with spatial data storage is selected. In addition to the feature ID and two-dimensional grid code, other information fields such as feature name, type, administrative affiliation, contact information, availability status, and construction time must also be stored. The unique identifier assigned to each feature adopts the format of type abbreviation-administrative level-serial number, such as YY-SJ-003 representing municipal hospital number 003, ensuring the uniqueness and identifiability of feature identifiers.
[0032] S4. Association of Influence Range Grid and Land Feature Attribute Data: The influence range grid information stored in S2 is associated with the original land feature attribute data entered in S3 through the land feature ID; In S4, after the influence range grid is associated with the land feature attribute data, the range of affected grid units is automatically identified by monitoring changes in incremental spatial data, and their spatial relationship attributes are synchronously corrected. Only the affected grids are updated and maintained. Specifically, a mapping between the influence range grid information and the feature attribute data is established through feature IDs, forming a related data table of grid code-feature ID-spatial relationship-feature attribute, thus binding the grid, features, and spatial relationships together. Incremental spatial data change monitoring employs a combination of timed scanning and event triggering. The timed scanning frequency can be set according to the application scenario, such as once per minute or once per hour, while simultaneously monitoring events such as feature addition, location change, attribute update, and feature deregistration. When an incremental data change is detected, the affected grid unit range is determined through spatial relationship calculations. For example, when a hospital is added, only the grids within the hospital's influence range are calculated and their spatial relationship attributes are updated. When a feature's location changes, only the grid attributes involved in the original and new influence ranges are corrected, without recalculating the entire grid, ensuring efficient and accurate data updates.
[0033] S5. Fast retrieval and multi-condition combination filtering: The spatial semantic query transformation mechanism parses user needs into structured query conditions, and completes retrieval and filtering based on the related data of S4; In S5, the spatial semantic query transformation mechanism includes the following steps: S501, Semantic parsing: Identify spatial semantic elements, map distance-type semantics to interval queries of distance classification fields, type-type semantics to value or fuzzy queries of attribute fields, direction-type semantics to matching queries of orientation code fields, and administrative affiliation semantics to filtering conditions of administrative relationship fields. S502, Query Location and Retrieval: Locate the grid area where the user is located or specified and its corresponding grid code in the grid spatial relationship table, and retrieve all candidate land features associated with the grid through a pre-built index; S503, Multi-condition combination filtering: Based on the query conditions set by the user, candidate land features are efficiently filtered through attribute field indexing; S504. Scoring and Ranking: A dynamic scoring method with multi-objective weight fusion is adopted to calculate and rank the comprehensive score of each candidate land feature. The comprehensive score = Σ (weight × condition satisfaction). S505. Result Return: Returns a list of land feature IDs that meet the criteria and their comprehensive scores. It supports obtaining complete land feature attribute data based on the land feature ID. In S5, the multi-condition combination filtering process is completed through the logical combination of structured fields; Specifically, in the semantic parsing stage, the natural language processing module identifies spatial semantic elements in the user's query. For example, a user querying for a south-facing tertiary hospital within 5 kilometers of their current location can be mapped to a distance classification field (0-5 kilometers), a type field (tertiary hospital), a direction field (south), and an unconstrained administrative affiliation field. During query location and retrieval, if the user provides their current location, its grid code is directly parsed; if the user specifies a region, the corresponding grid code is calculated based on the region boundary. Using pre-built grid code indexes, feature type indexes, and spatial relationship indexes, all candidate features within and associated with that grid are quickly retrieved. Multi-condition combination filtering uses logical AND, OR, and NOT combinations of structured fields to filter out features that meet all query conditions, such as type = hospital, distance ≤ 10 kilometers, and direction = north. During scoring and sorting, users can customize the weight of each spatial condition. Condition satisfaction is calculated based on specific attribute values; for example, closer distance results in higher satisfaction (ranging from 0-1). A perfect direction match results in a satisfaction of 1, a partial match 0.5, and no match 0. Finally, features are sorted from highest to lowest based on their overall score. In the results return phase, a list of eligible feature IDs and their comprehensive scores are first returned. Users can click on the feature ID to retrieve complete feature attribute data from the database, such as address, contact information, department settings, number of beds, etc.
[0034] A grid spatial indexing system based on structured spatial relationships, characterized by comprising the following modules: The data preprocessing module is used to perform unified format conversion and geometric construction on basic administrative division and multi-source feature data, standardizing features into point, line and surface spatial objects; The grid spatial relationship calculation module is used to calculate spatial relationships based on standard geometric features and administrative division data, combined with the influence range criteria of features, to determine the influence level, influence range, and influence range grid of features, and to store the influence range grid information in a structured manner. The data storage and entry module is used to uniformly store the original ground feature data and its attribute information into the database, determine the ground feature range and coding level, perform grid coding on the ground features, and enter the attribute information into the database, and assign a unique identifier to each ground feature; The data association module is used to associate the grid information of the affected area with the original land feature attribute data through the land feature ID, and establish a mapping relationship between the two. The retrieval and filtering module is used to parse user needs into structured query conditions through a spatial semantic query transformation mechanism, and to complete fast retrieval, multi-condition combination filtering, scoring and sorting, and result return based on related data; The dynamic maintenance module is used to monitor incremental spatial data changes, automatically identify the affected grid cell range, and synchronously correct spatial relationship attributes.
[0035] Specifically, the data preprocessing module has built-in data format conversion tools, a data cleaning engine, and a geometry building component. It supports the import and conversion of various mainstream spatial data formats. The data cleaning engine removes abnormal data, and the geometry building component completes the standardization processing of points, lines, and surfaces of ground features according to preset rules.
[0036] The grid spatial relationship calculation module includes a feature hierarchy division unit, an influence range calculation unit, a grid coding unit, and a grid information storage unit. The feature hierarchy division unit automatically matches the hierarchy based on the feature attributes. The influence range calculation unit calculates the influence range according to the feature type and hierarchy. The grid coding unit generates grid codes using hierarchical coding rules. The grid information storage unit stores the association information between the grid and the feature in a structured format.
[0037] The data storage module integrates a database connection pool, a feature range resolution unit, a coding level selection unit, and an attribute storage unit. The database connection pool supports connections to and efficient operations of multiple database types. The feature range resolution unit calculates the spatial boundaries of features. The coding level selection unit provides a flexible level configuration interface. The attribute storage unit enables batch storage of feature attributes and unique identifier allocation.
[0038] The data association module establishes a mapping between grid information and feature attribute data through a feature ID association engine, generating an association data table and maintaining an index. The retrieval and filtering module includes a semantic parsing engine, query location unit, conditional filtering unit, scoring and sorting unit, and result return unit. The semantic parsing engine supports the conversion of natural language to structured query conditions; the query location unit enables rapid location of grid codes; the conditional filtering unit achieves efficient filtering through indexes; the scoring and sorting unit supports custom weight configuration; and the result return unit provides flexible data return formats.
[0039] The dynamic maintenance module has a built-in incremental data monitoring engine, an affected grid identification unit, and an attribute correction unit. The incremental data monitoring engine listens for data changes in real time, the affected grid identification unit accurately locates the grids involved in the changes, and the attribute correction unit realizes incremental updates of the grid spatial relationship attributes.
[0040] The following is a description with reference to specific embodiments: Example 1: In smart city emergency response, it is necessary to quickly locate rescue resources around the accident site, respond to multi-condition combination queries within 1 second, support resource dispatch across administrative regions, and adapt to the dynamic updating of rescue resources.
[0041] Data preprocessing: The basic data includes citywide administrative division data and multi-source emergency-related feature data. All types of feature data are uniformly converted into WGS84 latitude and longitude coordinate format. Through geometric construction, hospitals, fire brigades, etc. are standardized into point objects, emergency access channels are standardized into line objects, and emergency shelters and administrative divisions are standardized into area objects. Grid spatial relationship calculation: Determine the impact level of features. Provincial features include the provincial emergency command center and provincial reserve warehouse; municipal features include the municipal fire brigade and tertiary hospitals; county features include county hospitals and regional shelters; town features include town health service centers and town fire hydrants; village features include village clinics; and general service facilities include temporary first aid points and small fire hydrants. Determine the scope of impact. Among administrative features, the provincial emergency command center's impact scope is the entire provincial administrative area plus a 200-kilometer buffer zone; the municipal fire brigade's impact scope is the entire municipal administrative area plus a 50-kilometer buffer zone; the county hospital's impact scope is the entire county administrative area plus a 20-kilometer buffer zone; the town features' impact scope is the entire town administrative area plus a 10-kilometer buffer zone; and village features... The entire village's administrative area is divided into a 5-kilometer buffer zone. For general service facilities, the fixed radius buffer zone for temporary first-aid points is set at 3 kilometers, and for small fire hydrants at 1 kilometer. An impact range grid is determined, using a hierarchical grid division based on latitude and longitude. The preset accuracy is 10 kilometers for provincial grids, 5 kilometers for city-level, 2 kilometers for county-level, 1 kilometer for town-level, and 500 meters for village-level. Features at each level are coded according to their impact range. Impact range grid information is stored using 8-directional discretization coding, linear hierarchical distance coding, and bit-identifier topological coding to transform spatial relationships into structured attribute fields. Each grid record includes features ID, grid orientation relative to the feature center, spatial distance, feature type, and resource capacity. Data storage and entry: Determine the scope of ground features and clarify the actual spatial boundaries of each emergency resource; determine the coding level, as high-precision positioning is required for emergency response scenarios, and a 1-kilometer-level grid coding level is uniformly selected; grid coding processing: combine the spatial scope of ground features with the 1-kilometer-level coding level to complete the grid coding of all emergency ground features; attribute information entry: store fields such as ground feature ID, 2D grid code, resource type, contact information, and availability status into a MongoDB database, and assign a unique identifier to each ground feature; The influence range grid is associated with the attribute data of the land feature: the stored grid information is associated with the attribute data in the database through the land feature ID to form a grid code, land feature attribute and spatial relationship association table. The incremental data monitoring frequency is set to 1 minute / time. When a new temporary shelter is added or a fire lane is closed, the affected grid unit is automatically identified and only the spatial relationship attribute within the grid is updated, without the need for global recalculation. Rapid retrieval and multi-condition combination filtering: The scenario requires a hazardous chemical leak in a certain area, and the system needs to query emergency resources within 10 kilometers of the accident site that can accommodate more than 100 people, are located north of the accident site, and have hazardous chemical emergency rescue capabilities. Semantic parsing maps the requirements to distance classification fields of 0 and 10 kilometers, type fields of hazardous chemical emergency rescue and capacity ≥ 100 people, and direction fields of north and no administrative affiliation constraints. The query locates and retrieves the grid code of the accident site, and retrieves all candidate features in the grid and its surrounding area through an index. Multi-condition combination filtering uses logical combinations of structured fields to filter out features that meet the conditions. The scoring and sorting are weighted as follows: distance 0.4, capacity 0.3, and emergency rescue capability level 0.3, and a comprehensive score is calculated and sorted. The results return a list of feature IDs and a comprehensive score, and users can click on the ID to view detailed information.
[0042] Example 2: A commercial group plans to build a new complex in the city. It needs to screen plots of land with a permanent population of ≥200,000 within 3 kilometers, no similar complexes within 5 kilometers, close to a subway station, and located on the south side of the city's main road. The requirements are to support multi-dimensional condition combination screening and quantitative scoring, and adapt to the dynamic changes in the city's population distribution.
[0043] Data preprocessing: Basic data includes urban administrative division data, population statistics data, existing commercial complex data, subway line and station data, urban main road data, and land plot planning data. Population statistics data are linked to street-level area objects, commercial complexes and subway stations are standardized as point objects, urban main roads are standardized as line objects, and land plots to be selected are standardized as area objects. All data are uniformly converted to CGCS2000 coordinate format. Grid spatial relationship calculation: Determine the impact level of land features: city-level land features are existing large commercial complexes, district-level land features are regional shopping centers, street-level land features are community supermarkets and small shopping malls, and general service facilities are subway stations and main urban roads; Determine the impact range: for administrative management attributes, the impact range of large commercial complexes is the entire administrative area of the city plus a 30-kilometer buffer zone, for regional shopping centers it is the entire administrative area of the district plus a 15-kilometer buffer zone, for general service facilities, the fixed radius buffer zone of subway stations is set at 1 kilometer, and for main urban roads it is set at 500 meters; Determine the impact range grid: the coding rule adopts a hierarchical division based on latitude and longitude, and the preset accuracy for commercial site selection scenarios is 5 kilometers for the city level, 2 kilometers for the district level, and 1 kilometer for the street level, and encode existing commercial complexes, subway stations, etc.; Store the impact range grid information: use 16-directional discretization coding, logarithmic hierarchical distance coding, and bit-identifier topological coding to transform spatial relationships into structured fields. Each grid record contains attributes such as land feature ID, orientation, distance, land feature type, and average daily passenger flow; Data storage and entry: Determine the scope of features, clarifying the operating areas of existing commercial complexes, the entrance and exit areas of subway stations, and the four boundaries of the proposed site; determine the coding level, balancing accuracy and efficiency in site selection, and choose a 1-kilometer grid coding level; grid coding processing, completing the 1-kilometer grid coding of all relevant features; attribute information entry, storing fields such as feature ID, grid code, population density, commercial type, and planned use into a MySQL database, and assigning temporary identifiers to the proposed site. Linking the influence range grid with land feature attribute data: Establishing a link between grid information and attribute data through land feature IDs to form a grid, population, commercial resources, and spatial relationship association table. Population data is updated quarterly, and commercial resources are updated monthly. After detecting data changes, the spatial relationship attributes of the affected grids are automatically corrected. Fast retrieval and multi-condition combination filtering: The scenario requires filtering candidate sites that meet the following criteria: a resident population of ≥200,000 within 3 kilometers, no large commercial complexes within 5 kilometers, within 1 kilometer of a subway station, and south of a main road. Semantic parsing mapping is used for distance classification fields (0, 3 km, 0, 5 km, 0, 1 km), type fields (resident population ≥200,000, no large commercial complexes, subway stations, main roads), and direction field (south). Query and retrieve the grid codes of each candidate site and retrieve all associated candidate features. Multi-condition combination filtering uses structured field logic to filter out candidate sites that meet all conditions. Scoring and sorting are weighted as follows: population density 0.4, commercial competition 0.3, transportation convenience 0.2, and location advantage 0.1. A comprehensive score is calculated and sorted. The results return a list of site IDs, a comprehensive score, and key attributes.
[0044] Example 3: In the spatial question-and-answer service of the intelligent voice assistant, it is necessary to respond to users' natural language queries, which requires converting natural language into structured queries without relying on a GIS engine, achieving millisecond-level response, and supporting massive concurrent queries from users.
[0045] Data preprocessing: The basic data includes city administrative division data, POI data, user location data, and merchant rating data. All POI data is standardized into point objects, administrative divisions into polygon objects, and uniformly converted into WGS84 latitude and longitude format, and invalid data is removed. Grid spatial relationship calculation: Determine the influence level of features: district-level features are flagship stores of chain brands, street-level features are regional chain stores, community-level features are independent cafes and small shops, and general service facilities are ordinary POIs without administrative attributes; determine the influence range: for administratively managed features, the influence range of flagship stores is the entire administrative area of the district plus a 5-kilometer buffer zone, for regional chain stores it is the entire administrative area of the street plus a 2-kilometer buffer zone, and for general service facilities, the fixed radius buffer zone of cafes is set at 3 kilometers; determine the influence range grid, the coding rule adopts a hierarchical division based on latitude and longitude, the grid side length of district-level is 2 kilometers, street-level is 1 kilometer, and community-level is 500 meters, and each POI is coded according to the influence range; influence range grid information storage adopts 16-directional discretization coding, logarithmic hierarchical distance coding, and bit-identifier topological coding, transforming spatial relationships into structured fields. Each grid record contains features ID, grid orientation relative to the feature center, spatial distance, merchant rating, business status, orientation, and other attributes; Data storage and ingestion: Determine the geographical features and define the actual location and operating area of each POI; determine the coding level, as AI semantic question answering requires high frequency and low latency, so a 1-kilometer grid coding level is selected; grid coding processing: combine the spatial location of the POI with the 1-kilometer level to complete the grid coding of all POIs; attribute information ingestion: store fields such as geographical feature ID, 2D grid code, business name, rating, address, orientation, and contact information into the Elasticsearch full-text indexing engine, and assign a unique identifier to each POI; Linking Influence Range Grid with Feature Attribute Data: By linking grid information with POI attribute data through feature IDs, a grid code, POI attribute, and spatial relationship index table is constructed, supporting full-text search. The monitoring frequency for merchant information updates is set to 2 hours / time. When a merchant's rating changes or their business status changes, the attribute fields of the corresponding grid are automatically updated. Fast retrieval and multi-condition filtering: The scenario requires users to query coffee shops in Chaoyang District, within 2 kilometers, with a rating of 4.5 or higher, and facing south. Semantic parsing uses a natural language processing module to identify spatial semantic elements, mapping them to the administrative affiliation field "Chaoyang District", distance classification fields "0" and "2 kilometers", type fields "coffee shop" and "rating ≥4.5", and direction field "south". Query location and retrieval obtain the user's grid code and retrieve all coffee shop POIs within that grid and its surrounding 2 kilometers using an Elasticsearch index. Multi-condition filtering uses logical combinations of structured fields to filter out candidate coffee shops in Chaoyang District, with a rating ≥4.5 and facing south. Rating ranking is weighted as follows: distance 0.5, rating 0.3, and user satisfaction rate 0.2, calculating a comprehensive score and ranking the results. The results return a list of IDs, comprehensive ratings, and core information for the top 10 coffee shops, with a response time controlled within 50 milliseconds.
[0046] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A grid spatial indexing method based on structured spatial relationships, characterized in that, Includes the following steps: S1. Data preprocessing: Perform unified format conversion and geometric construction on basic administrative division and multi-source feature data, and standardize the features into point, line and surface spatial objects; S2. Calculation of spatial relationships in grids: Based on the standard geometric features and administrative division data generated in S1, spatial relationships are calculated by combining the feature influence range criteria. The feature influence range criteria are an adaptive calculation method based on feature type, administrative level and service radius. S3. Data storage and entry: The original ground feature data and its attribute information are uniformly stored in the database, and a unique identifier is assigned to each ground feature; S4. Association of Influence Range Grid and Land Feature Attribute Data: The influence range grid information stored in S2 is associated with the original land feature attribute data entered in S3 through the land feature ID; S5, Fast Retrieval and Multi-Condition Combination Filtering: Through the spatial semantic query transformation mechanism, user needs are parsed into structured query conditions, and retrieval and filtering are completed based on the related data of S4.
2. The grid spatial indexing method based on structured spatial relationships according to claim 1, characterized in that: In S2, the calculation of grid spatial relationships includes the following steps: S201. Determine the impact level of land features: Based on the land feature level division rules, the impact level of land features is divided according to the attribute characteristics of land features. The land feature level includes provincial, municipal, county, town, village and general service facility levels. S202. Determine the scope of influence: Based on the influence level of the land feature, combined with the administrative division scope and the corresponding hierarchical distance, determine the scope of influence of the land feature; S203. Determine the grid of influence range: Based on the influence range determined in S202, encode the influence range to obtain the grid codes corresponding to the influence range; S204. Storage of influence range grid information: The influence range grid generated in S203 is stored in a structured manner. Each grid record contains the unique identifier of the associated ground feature, the grid's position relative to the center of the ground feature, the spatial distance from the center of the ground feature, and other optional attributes.
3. The grid spatial indexing method based on structured spatial relationships according to claim 1, characterized in that: In step S3, data storage and entry specifically includes the following steps: S301. Determine the extent of land features: Clarify the spatial extent covered by each land feature; S302. Determine the coding level: Select an appropriate grid coding level based on application requirements for spatial partitioning; S303, Grid Coding Processing: Combine the spatial extent of ground features with the specified level to perform grid coding on ground features; S304. Attribute Information Storage: Store all types of field attributes of land features into the database. The field attributes include land feature ID, two-dimensional grid code, and other information fields.
4. The grid spatial indexing method based on structured spatial relationships according to claim 1, characterized in that: In S5, the spatial semantic query transformation mechanism includes the following steps: S501, Semantic parsing: Identify spatial semantic elements, map distance-type semantics to interval queries of distance classification fields, type-type semantics to value or fuzzy queries of attribute fields, direction-type semantics to matching queries of orientation code fields, and administrative affiliation semantics to filtering conditions of administrative relationship fields. S502, Query Location and Retrieval: Locate the grid area where the user is located or specified and its corresponding grid code in the grid spatial relationship table, and retrieve all candidate land features associated with the grid through a pre-built index; S503, Multi-condition combination filtering: Based on the query conditions set by the user, candidate land features are efficiently filtered through attribute field indexing; S504. Scoring and Ranking: A dynamic scoring method with multi-objective weight fusion is adopted to calculate and rank the comprehensive score of each candidate land feature. S505. Result Return: Returns a list of land feature IDs that meet the criteria and their comprehensive scores. It supports obtaining complete land feature attribute data based on the land feature ID.
5. The grid spatial indexing method based on structured spatial relationships according to claim 1, characterized in that: In S2, the criteria for the scope of influence of land features include: For features with administrative management attributes, the scope of influence is the union of the entire administrative region to which the feature belongs and the buffer zone centered on the feature, with the buffer zone radius determined according to the administrative level; for general service facilities, the scope of influence is a fixed-radius buffer zone centered on the feature.
6. The grid spatial indexing method based on structured spatial relationships according to claim 1, characterized in that: In S2, discretized orientation coding, hierarchical distance coding, and bit identifier topology coding are used to transform the geometric relationship between spatial objects and grid cells into structured attribute fields.
7. The grid spatial indexing method based on structured spatial relationships according to claim 2, characterized in that: In S2, when determining the grid of the area of influence, the coding rule adopts a hierarchical grid division method based on latitude and longitude. By dividing the Earth's surface into layers with a preset precision, a multi-scale grid system is formed. Each grid corresponds to a unique coding identifier, and the coding contains the spatial location information of the grid, supporting cross-level grid association queries and spatial positioning.
8. The grid spatial indexing method based on structured spatial relationships according to claim 1, characterized in that: In S5, the multi-condition combination filtering process is completed through the logical combination of structured fields.
9. The grid spatial indexing method based on structured spatial relationships according to claim 1, characterized in that: In S4, after the influence range grid is associated with the land feature attribute data, the range of the affected grid cells is automatically identified by monitoring changes in incremental spatial data, and their spatial relationship attributes are synchronously corrected. Only the affected grid cells are updated and maintained.
10. A grid spatial indexing system based on structured spatial relationships, characterized in that, Includes the following modules: The data preprocessing module is used to perform unified format conversion and geometric construction on basic administrative division and multi-source geographic feature data; The grid spatial relationship calculation module is used to calculate spatial relationships based on standard geometric features and administrative division data, combined with the influence range criteria of features. The data storage and entry module is used to uniformly store the original ground feature data and its attribute information into the database; The data association module is used to associate the grid information of the affected area with the original land feature attribute data through the land feature ID, and establish a mapping relationship between the two. The retrieval and filtering module is used to parse user needs into structured query conditions through a spatial semantic query transformation mechanism, and to complete fast retrieval, multi-condition combination filtering, scoring and sorting, and result return based on related data; The dynamic maintenance module is used to monitor incremental spatial data changes, automatically identify the affected grid cell range, and synchronously correct spatial relationship attributes.