A method and system for generating semantic relations of geographic entities for basic surveying and mapping

CN122673396BActive Publication Date: 2026-10-09SHENYANG SURVEYING & MAPPING RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611176282.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-05
Publication Date
2026-10-09
Estimated Expiration
2046-08-05

AI Technical Summary

Technical Problem

[0006]针对现有技术的不足,本发明提供了一种面向基础测绘的地理实体语义关系生成方法及系统,解决了现有的地理实体语义关系生成方法依赖复杂连续空间几何拓扑运算导致计算效率低,且推断过程缺乏空间约束及结果缺乏底层位置证据支撑的问题

Benefits of technology

1、本发明通过对地理实体矢量数据进行多层级网格离散化与局部裁剪,结合边界补偿与附属图元生成角色码及定向扩展域,利用关系位图比对与受限邻接遍历推理语义关系,最终将关系推断结果及其路径序列封装入库。该协同处理机制将传统的连续空间几何拓扑计算转化为网格哈希索引逻辑比对与路径状态转移,在不依赖复杂拓扑多边形构建的条件下完成关系推断,打通了基础测绘数据向时空知识图谱标准三元组转换的数据链路。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122673396B_ABST
    Figure CN122673396B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of geographic information system and knowledge graph, and discloses a geographic entity semantic relationship generation method and system for basic surveying and mapping, which comprises the following steps: analyzing geographic entity vector space data, extracting graph elements and determining multi-grid levels to generate coarse and fine hash sets respectively; extracting boundaries and compensating neighborhood sets to generate role codes, combining with attached graph elements to build a directional extension domain set; using the coarse screening set to locally trim the fine set, generating a cross-level relationship bitmap and comparing it with a reasoning template to obtain a candidate sequence; performing restricted adjacency traversal based on the extension domain and the role code, outputting the final semantic relationship and state transition path; encapsulating the relationship evidence sequence, generating a standard triple and writing it into a spatiotemporal knowledge graph database. The present application converts complex spatial topology calculation into discrete grid routing and logical comparison, reduces the global spatial operation load, and improves the efficiency and interpretability of the conversion of basic surveying and mapping data to a graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of geographic information systems and knowledge graph technology, specifically to a method and system for generating semantic relationships of geographic entities for basic surveying and mapping. Background Technology

[0002] In the process of basic surveying and mapping and spatiotemporal knowledge graph construction, it is often necessary to extract and infer semantic relationships between entities based on vector data of geographic entities. Most existing methods for generating semantic relationships rely directly on geometric topological operations in continuous space, such as polygon intersection and overlay analysis. When dealing with surveying vector data with complex boundaries, such continuous geometric operations consume a lot of computing power and memory, resulting in low overall processing efficiency.

[0003] Meanwhile, traditional topological inference methods often lack effective spatial dimensionality reduction mechanisms and directional constraint logic. When processing data, the computation process often fails to effectively eliminate regions that have not occurred spatially, resulting in a large amount of invalid computation in irrelevant regions; and when searching for spatial adjacency relationships, the lack of explicit traversal guidance can easily lead to disordered spatial pathfinding and computational redundancy, making it difficult to guarantee the rigor and objectivity of relationship inference.

[0004] Furthermore, conventional knowledge graph construction processes, after extracting semantic relationships, mostly store only the abstract relational conclusions as edges between nodes in the database, directly discarding the spatial location change sequence and underlying judgment basis in the inference process. This data processing method severs the data evidence chain from spatial location to logical semantics, resulting in a lack of spatial interpretability in the generated graph network, which brings difficulties to subsequent data verification, tracing, and graph updates.

[0005] Therefore, this invention proposes a method and system for generating semantic relationships of geographic entities for basic surveying and mapping, in order to address the shortcomings of existing technologies. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a method and system for generating semantic relationships of geographic entities for basic surveying and mapping. This solves the problems of low computational efficiency caused by relying on complex continuous spatial geometric topology operations in existing methods for generating semantic relationships of geographic entities, as well as the lack of spatial constraints in the inference process and the lack of underlying location evidence to support the results.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a method for generating semantic relationships of geographic entities for basic surveying and mapping, comprising the following steps: The vector spatial data of the first geographic entity and the vector spatial data of the second geographic entity are analyzed to obtain the entity codes of the first geographic entity and the second geographic entity. The main polygon primitives and auxiliary primitives of the first geographic entity and the second geographic entity are extracted respectively to determine the fine-grained and coarse-grained grid levels. A relationship reasoning template is generated based on the combination of the entity classification codes of the first geographic entity and the second geographic entity. Based on the fine-grained and coarse-grained grid levels, spatial discretization calculations are performed on the main polygon primitives to generate a fine-grained hash set and a coarse-grained hash index set corresponding to each geographic entity; a boundary hash set and a boundary compensation neighborhood set are extracted from the fine-grained hash set. Based on the relational reasoning template, primary role codes and auxiliary role codes are generated for the boundary hash set and the boundary compensation neighborhood set; a directional extension domain set is constructed based on the subordinate primitives; and the fine-level hash set is locally pruned using the coarse-screened hash index set to obtain the locally pruned hash set. A cross-level relation bitmap is generated based on the hash set after local pruning. The cross-level relation bitmap is compared with the relation reasoning template to obtain a candidate semantic relation sequence. A restricted adjacency traversal is performed based on the candidate semantic relation sequence, the set of directed extended domains, the primary role code and the auxiliary role code to output the final semantic relation and state transition path sequence. The final semantic relationship and state transition path sequence are encapsulated into a relation evidence sequence. Standard triples are generated based on the entity code of the first geographic entity, the entity code of the second geographic entity, and the final semantic relationship. The standard triples are then written into the spatiotemporal knowledge graph database.

[0008] Preferably, extracting the boundary hash set and the boundary compensation neighborhood set from the fine-level hash set includes: Obtain the adjacent hash indices of the target hash unit in the fine-level hash set; When there is an adjacent hash index in the adjacent hash index that is not included in the fine-level hash set, the target hash unit is assigned to the boundary hash set; Obtain the boundary adjacent hash index of the boundary hash unit in the boundary hash set, remove the hash index that already exists in the fine-level hash set from the boundary adjacent hash index and perform deduplication processing to generate a boundary compensation neighborhood set.

[0009] Preferably, based on the relational reasoning template, primary role codes and auxiliary role codes are generated for the boundary hash set and the boundary compensation neighborhood set, including: For the target hash cell in the boundary hash set and the boundary compensation neighborhood set, calculate the shortest spatial distance from the center point of the target hash cell to the boundary of the main polygon primitive. When the shortest spatial distance is less than or equal to a preset distance threshold, a candidate role code is generated for the target hash unit according to the relation reasoning template. When multiple candidate role codes are generated from the same target hash unit, obtain the priority values ​​corresponding to all the candidate role codes; The candidate character code with the lowest priority value is set as the main character code, and the candidate character codes that are not set as the main character codes are set as the auxiliary character codes.

[0010] Preferably, constructing a set of directional extended domains based on the attached primitives includes: When the attached graphic element is a point feature, the hash unit corresponding to the point feature is set as the anchor unit, and the hash index of the anchor unit is written into the directional extension domain set. When the subordinate primitive is a linear feature, the local directional vector of the linear feature at the boundary of the main polygon primitive is extracted, and the grid connection vector between the center point of the boundary hash cell and the center point of the adjacent hash cell of the boundary hash cell is calculated. Calculate the directional consistency index between the local directional vector and the grid connection vector. When the directional consistency index is greater than or equal to a preset cosine threshold, write the hash index of the adjacent hash cell into the directional extension domain set.

[0011] Preferably, the locally pruned hash set is obtained by partially pruning the fine-level hash set using the coarse-screened hash index set, including: Extract the coarse-screened hash indexes that are the same in the coarse-screened hash index set corresponding to the first geographic entity and the coarse-screened hash index set corresponding to the second geographic entity to form a coarse-screened overlapping set; Based on the preset hierarchical mapping relationship, calculate the range of the two-dimensional bounding box corresponding to the coarse screen overlapping set under the fine grid level; The hash units within the two-dimensional bounding box range of the fine-level hash set are extracted to form the locally pruned hash set. The primary role code and auxiliary role code corresponding to the hash units within the two-dimensional bounding box range are extracted and retained simultaneously.

[0012] Preferably, a cross-level relation bitmap is generated based on the locally cropped hash set, and the cross-level relation bitmap is compared with the relation inference template to obtain a candidate semantic relation sequence, including: The partially cropped hash set is mapped to a preset hierarchical sequence, and the cross-hierarchical relationship bitmap is generated based on the spatial intersection state of the partially cropped hash sets at each level in the preset hierarchical sequence. Perform a bitwise XOR operation between the cross-level relationship bitmap and the baseline cross-level relationship bitmap pattern in the relationship reasoning template, and count the number of feature matches in the result of the bitwise XOR operation. Based on the number of feature matches, a cross-level matching score is calculated. The initial candidate semantic relation set in the relation reasoning template is then sorted in descending order according to the cross-level matching score to generate the candidate semantic relation sequence.

[0013] Preferably, a restricted adjacency traversal is performed based on the candidate semantic relation sequence, the set of directed extended domains, the primary role code, and the auxiliary role code to output the final semantic relation and state transition path sequence, including: Set the traversal cursor to the starting hash unit determined by the directional expansion field set, and extract the first-order adjacent hash units of the starting hash unit; When the first-order adjacent hash unit belongs to the set of directed extended domains, the current candidate relation in the candidate semantic relation sequence, the primary role code of the starting hash unit, and the primary role code of the first-order adjacent hash unit are merged to generate a retrieval key value. The search key value is matched in the preset legal state transition table. When the match is successful, the first-order adjacent hash unit is set as a legal traversal node and the traversal cursor is updated to the legal traversal node. When the auxiliary role code of the legally traversed node meets the preset termination condition, the restricted adjacency traversal is terminated, and the hash cell coordinates of the legally traversed nodes are output as the state transition path sequence.

[0014] Preferably, during the execution of the restricted adjacency traversal: When the attached primitives are in an empty set state, the restricted adjacency traversal is performed based on the main body boundary constraint path and the defect degradation path, respectively. When the candidate relationship output by the main body boundary constraint path is the same as the candidate relationship output by the defect degradation path, the standardized semantic relationship is output as the final semantic relationship. When the relation reasoning template is configured with a two-way verification identifier, forward state transition traversal and reverse state transition traversal are performed. The termination role code of the forward state transition traversal is compared with the termination role code of the reverse state transition traversal. Based on the comparison result, symmetric or asymmetric attributes are output. The final semantic relationship is determined by combining the symmetric or asymmetric attributes.

[0015] Preferably, a standard triple is generated based on the entity code of the first geographic entity, the entity code of the second geographic entity, and the final semantic relationship, and the standard triple is written into a spatiotemporal knowledge graph database, including: The entity code of the first geographic entity is used as the head node identifier, and the entity code of the second geographic entity is used as the tail node identifier. The standard graph predicate is retrieved according to the final semantic relationship as the semantic relationship edge to construct the standard triple. The relation evidence sequence is converted into a key-value pair structure, and the key-value pair structure is appended as attribute data to the semantic relation edge of the standard triple. The standard triple with the appended attribute data is then written into the spatiotemporal knowledge graph database.

[0016] This invention provides a geographic entity semantic relationship generation system for basic surveying and mapping, comprising: The template adaptation module is used to parse the vector spatial data of the first geographic entity and the vector spatial data of the second geographic entity, obtain the entity codes of the first geographic entity and the second geographic entity, and extract the main polygon primitives and auxiliary primitives of the first geographic entity and the second geographic entity respectively, determine the fine-grained level and coarse-grained level of the grid; and generate a relationship reasoning template based on the combination of the entity classification codes of the first geographic entity and the second geographic entity. The grid mapping module is used to perform spatial discretization calculations on the main polygonal primitives based on the fine-grained and coarse-grained grid levels, respectively, to generate a fine-grained hash set and a coarse-grained hash index set corresponding to each geographic entity; extract a boundary hash set and a boundary compensation neighborhood set from the fine-grained hash set; generate a primary role code and an auxiliary role code for the boundary hash set and the boundary compensation neighborhood set according to the relation inference template; construct a directional extension domain set based on the subordinate primitives; and perform local pruning on the fine-grained hash set using the coarse-grained hash index set to obtain a locally pruned hash set. The transition reasoning module is used to generate a cross-level relation bitmap based on the locally pruned hash set, compare the cross-level relation bitmap with the relation reasoning template to obtain a candidate semantic relation sequence, perform restricted adjacency traversal based on the candidate semantic relation sequence, the directed extended domain set, the primary role code and the auxiliary role code, and output the final semantic relation and state transition path sequence. The graph persistence module is used to encapsulate the final semantic relationship and state transition path sequence into a relation evidence sequence, generate standard triples based on the entity code of the first geographic entity, the entity code of the second geographic entity and the final semantic relationship, and write the standard triples into the spatiotemporal knowledge graph database.

[0017] The present invention provides a computer device, including: a processor and a memory, wherein the memory stores a computer program executable by the processor, and the computer program performs the method described above when executed by the processor.

[0018] The present invention provides a storage medium storing a computer program, which is executed by a processor to perform the method described above.

[0019] This invention provides a method and system for generating semantic relationships of geographic entities for basic surveying and mapping. It has the following beneficial effects: 1. This invention discretizes and locally clips geographic entity vector data into multi-level grids, combines boundary compensation and auxiliary primitive generation of role codes and directional extended domains, utilizes relation bitmap comparison and restricted adjacency traversal to infer semantic relationships, and finally encapsulates the relationship inference results and their path sequences into a database. This collaborative processing mechanism transforms traditional continuous spatial geometric topology calculations into grid hash index logical comparison and path state transitions, completing relationship inference without relying on complex topological polygon construction, and establishing a data link for converting basic surveying and mapping data into standard triples of spatiotemporal knowledge graphs.

[0020] 2. This invention sets fine-grained and coarse-grained mesh levels, and uses the coarse-grained hash index set to locally prune the fine-grained hash set before generating a cross-level relationship bitmap. This dimensionality reduction mechanism uses the coarse-grained mesh to pre-exclude regions where no spatial contact occurs, limiting the subsequent fine-grained bitmap generation and logical reasoning operations to the local spatial range where the target entities interact, thus controlling the computational load of global mesh spatial computation.

[0021] 3. This invention utilizes relational reasoning templates and primary / secondary role codes generated from subordinate primitives, along with a set of directional extended domains, to construct the constraints for restricted adjacency traversal. When confirming candidate semantic relationships, the extended domains limit the traversal direction, and the role codes control the state transition. This transforms the determination of abstract relationships between geographic entities into a grid node pathfinding process with directional constraints and logical state constraints, thus converging the boundaries of spatial adjacency searches and providing a clear inference basis for semantic relationship identification.

[0022] 4. This invention encapsulates the final semantic relationship and the state transition path sequence generated during restricted adjacency traversal into a relational evidence sequence, and co-writes it into the spatiotemporal knowledge graph database when constructing standard triples. This step, while completing the construction of the knowledge graph semantic network, solidifies the underlying location node transition process of spatial relation reasoning as an attribute, enabling the relatively abstract geographic semantic association edges in the graph to have spatial interpretability and supporting post-verification of graph data. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the system architecture according to an embodiment of the present invention.

[0024] Figure 2 This is a schematic diagram of the method flow according to an embodiment of the present invention.

[0025] Figure 3 This is a schematic diagram illustrating the working principle of mesh discretization mapping and local clipping processing in an embodiment of the present invention.

[0026] Figure 4 This is a schematic diagram of the branching process for state transition restricted adjacency traversal and exception verification in an embodiment of the present invention.

[0027] Figure 5 This is a schematic diagram illustrating the working principle of relational evidence sequence encapsulation and spatiotemporal knowledge graph persistent writing in an embodiment of the present invention.

[0028] Figure 6 This is a schematic diagram of the grid situation in which the grid mapping module performs spatial discretization and role code generation according to an embodiment of the present invention.

[0029] Figure 7 This is a schematic diagram of the state transition path for the bidirectional restricted adjacency traversal performed by the transition reasoning module in this embodiment of the invention.

[0030] Figure 8 The following is a comparison chart of the application effects of different algorithms in the embodiments of the present invention, wherein (a) is a curve comparing the average inference time and (b) is a bar chart comparing the percentage of semantic relationship determination accuracy.

[0031] Among them, 100 is the template adaptation module; 200 is the grid mapping module; 300 is the transfer reasoning module; and 400 is the graph persistence module. Detailed Implementation

[0032] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Reference Figure 1 The present invention provides a multi-level grid state transition relationship reasoning system constrained by entity classification semantics, including: a template adaptation module 100, a grid mapping module 200, a transition reasoning module 300, and a graph persistence module 400.

[0034] The template adaptation module 100 reads the vector spatial data of the first and second geographic entities and parses the main polygonal primitives and subordinate primitives from the vector spatial data. Based on the system-set mapping geometry tolerance threshold, the template adaptation module 100 determines the fine-grained and coarse-grained grid levels that match the current vector spatial data. The template adaptation module 100 also extracts parameter elements from a preset ontology rule base based on the entity classification code combination of the first and second geographic entities, and combines this with the subordinate primitive completeness and spatial grid level parameters to generate a relational reasoning template and a template adaptation identifier. The relational reasoning template includes at least a set of candidate semantic relations and a baseline cross-level relation bitmap pattern, which are output as computational constraints for subsequent relational reasoning processes.

[0035] The mesh mapping module 200 receives the main polygon primitives, auxiliary primitives, fine mesh level, coarse mesh level, and relational reasoning template output by the template adaptation module 100. The mesh mapping module 200 performs spatial discretization calculations on the main polygon primitives, generating hash index sets corresponding to the main polygon primitives at the fine mesh level and the coarse mesh level. Subsequently, the mesh mapping module 200 divides the fine-level hash set into an internal core hash set, a boundary hash set, and a boundary compensation neighborhood set.

[0036] The grid mapping module 200 generates boundary role codes for hash units based on the relational reasoning template. When the same hash unit meets the conditions for generating multiple role codes, the grid mapping module 200 determines the primary role code according to the judgment rules in the relational reasoning template and records the remaining role codes as auxiliary role codes. The grid mapping module 200 also uses the overlap detection results of the coarse-screening level to perform local pruning on the fine-level hash set, and simultaneously retains the primary role code, auxiliary role code, entity ownership identifier, and level source identifier during the local pruning process. For subordinate primitives, the grid mapping module 200 extracts their geometric features and local tangent vectors, and constructs a directional extension domain based on the directional consistency between adjacent grid units and local tangent vectors.

[0037] The transition reasoning module 300 receives the primary role code, auxiliary role code, directional extension domain, and relation reasoning template output by the grid mapping module 200. The transition reasoning module 300 generates a cross-level relation bitmap and logically compares it with the baseline cross-level relation bitmap pattern to obtain a difference measurement parameter. The transition reasoning module 300 sorts the candidate semantic relation set according to the difference measurement parameter to obtain a candidate semantic relation sequence.

[0038] The transition reasoning module 300 performs a restricted adjacency traversal based on the candidate semantic relation sequence and the directed extension domain. During the restricted adjacency traversal, the transition reasoning module 300 determines the validity of the state transition path based on the primary role code and whether the traversal termination condition is met based on the auxiliary role code. When an attached primitive is missing, the transition reasoning module 300 performs a dual-path comparison to determine the standardized semantic relation, the downgraded relation, or the relation to be confirmed. For entity combinations in the relation reasoning template that have bidirectional verification requirements, the transition reasoning module 300 calculates the forward transition path and the reverse transition path respectively, and determines the symmetric or asymmetric attribute of the output relation based on the termination role and path sequence of the two transition paths. The transition reasoning module 300 outputs the final semantic relation and the state transition path sequence.

[0039] The graph persistence module 400 receives the final semantic relations and state transition path sequence output by the transition reasoning module 300, and the template adaptation identifier output by the template adaptation module 100. The graph persistence module 400 encapsulates the template adaptation identifier, state transition path sequence, and termination criterion into a relational evidence sequence. The graph persistence module 400 generates standard triples based on the first geographic entity code, standard graph predicate, and second geographic entity code, and converts the relational evidence sequence into a key-value pair structure, appending it as attribute data to the semantic relation edges of the standard triples. Subsequently, the graph persistence module 400 writes the attribute data of the standard triples and their semantic relation edges into the spatiotemporal knowledge graph database.

[0040] Reference Figure 2 This invention provides a multi-level grid state transition relation reasoning method constrained by entity classification semantics, comprising the following steps: S100: Parse the vector spatial data of the first and second geographic entities, extract the main polygon primitives and subordinate primitives, and determine the corresponding fine and coarse mesh levels. Based on the entity classification code combination of the first and second geographic entities and the status of subordinate primitives, generate a relationship reasoning template and template adaptation identifier from the preset ontology rule base. S200, based on the fine-level and coarse-level mesh, performs spatial discretization calculations on the main polygon primitives to generate an initial hash index set; and divides the fine-level hash set into an internal core hash set, a boundary hash set, and a boundary compensation neighborhood set. S300: Based on the relational reasoning template, generate boundary role codes for hash units in the boundary hash set and boundary compensation neighborhood set; when role code conflicts exist in the same hash unit, determine the primary role code and record the secondary role code. Construct a directional extension domain based on the local orientation of subordinate primitives and the directional consistency of adjacent grid units; and use the overlap detection results of the coarse-screening level to locally prune the fine-level hash set, simultaneously retaining the primary role code, secondary role code, entity ownership identifier, and level source identifier; S400: Generate a cross-level relation bitmap and compare it with the baseline cross-level relation bitmap pattern in the relation reasoning template to obtain a sorted candidate semantic relation sequence. Based on the candidate semantic relation sequence, the directed extension domain, the primary role code, and the auxiliary role code, perform a restricted adjacency traversal to output the final semantic relation and state transition path sequence. S500 integrates the final semantic relations, state transition path sequences, and template adaptation identifiers into a relational evidence sequence. Standard triples are generated based on geographic entity codes and the final semantic relations, and the relational evidence sequence is appended as attribute data to the semantic relation edges of the standard triples, then written into the spatiotemporal knowledge graph database.

[0041] To further clarify the implementation of each technical aspect of the present invention, the following will provide a detailed description of the implementation of each functional module involved above and its internal processing flow.

[0042] Step S100 is used to complete the structured parsing of the input data and generate the algorithm control parameters required for subsequent grid mapping and state transition inference. This step includes the following sub-steps: S101, Read and separate vector data.

[0043] The primitive parsing unit within the template adaptation module 100 reads vector spatial data from the basic mapping database through a data interface conforming to the Open Geospatial Consortium's Simple Feature Specification. The primitive parsing unit reads the entity attribute fields of the vector spatial data, extracting the first entity classification code of the first geographic entity and the second entity classification code of the second geographic entity; simultaneously, it reads the globally unique identifiers from the entity attribute fields, extracting the first unique entity code of the first geographic entity and the second unique entity code of the second geographic entity.

[0044] The primitive analysis unit parses the geometric node coordinate strings in the vector space data and reads the corresponding coordinate system definition file. When the geometric node coordinate strings are represented using spherical latitude and longitude coordinates, the primitive analysis unit uses Gauss-Kruger projection or Mercator projection to convert the spherical latitude and longitude coordinates into planar geometric coordinates in a Cartesian coordinate system; when the geometric node coordinate strings are already represented in a Cartesian coordinate system, the primitive analysis unit directly reads the planar geometric coordinates. Thus, the first geographic entity and the second geographic entity are unified into the same planar coordinate system, so that subsequent calculations of distance, area, and topological relationships can use a consistent dimensional scale.

[0045] The primitive parsing unit extracts areal vector data based on the layer category identifier and geometric type identifier in the vector spatial data, forming the first main polygon primitive of the first geographic entity and the second main polygon primitive of the second geographic entity. The first and second main polygon primitives are used to represent the spatial coverage of the corresponding geographic entities.

[0046] The primitive parsing unit also reads the point or line vector data associated with the main polygon primitive and forms the first subordinate primitive of the first geographic entity and the second subordinate primitive of the second geographic entity, respectively. When there is no associated point or line vector data for the corresponding geographic entity, the primitive parsing unit configures the subordinate primitives of the geographic entity as an empty set and records the number of its subordinate primitive geometric nodes as 0.

[0047] S102, Hierarchical parameter calculation.

[0048] The tolerance calculation unit within the template adaptation module 100 reads the surveying scale of the current input data and, based on a preset surveying specification comparison table, obtains the surveying geometric tolerance threshold corresponding to the surveying scale. The surveying geometric tolerance threshold represents the allowable spatial error distance, and its dimension is length. For example, in this embodiment, when the surveying scale is 1:2000, the surveying geometric tolerance threshold is 0.6m.

[0049] The tolerance calculation unit reads the system's preset hierarchical grid system parameters. The hierarchical grid system includes multiple grid levels; within this system, the higher the grid level number, the smaller the average side length of the corresponding grid cell. The tolerance calculation unit calculates the average side length of the grid cells corresponding to each preset grid level and compares it with the surveying geometry tolerance threshold.

[0050] The tolerance calculation unit forms a candidate level set by grouping the level labels of grid cells whose average side length is less than or equal to the mapping geometry tolerance threshold, and selects the smallest level label in the candidate level set as the fine-grained level of the grid. When the candidate level set is empty, the tolerance calculation unit selects the largest grid level supported by the system as the grid fineness level. Fine-grained mesh levels Used to determine the grid resolution used when discretizing vector space data.

[0051] To obtain the coarse screening scale for pre-screening, the tolerance calculation unit further calculates the coarse screening level. Coarse screening stage Determine according to the following formula: ; In the formula, This indicates the coarse screening level and is a dimensionless scalar. This represents the function for finding the maximum value. Indicates the fineness level of the mesh; Indicates the step size of the hierarchical span. A preset positive integer parameter used to limit the mesh fineness level. With coarse screening level The hierarchical span between them. In this embodiment, The value range is from 1 to 3, which is the system initialization configuration parameter.

[0052] S103, Extract algorithm control parameters.

[0053] The template generation unit within the template adaptation module 100 combines the first entity classification code and the second entity classification code into a query key value, and inputs this query key value into a preset ontology rule base for matching queries. The ontology rule base is a pre-built structured rule database used to store the correspondence between different combinations of entity classification codes and relation reasoning templates.

[0054] The template generation unit extracts the corresponding relation reasoning template from the ontology rule base based on the query key value. The relation reasoning template is a structured data set containing algorithm control parameters, including at least a candidate semantic relation set, a baseline cross-level relation bitmap pattern, a role code generation condition function, a state transition constraint matrix, defect handling rules, and consistency verification conditions.

[0055] Among them, the candidate semantic relationship set is used to limit the types of semantic relationships that can be output between the first geographic entity and the second geographic entity; the benchmark cross-level relationship bitmap pattern is used to store the cross-level bit tag arrays corresponding to different semantic relationships and serve as the benchmark for subsequent cross-level relationship bitmap comparisons; the role code generation condition function is used to determine the boundary role code corresponding to the hash unit in different boundary topology states; the state transition constraint matrix is ​​used to record the Boolean verification parameters for whether state transitions are allowed between adjacent hash units; the defect handling rule is used to specify the calculation branch when the subordinate primitive is in an empty set state; and the consistency verification condition is used to specify whether a comparison between forward state transition traversal and reverse state transition traversal is required.

[0056] During state transition traversal, the state transition constraint matrix is ​​invoked in the form of a valid state transition table. The retrieval keys of the valid state transition table include the current candidate relation, the primary role code of the current hash cell, the primary role codes of adjacent hash cells, and the identifier of the directed extension domain.

[0057] S104, Configure template adaptation identifier.

[0058] The template adaptation identifier is a system-internal runtime mode character constant used to indicate the algorithm calculation branch executed by the current entity pair in subsequent association modules. The template generation unit reads the number of geometric nodes of the first and second subordinate primitives and reads the consistency verification conditions in the relational reasoning template.

[0059] When the number of geometric nodes of the first and second subordinate primitives is greater than 0, and the consistency verification condition is configured as a one-way reasoning identifier, the template generation unit sets the template adaptation identifier to a standard reasoning mode constant character.

[0060] When the number of geometric nodes of the first or second subordinate primitive is equal to 0, the template generation unit sets the template adaptation identifier to a constant character of the defect degradation mode according to the defect handling rules in the relational reasoning template.

[0061] When the number of geometric nodes of the first and second auxiliary elements is greater than 0, and the consistency verification condition is configured as a two-way verification identifier, the template generation unit sets the template adaptation identifier to a two-way verification mode constant character.

[0062] When the same entity pair simultaneously meets at least two of the triggering conditions in the defective degradation mode, the two-way verification mode, or multiple parallel association rule sets, the template generation unit sets the template adaptation identifier to a constant character in the composite reasoning mode and retains the calculation branch identifier corresponding to each triggering condition in the relation reasoning template.

[0063] The template generation unit encapsulates the relation reasoning template and template adaptation identifier into a template control data packet and outputs it to the mesh mapping module 200. The template control data packet serves as the control parameters for the mesh mapping module 200 to perform spatial discretization, boundary role code generation, and directional extended domain construction.

[0064] Reference Figure 3 Step S200 is used to map the main polygon primitives to a discrete hash index set, and to perform internal, boundary, and compensated neighborhood classification processing on the hash index set. This step includes the following sub-steps:

[0065] S201, Generate a set of hash indexes for the main polygon primitives.

[0066] The spatial discretization unit within the mesh mapping module 200 reads the planar geometric coordinates of the first and second main polygonal primitives, and reads the fine and coarse mesh levels output in step S100. Based on a preset planar mesh Cartesian coordinate system, the spatial discretization unit performs discretization processing on the first and second main polygonal primitives at both the fine and coarse mesh levels.

[0067] Specifically, the spatial discretization unit obtains the coordinates of the minimum bounding rectangle boundary of the first main polygon primitive, and performs orthogonal meshing on the minimum bounding rectangle using the average side length of the mesh cells corresponding to the fine mesh level as the step size. After the meshing is completed, the spatial discretization unit extracts candidate mesh cells whose center points are located inside the first main polygon primitive, as well as mesh cells that have spatial intersection with the boundary of the first main polygon primitive.

[0068] In this embodiment, the spatial discretization unit uses the ray intersection method to determine the positional relationship between the center point of the grid cell and the first main polygon primitive. The spatial discretization unit obtains the coordinates of the center point of the current grid cell and constructs a ray along the positive horizontal direction of the plane coordinate system, starting from the center point coordinates. The spatial discretization unit counts the number of intersections between the ray and each boundary segment of the first main polygon primitive; when the number of intersections is odd, it is determined that the center point is located inside the first main polygon primitive; when the number of intersections is even, it is determined that the center point is located outside the first main polygon primitive.

[0069] When a ray passes through a vertex of the main polygon primitive, is collinear with the boundary segment of the main polygon primitive, or passes through the endpoint of the boundary segment, the spatial discretization unit corrects the number of intersections according to the preset vertex offset rule, half-open boundary counting rule, or odd-even intersection rounding rule.

[0070] For boundary intersection determination, the spatial discretization unit extracts the coordinates of the four vertices and the four edge segments of the current grid cell, and calculates whether the boundary segments of the first main polygon primitive intersect with the edge segments of the current grid cell or coincide with its vertices. When there is an intersection or coincidence, the spatial discretization unit determines that there is a spatial intersection between the current grid cell and the boundary of the first main polygon primitive.

[0071] Whether a grid cell is classified into the internal core hash set or the boundary hash set is determined by the spatial discretization unit in combination with the location of its center point, the intersection relationship between the grid cell edge and the boundary of the main polygon primitive, and the subsequent first-order adjacency classification results.

[0072] For each grid cell that is determined to be a candidate grid cell or a boundary intersection grid cell, the spatial discretization cell records its row index and column index at the current level, and converts the row index and column index into a one-dimensional hash index.

[0073] As an optional implementation, the spatial discretization unit converts the row index value into binary form and performs a left shift operation on it with a preset number of bits. Then, it performs a bitwise OR operation with the binary form of the column index value to obtain the one-dimensional hash index of the current grid cell. The preset number of bits is determined based on the maximum number of columns supported by the system grid hierarchy at the current level, ensuring that the row and column index values ​​occupy non-overlapping bit segments in the one-dimensional hash index.

[0074] The spatial discretization unit aggregates the hash indices generated by the first main polygon primitive at the fine-grained grid level into a first fine-grained hash index set; and uses the same discretization process to generate a first coarse-grained hash index set at the coarse-grained level. The spatial discretization unit performs the same process on the second main polygon primitive to obtain a second fine-grained hash index set and a second coarse-grained hash index set.

[0075] S202, divide the internal core hash set and the boundary hash set.

[0076] The spatial discretization unit is based on a first-order adjacency operator, which performs spatial topological classification on the first and second fine-grained hash index sets respectively. The first-order adjacency operator is used to obtain the neighboring hash units around the target hash unit.

[0077] In this embodiment, the first-order adjacency operator reads the row and column index values ​​of the target hash cell and performs a combination of operations—adding 1, subtracting 1, and keeping the row and column index values ​​unchanged—on them respectively. After removing the row and column coordinates corresponding to the target hash cell itself, the first-order adjacency operator obtains eight sets of adjacent row and column coordinates around the target hash cell and converts these eight sets of adjacent row and column coordinates into eight adjacent hash indices.

[0078] The spatial discretization unit traverses the hash cells in the first fine-grained hash index set. For the current hash cell, the spatial discretization unit calls the first-order adjacency operator to obtain its 8 adjacent hash indices, and then queries the first fine-grained hash index set for the 8 adjacent hash indices.

[0079] When all 8 adjacent hash indices exist in the first fine hash index set, the spatial discretization unit determines that the current hash unit is located in the internal region of the first main polygon primitive and assigns the current hash unit to the internal core hash set.

[0080] When at least one of the eight adjacent hash indices is not included in the first fine hash index set, the spatial discretization unit determines that the current hash unit is adjacent to the outer region of the first main polygon primitive on at least one side, and assigns the current hash unit to the boundary hash set.

[0081] The spatial discretization unit processes the second fine hash index set in the same way to obtain the internal core hash set and boundary hash set corresponding to the second main polygon primitive.

[0082] S203, generate a set of boundary compensation neighborhoods.

[0083] The spatial discretization unit reads the boundary hash sets corresponding to the first and second main polygon primitives, and generates a boundary compensation neighborhood set based on the first-order adjacency operator.

[0084] Specifically, the spatial discretization unit traverses each boundary hash unit in the boundary hash set and inputs the current boundary hash unit into the first-order adjacency operator to obtain the neighboring hash indices around the current boundary hash unit. The spatial discretization unit deletes the hash indices that already exist in the corresponding fine hash index set from the neighboring hash indices and performs deduplication processing on the remaining hash indices to obtain the boundary compensation neighborhood set.

[0085] The boundary compensation neighborhood set is used to record the first-order adjacency hash units outside the boundary of the main polygon primitive, providing compensation neighborhood data for subsequent boundary role code generation and directional expansion domain construction.

[0086] After the above processing, the hash index corresponding to the first main polygon primitive at the fine mesh level is divided into an internal core hash set, a boundary hash set, and a boundary compensation neighborhood set. The hash index corresponding to the second main polygon primitive at the fine mesh level is divided in the same way. The internal core hash set, boundary hash set, boundary compensation neighborhood set, as well as the first and second coarse-screened hash index sets, serve as input data for subsequent boundary role code generation, directional expansion domain construction, and local pruning processing.

[0087] Step S300 generates boundary role codes for hash units in the boundary hash set and the boundary compensation neighborhood set, constructs a directional extended domain set based on the attached primitives, and locally prunes the fine-level hash set based on the coarse-screened overlapping set. This step includes the following sub-steps: S301, Generate boundary role codes and resolve role code conflicts.

[0088] The role generation and resolution unit within the grid mapping module 200 reads the boundary hash set and boundary compensation neighborhood set output in step S200, and reads the role code generation condition function and role priority rules from the relation reasoning template. The role generation and resolution unit traverses the hash cells in the boundary hash set and boundary compensation neighborhood set, inputs the coordinate attributes of the current hash cell into the role code generation condition function, and obtains the candidate role code corresponding to the current hash cell.

[0089] As an optional implementation, the character code generation condition function includes a distance determination branch. When executing the distance determination branch, the character generation and resolution unit calculates the shortest spatial distance from the center point of the current hash unit to the boundary of the corresponding main polygon primitive.

[0090] Specifically, the boundary of the main polygon primitive consists of multiple boundary line segments connected end to end. The character generation and resolution unit obtains the coordinates of the center point of the current hash unit and calculates the distance from the center point to each boundary line segment. For any boundary line segment, if the perpendicular projection point from the center point to the boundary line segment is located within the boundary line segment, the Euclidean distance from the center point to the perpendicular projection point is taken as the corresponding distance; if the perpendicular projection point is located on the extension line of the boundary line segment, the Euclidean distances from the center point to the two endpoints of the boundary line segment are calculated separately, and the smaller value is taken as the corresponding distance. The character generation and resolution unit selects the minimum value from all corresponding distances as the shortest spatial distance from the center point of the current hash unit to the boundary of the main polygon primitive.

[0091] The character generation and resolution unit compares the shortest spatial distance with a preset distance threshold. In this embodiment, the preset distance threshold is 0.5 times the average side length of the grid cells at the current grid level, and the unit of measurement is length. This preset distance threshold is a system initialization configuration parameter used to limit the boundary proximity range when generating boundary character codes.

[0092] When the current hash unit satisfies any logical branch in the role code generation condition function, the role generation and resolution unit generates the corresponding role code character for the current hash unit. The role code character is internal system identifier data used to represent the boundary role of the current hash unit in subsequent state transition traversals.

[0093] When the same hash unit simultaneously meets multiple role code generation conditions, the role generation and resolution unit reads multiple role code characters and calls the role priority rules in the relational reasoning template. The role priority rules store the correspondence between role code characters and integer priority values, where the smaller the priority value, the higher the priority of the corresponding role code character.

[0094] The role generation and resolution unit compares the priority values ​​of multiple role code characters, writes the role code character with the lowest priority value into the main role code field of the current hash unit, and writes the remaining role code characters into the auxiliary role code list field of the current hash unit. The main role code field is used for subsequent state transition validity judgment; the auxiliary role code list field is used for subsequent termination condition judgment, missing branch identification, and relation evidence sequence recording.

[0095] S302, Construct a set of directional extended domains based on the attached primitives.

[0096] The directional extension domain construction unit within the mesh mapping module 200 reads the geometric data of the first and second subordinate primitives and constructs a set of directional extension domains based on the geometric type of the subordinate primitives. This set of directional extension domains is used to define the candidate mesh cells that can participate in state transitions during subsequent restricted adjacency traversal.

[0097] When the subordinate graphic element is a point feature, the directional extension domain construction unit reads the Cartesian coordinates of the point feature and determines its corresponding hash cell based on these coordinates. Specifically, the directional extension domain construction unit converts the Cartesian coordinates of the point feature into row and column index values ​​at the corresponding grid level, and obtains the hash index corresponding to the point feature according to the hash index conversion method in step S201. The directional extension domain construction unit marks the hash cell corresponding to the hash index as an anchor cell and writes the hash index of the anchor cell into the directional extension domain set.

[0098] When the subordinate primitive is a linear feature, the directional extension domain construction unit selects adjacent hash units that meet the directional consistency condition based on the local orientation of the linear feature near the boundary of the main polygon primitive.

[0099] Specifically, the directional expansion domain construction unit reads the node coordinate sequence of the linear feature and selects two adjacent node coordinates closest to the boundary of the main polygonal feature, which are used as the start coordinate and end coordinate, respectively. The directional expansion domain construction unit subtracts the start coordinate from the end coordinate to obtain the local orientation vector of the linear auxiliary feature near the boundary of the main polygonal feature.

[0100] The directional expansion domain building unit traverses the boundary hash cells in the boundary hash set and obtains the first-order adjacent hash cells of the current boundary hash cell. For any adjacent hash cell, the directional expansion domain building unit obtains the coordinates of the center point of that adjacent hash cell, and subtracts the coordinates of the center point of the current boundary hash cell from these coordinates to obtain the grid connection vector.

[0101] The directional consistency index between the local orientation vector and the mesh connection vector is calculated using the following formula: ; In the formula, The directional consistency index is a dimensionless scalar; vector. A vector representing the local directional direction of a linear subordinate primitive, with units of length; vector This represents a grid line vector, with the dimension being length. This represents the vector dot product operator; and These represent the magnitudes of the local directional vector and the mesh connection vector, respectively. This represents the preset smallest positive number.

[0102] In this embodiment, The value is 10 -6 This is used to avoid the denominator being 0 when the magnitude of the local directional vector or mesh connection vector is 0.

[0103] The directional expansion domain construction unit reads a preset cosine threshold and compares the directional consistency index with the preset cosine threshold. In this embodiment, the preset cosine threshold is 0.707, which is a system initialization configuration parameter. When the directional consistency index is greater than or equal to the preset cosine threshold, the directional expansion domain construction unit determines that the corresponding adjacent hash unit meets the directional consistency condition and writes the hash index of the adjacent hash unit into the directional expansion domain set.

[0104] If, after completing the traversal of the first-order adjacent hash units of the current boundary hash unit, no hash index is written into the directed extension domain set, the directed extension domain construction unit writes the first-order adjacent hash units of the current boundary hash unit into the directed extension domain set according to the defect handling rules in the relation inference template, so as to serve as candidate grid units for subsequent restricted adjacency traversal.

[0105] S303, local cropping based on coarsely screened overlapping sets.

[0106] The local pruning unit within the grid mapping module 200 reads the first coarse-screened hash index set and the second coarse-screened hash index set, and performs set traversal and index comparison on the coarse-screened hash indices in the two sets. When the two sets contain the same coarse-screened hash index, the local pruning unit writes that coarse-screened hash index into the coarse-screened overlapping set.

[0107] For hierarchical grid systems, the system presets coarse screening levels. With fine mesh hierarchy The hierarchical mapping relationship between them. The hierarchical mapping relationship is determined by the hierarchical span step size. Confirmed. The local pruning unit reads each coarse-screen hash index from the coarse-screen overlap set and parses the corresponding row and column index values.

[0108] When the hierarchical grid system is divided by a factor of 2 in both the row and column directions of adjacent levels, the local clipping unit is determined according to the hierarchical span step size. The row and column index values ​​corresponding to the coarse-screened hash index are shifted to obtain the coarse-screened hash index at the fine-grained grid level. The corresponding starting and ending row and column coordinates are used to determine the mesh fineness level. The extent of the two-dimensional bounding box below.

[0109] When the hierarchical grid system adopts other hierarchical partitioning ratios, the local pruning unit determines the fine-grained grid level corresponding to the coarse-screened hash index according to the system's preset hierarchical parent-child mapping table. scope.

[0110] The local pruning unit traverses the hash cells in the first and second fine-grained hash index sets. When the row and column index values ​​of the current hash cell are within the bounding box of the two-dimensional boundary, the local pruning unit writes the current hash cell into the corresponding locally pruned hash set.

[0111] During the partial pruning process, the partial pruning unit simultaneously retains the primary role code field, auxiliary role code list field, entity ownership identifier, and hierarchical source identifier corresponding to the current hash unit. The primary role code field, auxiliary role code list field, entity ownership identifier, and hierarchical source identifier serve as node state data for subsequent state transition reasoning.

[0112] Reference Figure 4 Step S400 is used to complete the generation of cross-level relation bitmap, sorting of candidate semantic relations, restricted adjacency traversal, and defect handling branches and bidirectional consistency verification. This step includes the following sub-steps:

[0113] S401, Generate a cross-level relationship bitmap and sort candidate semantic relationships.

[0114] The bitmap sorting unit within the transfer reasoning module 300 reads the initial candidate semantic relation set from the relation reasoning template and performs a coarse screening. To finer mesh level A preset hierarchical sequence is determined between these levels. The preset hierarchical sequence includes a coarse screening level. Grid fineness level And the intermediate levels between the two.

[0115] The bitmap sorting unit maps the partially cropped hash sets of the first and second geographic entities layer by layer to the current level in the preset hierarchical sequence, and calculates the intersection of the two at the current level. When the intersection at the current level is not empty, the bitmap sorting unit sets the bit flag corresponding to that level to 1; when the intersection at the current level is empty, the bitmap sorting unit sets the bit flag corresponding to that level to 0. The bitmap sorting unit arranges the bit flags according to the hierarchical order to form the actual cross-hierarchical relationship bitmap.

[0116] The primary role code field and entity affiliation identifier are stored as extended fields of the actual cross-level relationship bitmap, which are used to provide node state information in candidate semantic relationship ranking and subsequent state transition reasoning.

[0117] For the current candidate relation in the initial candidate semantic relation set, the bitmap sorting unit reads the baseline cross-level relation bitmap pattern corresponding to the current candidate relation. The bitmap sorting unit performs a bitwise XOR operation on the actual cross-level relation bitmap and the baseline cross-level relation bitmap pattern, and counts the number of bits with a value of 0 in the XOR operation result, using this number as the feature matching quantity.

[0118] As an optional implementation, bitwise XOR operations and bit counting operations are executed by the computer device's processor by calling bitwise operation instructions, bit counting instructions, or vectorized instructions; when the computer device does not support the corresponding hardware instructions, the equivalent calculation is performed by a software bit counting algorithm.

[0119] The bitmap sorting unit calculates the cross-level matching score according to the system's preset weighted operation rules. The calculation formula is as follows: ; In the formula, This represents the cross-level matching score, which is a dimensionless scalar. Represents the fineness level of the mesh. The number of feature matches; This represents the total number of bits in the actual cross-level relationship bitmap; Represents the fineness level of the mesh. The corresponding weighting coefficient is 0.75 in this embodiment; Indicates coarse screening level The number of overlapping grids is counted below; Indicates coarse screening level The number of baseline grids; Indicates coarse screening level The corresponding weighting coefficient is 0.25 in this embodiment; This represents a very small positive number, which is 10 in this embodiment. -6 This is used to avoid division by zero errors when the denominator is 0. All the above parameters are dimensionless parameters or dimensionless count values.

[0120] The system has a pre-configured entity classification combination calibration factor table. This table is stored in the ontology rule base and records the correspondence between entity classification code combinations, candidate semantic relationships, and calibration factors. The calibration factors are system initialization configuration parameters and are not part of the training output of the machine learning model. In this embodiment, the calibration factor ranges from [0.8, 1.2].

[0121] The bitmap sorting unit queries the entity classification combination calibration factor table based on the first entity classification code, the second entity classification code, and the current candidate relation. It then multiplies the cross-level matching score by the calibration factor to obtain the final score of the current candidate relation. The bitmap sorting unit then sorts the initial candidate semantic relation set in descending order according to the final score, resulting in a candidate semantic relation sequence.

[0122] S402, Perform restricted adjacency traversal based on candidate semantic relation sequences.

[0123] The restricted traversal unit within the transfer reasoning module 300 reads the set of directed extended domains and the sequence of candidate semantic relations, and selects the current candidate relation in sequence according to the sorting result of the candidate semantic relation sequence.

[0124] When an anchored cell defined by point-like subordinate primitives exists in the set of directed extension domains, the restricted traversal cell sets its traversal cursor to the hash cell corresponding to the anchored cell. When no anchored cell exists but a directed extension domain defined by line-like subordinate primitives exists, the restricted traversal cell uses the boundary hash cell corresponding to the local orientation of the line-like subordinate primitive as the starting traversal cell.

[0125] The restricted traversal unit extracts the first-order adjacent hash units of the current hash unit according to the preset adjacency access order, and determines whether the first-order adjacent hash units belong to the directed extension domain set. When the first-order adjacent hash units belong to the directed extension domain set, the restricted traversal unit reads the primary role code field of the current hash unit and the primary role code field of the first-order adjacent hash units.

[0126] The restricted traversal unit uses the current candidate relation, the primary role code of the current hash unit, the primary role codes of adjacent hash units, and the identifier of the directed extension field as the search key, and inputs them into the valid state transition table corresponding to the current candidate relation. If the search key exists in the valid state transition table, the restricted traversal unit determines that the adjacent hash unit is a valid traversal node and updates the traversal cursor to that valid traversal node.

[0127] The restricted traversal unit continues to perform state transitions under the current candidate relation until the termination condition is met, no valid adjacent traversal nodes exist, or the traversal count threshold is reached. If the current candidate relation does not meet the termination condition, the restricted traversal unit selects the next candidate relation according to the candidate semantic relation sequence and re-executes the state transition judgment. When all candidate relations in the candidate semantic relation sequence do not meet the termination condition, the restricted traversal unit outputs the state of the relation to be confirmed.

[0128] To avoid repeated traversals during state transitions, a traversal count counter is set in the restricted traversal unit. Each time the traversal cursor is updated to a new valid traversal node, the traversal count counter is incremented by 1. When the traversal count counter reaches a preset traversal count threshold, the restricted traversal unit terminates the state transition process under the current candidate relationship and returns an undecided state code. The traversal count threshold is a system initialization configuration parameter, set to 200 times in this embodiment.

[0129] When the traversal cursor reaches a valid traversal node, the restricted traversal unit reads the auxiliary role code list field of that node and compares it with the termination condition database corresponding to the current candidate relationship. When the comparison result meets the termination condition, the restricted traversal unit stops the state transition process, extracts the hash unit coordinates traversed in this traversal, forms a state transition path sequence, and writes this state transition path sequence into the evidence record set.

[0130] S403 executes the defect handling branch and bidirectional consistency check.

[0131] The anomaly verification unit within the transfer reasoning module 300 reads the status of the first and second subordinate primitives. When either the first or second subordinate primitive is an empty set, the anomaly verification unit initiates a defect handling branch and executes the main boundary constraint path and the defect degradation path, respectively.

[0132] In the main body boundary constraint path, the anomaly verification unit performs a restricted adjacency traversal based on the boundary hash set of the main body polygon primitives, the boundary compensation neighborhood set, and the state transition constraints in the relation reasoning template. In the defect degradation path, the anomaly verification unit marks the relevant boundary hash units as defect-pending roles and performs a restricted adjacency traversal according to the defect handling rules in the relation reasoning template.

[0133] The anomaly verification unit compares the candidate relationships output by the main boundary constraint path and the defect / degradation path. When the candidate relationships output by the two paths are consistent, the anomaly verification unit outputs the corresponding standardized semantic relationship; when the candidate relationships output by the two paths are inconsistent, the anomaly verification unit outputs a degradation relationship or a relationship to be confirmed.

[0134] When the consistency check condition in the relational reasoning template is configured as a two-way verification identifier, the anomaly check unit performs a forward state transition traversal from the first geographic entity to the second geographic entity, and a reverse state transition traversal from the second geographic entity to the first geographic entity. Both the forward and reverse state transition traversals use the legal state transition table, directional extension domain constraints, primary role code, and auxiliary role code from step S402.

[0135] The anomaly verification unit records the starting role code, transition role code sequence, termination role code, and termination unit affiliation corresponding to the forward state transition traversal and the reverse state transition traversal, respectively.

[0136] When both the forward and reverse state transition traversals reach the same type of terminating role, and the relation reasoning template marks the current candidate relation as a symmetric relation, the anomaly verification unit outputs the symmetric attribute.

[0137] When only one side of the state transition traversal satisfies the state transition condition from the attached primitive anchor unit to the termination role of another geographic entity, or when the forward state transition traversal and the reverse state transition traversal are inconsistent in at least one of the starting role code, transition role code sequence, termination role code, or termination unit affiliation, the anomaly verification unit outputs asymmetric attributes according to the relational reasoning template.

[0138] The anomaly verification unit encapsulates symmetric or asymmetric attributes into consistency verification criteria, and combines the consistency verification criteria with the current candidate relationship or the relationship to be confirmed status to determine the final semantic relationship or relationship status type between the first geographic entity and the second geographic entity.

[0139] The anomaly verification unit outputs the final semantic relationship or relationship state type, the forward state transition path sequence, the reverse state transition path sequence, and the defect handling branch identifier as the state transition path sequence to the graph persistence module 400.

[0140] Reference Figure 5 Step S500 is used to encapsulate the relation evidence sequence and write the attribute data of the standard triples and their semantic relation edges into the spatiotemporal knowledge graph database. This step includes the following sub-steps:

[0141] S501, Encapsulated Relationship Evidence Sequence.

[0142] After completing the state transition calculation and topological relationship comparison, the evidence encapsulation unit within the graph persistence module 400 reads the calculated state parameters output by the transition reasoning module 300. The calculated state parameters include: the template adaptation identifier corresponding to the relationship reasoning template, the cross-level matching score, the sorted candidate semantic relationship sequence, the primary role code sequence and auxiliary role code sequence traversed during the state transition, the missing branch identifier, and the consistency verification criterion obtained by comparing the forward and reverse state transition traversals.

[0143] The evidence encapsulation unit encapsulates the calculated state parameters into a relational evidence sequence according to a preset data field format. In this embodiment, the relational evidence sequence is organized in key-value pair format; wherein, the template adaptation identifier is written into the rule source field, the consistency verification criterion is written into the verification result field, the cross-level matching score is written into the matching score field, the candidate semantic relation sequence is written into the candidate relation field, the primary role code sequence and the auxiliary role code sequence are written into the role path field, and the defect processing branch identifier is written into the defect status field.

[0144] The evidence encapsulation unit transforms the sequence of relational evidence with completed field assignments into a persistent data structure. Persistent data structures include strings, JSON data packets, binary serialized data, or other key-value pair attribute formats supported by graph databases. Thus, temporary computational parameters generated during state transition calculations are converted into attribute data that can be synchronously stored along with the semantic relation edges.

[0145] S502 generates standard triples and writes them into the spatiotemporal knowledge graph database.

[0146] The graph writing unit within the graph persistence module 400 reads the final semantic relationship or relationship state type, and reads the first unique entity code of the first geographic entity and the second unique entity code of the second geographic entity. Based on the node and edge storage specifications of the graph database, the graph writing unit generates standard triplet objects in its working memory.

[0147] The graph writing unit writes the first unique entity code into the head node identifier field of the standard triple object and the second unique entity code into the tail node identifier field. The graph writing unit also reads the system's preset standard semantic mapping table and retrieves the corresponding standard graph predicate using the final semantic relation or relation state type as the query key. The standard graph predicate is used to identify the relation type of semantic relation edges. The graph writing unit writes the retrieved standard graph predicate into the relation edge identifier field of the standard triple object.

[0148] The graph writing unit converts the relation evidence sequence generated in step S501 into an attribute data format supported by the graph database, and writes the converted relation evidence sequence into the semantic relation edge attribute field of the standard triple object. Thus, the semantic relation edge of the standard triple not only records the final semantic relation or relation state type, but also records the computational state parameters on which the final semantic relation or relation state type was generated.

[0149] The graph writing unit establishes a connection with the spatiotemporal knowledge graph database and writes the attribute data of standard triple objects and semantic relation edges into the spatiotemporal knowledge graph database. In this embodiment, the graph writing unit can enable a pre-write log mechanism before writing to temporarily record the standard triple objects and attribute data to be written; when the database connection or writing process encounters an anomaly, the graph writing unit re-executes the writing operation based on the records in the pre-write log.

[0150] For the connection configuration, data message encapsulation, pre-write log management, and transaction commit process of the spatiotemporal knowledge graph database, those skilled in the art can use existing graph database drivers and data synchronization components to implement them, which will not be elaborated here.

[0151] The present invention also provides a computer device, including: a processor and a memory, the memory storing a computer program executable by the processor, the computer program performing the method described above when executed by the processor.

[0152] The present invention also provides a storage medium storing a computer program, which is executed by a processor to perform the method described above.

[0153] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0154] To further assist those skilled in the art in understanding the technical solution of this invention, the following provides a specific application embodiment using the review of urban cadastral surveying data as an application scenario. This embodiment specifically performs spatial connectivity semantic relationship reasoning between residential land parcels (first geographic entity) and municipal roads (second geographic entity).

[0155] Reference Figure 6 , Figure 6 The horizontal axis represents the longitudinal hash column index, and the vertical axis represents the latitudinal hash row index.

[0156] In step S100, the system reads the vector spatial data of the residential land parcel and extracts the land parcel surface as the first main polygon primitive. Figure 6 The system extracts the boundaries of vector primitives (represented by solid black lines) and extracts the entrance and exit points of the residential area as the first subordinate primitive; simultaneously, it reads the areal data of municipal roads as the second main polygon primitive and extracts the road centerlines as the second subordinate primitive. Based on the mapping scale of the current input data, the system determines the mapping geometric tolerance threshold and selects the fine and coarse mesh levels accordingly. Based on the relational reasoning template output from the ontology rule base, since both entities have subordinate primitives and the consistency verification condition in the relational reasoning template is configured as a two-way verification identifier, the system configures the template adaptation identifier as a two-way verification mode constant character.

[0157] In steps S200 and S300, combined Figure 6 As shown, the mesh mapping module 200 discretizes the first main polygon primitive and the second main polygon primitive. Figure 6 Medium-dark gray grid blocks represent areas divided into internal core hash sets, while light gray grid blocks represent boundary hash sets. For residential land parcels, the system marks the corresponding grid as anchor units based on the coordinates of entrance and exit points. Figure 6 The grid is marked with black dots; for municipal roads, the system selects adjacent grids that satisfy the direction consistency condition with the local direction vector of the road centerline, and constructs a set of directional extension domains ( Figure 6 (Grid areas filled with diagonal lines). At the same time, the role generation and resolution unit assigns boundary role codes to the boundary hash set. For example, it generates the main role code "Pallet Front" for the street-facing boundary of a land parcel and the main role code "Roadside Boundary" for the road boundary.

[0158] Reference Figure 7 , Figure 7 The horizontal axis represents the longitudinal hash column index, and the vertical axis represents the latitudinal hash row index.

[0159] In step S400, the transition reasoning module 300 first ranks connected relationships at the top of the candidate semantic relationship sequence by comparing the scores of the actual cross-level relationship bitmap with the baseline cross-level relationship bitmap pattern. Then, the transition reasoning module 300 initiates a restricted adjacency traversal. For example... Figure 7 As shown, the traversal cursor starts from the anchor cell, verifies the primary role code of the adjacent grid according to the valid state transition table, and steps along the grid nodes with valid primary role codes that are within the directional expansion domain. Figure 7 The grid sequence connected by solid arrows represents the forward state transition path. Simultaneously, the transition reasoning module 300 performs a reverse state transition traversal from the municipal road boundary to the residential land parcel boundary. Figure 7(A grid sequence connected by dashed arrows). Both the forward and reverse state transition paths reach the corresponding terminating role, and the terminating unit's affiliation satisfies the symmetric relationship judgment condition in the relation reasoning template. Based on this, the anomaly verification unit outputs the symmetric attribute and confirms that the final semantic relationship between the first geographic entity and the second geographic entity is connected.

[0160] In step S500, the map persistence module 400 generates standard triplets for node identifiers, namely the first geographic entity code and the second geographic entity code. Figure 7 The forward and reverse state transition path sequences obtained from the process, as well as the calculated state parameters such as template adaptation identifiers, are all encapsulated into a key-value pair format relational evidence sequence. This relational evidence sequence is appended as attribute data to the semantic relation edges of standard triples and finally persistently written into the spatiotemporal knowledge graph database.

[0161] To illustrate the technical advantages of this invention compared to existing spatial relationship reasoning algorithms, the following qualitative application effect comparison is provided. The comparison objects include traditional vector geometry intersection algorithms (based on directly calculating geometric intersection points based on polygon boundary line segments) and heuristic reasoning algorithms based on bounding box distances (without mesh subdivision and role code constraints).

[0162] Reference Figure 8 , Figure 8 In (a), the horizontal axis represents the number of input entity pairs, and the vertical axis represents the average reasoning time. Figure 8 In (b), the horizontal axis represents the algorithm type, and the vertical axis represents the percentage of semantic relationship determination accuracy.

[0163] like Figure 8 As shown in (a), the average inference time of traditional vector geometry intersection algorithms increases significantly with the increase in the number of input entities; especially when the polygon boundary complexity is high, its computation time is greatly affected by the number of intersections of boundary line segments. Algorithms based on bounding box distance have a shorter overall time because they only perform bounding box calculations, but their applicability to complex geographic entities is limited. The method provided by this invention maintains a stable and relatively low increase in average inference time as the amount of data increases. The core reason is that this invention uses the overlap detection results of the coarse screening level to complete local pruning, reducing the number of times complex floating-point geometry intersection is directly performed, and shifting the main computation to bit operations and hash index traversal of the fine hash set, thereby improving computational efficiency.

[0164] Combination Figure 8As analyzed in (b), when the input data has minor boundary deviations or some missing auxiliary primitives (such as noisy data or missed acquisition), traditional vector geometry intersection algorithms, due to overly rigid topological constraints, tend to classify reasonable spatial connectivity as isolation; bounding box distance-based algorithms are prone to misjudgment in the vicinity of complex concave polygons. In contrast, the method provided by this invention, by binding the fine mesh level with the mapping geometry tolerance threshold, can reduce the impact of minor boundary deviations on the relationship determination results within a preset mapping geometry tolerance range. Simultaneously, when auxiliary primitives are missing, the method provided by this invention verifies the relationship determination results through the main boundary constraint path and the missing degradation path triggered by the anomaly verification unit, thereby improving the consistency of the relationship determination results under conditions of missing auxiliary primitives. The above application analysis shows that the method provided by this invention ensures the integrity and traceability of the spatial semantic evidence chain while balancing algorithm execution efficiency and the reliability of the determination results.

[0165] 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 method for generating semantic relationships of geographic entities for basic surveying and mapping, characterized in that, Includes the following steps: The vector spatial data of the first geographic entity and the vector spatial data of the second geographic entity are analyzed to obtain the entity codes of the first geographic entity and the second geographic entity. The main polygon primitives and auxiliary primitives of the first geographic entity and the second geographic entity are extracted respectively to determine the fine-grained and coarse-grained grid levels. A relationship reasoning template is generated based on the combination of the entity classification codes of the first geographic entity and the second geographic entity. Based on the fine-grained and coarse-grained grid levels, spatial discretization calculations are performed on the main polygon primitives to generate fine-grained hash sets and coarse-grained hash index sets corresponding to each geographic entity. Extract the boundary hash set and the boundary compensation neighborhood set from the fine-level hash set; Based on the relational reasoning template, primary role codes and auxiliary role codes are generated for the boundary hash set and the boundary compensation neighborhood set; a directional extension domain set is constructed based on the subordinate primitives; and the fine-level hash set is locally pruned using the coarse-screened hash index set to obtain the locally pruned hash set. Based on the hash set after local pruning, a cross-level relation bitmap is generated, and the cross-level relation bitmap is compared with the relation reasoning template to obtain a candidate semantic relation sequence; Based on the candidate semantic relation sequence, the set of directional extended domains, the primary role code and the auxiliary role code, a restricted adjacency traversal is performed, and the final semantic relation and state transition path sequence is output. The final semantic relationship and state transition path sequence are encapsulated into a relation evidence sequence. Standard triples are generated based on the entity code of the first geographic entity, the entity code of the second geographic entity, and the final semantic relationship. The standard triples are then written into the spatiotemporal knowledge graph database.

2. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 1, characterized in that, Extracting the boundary hash set and the boundary compensation neighborhood set from the fine-level hash set includes: Obtain the adjacent hash indices of the target hash unit in the fine-level hash set; When there is an adjacent hash index in the adjacent hash index that is not included in the fine-level hash set, the target hash unit is assigned to the boundary hash set; Obtain the boundary adjacent hash index of the boundary hash unit in the boundary hash set, remove the hash index that already exists in the fine-level hash set from the boundary adjacent hash index and perform deduplication processing to generate a boundary compensation neighborhood set.

3. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 1, characterized in that, Based on the relational reasoning template, primary role codes and auxiliary role codes are generated for the boundary hash set and the boundary compensation neighborhood set, including: For the target hash cell in the boundary hash set and the boundary compensation neighborhood set, calculate the shortest spatial distance from the center point of the target hash cell to the boundary of the main polygon primitive. When the shortest spatial distance is less than or equal to a preset distance threshold, a candidate role code is generated for the target hash unit according to the relation reasoning template. When multiple candidate role codes are generated from the same target hash unit, obtain the priority values ​​corresponding to all the candidate role codes; The candidate character code with the lowest priority value is set as the main character code, and the candidate character codes that are not set as the main character codes are set as the auxiliary character codes.

4. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 1, characterized in that, Based on the aforementioned auxiliary primitives, a set of directional extended domains is constructed, including: When the attached graphic element is a point feature, the hash unit corresponding to the point feature is set as the anchor unit, and the hash index of the anchor unit is written into the directional extension domain set. When the subordinate primitive is a linear feature, the local directional vector of the linear feature at the boundary of the main polygon primitive is extracted, and the grid connection vector between the center point of the boundary hash cell and the center point of the adjacent hash cell of the boundary hash cell is calculated. Calculate the directional consistency index between the local directional vector and the grid connection vector. When the directional consistency index is greater than or equal to a preset cosine threshold, write the hash index of the adjacent hash cell into the directional extension domain set.

5. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 1, characterized in that, The locally pruned hash set is obtained by partially pruning the fine-level hash set using the coarse-screened hash index set, including: Extract the coarse-screened hash indexes that are the same in the coarse-screened hash index set corresponding to the first geographic entity and the coarse-screened hash index set corresponding to the second geographic entity to form a coarse-screened overlapping set; Based on the preset hierarchical mapping relationship, calculate the range of the two-dimensional bounding box corresponding to the coarse screen overlapping set under the fine grid level; The hash units within the two-dimensional bounding box range of the fine-level hash set are extracted to form the locally pruned hash set. The primary role code and auxiliary role code corresponding to the hash units within the two-dimensional bounding box range are extracted and retained simultaneously.

6. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 1, characterized in that, Based on the hash set after partial pruning, a cross-level relation bitmap is generated. The cross-level relation bitmap is compared with the relation inference template to obtain a candidate semantic relation sequence, including: The partially cropped hash set is mapped to a preset hierarchical sequence, and the cross-hierarchical relationship bitmap is generated based on the spatial intersection state of the partially cropped hash sets at each level in the preset hierarchical sequence. Perform a bitwise XOR operation between the cross-level relationship bitmap and the baseline cross-level relationship bitmap pattern in the relationship reasoning template, and count the number of feature matches in the result of the bitwise XOR operation. Based on the number of feature matches, a cross-level matching score is calculated. The initial candidate semantic relation set in the relation reasoning template is then sorted in descending order according to the cross-level matching score to generate the candidate semantic relation sequence.

7. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 1, characterized in that, Based on the candidate semantic relation sequence, the set of directed extended domains, the primary role code, and the secondary role code, a restricted adjacency traversal is performed to output the final semantic relation and state transition path sequence, including: Set the traversal cursor to the starting hash unit determined by the directional expansion field set, and extract the first-order adjacent hash units of the starting hash unit; When the first-order adjacent hash unit belongs to the set of directed extended domains, the current candidate relation in the candidate semantic relation sequence, the primary role code of the starting hash unit, and the primary role code of the first-order adjacent hash unit are merged to generate a retrieval key value. The search key value is matched in the preset legal state transition table. When the match is successful, the first-order adjacent hash unit is set as a legal traversal node and the traversal cursor is updated to the legal traversal node. When the auxiliary role code of the legally traversed node meets the preset termination condition, the restricted adjacency traversal is terminated, and the hash cell coordinates of the legally traversed nodes are output as the state transition path sequence.

8. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 7, characterized in that, During the execution of the restricted adjacency traversal: When the attached primitives are in an empty set state, the restricted adjacency traversal is performed based on the main body boundary constraint path and the defect degradation path, respectively. When the candidate relationship output by the main body boundary constraint path is the same as the candidate relationship output by the defect degradation path, the standardized semantic relationship is output as the final semantic relationship. When the relation reasoning template is configured with a two-way verification identifier, forward state transition traversal and reverse state transition traversal are performed. The termination role code of the forward state transition traversal is compared with the termination role code of the reverse state transition traversal. Based on the comparison result, symmetric or asymmetric attributes are output. The final semantic relationship is determined by combining the symmetric or asymmetric attributes.

9. The method for generating semantic relationships of geographic entities for basic surveying and mapping according to claim 1, characterized in that, Standard triples are generated based on the entity codes of the first geographic entity, the entity codes of the second geographic entity, and the final semantic relationship. These standard triples are then written into a spatiotemporal knowledge graph database, including: The entity code of the first geographic entity is used as the head node identifier, and the entity code of the second geographic entity is used as the tail node identifier. The standard graph predicate is retrieved according to the final semantic relationship as the semantic relationship edge to construct the standard triple. The relation evidence sequence is converted into a key-value pair structure, and the key-value pair structure is appended as attribute data to the semantic relation edge of the standard triple. The standard triple with the appended attribute data is then written into the spatiotemporal knowledge graph database.

10. A geographic entity semantic relationship generation system for basic surveying and mapping, applied to the method described in any one of claims 1-9, characterized in that, The system includes: The template adaptation module is used to parse the vector spatial data of the first geographic entity and the vector spatial data of the second geographic entity, obtain the entity codes of the first geographic entity and the second geographic entity, and extract the main polygon primitives and auxiliary primitives of the first geographic entity and the second geographic entity respectively, determine the fine-grained level and coarse-grained level of the grid; and generate a relationship reasoning template based on the combination of the entity classification codes of the first geographic entity and the second geographic entity. The grid mapping module is used to perform spatial discretization calculations on the main polygonal primitives based on the fine-grained and coarse-grained grid levels, respectively, to generate a fine-grained hash set and a coarse-grained hash index set corresponding to each geographic entity; extract a boundary hash set and a boundary compensation neighborhood set from the fine-grained hash set; generate a primary role code and an auxiliary role code for the boundary hash set and the boundary compensation neighborhood set according to the relation inference template; construct a directional extension domain set based on the subordinate primitives; and perform local pruning on the fine-grained hash set using the coarse-grained hash index set to obtain a locally pruned hash set. The transition reasoning module is used to generate a cross-level relation bitmap based on the locally pruned hash set, compare the cross-level relation bitmap with the relation reasoning template to obtain a candidate semantic relation sequence, perform restricted adjacency traversal based on the candidate semantic relation sequence, the directed extended domain set, the primary role code and the auxiliary role code, and output the final semantic relation and state transition path sequence. The graph persistence module is used to encapsulate the final semantic relationship and state transition path sequence into a relation evidence sequence, generate standard triples based on the entity code of the first geographic entity, the entity code of the second geographic entity and the final semantic relationship, and write the standard triples into the spatiotemporal knowledge graph database.

Citation Information

Patent Citations

  • Method for constructing three-dimensional semantic knowledge graph of geographic entity space-time relationship

    CN121146014A

  • Multi-scale dynamic space-time geographic map automatic construction method based on vector data

    CN122309626A