Knowledge graph construction method based on hierarchical semantic reasoning and spatio-temporal joint constraint

CN122885221APending Publication Date: 2026-10-09SIWEI SHIJING TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611377200.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-07
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明提供了一种基于分层语义推理和时空联合约束的知识图谱构建方法,以解决相关时空知识图谱构建技术语义挖掘深度不足、时空特征割裂、关联精度偏低、知识冲突冗余和动态更新滞后的问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122885221A_ABST
    Figure CN122885221A_ABST
Patent Text Reader

Abstract

The application discloses a kind of knowledge graph construction methods based on layered semantic reasoning and space-time joint constraint, it is related to knowledge graph technical field.The method includes: based on standardized data set establishes the bidirectional mapping index table of geographic coordinates and the grid code;Calculate entity total similarity and determine normalized entity set;Utilize ontology mode explicit association rule matching to generate explicit triple set;Utilize big model to mine implicit association and generate implicit triple set with confidence value;Based on the conflict triple group identified after checking triple, calculate comprehensive confidence and generate standardized triple library;Entity is regarded as node, association is regarded as edge and constructs topological network, with grid code as block index distributed storage triple, generates grid block graph. Solve the problem that the depth of semantic mining of space-time knowledge graph construction technology is insufficient, space-time feature is split, association precision is low, knowledge conflict redundancy and dynamic updating lag.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph technology, specifically to a knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints. Background Technology

[0002] Spatiotemporal knowledge graphs are structured knowledge carriers that integrate entity semantic relationships, spatial topology, and temporal evolution patterns. They can fully depict the dynamic changes in entity relationships across time and space, and possess multidimensional knowledge expression and dynamic adaptation capabilities.

[0003] Current mainstream spatiotemporal knowledge graph construction solutions in the industry mostly rely on fixed rule templates or single basic models to extract entities and relationships, which has obvious technical limitations. Multi-source spatiotemporal data fusion modeling methods generally emphasize entity extraction and neglect semantic deep modeling. They lack an integrated construction framework with semantic association mining as the core and spatiotemporal multi-dimensional joint constraints as the correction benchmark. They only use grid coding to achieve data block storage, or use a single large model to uniformly extract triples, or only set independent verification for spatial and temporal dimensions. The resulting graphs have problems such as low knowledge density, weak reasoning ability, and poor dynamic adaptability, which seriously restricts the intelligent application of spatiotemporal big data.

[0004] In summary, the relevant spatiotemporal knowledge graph construction technologies are unable to achieve full semantic coverage mining at both the deep and shallow levels, and cannot take into account multi-dimensional spatiotemporal joint verification, dynamic weight conflict resolution, and block-based incremental updates. The construction accuracy and dynamic adaptation capabilities cannot meet actual needs. Summary of the Invention

[0005] In view of this, the present invention provides a knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints to solve the problems of insufficient semantic mining depth, spatiotemporal feature fragmentation, low association accuracy, knowledge conflict redundancy and dynamic update lag in related spatiotemporal knowledge graph construction technology.

[0006] In a first aspect, this invention provides a method for constructing a knowledge graph based on hierarchical semantic reasoning and spatiotemporal joint constraints. The method includes: acquiring a standardized multi-source spatiotemporal data set; defining an ontology pattern based on the standardized dataset and assigning multi-level grid codes to the data with spatial coordinates; establishing a bidirectional mapping index table between geographic coordinates and grid codes; the ontology pattern includes entity categories, attribute dimensions, and association types; using a named entity recognition model, extracting spatiotemporal entities and corresponding attributes based on the standardized dataset to generate an initial entity set; calculating the total entity similarity of each candidate entity in the initial entity set; determining a normalized entity set based on a preset similarity threshold; using explicit association rules of the ontology pattern to generate an explicit triplet set based on the normalized entity set; reading the bidirectional mapping index table to obtain grid neighborhood information; encoding the grid neighborhood information into a structured sequence and concatenating it with entity attributes to form prompt words; using a large model to mine implicit associations based on the prompt words; and generating a set with confidence values. The system first identifies the implicit triple set; then merges the explicit triple set and the implicit triple set to generate a deep and shallow semantic association library; for the deep and shallow semantic association library, it reads the head and tail entity grid codes, timestamps, and implicit triple confidence values ​​respectively to determine topological compliance and temporal logic, and calculates grid topology score, temporal consistency score, and inference confidence score; it calculates a joint verification score based on the grid topology score, temporal consistency score, and inference confidence score, and generates verified triples based on the joint verification score and a preset verification score threshold; it identifies conflicting triple groups based on the verified triples, calculates the comprehensive credibility based on the conflicting triple groups, and generates a standardized triple library. The comprehensive credibility is calculated based on a weighted average of four factors: grid matching degree, temporal integrity, inference confidence, and data source authority; for the standardized triple library, it constructs a topological network with entities as nodes, associations as edges, and attributes and credibility as features, and distributes triples using grid codes as block indexes to generate a grid block graph.

[0007] The knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints provided in this embodiment has the following beneficial effects: First, by acquiring a standardized multi-source spatiotemporal dataset, an ontology schema is defined based on the standardized dataset, and multi-level grid codes are assigned to data with spatial coordinates. A bidirectional mapping index table between geographic coordinates and grid codes is established, unifying multi-source heterogeneous spatiotemporal data into standardized data with a standardized format, providing a consistent data foundation for subsequent entity extraction and association mining. The ontology schema definition unifies the standardization of entity categories, attribute dimensions, and association types, enabling data from different sources to be organized and associated according to a unified semantic framework. Multi-level grid codes assign a unified spatial identifier to data with spatial coordinates, and the bidirectional mapping index table establishes a fast conversion channel between geographic coordinates and grid codes, enabling spatial location queries and neighborhood retrieval to be performed efficiently based on grid codes, providing index support for subsequent entity spatial alignment and grid neighborhood information extraction. Secondly, by utilizing a named entity recognition model to extract spatiotemporal entities and corresponding attributes from a standardized dataset, an initial entity set is generated. The total entity similarity of each candidate entity in the initial entity set is calculated, and a normalized entity set is determined based on a preset similarity threshold. This achieves accurate identification and fusion of homonymous and heteronymous entities in multi-source data. The named entity recognition model can automatically identify various spatiotemporal entities and their attributes from unstructured text and structured data, avoiding the inefficiency and subjectivity of manual annotation. The total entity similarity integrates features from three dimensions: textual semantics, temporal association, and spatial matching. It can comprehensively measure the likelihood of common origin between candidate entities and has a higher alignment accuracy compared to single-dimensional similarity calculation. The normalized entity set provides a unified entity foundation for subsequent bi-branch semantic reasoning, eliminating the problems of association duplication and conflict caused by entity redundancy in multi-source data. Then, by utilizing explicit association rules based on ontology patterns to generate explicit triple sets based on normalized entity sets, and by reading bidirectional mapping index tables to obtain grid neighborhood information, the grid neighborhood information is encoded into structured sequences and concatenated with entity attributes to form cue words. A large model is then used to mine implicit associations based on these cue words to generate implicit triple sets with confidence values. This constructs a dual-branch hierarchical semantic mining architecture of explicit rule matching and implicit large-model inference. The explicit association rule branch quickly extracts intuitive and resolvable associations between entities based on preset ontology rules, ensuring the efficiency and accuracy of basic association extraction. The implicit inference branch innovatively encodes grid neighborhood spatial information into structured sequences as cue word context, enabling the large model to perceive the spatial environment features and entity distribution patterns around entities during inference, thereby uncovering deep potential associations not explicitly stated in the text. The outputs of the two branches are merged to form a deep and shallow semantic association library, achieving full coverage mining of both surface explicit semantics and deep implicit semantics, significantly improving the knowledge density and association completeness of the graph.Subsequently, by reading the head and tail entity grid codes, timestamps, and implicit triple confidence values ​​from both deep and shallow semantic association libraries, topological compliance and temporal logic are determined. Grid topology scores, temporal consistency scores, and inference confidence scores are calculated. A joint verification score is then calculated based on these three scores, and a verified triple is generated based on the joint verification score and a preset verification score threshold. This constructs a triple joint verification mechanism encompassing grid topology, temporal evolution, and inference confidence. This triple verification comprehensively scores semantic associations from three dimensions: spatial rationality, temporal logic, and semantic credibility. Unlike existing technologies that use independent spatial and temporal verification methods, this approach achieves coupled constraints on multi-dimensional features. The joint verification score is calculated by multiplying the three scores, ensuring that a low score in any dimension significantly lowers the total score, thus achieving a strongly coupled joint filtering effect. For associations with correctable temporal deviations, the effective time attribute of the association is automatically corrected based on the entity timestamp interval. This filters out erroneous associations while retaining correctable valid knowledge, improving knowledge utilization. Subsequently, conflicting triples were identified based on the verified triples. The overall credibility of these conflicting triples was calculated, and a standardized triple library was generated. The overall credibility was calculated using a weighted average of four factors: grid matching degree, temporal completeness, inference confidence, and data source authority. A four-factor dynamic adaptive conflict resolution strategy was constructed. These four factors comprehensively quantify the overall quality of the triples from four perspectives: spatial matching degree, temporal coverage completeness, model inference credibility, and data source authority. The weight coefficients are dynamically adjusted based on manual verification feedback using a Bayesian update mechanism, enabling the system to continuously learn the importance of each factor in different scenarios without requiring manual pre-setting of fixed weights. Conflicting triples are processed hierarchically according to their overall credibility. High-credibility knowledge is directly retained, low-credibility knowledge is directly removed, and medium-credibility knowledge is marked for manual review. This achieves an organic combination of automatic processing and manual verification, effectively resolving multi-source knowledge conflicts and ensuring the quality and standardization of the standardized triple library. Finally, by constructing a topological network using entities as nodes, associations as edges, and attributes and credibility as features in a standardized triplet library, and distributively storing triples with grid coding as a block index, a grid-based block graph is generated, achieving efficient storage and dynamic iterative updates of the spatiotemporal knowledge graph. The topological network unifies entities, associations, and attributes into a graph structure, enabling knowledge to possess reasonable and traversable characteristics. The distributed storage method using grid coding as a block index divides the graph into independent blocks according to spatial regions. New data only requires updating the corresponding grid block, eliminating the need for global graph reconstruction, significantly improving the graph's update efficiency and dynamic adaptability. The dual-copy storage mechanism across block triples and the three-level retrieval index ensure the integrity and retrieval efficiency of cross-regional association queries, enabling the graph to support real-time updates and efficient queries of large-scale spatiotemporal data. By implementing this invention, the problems of insufficient semantic mining depth, fragmented spatiotemporal features, low association accuracy, knowledge conflict redundancy, and lagging dynamic updates in related spatiotemporal knowledge graph construction technologies are solved.

[0008] In one optional implementation, the process of generating a standardized multi-source spatiotemporal data set includes: acquiring alarm log data, structured video surveillance data, vehicle passage data at checkpoints, and data reported by grid workers in urban public safety scenarios; uniformly converting time fields into standard timestamps; uniformly converting spatial coordinates into WGS84 latitude and longitude coordinates; and generating a format-normalized dataset. For the format-normalized dataset, data with a field missing rate exceeding a preset threshold is removed; data with missing key fields are filled by interpolation based on adjacent data from the same data source; and duplicate data is deduplicated to generate a standardized multi-source spatiotemporal data set.

[0009] In one optional implementation, a standardized multi-source spatiotemporal data set is acquired. An ontology schema is defined based on the standardized dataset, and multi-level grid codes are assigned to data with spatial coordinates. A bidirectional mapping index table between geographic coordinates and grid codes is established. This includes: calculating corresponding grid codes for data with spatial coordinates based on GeoSOT multi-level grid partitioning rules, establishing a forward mapping from geographic coordinates to grid codes and a reverse mapping from grid codes to data lists, and generating a bidirectional mapping index table; defining entity categories and corresponding static inherent attribute dimensions and dynamic spatiotemporal evolution attribute dimensions for urban public safety business scenarios based on the standardized multi-source spatiotemporal data set. Entity categories include event entity categories, personnel entity categories, vehicle entity categories, location entity categories, and police resource entity categories; defining core semantic association types and spatiotemporal constraint criteria, and generating an ontology schema. Core semantic association types include event-associated personnel types, event-associated vehicle types, event-associated location types, event-associated police resource types, personnel-associated vehicle types, and location-associated police resource types.

[0010] In one optional implementation, a named entity recognition model is used to extract spatiotemporal entities and corresponding attributes from a standardized dataset to generate an initial entity set. The total entity similarity of each candidate entity in the initial entity set is calculated, and a normalized entity set is determined based on a preset similarity threshold. This includes: inputting a standardized multi-source spatiotemporal data set into a fine-tuned BERT-CRF named entity recognition model, outputting entity fragments labeled with event entity tags, personnel entity tags, vehicle entity tags, location entity tags, and police resource entity tags, generating an initial entity recognition result; and based on the initial entity recognition result, performing field alignment mapping on entities in the structured ledger data and vector data, associating the police incident number, license plate number, monitoring point number, and corresponding entities in the initial entity recognition result to generate an entity set with source data identifiers. For an entity set with source data identifiers, the static inherent attributes and dynamic spatiotemporal evolution attributes of each entity are extracted based on the attribute dimensions in the ontology schema. The corresponding grid codes are obtained by reading the bidirectional mapping index table and the attributes are attached to generate an initial entity set. For the initial entity set, the text similarity between the entity name and attribute description is calculated using cosine similarity for each pair of candidate entities. The intersection-union ratio of the timestamp interval is calculated as the temporal similarity. The weighted value of the grid code prefix matching length and the grid center distance is calculated as the grid similarity. The total entity similarity of each pair of candidate entities is calculated based on a preset formula. Based on the total entity similarity and a preset similarity threshold, candidate entities with a total entity similarity higher than the preset similarity threshold are determined as homologous entities. Attribute fusion and deduplication are performed, and a globally unique identifier is assigned to each fused entity to generate a normalized entity set.

[0011] In one optional implementation, explicit association rules of the ontology schema are used to generate an explicit triple set based on the normalized entity set matching, including: based on the normalized entity set and the explicit association rules in the ontology schema, performing rule matching on entity pairs corresponding to event-related personnel types, event-related vehicle types, event-related location types, event-related police resource types, and location-related police resource types to generate a candidate explicit association set; for the candidate explicit association set, based on the semantic association type in the ontology schema as the relationship type and effective time interval for each association label, generating an explicit semantic quintuple consisting of head entity, relationship, tail entity, time interval, and grid code, and attaching the time interval and grid code as attributes to generate an explicit triple set; based on the explicit triple set, cases where there are at least two associations of the same type between the same pair of head and tail entities are merged by time interval, retaining the association with the largest time span to generate a deduplicated explicit triple set.

[0012] In one optional implementation, a bidirectional mapping index table is read to obtain grid neighborhood information. This grid neighborhood information is encoded into a structured sequence and concatenated with entity attributes to form a cue word. A large model is used to mine implicit associations based on the cue words, generating a set of implicit triples with confidence values. This includes: for a normalized entity set, reading the bidirectional mapping index table to obtain the grid code corresponding to each entity, querying the entity distribution information within the 8 neighboring grids of the grid code, generating grid neighborhood information. The entity distribution information includes the number of entities within the neighborhood, the distribution of entity categories, and high-frequency event types. Based on the grid neighborhood information, the neighborhood entity distribution is encoded into a structured sequence, and the structured sequence... The system concatenates entity attributes, event type constraints, and inference task instructions from the normalized entity set. A structured sequence is inserted after the entity attribute description of the prompt word and before the inference task instructions to generate the prompt word input sequence. This prompt word input sequence is then fed into the fine-tuned LLaMA-7B large language model to perform implicit association inference, outputting implicit association inference results containing the head entity, implicit relation type, tail entity, and inference confidence value. Low-confidence associations with inference confidence values ​​below a preset threshold are filtered out from the implicit association inference results. The implicit relations are then normalized and mapped based on the semantic association type in the ontology pattern to generate a set of implicit triples with confidence values.

[0013] In one optional implementation, the explicit triple set and the implicit triple set are merged to generate a deep and shallow semantic association library, including: for the explicit triple set and the implicit triple set, identifying duplicate triple sets with completely identical head and tail entities and the same relation type based on the entity global identifier; comparing the inference confidence values ​​of each duplicate triple set; retaining the triple with the largest inference confidence value; deleting the remaining duplicate triples in each group to generate a deduplicated triple set; for the deduplicated triple set, supplementing each triple with head entity grid code, tail entity grid code, association effective time interval, and inference confidence value attributes to generate a triple set with complete attributes; for the triple set with complete attributes, classifying and organizing them according to entity category and relation type to generate a deep and shallow semantic association library.

[0014] In one optional implementation, for both deep and shallow semantic association libraries, the head and tail entity mesh codes, timestamps, and implicit triple confidence values ​​are read respectively to determine topological compliance and temporal logic. Mesh topology scores, temporal consistency scores, and inference confidence scores are calculated, including: for both deep and shallow semantic association libraries, reading the mesh codes of the head and tail entities in each triple, calculating the prefix matching length of the head and tail entity mesh codes, calculating the Euclidean distance between the center coordinates of the head and tail entity meshes, determining the topological relationship type of the two entity meshes based on the prefix matching length and Euclidean distance, where the topological relationship type includes containment, adjacency, intersection, and isolation types, and determining the topological relationship type and triples. The relationship type is queried from the preset spatial compliance scoring mapping table to obtain the grid topology score; for deep and shallow semantic association libraries, the timestamp intervals of the head entity and tail entity in each triple are read, the intersection duration of the head entity timestamp interval and the tail entity timestamp interval is calculated, and the temporal relationship type is determined based on the intersection duration and the order of the timestamps. The temporal relationship types include fully self-consistent type, temporally inverted overlapping type, and non-overlapping type. The temporal consistency score is obtained by querying the preset temporal compliance scoring mapping table based on the temporal relationship type; for implicit triples in deep and shallow semantic association libraries, the inference confidence value output by the large model is read as the inference confidence score; for explicit triples in deep and shallow semantic association libraries, the default inference confidence score is calculated as full score.

[0015] In one optional implementation, conflicting triplet groups are identified based on the verified triplets, and a comprehensive confidence level is calculated based on the conflicting triplet groups to generate a standardized triplet library. This includes: for verified triplets, grouping them based on head entity, relation type, and tail entity; ensuring that the head entity, relation type, and tail entity of each triplet within the same group are identical; grouping triplets with different attribute values ​​and different sources within the same group as conflicting triplet groups to generate a conflicting triplet set; for each conflicting triplet group in the conflicting triplet set, calculating the grid matching degree, temporal completeness, inference confidence, and data source authority of each triplet within the group to generate a four-factor index matrix; for the four-factor index matrix, multiplying the grid matching degree of each triplet by the grid matching degree weight coefficient, and multiplying the temporal completeness by... The overall credibility of each triple is obtained by summing the time sequence completeness weight coefficient, the inference confidence multiplied by the inference confidence weight coefficient, and the data source authority multiplied by the data source authority weight coefficient. The four weight coefficients are initially equal. After each round of conflict resolution, the four weight coefficients are updated and adjusted using Bayesian methods to generate a ranking of the overall credibility of conflict triples. For the ranking of the overall credibility of conflict triples, the triple with the highest overall credibility in each conflict triple group is retained as standard knowledge. If the overall credibility is the same, the triple with the higher data source authority is retained. Triples with an overall credibility lower than the preset low credibility threshold are directly removed. Triples with an overall credibility between the preset low credibility threshold and the preset medium credibility threshold are marked as pending review, generating a standardized triple library.

[0016] Secondly, this invention provides a knowledge graph construction system based on hierarchical semantic reasoning and spatiotemporal joint constraints. The system includes: an indexing module for acquiring a standardized multi-source spatiotemporal data set, defining an ontology pattern based on the standardized dataset, assigning multi-level grid codes to data with spatial coordinates, and establishing a bidirectional mapping index table of geographic coordinates and grid codes. The ontology pattern includes entity categories, attribute dimensions, and association types. An extraction module is used to extract spatiotemporal entities and corresponding attributes based on the standardized multi-source spatiotemporal data set using a named entity recognition model, obtaining an initial entity set, calculating the total entity similarity of each candidate entity in the initial entity set, and determining a normalized entity set based on a preset similarity threshold. An explicit mining module is used to perform rule matching based on the normalized entity set using explicit association rules of the ontology pattern, obtaining an explicit triplet set. An implicit reasoning module is used to read the bidirectional mapping index table to obtain grid neighborhood information, encode the grid neighborhood information into a structured sequence and concatenate it with entity attributes to form prompt words, and use a large model to mine implicit associations based on the prompt words, obtaining a knowledge graph with spatial coordinates. The system comprises the following modules: a set of implicit triples for confidence values; a fusion module to merge explicit and implicit triple sets to obtain a deep and shallow semantic association library; a verification module to read the head and tail entity grid codes, timestamps, and implicit triple confidence values ​​for the deep and shallow semantic association libraries, determine topological compliance and temporal logic, and obtain grid topology scores, temporal consistency scores, and inference confidence scores; a scoring module to calculate a joint verification score based on the grid topology score, temporal consistency score, and inference confidence score, and generate verified triples based on the joint verification score and a preset verification score threshold; a resolution module to identify conflicting triple groups based on the verified triples, calculate the comprehensive credibility based on the conflicting triple groups, and generate a standardized triple library. The comprehensive credibility is calculated by weighting four factors: grid matching degree, temporal integrity, inference confidence, and data source authority; and a construction module to construct a topological network for the standardized triple library, using entities as nodes, associations as edges, attributes, and credibility as features, and distributing the triples using grid codes as block indexes to obtain a grid block graph. Attached Figure Description

[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of a specific example of a knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints, according to an embodiment of the present invention. Figure 2This is a principle block diagram of a specific example of a knowledge graph construction system based on hierarchical semantic reasoning and spatiotemporal joint constraints, according to an embodiment of the present invention. Detailed Implementation

[0019] To address the technical problems mentioned in the background section, this application provides a method for constructing a knowledge graph based on hierarchical semantic reasoning and spatiotemporal joint constraints. See details below. Figure 1 As shown, the method includes: Step S101: Obtain a standardized multi-source spatiotemporal data set, define an ontology pattern based on the standardized dataset, assign multi-level grid codes to the data with spatial coordinates, and establish a bidirectional mapping index table between geographic coordinates and grid codes. The ontology pattern includes entity categories, attribute dimensions, and association types.

[0020] Specifically, step S101 includes: Step a1: Obtain multi-source heterogeneous spatiotemporal data of urban public safety scenarios, perform standardized preprocessing, and generate a standardized multi-source spatiotemporal data set.

[0021] Furthermore, the multi-source heterogeneous spatiotemporal data in urban public safety scenarios encompasses four core data sources: alarm receipt log data, structured video surveillance data, vehicle passage data at checkpoints, and data reported by grid workers. Alarm receipt log data consists of structured alarm information recorded by the alarm receiving system, including fields such as alarm number, alarm time, alarm location, alarm type, handling status, and involved personnel and vehicles, possessing high data authority and completeness. Structured video surveillance data comprises structured detection results automatically analyzed and output by front-end intelligent cameras, including face capture information, vehicle capture information, behavioral event information, and corresponding timestamps and monitoring point coordinates; this data is highly real-time but has a certain false detection rate. Vehicle passage data consists of vehicle passage records recorded by road checkpoint equipment, including fields such as license plate number, passage time, checkpoint coordinates, vehicle brand and model, and vehicle color; this data has a standardized format and high vehicle recognition accuracy. The data reported by grid workers consists of event information submitted via mobile devices, including fields such as event description, reporting time, event location, and on-site photos. While the data is fine-grained, it suffers from issues such as non-standard descriptions and missing fields. During data collection, integrity checks are first performed on all accessed data sources to ensure complete data fields, continuous time ranges, and spatial coverage of the target area, removing obviously abnormal or corrupted data records. Standardized preprocessing involves four operations: format normalization, noise filtering, missing data completion, and duplicate removal. Format normalization converts the time fields of all data types to a standard timestamp format and the spatial coordinates to the WGS84 latitude and longitude coordinate system, eliminating differences in time format and coordinate reference between different data sources. The WGS84 latitude and longitude coordinate system is an internationally recognized geographic coordinate system. It uses the Earth's center of mass as the origin and employs longitude and latitude as two angular parameters to identify the spatial location of any point on the Earth's surface, making it the most widely used coordinate reference in the field of geographic information. Noise filtering removes data records with a field missing rate exceeding a preset threshold. For data with missing key fields, interpolation is performed to fill in the missing fields based on adjacent data from the same data source. For example, if a checkpoint vehicle passage record is missing the vehicle body color field, the missing field is filled in based on the vehicle body color values ​​of adjacent vehicle passage records with the same license plate number. Duplicate removal deduplicates completely identical data records, retaining only the record with the most recent timestamp, eliminating duplicate data generated during data collection due to system retries or multi-source synchronization. After standardization preprocessing, the four types of data sources are unified into a standardized multi-source spatiotemporal data set with a standardized format, complete fields, and no duplicates, providing a consistent data foundation for subsequent entity extraction and ontology definition.

[0022] Step a2: Based on the standardized multi-source spatiotemporal dataset, calculate the corresponding grid code for the data with spatial coordinates according to the GeoSOT multi-level grid partitioning rules, establish a forward mapping from geographic coordinates to grid codes and a reverse mapping from grid codes to data lists, and generate a bidirectional mapping index table.

[0023] Furthermore, the GeoSOT multi-level grid partitioning rule is a global multi-level grid partitioning scheme based on latitude and longitude. It divides the Earth's surface into rectangular grids of different scales according to latitude and longitude ranges. Each grid level corresponds to a fixed latitude and longitude span, with multiple levels from global to centimeter-level. Each grid is assigned a unique binary code identifier. Data with spatial coordinates includes alarm location coordinates in alarm logs, monitoring point coordinates in structured video surveillance data, checkpoint point coordinates in vehicle checkpoint data, and event location coordinates in data reported by grid workers. The grid coding calculation process first converts latitude and longitude coordinates into the binary representation of GeoSOT grid codes, then extracts a corresponding length of code prefix according to the preset grid level to obtain the grid code for that coordinate point at the target level. The selected grid level is determined based on the spatial accuracy requirements of the business scenario. In urban public safety scenarios, grid levels ranging from meters to tens of meters are typically selected to match the coverage of a single grid with the spatial impact range of a typical event. The bidirectional mapping index table includes both forward and reverse mapping parts. The forward mapping uses latitude and longitude coordinates as keys to store corresponding grid codes, supporting quick querying of the grid by coordinates. The reverse mapping uses grid codes as keys to store a list of identifiers for all data records falling within that grid, supporting quick retrieval of all data within that spatial area by grid code. The index table uses a hash table structure for storage, with constant-time query complexity, supporting high-frequency spatial query operations. The establishment of the bidirectional mapping index table enables subsequent operations such as entity spatial alignment, grid neighborhood information querying, and grid block storage to be performed efficiently based on grid codes, avoiding the need for complex latitude and longitude range calculations for each spatial query, significantly improving spatial data processing efficiency. For example, when querying monitoring devices around an event, it is only necessary to obtain the grid code corresponding to the event and then query the video monitoring data list in adjacent grids to quickly locate the surrounding monitoring points.

[0024] Step a3: Based on the urban public safety business scenario of standardized multi-source spatiotemporal data set, define entity categories and corresponding static inherent attribute dimensions and dynamic spatiotemporal evolution attribute dimensions, define core semantic association types and spatiotemporal constraint criteria, and generate ontology patterns.

[0025] Furthermore, the ontology model defines the semantic framework of the knowledge graph, uniformly specifying the entity categories included in the graph, the attribute dimensions of each entity category, the types of associations between entities, and the spatiotemporal constraints that the associations must satisfy. It serves as the rule foundation for subsequent entity extraction, association mining, and knowledge verification. The entity category definition, combined with the core elements of urban public safety business scenarios, is divided into five major categories: event entity categories, personnel entity categories, vehicle entity categories, location entity categories, and police resource entity categories. Event entity categories correspond to various police incidents and emergencies, including subtypes such as theft, fights, traffic accidents, fires, and mass incidents. Personnel entity categories correspond to various personnel involved in the event, including roles such as victims, suspects, those reporting the incident, and witnesses. Vehicle entity categories correspond to various motor vehicles involved in the event, including usage classifications such as vehicles involved in the case, vehicles seen in the incident, and patrol vehicles. Location entity categories correspond to various spatial locations where the event occurs and is involved, including location types such as residential areas, commercial areas, schools, hospitals, and roads. The police resource entity category corresponds to various police resources involved in incident handling, including patrol officers, special police, traffic police, and police station personnel. The static inherent attribute dimension consists of attributes inherent to the entity itself that do not change over time, such as the name, gender, and ID number of a person entity; the license plate number, brand, model, and body color of a vehicle entity; the location name, address, and location type of a place entity; and the officer number, unit, and police branch of a police resource entity. The dynamic spatiotemporal evolution attribute dimension consists of attributes that change over time and space, such as the appearance time and location of a person entity; the passage time and location of a vehicle entity; the occurrence time, location, and handling status of an event entity; and the dispatch time and duty location of a police resource entity. The definition of attribute dimensions provides clear field specifications for subsequent entity attribute extraction and attribute attachment. The core semantic association type defines the types of associations allowed between entities, including six categories: event-associated personnel type, event-associated vehicle type, event-associated location type, event-associated police resource type, personnel-associated vehicle type, and location-associated police resource type. The "Event-Associated Personnel Type" indicates the relationship between an event and the personnel involved; the "Event-Associated Vehicle Type" indicates the relationship between an event and the vehicles involved; the "Event-Associated Location Type" indicates the relationship between an event and the location where it occurred; the "Event-Associated Police Resource Type" indicates the relationship between an event and the police force handling the event; the "Person-Associated Vehicle Type" indicates the relationship between a person and their vehicle; and the "Location-Associated Police Resource Type" indicates the relationship between a location and the police resources responsible for that location. The spatiotemporal constraint criteria stipulate the reasonableness conditions that various relationships must meet in the spatial and temporal dimensions. For example, the "Event-Associated Personnel Type" requires that the person's appearance time falls within the event's duration range and that the person's location is spatially related to the event's location, providing a constraint basis for subsequent triple joint verification.The complete definition of the ontology schema enables the entire knowledge graph construction process to have a unified semantic specification, ensuring that entities and associations from different sources and of different types can be organized and integrated according to a consistent standard.

[0026] Step S102: Using the named entity recognition model, spatiotemporal entities and corresponding attributes are extracted based on a standardized dataset to generate an initial entity set. The total entity similarity of each candidate entity in the initial entity set is calculated, and a normalized entity set is determined based on a preset similarity threshold.

[0027] Specifically, step S102 includes: Step b1 involves inputting a standardized multi-source spatiotemporal data set into the fine-tuned BERT-CRF named entity recognition model, which outputs entity fragments labeled with event entity tags, personnel entity tags, vehicle entity tags, location entity tags, and police resource entity tags, generating the initial entity recognition result.

[0028] Furthermore, the BERT-CRF named entity recognition model is a named entity recognition architecture that combines a BERT pre-trained language model and a Conditional Random Field (CRF). The BERT pre-trained language model is built on a Transformer encoder architecture, acquiring rich semantic representation capabilities through large-scale unlabeled text pre-training, and can convert each word in the input text into a high-dimensional vector representation containing contextual semantic information. The CRF is a sequence labeling algorithm that learns the transition probability constraints between entity labels based on the word vectors output by BERT, considering the dependencies between adjacent labels and avoiding labeling results that do not conform to the label transition rules, such as irrational cases like directly following a B-person label with an I-vehicle label. The model fine-tuning process is performed based on labeled corpora from urban public safety scenarios. The labeled corpora include various entity fragments manually labeled from police dispatch logs, police reports, and event description texts. Fine-tuning adapts the model to the professional terminology and expression habits of the urban public safety field. The model inference process inputs textual data from a standardized multi-source spatiotemporal dataset sentence by sentence into the BERT-CRF model. This textual data includes crime description fields from police report logs, event description fields from grid worker reports, and behavioral event description fields from structured video surveillance data. The BERT encoder performs multi-layer self-attention computation on the input text, capturing the semantic relationships between each word and other words in its context, and outputting a contextual semantic vector for each word. The Conditional Random Field layer calculates the probability of each entity label corresponding to each location based on the semantic vector, and outputs the globally optimal label sequence by combining label transition probability constraints. Entity labels use the BIO annotation system, where B labels represent the starting position of an entity fragment, I labels represent the internal position of an entity fragment, and O labels represent non-entity content. The model outputs entity fragments labeled with event entity labels, personnel entity labels, vehicle entity labels, location entity labels, and police resource entity labels. Each entity fragment includes the entity text content, entity category, and its position offset in the original text. For entities in structured data, such as the alarm number, license plate number, and person name fields in the alarm log, they are directly mapped to the corresponding category entities based on the field names, without the need for model recognition. The initial entity recognition results combine entities identified by the model from text data and entities mapped from fields in structured data, providing a foundation for subsequent attribute extraction and entity alignment.

[0029] Step b2: Based on the initial entity recognition results, perform field alignment mapping on the entities in the structured ledger data and vector data, and associate the alarm number, license plate number, monitoring point number and the corresponding entity in the initial entity recognition results to generate an entity set with source data identifier.

[0030] Furthermore, field alignment mapping is the process of establishing an association between unique identifier fields in structured data and entities in the initial entity recognition results, enabling entities identified from text to be traced back to their corresponding original structured data records. The alarm number is the unique identifier for each alarm record in the alarm log data, the license plate number is the core identifier field for the vehicle entity, and the monitoring point number is the unique identifier for the video surveillance equipment. The alignment mapping process first establishes an initial association based on a precise match between the entity's text content and the structured field values. For example, a precise string match is performed between the license plate number string identified in the text and the license plate number field in the checkpoint vehicle passage data. If a match is successful, the vehicle entity is associated with the corresponding checkpoint vehicle passage record. For cases with discrepancies in expression, such as license plate numbers containing spaces or inconsistent capitalization in the text, normalization is performed before matching. After association, each entity carries a source data identifier, which records the type of data source, the original record, and the corresponding field name from which the entity originates, giving the entity complete data traceability capabilities. Each entity in the entity set with source data identifiers contains information such as entity text content, entity category, source data type, source record identifier, and corresponding field name. The source data type identifies whether the entity originates from the alarm log, video surveillance, vehicle checkpoint data, or data reported by grid workers, providing a basis for subsequent data source authority assessment. The source record identifier points to a unique number of the original data record, supporting backtracking to view the original data context corresponding to the entity. Field alignment mapping effectively solves the problem of separation between text-recognized entities and structured data entities, enabling the same entity obtained from different data sources to be associated through identifier fields, providing a data association foundation for subsequent multi-feature fusion entity alignment. For example, a license plate number may be identified as a vehicle entity in the alarm description in the alarm log, and simultaneously exist as a structured field in the vehicle checkpoint data. License plate number alignment mapping can associate the same vehicle entity obtained from both sources, providing a basis for subsequent fusion and deduplication.

[0031] Step b3: For the entity set with source data identifiers, extract the static inherent attributes and dynamic spatiotemporal evolution attributes of each entity based on the attribute dimensions in the ontology schema, read the bidirectional mapping index table to obtain the corresponding grid code and complete the attribute attachment to generate the initial entity set.

[0032] Furthermore, the attribute extraction process, based on the static inherent attribute dimensions and dynamic spatiotemporal evolution attribute dimensions defined in the ontology schema, extracts corresponding field values ​​from the original data records associated with the entities. For event entities, attributes such as alarm type, alarm time, alarm location coordinates, handling status, and number of personnel involved are extracted. For personnel entities, static attributes such as name, gender, and ID number are extracted, as well as dynamic attributes such as occurrence time and location coordinates. For vehicle entities, static attributes such as license plate number, brand and model, and vehicle color are extracted, as well as dynamic attributes such as passage time and passage location coordinates. For location entities, static attributes such as location name, address, and location type are extracted, as well as dynamic attributes such as the location's valid time interval. For police resource entities, static attributes such as officer number, affiliated unit, and police type are extracted, as well as dynamic attributes such as dispatch time and duty location coordinates. After attribute extraction, for attribute values ​​with spatial coordinates, the corresponding grid code is retrieved from the bidirectional mapping index table, and the grid code is attached to the entity as a spatial attribute. Attribute attachment organizes the extracted static inherent attributes and dynamic spatiotemporal evolution attributes into a structured attribute set according to the attribute dimensions defined in the ontology schema, and attaches it to the corresponding entity. Each entity's attribute set contains three parts: attribute name, attribute value, and attribute source. The attribute source records which field of which original data record the attribute value was extracted from, ensuring attribute traceability. For different values ​​of the same attribute obtained from multiple data sources for the same entity, all are temporarily retained and labeled with their respective sources, to be uniformly processed in the subsequent entity fusion stage. Each entity in the initial entity set includes a global temporary identifier, entity category, entity text content, a set of static inherent attributes, a set of dynamic spatiotemporal evolution attributes, spatial grid encoding, and a list of source data identifiers. The initial entity set provides a complete foundation of entity attributes for subsequent multi-feature fusion entity similarity calculation and normalization alignment.

[0033] Step b4: For the initial entity set, cosine similarity is used to calculate the text similarity of entity name and attribute description for each pair of candidate entities. The intersection-union ratio of timestamp intervals is calculated as temporal similarity. The weighted value of grid coding prefix matching length and grid center distance is calculated as grid similarity. The total entity similarity of each pair of candidate entities is calculated based on a preset formula. Based on the total entity similarity and a preset similarity threshold, candidate entities with a total entity similarity higher than the preset similarity threshold are determined as homologous entities. Attribute fusion and deduplication are performed. A globally unique identifier is assigned to each fused entity to generate a normalized entity set.

[0034] Furthermore, entity alignment, the process of identifying multiple entities in an initial entity set that point to the same real-world object and merging them into a unified entity, is a core step in resolving the issues of homonymy and heteronymy in multi-source data. The generation of candidate entity pairs begins with filtering based on entity categories, calculating similarity only for entities of the same category to avoid invalid calculations between entities of different categories; for example, the similarity comparison is not performed between the entities of "person" and "vehicle". Text similarity calculation uses the cosine similarity method. First, the entity names and attribute descriptions are converted into word vector representations. These word vectors can be generated based on a bag-of-words model or a pre-trained word vector model. Then, the cosine angle between the text vectors of two entities is calculated as the text similarity; the closer the cosine value is to 1, the more similar the text semantics. Temporal similarity calculation is based on the timestamp intervals in the entity's dynamic attributes. The ratio of the intersection length to the union length of the timestamp intervals of two entities is calculated, i.e., the intersection-union ratio (IU). A higher IU indicates a higher degree of overlap between the two entities in the time dimension, making them more likely to point to the same object.

[0035] Grid similarity calculation integrates two metrics: grid code prefix matching length and grid center distance. The grid code prefix matching length is the number of consecutive identical binary bits in the grid codes of two entities, starting from the most significant bit; a longer prefix matching length indicates greater spatial proximity between the two entities. The grid center distance is the Euclidean distance between the corresponding grid center coordinates of the two entities; a closer distance indicates closer spatial location. The two metrics are normalized and then weighted to obtain the grid similarity score, allowing for a quantifiable representation of spatial matching. The formula for calculating the total entity similarity is as follows:

[0036] in, For text semantic similarity, For time-series label similarity, Match similarity in the grid space; The weights are dynamically adjustable; the weight coefficients are preset based on the importance of each dimension in the business scenario, and the sum of the three weight coefficients is 1. In urban public safety scenarios, text similarity usually has the highest weight because text identifiers such as license plate numbers and ID card numbers are highly distinguishable. Temporal similarity and grid similarity are used as auxiliary verification dimensions. After the total entity similarity is calculated, it is compared with the preset similarity threshold. Candidate entity pairs with a total similarity higher than the threshold are determined to be homologous entities, and attribute fusion and deduplication need to be performed. The attribute fusion process merges the attribute sets of homologous entities. For cases where the same attribute has multiple values, the value with the highest authority based on the data source authority is selected as the fused attribute value, while other values ​​are retained as candidate attribute records. The deduplication operation merges multiple homologous entities into one entity and assigns a globally unique identifier to the fused entity. The globally unique identifier is generated using a unified encoding rule to ensure that each entity in the graph has a unique identity. The normalized entity set eliminates entity redundancy in multi-source data, so that each real object corresponds to only one unified entity in the graph, providing a clean and consistent entity foundation for subsequent bi-branch semantic association mining. For example, a vehicle entity with the same license plate number may appear in both the police report and the checkpoint vehicle passage record. After entity alignment, it can be merged into a single vehicle entity, combining attribute information from both sources to avoid duplicate associations in subsequent association mining.

[0037] Step S103: Utilize explicit association rules of ontology patterns to generate explicit triple sets based on normalized entity set matching.

[0038] Specifically, step S103 includes: Step c1: Based on the normalized entity set and the explicit association rules in the ontology schema, perform rule matching on the entity pairs corresponding to the event-related personnel type, event-related vehicle type, event-related location type, event-related police resource type, and location-related police resource type to generate a candidate explicit association set.

[0039] Furthermore, explicit association rules are predefined rules for determining inter-entity relationships based on business logic and common sense. Each rule specifies the applicable association type, triggering conditions, and determination logic. The rule matching process traverses all entity pairs in the normalized entity set, checking each pair according to the association type to see if it meets the triggering conditions of the corresponding rule. The rule determination logic for event-related personnel type is as follows: when the incident description of an event entity mentions the name or ID number of a personnel entity, or when the appearance time and location of a personnel entity overlap with the occurrence time and location of an event entity, it is determined that there is an event-related personnel type association between the event and the personnel. The rule determination logic for event-related vehicle type is as follows: when the incident description of an event entity mentions the license plate number of a vehicle entity, or when the passage time and location of a vehicle entity overlap with the occurrence time and location of an event entity, it is determined that there is an event-related vehicle type association between the event and the vehicle. The rule determination logic for event-related location type is as follows: when the occurrence location of an event entity falls within the spatial range of a location entity, or when the incident description of an event entity mentions the name of a location entity, it is determined that there is an event-related location type association between the event and the location. The rule-based logic for determining the type of police resource associated with an event is as follows: when the dispatch record of a police resource entity contains the incident number of an event entity, or when the duty time and location of a police resource entity overlap with the occurrence time and location of an event entity, it is determined that there is an event-associated police resource type relationship between the event and the police resource. The rule-based logic for determining the type of police resource associated with a location is as follows: when the jurisdiction of a police resource entity includes the spatial range of a location entity, it is determined that there is a location-associated police resource type relationship between the location and the police resource. The rule-based logic for determining the type of vehicle associated with a person is as follows: when a person entity and a vehicle entity appear at the same location at the same time, or when the alarm log records a person as the driver of a vehicle, it is determined that there is a person-associated vehicle type relationship between the person and the vehicle. The rule matching process generates candidate explicit association records for entity pairs that meet the conditions. Each record includes a head entity identifier, a tail entity identifier, an association type, and a matching basis, generating a candidate explicit association set.

[0040] Step c2: For the candidate explicit association set, based on the semantic association type in the ontology pattern, label each association with relation type and effective time interval, generate an explicit semantic quintuple consisting of head entity, relation, tail entity, time interval, and grid code, and attach the time interval and grid code as attributes to generate an explicit triple set.

[0041] Furthermore, the relation type labeling is based on the matching rule type of candidate explicit associations, mapping the association type to the standardized relation name defined in the ontology schema. For example, an event-related personnel type is mapped to a personnel-involved relationship, an event-related vehicle type is mapped to a vehicle-involved relationship, an event-related location type is mapped to an occurrence-in-the-place relationship, an event-related police resource type is mapped to a handling police force relationship, a personnel-related vehicle type is mapped to a driving relationship, and a location-related police resource type is mapped to a responsibility relationship. The determination of the effective time interval is based on the intersection of the dynamic time attributes of the two entities involved in the association. For example, the effective time interval for an event-related personnel type is the intersection of the event duration interval and the personnel appearance time interval, and the effective time interval for an event-related location type is the intersection of the event occurrence time and the location's effective time interval. The effective time interval gives the association a time dimension and can characterize the effective time range of the association. The explicit semantic quintuple consists of five elements: head entity, relation, tail entity, time interval, and grid code. The head entity and tail entity are globally unique identifiers of the two entities involved in the association, the relation is the standardized relation type name, the time interval is the effective time range of the association, and the grid code is the spatial grid code corresponding to the location where the association occurs. Time intervals and grid codes are attached as attributes to triples, forming explicit triples with spatiotemporal attributes. A triple is the basic storage unit of a knowledge graph, consisting of a subject, a predicate, and an object. The subject corresponds to the head entity, the predicate to the relation type, and the object to the tail entity. Each triple in the explicit triple set carries attribute information such as association type, valid time interval, spatial grid code, and matching criteria, providing complete association data for subsequent merging, deduplication, and triple verification. For example, in an explicit triple between a theft incident and a suspect, the head entity is the event identifier, the relation is the involved personnel, the tail entity is the personnel identifier, the time interval is the time period of the event, and the grid code is the grid code corresponding to the location of the event.

[0042] Step c3: Based on the set of explicit triples, merge cases where there are at least two associations of the same type between the head and tail entities of the same pair according to time interval, retain the association with the largest time span, and generate a set of explicit triples after deduplication.

[0043] Furthermore, multiple associations of the same type may arise between the same pair of head and tail entities due to different triggering conditions for rule matching. For example, an event and a vehicle may trigger the event-related vehicle type rule based on two conditions: the police report mentioning the license plate number and the checkpoint vehicle passage record overlapping, generating two association records. The merging process first groups the explicit triples according to the head entity identifier, tail entity identifier, and relationship type. Triples within the same group point to the same type of association between the same pair of head and tail entities. For multiple triples within the same group, their respective valid time intervals are compared, and the union of all time intervals is taken as the valid time interval of the merged association. The association record with the largest time span is retained, and the remaining duplicate records are deleted. If other attributes of the triples within the same group differ, such as different grid codes, all different grid codes are retained as multiple spatial location attributes of the association. The deduplicated set of explicit triples eliminates the association redundancy caused by multiple rule triggers, ensuring that only one record is retained for the same type of association between the same pair of head and tail entities, and the valid time interval covers the time range corresponding to all triggering conditions. The deduplication operation ensures the simplicity and integrity of explicit associations, avoiding excessive duplicate associations when merging with implicit triples. For example, if two event-related vehicle type triples are generated based on the police report and checkpoint records, merging them retains only one triple, with the effective time interval covering the union of the event occurrence time and the vehicle passage time.

[0044] Step S104: Read the bidirectional mapping index table to obtain grid neighborhood information, encode the grid neighborhood information into a structured sequence and concatenate it with entity attributes to form prompt words, use the large model to mine implicit associations based on prompt words, and generate a set of implicit triples with confidence values.

[0045] Specifically, step S104 includes: Step d1: For the normalized entity set, read the bidirectional mapping index table to obtain the grid code corresponding to each entity, query the entity distribution information in the 8 neighboring grids of the grid code, and generate grid neighborhood information. The entity distribution information includes the number of entities in the neighborhood, the distribution of entity categories, and the high-frequency event types.

[0046] Furthermore, the grid neighborhood is a set of surrounding grids centered on the grid containing the entity. An 8-neighborhood grid comprises nine grids: the four adjacent grids above, below, left, and right of the central grid, and the four diagonally adjacent grids (top left, top right, bottom left, and bottom right). 8-neighborhood queries are performed using a reverse mapping of a bidirectional mapping index table. First, the grid code corresponding to the entity is obtained. Then, the codes of the eight neighboring grids are calculated based on the spatial adjacency of the grid codes. Finally, the entity list contained within each neighboring grid is retrieved through reverse mapping. Entity distribution statistics include the total number of entities within the neighborhood, the proportion of each entity category, and the most frequently occurring event type. Entity category distribution statistics show the distribution of five entity categories—events, personnel, vehicles, locations, and police resources—within the neighborhood, reflecting the entity composition characteristics of the spatial area. High-frequency event type statistics show the most frequently occurring police incident type among event entities within the neighborhood, reflecting the typical event characteristics of the area. Grid neighborhood information provides spatial context enhancement for implicit inference in large models, enabling the model to perceive the spatial environment characteristics and entity distribution patterns surrounding entities. Traditional large-scale model inference relies solely on the attribute text of entities, lacking spatial contextual information and making it difficult to uncover potential associations dependent on spatial neighborhood features. By introducing grid neighborhood information, large-scale models can combine spatial features such as population density, vehicle traffic, location type, and event frequency around an entity to infer deep associations not explicitly stated in the text. For example, if a person entity appears in a grid neighborhood with a high incidence of theft, and there are multiple suspicious vehicles in the neighborhood, the large-scale model can combine these spatial contextual features to infer a possible implicit association between the person and the theft.

[0047] Step d2: Based on the grid neighborhood information, the distribution of neighborhood entities is encoded into a structured sequence. The structured sequence is then concatenated with the entity attributes, event type constraints, and inference task instructions in the normalized entity set. The structured sequence is inserted after the entity attribute description of the prompt word and before the inference task instructions to generate the prompt word input sequence.

[0048] Furthermore, structured sequence encoding transforms grid neighborhood information into a text sequence format that large models can understand. The encoding process first describes the total number of entities within the neighborhood as a quantity description, then describes the quantity distribution of each type of entity as a category percentage description, and finally describes high-frequency event types as typical event descriptions. For example, the grid neighborhood information of a certain entity can be encoded as follows: there are several entities in the surrounding grid, with event entities having the highest percentage, followed by personnel and vehicle entities; the high-frequency event type is theft, indicating that this area is a high-incidence area for theft. The structured sequence format remains consistent, enabling large models to stably parse the various components of the neighborhood information. The cue word concatenation follows a fixed template, which includes four parts: entity attribute description, grid neighborhood structured sequence, event type constraints, and inference task instructions. The entity attribute description lists the static inherent attributes and dynamic spatiotemporal evolution attributes of the entity to be inferred, allowing the large model to understand the basic characteristics of the entity. The grid neighborhood structured sequence is inserted after the entity attribute description, providing spatial context enhancement information for the large model. The event type constraint section limits the range of association types that the inference focuses on, such as limiting the potential associations between inference events and people, to prevent the large model from outputting irrelevant association types. The inference task instruction section explicitly requires the large model to discover potential implicit associations between entities and output the head entity, relationship type, tail entity, and inference confidence value of the association. The careful design of the prompt word input sequence enables the large model to perform implicit association inference under the condition of enhanced spatial context, significantly improving the ability and accuracy of deep association discovery.

[0049] Step d3: Input the prompt word input sequence into the fine-tuned LLaMA-7B large language model, perform implicit association reasoning, and output the implicit association reasoning result containing head entity, implicit relation type, tail entity, and reasoning confidence value.

[0050] Furthermore, the LLaMA-7B large language model is an open-source large language model based on the Transformer decoder architecture, with a parameter count on the order of seven billion. Pre-trained on a large-scale general corpus, it possesses powerful language understanding and generation capabilities. Model fine-tuning is performed using implicit association annotation data from urban public safety scenarios. This annotation data includes entity attributes, grid neighborhood information, and corresponding manually annotated implicit association triples. Fine-tuning adapts the model to association reasoning tasks in the urban public safety domain, learning domain-specific association patterns and reasoning logic. The fine-tuning process employs a low-rank adaptation method, training only a small number of adapter parameters while keeping pre-trained parameters unchanged, significantly reducing the computational cost of fine-tuning while preserving the model's general language capabilities. During inference, the prompt word input sequence is fed batch by batch into the fine-tuned LLaMA-7B model. The model performs deep semantic understanding of entity attributes, grid neighborhood information, and task instructions in the prompt words through multi-layer self-attention computation. Combining the general knowledge learned in the pre-training stage and the domain association patterns learned in the fine-tuning stage, it infers the potential implicit associations between entities. The model outputs structured association records, each containing a head entity identifier, implicit relation type, tail entity identifier, and inference confidence value. The inference confidence value is the model's probability assessment of the likelihood of the association being true, ranging from 0 to 1; a higher confidence value indicates that the model considers the association more reliable. Implicit relation types include the six association types defined in the ontology schema. The relation types output by the model may include new relation types not defined in the ontology schema, requiring subsequent normalization mapping processing. Large-scale implicit inference can uncover deep potential associations that explicit rules cannot cover, such as inferring associations between people and unmentioned events based on people's activity trajectory patterns and neighborhood event characteristics.

[0051] Step d4: Filter out low-confidence associations in the implicit association reasoning results whose reasoning confidence values ​​are lower than a preset threshold, normalize the implicit relations based on the semantic association types in the ontology pattern, and generate a set of implicit triples with confidence values.

[0052] Furthermore, confidence value filtering is performed based on a preset inference confidence threshold. Records with inference confidence values ​​below the threshold are judged as low-confidence associations and directly removed, while only associations with confidence values ​​above the threshold are retained. The threshold selection is determined based on the trade-off between precision and recall in the business scenario; a higher threshold is selected for scenarios with high precision requirements, and a lower threshold is selected for scenarios with high recall requirements. The filtering operation effectively reduces illusory and erroneous associations generated by the large model's inference, ensuring the overall quality of implicit triples. Normalization mapping maps the implicit relation types output by the large model to the standardized association types defined in the ontology schema. The mapping process is performed based on the semantic similarity of relation type names and a predefined mapping table. For example, the model output of a suspect relation is mapped to an event-related personnel type, a vehicle-related relation is mapped to an event-related vehicle type, a location relation is mapped to an event-related location type, police force relation is mapped to an event-related police resource type, a driver relation is mapped to a personnel-related vehicle type, and a jurisdiction police force relation is mapped to a location-related police resource type. For new relation types that cannot be mapped to the ontology schema definition type, they are marked as relations awaiting manual confirmation and will be processed through subsequent manual review. The implicit associations after normalization mapping are organized in a triple format, with the head and tail entities serving as globally unique identifiers. The relation is a standardized association type, with attributes such as inference confidence value, valid time interval, and grid encoding, generating a set of implicit triples with confidence values. The set of implicit triples complements the set of explicit triples, together constituting complete semantic association knowledge.

[0053] Step S105: Merge the set of explicit triples and the set of implicit triples to generate a deep and shallow semantic association library.

[0054] Specifically, step S105 includes: Step e1: For the set of explicit triples and the set of implicit triples, identify the repeating triples with completely identical head and tail entities and the same relation type based on the global entity identifier. Compare the inference confidence values ​​of each repeating triple group, retain the triple with the largest inference confidence value, delete the remaining repeating triples in each group, and generate the deduplicated triple set.

[0055] Furthermore, duplicate triple identification is performed based on exact matching of three fields: head entity global identifier, tail entity global identifier, and relation type. Explicit and implicit triples may point to the same type of association between the same pair of head and tail entities. For example, the association between an event and a person may be matched by both explicit rules and implicitly inferred by the large model, resulting in two duplicate associations. The identification process groups all triples in the two sets according to head entity identifier, tail entity identifier, and relation type. Triples within the same group constitute a duplicate triple group. For groups containing only one triple, the triple is directly retained. For groups containing multiple triples, the inference confidence values ​​of each triple within the group are compared. The inference confidence value of explicit triples is assumed to be full, while the inference confidence value of implicit triples is the confidence value output by the large model. The triple with the highest inference confidence value is retained as the representative of the group, and the remaining duplicate triples within the group are deleted. This deduplication operation effectively eliminates redundancy in associations between explicit and implicit branches, preventing the same association from being stored repeatedly in the graph. The strategy of retaining high-confidence triples ensures the reliability of the deduplicated associations. When both explicit rules and implicit inference identify an association, explicit triples are retained first because they have higher certainty based on explicit rule matching. The deduplicated triple set gathers all the effective knowledge of explicit and implicit associations and has no duplicate associations, providing a clean association foundation for subsequent attribute supplementation and classification organization.

[0056] Step e2: For the deduplicated triple set, add head entity grid code, tail entity grid code, associated valid time interval and inference confidence value attributes to each triple to generate a triple set with complete attributes.

[0057] Furthermore, the attribute completion process iterates through each triple in the deduplicated triple set, reads the global identifiers of the head and tail entities, queries the spatial grid codes of the corresponding entities from the normalized entity set, and appends the head and tail entity grid codes as spatial attributes to the triple. The effective time interval for association is determined during the explicit association generation stage for explicit triples, and for implicit triples, it is calculated based on the intersection of the dynamic time attributes of the two related entities, ensuring that each triple carries a valid time interval attribute. The inference confidence value is the default full score for explicit triples, and for implicit triples, it is the inference confidence value output by the large model, uniformly appended to the confidence value attribute field of the triple. Each triple after attribute completion contains complete attribute information such as head entity identifier, relation type, tail entity identifier, head entity grid code, tail entity grid code, effective time interval for association, inference confidence value, data source type, and matching criteria. Complete attribute information provides the necessary data input for subsequent triple joint verification. Mesh topology verification requires reading the mesh codes of the head and tail entities, temporal consistency verification requires reading the associated valid time interval and entity timestamp interval, and inference confidence scoring requires reading the inference confidence value. The set of triples with complete attributes allows subsequent verification operations to directly read the required attributes without querying the entity set again, thus improving processing efficiency.

[0058] Step e3: For the set of triples with complete attributes, classify and organize them according to entity category and relation type to generate a deep and shallow semantic association library.

[0059] Furthermore, the classification process first categorizes triples by entity type, dividing them into five main categories: event head entities, personnel head entities, vehicle head entities, location head entities, and police resource head entities. Each main category is then further categorized by relation type; for example, the event head entity category is divided into four subcategories: event-related personnel types, event-related vehicle types, event-related location types, and event-related police resource types. The classification organization uses a multi-level index structure for storage, with the first-level index representing entity types and the second-level index representing relation types. Each leaf node stores a list of triples corresponding to its category. This classification organization enables the deep and shallow semantic association library to have efficient category retrieval capabilities, supporting rapid filtering of associated triples by entity type and relation type. The deep and shallow semantic association library combines surface semantic associations from explicit rule matching with deep implicit associations from large-model inference, achieving full coverage mining of deep and shallow semantics. Each triple in the library carries complete spatiotemporal and confidence attributes, providing a complete association knowledge foundation for subsequent triple joint verification and conflict resolution. The construction of the deep and shallow semantic association database marks the completion of the two-branch semantic mining stage. The association knowledge is transformed from fragmented information in the original data into a structured, attribute-based, verifiable, and standardized set of associations. For example, the association knowledge of a theft incident in the database includes multiple associations such as the suspects involved, the vehicles involved, the location of the incident, and the police forces involved. There are both direct associations based on explicit rule matching and potential associations based on grid neighborhood information inference by a large model, which constitute a complete association knowledge network for the incident.

[0060] Step S106: For the deep and shallow semantic association libraries, read the head and tail entity grid codes, timestamps and implicit triple confidence values ​​respectively, determine topological compliance and temporal logic, and calculate grid topology score, temporal consistency score and inference confidence score.

[0061] Specifically, step S106 includes: Step f1: For the deep and shallow semantic association library, read the mesh codes of the head entity and tail entity in each triple, calculate the prefix matching length of the head entity mesh code and the tail entity mesh code, calculate the Euclidean distance between the center coordinates of the head entity mesh and the center coordinates of the tail entity mesh, determine the topological relationship type of the two entity meshes based on the prefix matching length and the Euclidean distance, the topological relationship type includes containment type, adjacency type, intersection type and isolation type, and query the preset spatial compliance score mapping table based on the topological relationship type and the relationship type of the triple to obtain the mesh topological score.

[0062] Furthermore, grid topology verification assesses the spatial rationality of semantic associations from a spatial dimension, determining whether the spatial positional relationship between the two entities conforms to the spatial constraints expected of this type of association. Prefix matching length calculation aligns the head entity grid code and tail entity grid code bit-by-bit, comparing each bit sequentially starting from the most significant bit. It counts consecutive identical binary digits; a longer prefix matching length indicates that the two entities are closer at the grid level, potentially belonging to the same large spatial region. Euclidean distance calculation is based on the grid center coordinates, which are the latitude and longitude coordinates of the center point of the grid's coverage area. After converting the latitude and longitude to planar coordinates, it calculates the straight-line distance between the two points. A closer Euclidean distance indicates that the two entities are closer in actual spatial location. Topology relationship type determination combines both prefix matching length and Euclidean distance. The "inclusion" type indicates that the grid of one entity is completely contained within the grid of another entity, corresponding to cases with a long prefix matching length and a small Euclidean distance, such as when an event occurs inside a location and the event grid is contained within the location grid. The "adjacency" type indicates that the grids of two entities are spatially adjacent, corresponding to cases with a medium prefix matching length and an Euclidean distance close to the grid's edge length, such as when an event occurs next to a location. Intersection type indicates that the meshes of two entities partially overlap in space, corresponding to cases where the prefix matching length is moderate and the Euclidean distance is less than the mesh side length. Isolation type indicates that the meshes of two entities are spatially separated, corresponding to cases where the prefix matching length is short and the Euclidean distance is large, such as when an event and a person are far apart. The spatial compliance scoring mapping table pre-sets scoring values ​​for different topological relationship types for each type of relationship. For event-related location type, the topological relationship type must be containment or adjacency, because events usually occur within or adjacent to locations; meeting this requirement results in a full score. Intersection types that do not meet the requirement receive a moderate score, and isolation types receive a low score. For event-related police resource type, the topological relationship type must be adjacency or intersection, because police resources are usually deployed in the surrounding area of ​​the event; meeting this requirement results in a full score, and other types are scored according to the degree of deviation. For event-related personnel and event-related vehicle types, the topological relationship type must be containment, adjacency, or intersection; personnel and vehicles should be within or around the event location. For associating personnel with vehicle types and locations with police resources types, the topological relationship type must be either containment or adjacency. The grid topology score quantifies the spatial rationality of the association, providing spatial scoring input for subsequent joint verification. For example, if a theft incident is associated with a person several kilometers away, and the topological relationship is isolation, the grid topology score will be low, indicating that the association may be spatially unreasonable.

[0063] Step f2: For the deep and shallow semantic association library, read the timestamp intervals of the head entity and tail entity in each triple, calculate the intersection duration of the timestamp intervals of the head entity and tail entity, determine the time sequence relationship type based on the intersection duration and the order of the timestamps, the time sequence relationship type includes fully self-consistent type, time sequence inverted intersection type and no intersection type, and obtain the time sequence consistency score by querying the preset time sequence compliance score mapping table based on the time sequence relationship type.

[0064] Furthermore, temporal consistency verification assesses the temporal logical rationality of semantic associations from a time perspective, determining whether the time intervals of the two related entities conform to the time constraints expected of this type of association. Timestamp intervals are derived from the dynamic spatiotemporal evolution attributes of the entities. For event entities, the timestamp interval is the duration from the event's occurrence to its completion; for personnel entities, it's the time interval during which personnel appear at the relevant location; for vehicle entities, it's the time interval during which vehicles travel at the relevant location; for location entities, it's the effective time interval for normal operation; and for police resource entities, it's the time interval for police dispatch and duty. The intersection duration is calculated as the length of the overlapping portion between the timestamp intervals of the head and tail entities. A longer intersection duration indicates a higher degree of overlap between the two entities in the time dimension. The temporal relationship type determination combines the intersection duration and the order of the timestamps. A fully self-consistent type indicates that the time intervals of two entities not only overlap, but their chronological order also conforms to the logical requirements of the association type. For example, an event-related personnel type requires the personnel's appearance time to fall within the event's duration interval, while an event-related police resource type requires the event's occurrence time to be earlier than the police dispatch time, and the police dispatch time to fall within the event's duration interval. A time-reversed, overlapping type indicates that the time intervals of two entities overlap, but their chronological order is the opposite of the logical requirements of the association type. For example, the police dispatch time may be earlier than the event's occurrence time, potentially indicating a time recording error. A non-overlapping type indicates that the time intervals of two entities do not overlap at all; for example, the personnel were not present when the event occurred. The time-series compliance scoring mapping table pre-sets scoring values ​​for various time-series relationship types. A fully self-consistent type corresponds to a full score, a time-reversed, overlapping type corresponds to a lower score, and a non-overlapping type corresponds to the lowest score. The time-series consistency score quantifies the logical rationality of the association in the time dimension, providing time-dimensional scoring input for subsequent joint verification. For associations with overlapping time sequences, although the time order is incorrect, the time intervals overlap. This may be due to time recording discrepancies, and time correction can be performed during the subsequent joint verification phase. For example, if a person's appearance time in an event-related personnel type is later than the event's end time, the time sequence relationship is non-overlapping, resulting in a very low time sequence consistency score, suggesting that the person may be unrelated to the event.

[0065] Step f3: For implicit triples in the deep and shallow semantic association databases, read the inference confidence value output by the large model as the inference confidence score. For explicit triples in the deep and shallow semantic association databases, the inference confidence score is calculated as full score by default.

[0066] Furthermore, the inference confidence score assesses the reliability of associations from a semantic credibility dimension, reflecting the credibility of the association itself. For implicit triples, the inference confidence score directly takes the inference confidence value output by the large model. This value is the probability assessment of the likelihood of the association being true during the inference process, integrating the large model's comprehensive judgment on entity attributes, grid neighborhood information, and contextual semantics. A higher inference confidence value indicates that the large model considers the association more reliable, while a lower value indicates that the large model has less confidence in the association, which may be a hallucinatory or weak association. For explicit triples, since they are generated based on preset ontology rules and explicit matching conditions, the matching process is traceable and logically deterministic. Therefore, the default inference confidence score is full, indicating that explicit associations are completely reliable in terms of semantic credibility. The full confidence setting for explicit triples reflects the deterministic advantage of rule matching over model inference, giving explicit associations a higher credibility priority in subsequent joint verification and conflict resolution. The unified calculation of inference confidence scores enables explicit and implicit triples to have comparable quantitative indicators in the semantic credibility dimension, providing a consistent scoring basis for the subsequent calculation of the score product in the triple joint verification. After all scores in the three dimensions have been calculated, each triple carries three quantitative indicators: grid topology score, temporal consistency score, and inference confidence score, and enters the joint verification score calculation stage.

[0067] Step S107: Calculate the joint verification score based on the grid topology score, temporal consistency score, and inference confidence score; generate a post-verification triplet based on the joint verification score and a preset verification score threshold.

[0068] Specifically, step S107 includes: Step g1: For the grid topology score, temporal consistency score, and inference confidence score, multiply the grid topology score, temporal consistency score, and inference confidence score to obtain the joint verification score of each triple, and generate a set of joint verification scores.

[0069] Furthermore, the joint verification score is calculated by multiplying the three scores instead of by weighted summation. This product method achieves strong coupling constraints across the three dimensions. In the weighted summation method, a high score in one dimension can compensate for a low score in another, allowing spatially unreasonable but highly confident associations to still pass verification. In the product method, a low score in any dimension significantly lowers the joint verification score. For example, if the grid topology score is low, the temporal consistency score is full, and the inference confidence score is full, the product result will still be low, ensuring that only associations that meet the requirements in all three dimensions can obtain a high joint verification score. The product calculation method embodies the core idea of ​​triple joint verification: spatial rationality, temporal logic, and semantic credibility are all indispensable; failure in any dimension should result in a low-quality association. The joint verification score ranges from 0 to 1, with a higher score indicating higher overall quality of the triple across the three dimensions. The joint verification score set records the joint verification score corresponding to each triple in the deep and shallow semantic association databases, providing a quantitative basis for subsequent threshold filtering and bias correction. The strong coupling characteristic of the joint verification score distinguishes the triple verification from the independent threshold filtering of existing technologies. Existing technologies usually set thresholds for spatial and temporal dimensions separately, and the data passes as long as both dimensions exceed their respective thresholds. However, the product method of this invention can capture the synergistic effect between the scores of each dimension, and achieve a more refined quality assessment.

[0070] Step g2: For the joint verification score set and the preset verification score threshold, triples with joint verification scores lower than the preset verification score threshold are marked as invalid associations and removed from the deep and shallow semantic association databases to generate a candidate set of triples after verification.

[0071] Furthermore, threshold filtering is performed based on a preset joint validation score threshold. Triples with a joint validation score below the threshold are judged as low-quality invalid associations and removed from the database. The threshold is selected based on the business scenario's requirements for association quality; a higher threshold is selected for scenarios with high accuracy requirements, and a lower threshold is selected for scenarios with high recall requirements. Removed triples typically have serious problems in one or more dimensions, such as spatially isolated associations with no temporal overlap, resulting in extremely low joint validation scores and clearly erroneous associations. The removal operation directly removes these low-quality associations, preventing them from entering the subsequent conflict resolution and graph construction stages, thus ensuring the overall quality of the knowledge graph. The candidate triple set after verification contains all triples with joint validation scores above the threshold, and these triples meet the basic quality requirements in all three dimensions. Although the triples in the candidate set pass the joint validation score threshold, some triples may have correctable deviations in the temporal dimension. For example, associations with overlapping temporal sequences may have joint validation scores just exceeding the threshold, but their temporal order is problematic, requiring subsequent deviation correction processing. The two-stage processing strategy of threshold filtering and bias correction not only filters out obviously erroneous associations but also preserves and repairs salvageable valid associations, thereby improving the utilization rate of knowledge.

[0072] Step g3: For the candidate set of verified triples, identify triples with a temporal consistency score lower than a preset threshold, read the timestamp intervals of the head entity and tail entity of the triple, take the intersection of the timestamp intervals of the head entity and tail entity as the corrected associated valid time interval, replace the original associated valid time attribute, and generate the verified triples.

[0073] Furthermore, the temporal deviation correction targets triples with low temporal consistency scores but joint verification scores still above the threshold. These associations typically have good quality in the spatial and semantic dimensions, with correctable deviations only in the temporal dimension. The identification process, based on a preset temporal consistency score threshold, marks triples with scores below the threshold as associations requiring correction. Associations requiring correction are often of the temporally inverted, overlapping type, meaning the time intervals of the head and tail entities overlap, but the chronological order does not meet the logical requirements of the association type. This may be due to time recording errors or attribute extraction biases. The correction process reads the timestamp intervals of the head and tail entities of the triple to be corrected, calculates the intersection of the two intervals, and uses this intersection interval as the corrected effective time interval for the association, replacing the original effective time attribute. The intersection interval represents the truly overlapping portion of the two entities' times. Using the intersection as the effective time for the association ensures that the association's time interval falls within the effective time range of both entities, eliminating the temporal inversion problem. For example, if the police dispatch time in the event-related police resource type is earlier than the event occurrence time but the two overlap, the correction sets the effective association time to the intersection of the event occurrence time and the police dispatch end time, ensuring that the police dispatch time falls within the event duration range. After correction, validated triples are generated. These triples undergo triple joint validation and bias correction, meeting quality requirements in spatial, temporal, and semantic dimensions, and then proceed to the subsequent conflict resolution stage.

[0074] Step S108: Identify conflicting triple groups based on the verified triple groups, calculate the comprehensive confidence level based on the conflicting triple groups, and generate a standardized triple group library. The comprehensive confidence level is calculated by weighting four factors: grid matching degree, temporal completeness, inference confidence, and data source authority.

[0075] Specifically, step S108 includes: Step h1: For the validated triples, group them based on the head entity, relation type, and tail entity. The head entity, relation type, and tail entity of each triple in the same group are completely identical. Triples with different attribute values ​​and different sources in the same group are classified into conflicting triple groups to generate a set of conflicting triples.

[0076] Furthermore, conflict identification is the process of discovering multiple triples within a validated triplet that point to the same association but have different attribute information. The grouping process first groups the validated triples according to three fields: head entity identifier, relation type, and tail entity identifier. Triples within the same group point to the same type of association between the same pair of head and tail entities. If a group contains only one triple, the association is considered conflict-free and is directly retained as standard knowledge. If a group contains multiple triples, the attribute values ​​and sources of each triple within the group are further examined. If attribute values ​​differ or sources are different, the group is identified as a conflicting triplet group. Attribute value differences include different association validity time intervals, different grid encodings, and different inference confidence values. Different sources include one from explicit rule matching and another from implicit inference in a large model, or two from different data sources. The conflicting triplet set gathers all conflicting association groups, and each conflicting triplet group contains at least two triples that point to the same association but have inconsistent attribute information. The main causes of conflicts include discrepancies in the descriptions of the same association across multiple data sources, differences in attribute calculations for the same association between explicit rules and large-scale model inference, and deviations in time and location records during data collection. Conflict identification is a necessary step in multi-source knowledge fusion. Only by accurately identifying conflicts can targeted resolution processes be implemented to prevent conflicting knowledge from entering the final knowledge graph and causing contradictions. For example, in the association between an event and a vehicle, the association time recorded in the alarm log data is inconsistent with the association time recorded in the checkpoint vehicle passage data, forming a conflicting triple. Subsequent determination based on comprehensive credibility is needed to decide which record to retain.

[0077] Step h2: For each conflicting triplet group in the conflicting triplet set, calculate the grid matching degree, temporal completeness, inference confidence, and data source authority for each triple within the group. The grid matching degree is the normalized value obtained by dividing the prefix matching length of the head entity grid code and the tail entity grid code by the total length of the grid codes. The temporal completeness is the coverage obtained by dividing the intersection length of the associated valid time interval and the entity timestamp interval by the total length of the entity timestamp interval. The inference confidence is the inference confidence score carried by the triple. The data source authority is based on the data type of the triple's source data, generating a four-factor index matrix.

[0078] Furthermore, the four-factor index calculation quantifies the overall quality of each triple from four dimensions, providing a multi-dimensional quantitative basis for conflict resolution. Grid matching degree measures the degree of spatial matching between the associated entities. It is calculated by dividing the prefix matching length of the grid codes of the head and tail entities by the total length of the grid codes, resulting in a normalized value between 0 and 1. A longer prefix matching indicates a higher spatial matching degree. Temporal completeness measures the degree to which the effective association time covers the entity timestamp interval. It is calculated by dividing the intersection length of the effective association time interval and the entity timestamp interval by the total length of the entity timestamp interval. Higher coverage indicates more complete temporal information in the association. Inference confidence directly takes the inference confidence score carried by the triple. Explicit triples receive a full score, while implicit triples are the confidence values ​​output by the larger model. The authority of the data source is based on preset values ​​for the source data type of the triples. Police report data has the highest authority because it has been officially recorded and reviewed by the public security system. Vehicle passage data from checkpoints has the second highest authority because it is automatically recognized by equipment and has a standardized format. Structured video surveillance data has the next lowest authority due to a certain false detection rate. Data reported by grid workers has relatively low authority because it is manually reported and subject to subjectivity and differences in expression. These four factors comprehensively evaluate the quality of the triples from four perspectives: spatial matching, temporal coverage, semantic credibility, and data authority, avoiding the one-sidedness of a single-dimensional evaluation. The four-factor index matrix is ​​organized by conflicting triple groups, with each row corresponding to one triple within the group and each column corresponding to one factor index, providing structured data input for subsequent weighted calculation of overall credibility.

[0079] Step h3: For the four-factor index matrix, multiply the grid matching degree of each triple by the grid matching degree weight coefficient, the temporal completeness by the temporal completeness weight coefficient, the inference confidence by the inference confidence weight coefficient, and the data source authority by the data source authority weight coefficient, and then sum them to obtain the comprehensive credibility of each triple. The initial values ​​of the four weight coefficients are equal. After each round of conflict resolution, the four weight coefficients are updated and adjusted through Bayesian method to generate the comprehensive credibility ranking of conflict triples.

[0080] Furthermore, the formula for calculating overall credibility is as follows:

[0081] Where W represents the overall credibility. For grid matching degree, For timing integrity, For the sake of reasoning confidence, For the authority of the data source, ω1, ω2, ω3, and ω4 are the weight coefficients corresponding to the four factors. A weighted summation method integrates the four dimensions of indicators according to their weight coefficients into a single comprehensive credibility score, enabling triples with different quality characteristics to be compared on a uniform scale. The four weight coefficients are initially equal, meaning each factor has the same initial importance. As the system runs and human verification feedback accumulates, the weight coefficients are dynamically adjusted to adapt to the actual scenario. Bayesian update is a parameter learning method based on Bayes' theorem, which can dynamically update the probability distribution based on new observation data. After each round of conflict resolution, the verification results of triples marked as pending review are collected as feedback data. Triples confirmed to be retained by humans are used as positive samples, and triples confirmed to be removed by humans are used as negative samples. Based on the value distribution of the four factors in the positive and negative samples, the four weight coefficients are adjusted through Bayesian update. Bayesian updates enable weight coefficients to continuously learn the actual contribution of each factor to association quality under different scenarios. For example, in some scenarios, data source authority is better at predicting association quality than grid matching, and weight coefficients will automatically tilt towards data source authority. Dynamic weight adjustment, unlike the fixed weight conflict resolution of existing technologies, gives the system adaptive learning capabilities, enabling it to continuously optimize the accuracy of conflict resolution. Comprehensive credibility ranking arranges the triples within each group from highest to lowest score, providing a ranking basis for subsequent hierarchical processing.

[0082] Step h4: For the overall credibility ranking of conflicting triples, retain the triple with the highest overall credibility in each conflicting triple group as standard knowledge. If the overall credibility is the same, retain the triple with higher data source authority. Triples with overall credibility below the preset low credibility threshold are directly removed. Triples with overall credibility between the preset low credibility threshold and the preset medium credibility threshold are marked as pending review, thus generating a standardized triple library.

[0083] Furthermore, conflict resolution employs a hierarchical processing strategy, applying different processing operations to conflicting triples based on their overall credibility. For each conflicting triple pair, the triple with the highest overall credibility is deemed the most reliable related knowledge and is directly retained as standard knowledge. If multiple triples have the same overall credibility, the authority of the data source is compared, and the triple with the higher authority is retained, as records from authoritative data sources are generally more accurate. Triples with an overall credibility below a preset low credibility threshold are deemed low-quality conflicting knowledge and are directly removed to prevent them from entering the final graph. Triples with an overall credibility between the preset low credibility threshold and the preset medium credibility threshold are deemed knowledge of questionable quality, marked as pending review, and pushed to manual review for confirmation. After manual confirmation, a decision is made to retain or remove them. This hierarchical processing strategy organically combines automatic processing and manual verification: high-credibility knowledge is automatically retained, low-credibility knowledge is automatically removed, and medium-credibility knowledge is manually reviewed, ensuring knowledge quality while controlling the workload of manual review. The standardized triplet library compiles all conflict-free triples and the standard knowledge retained after conflict resolution. All triples in the library undergo triple joint verification and four-factor conflict resolution, meeting quality requirements in four dimensions: spatial rationality, temporal logic, semantic credibility, and data authority. The standardized triplet library provides a high-quality, conflict-free foundation of associated knowledge for the final construction of the graph topology network. For example, if the combined credibility of three triples in a conflicting triplet group is high, medium, and low respectively, the high-scoring triplet is directly retained, the medium-scoring triplet is marked for manual review, and the low-scoring triplet is directly removed, achieving efficient conflict resolution.

[0084] Step S109: For the standardized triplet library, construct a topological network with entities as nodes, associations as edges, and attributes and credibility as features. Distribute the triplets using grid encoding as a block index to generate a grid block graph.

[0085] Specifically, step S109 includes: Step i1: For the standardized triplet library, construct a topological network with entities as nodes, associations as edges, and attributes and credibility as features.

[0086] Furthermore, the topology network construction transforms entities and associations in the standardized triplet library into a graph structure. Nodes correspond to entities in the normalized entity set, each carrying a globally unique identifier, entity category, set of static inherent attributes, and set of dynamic spatiotemporal evolution attributes as node features. Edges correspond to associations in the standardized triplet library, each carrying relation type, association validity time interval, spatial grid encoding, inference confidence value, and overall credibility as edge features. The direction of edges points from the head entity to the tail entity, forming a directed edge structure. The construction of the topology network transforms knowledge from the flat storage of triples into a traversable and inferable graph structure, supporting advanced analysis operations such as graph-based association queries, path reasoning, and community detection. The feature parameters of nodes and edges in the topology network are organized in a unified format, with attribute and credibility information appended to nodes and edges in key-value pairs, supporting filtering of nodes and edges based on attribute conditions. For example, all event nodes can be filtered by entity category, edges with high credibility can be filtered by overall credibility, and active associations within a certain time period can be filtered by association validity time interval. The graph structure of topological networks enables structured associative reasoning of knowledge, supporting the discovery of related entities by traversing along associated edges from a given entity, and also supporting multi-hop path reasoning to discover indirect relationships between entities. For example, starting from a theft incident node, one can find the suspect node by following the edge of the person involved, and then find the vehicle involved by following the edge of the driver, thus achieving multi-hop associative reasoning from the incident to the person to the vehicle.

[0087] Step i2: Distributed storage of triples using grid encoding as block index. For triples spanning grid blocks, copies are stored in the head entity grid block and the tail entity grid block respectively. A three-level retrieval index is maintained, from grid to entity, entity to association, and association to triple, to generate a grid block map.

[0088] Furthermore, grid-based distributed storage divides the triples in the topology network into multiple independent storage blocks according to spatial grid codes. Each block stores entities and associations falling within the corresponding grid region. The block index uses the grid code as the key, with each grid code corresponding to a storage block. The block stores all entity nodes within that grid region, the associated edges with these entities as head or tail entities, and the corresponding triple data. This distributed storage approach disperses large-scale graphs across multiple storage nodes according to spatial regions, supporting parallel queries and incremental updates, and avoiding the performance bottlenecks and single points of failure issues of centralized storage.

[0089] For triples that span across grid blocks (i.e., associations where the head and tail entities reside in different grids), a dual-replica storage strategy is employed. A copy of the triple is stored in both the grid block containing the head entity and the grid block containing the tail entity. Dual-replica storage ensures that the association can be queried from any entity's grid, avoiding the overhead of accessing multiple storage nodes during cross-block queries. The two copies are linked by a globally unique triple identifier, and updates are performed synchronously to maintain consistency. The three-level retrieval index includes a grid-to-entity index, an entity-to-association index, and an association-to-triple index. The grid-to-entity index supports fast querying of all entities within a region by grid code; the entity-to-association index supports fast querying of all associations a given entity participates in by entity identifier; and the association-to-triple index supports fast querying of the corresponding complete triple data by association identifier. This three-level index enables spatial queries, entity association queries, and triple detail queries of the graph to be completed in constant time complexity, ensuring query efficiency for large-scale graphs. The generation of the grid-block graph marks the completion of the entire spatiotemporal knowledge graph construction process. The graph boasts features such as full semantic coverage across both shallow and deep layers, triple joint verification to ensure quality, four-factor conflict resolution to eliminate contradictions, and grid-based distributed storage supporting dynamic updates. When new spatiotemporal data is added, only the corresponding grid block needs to be locally updated, including adding entity nodes, adding associated edges, and updating attribute features. This eliminates the need for full graph reconstruction, significantly improving the efficiency of dynamic updates. Continuous incremental updates enable the graph to reflect the dynamic changes in entity states and relationships within urban public safety scenarios in real time, providing high-quality real-time knowledge support for spatiotemporal intelligent reasoning, multidimensional data retrieval, and dynamic event analysis. For example, when a new incident occurs in a certain area, only the grid block containing the incident needs to be updated, adding event nodes and related personnel, vehicles, locations, and police force associated edges. Other grid blocks remain unaffected, achieving incremental graph updates within seconds.

[0090] The knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints provided in this embodiment has the following beneficial effects: First, by acquiring a standardized multi-source spatiotemporal data set, an ontology pattern is defined based on the standardized dataset, and multi-level grid codes are assigned to data with spatial coordinates. A bidirectional mapping index table between geographic coordinates and grid codes is established, unifying alarm log data, video surveillance structured data, checkpoint vehicle data, and grid worker reported data into a standardized dataset with consistent time format and coordinate reference, eliminating format differences and coordinate reference differences between multi-source data. Using GeoSOT multi-level grid partitioning rules, unified grid codes are assigned to data with spatial coordinates, establishing a forward mapping from geographic coordinates to grid codes and a reverse mapping from grid codes to data lists. This enables spatial location queries and neighborhood retrieval to be performed efficiently based on grid codes, providing index support for subsequent entity spatial alignment and grid neighborhood information extraction. By leveraging a named entity recognition model to extract spatiotemporal entities and corresponding attributes from a standardized dataset, a fine-tuned BERT-CRF named entity recognition model is used to identify five types of entities: events, people, vehicles, locations, and police resources. Field alignment mapping is performed on structured data to extract static inherent attributes and dynamic spatiotemporal evolution attributes, which are then coupled with grid coding to generate an initial entity set. The overall entity similarity is calculated by integrating three dimensions: textual semantic similarity, temporal label similarity, and grid spatial matching similarity. This comprehensively measures the likelihood of common origin among candidate entities. Candidate entities with similarity values ​​exceeding a preset threshold are classified as common-origin entities, and attribute fusion and deduplication are performed. A globally unique identifier is assigned, generating a normalized entity set. This completely resolves the entity redundancy problem caused by homonyms and synonyms in multi-source data. Secondly, by utilizing explicit association rules based on ontology patterns to generate explicit triple sets based on normalized entity sets, entity pair matching is performed according to six association rules: event-related personnel, event-related vehicles, event-related locations, event-related police resources, personnel-related vehicles, and locations-related police resources. Successfully matched associations are labeled with relationship types and valid time intervals, generating explicit triples with spatiotemporal attributes. Duplicate associations are merged and deduplicated according to time intervals to ensure the efficiency and accuracy of basic association extraction. Grid neighborhood information is obtained by reading a bidirectional mapping index table, encoded into a structured sequence, and concatenated with entity attributes to form prompt words. Implicit associations are mined using a large model based on these prompt words. The distribution information of the 8-neighborhood entities in the grid where the entity is located is queried, encoded into a structured sequence, and inserted after the entity attribute description of the prompt words and before the inference task instructions. This sequence is then input into a fine-tuned LLaMA-7B large language model to perform implicit association inference, filtering low-confidence associations and performing relationship type normalization mapping to generate a set of implicit triples with confidence values. Grid neighborhood information serves as spatial context to enhance the reasoning ability of large models, enabling them to perceive the spatial environmental characteristics and distribution patterns of entities around them, and uncover deep potential relationships not explicitly stated in the text.By merging the sets of explicit and implicit triples, repeating triple groups are identified based on the global entity identifier, and the highest confidence record is retained according to the inference confidence value. After supplementing the complete attributes, the data is classified and organized according to entity category and relation type to generate a deep and shallow semantic association library, achieving full coverage mining of surface explicit semantics and deep implicit semantics.

[0091] Then, by reading the head and tail entity grid codes, timestamps, and implicit triple confidence values ​​from the deep and shallow semantic association databases respectively, topological compliance and temporal logic are determined. Grid topology scores, temporal consistency scores, and inference confidence scores are calculated. Based on the grid code prefix matching length and grid center distance, four types of topological relationships are determined: inclusion, adjacency, intersection, and isolation. The grid topology score is obtained by querying the spatial compliance score mapping table. Based on the intersection and order of timestamp intervals, three types of temporal relationships are determined: complete self-consistency, temporal inversion with intersection, and no intersection. The temporal consistency score is obtained by querying the temporal compliance score mapping table. The inference confidence value of the large model or the full score of the explicit triple is read as the inference confidence score. The association quality is quantitatively evaluated from three dimensions: spatial rationality, temporal logic, and semantic credibility. By calculating a joint verification score based on grid topology scoring, temporal consistency scoring, and inference confidence scoring, and multiplying the three scores to obtain the joint verification score, the product method achieves strong coupling constraints across the three dimensions. A low score in any dimension will significantly lower the total score. Unlike existing technologies that use independent spatial and temporal verification methods, triples with scores below a preset verification score threshold are marked as invalid associations and removed. For triples with low temporal consistency scores, the effective association time is corrected based on the intersection of the head and tail entity timestamp intervals. This process filters out erroneous associations while retaining correctable valid knowledge, generating verified triples. Subsequently, conflicting triplet groups are identified based on verified triplets. These groups are further categorized by head entity, relation type, and tail entity to identify conflicting triplet groups with different attribute values ​​and origins. Four factor indices are calculated: grid matching degree, temporal completeness, inference confidence, and data source authority. The overall credibility is obtained by multiplying each factor by its corresponding weight coefficient and summing the results. The four weight coefficients are initially equal. After each round of conflict resolution, the weight coefficients are dynamically adjusted using Bayesian updates, enabling the system to continuously learn the importance of each factor in different scenarios without requiring manual pre-setting of fixed weights. Triplets with the highest overall credibility in each group are retained as standard knowledge. In cases where overall credibility is the same, triplets with higher data source authority are retained. Triplets below a preset low credibility threshold are directly removed. Triplets between the preset low credibility threshold and the preset medium credibility threshold are marked for review. This achieves an organic combination of automatic processing and manual verification, generating a standardized triplet library, effectively resolving multi-source knowledge conflicts, and ensuring the quality and standardization of the knowledge graph. Finally, by constructing a topological network for the standardized triplet library, with entities as nodes, associations as edges, and attributes and credibility as features, and using grid encoding as a block index for distributed storage of triplets, entities and associations are transformed into a directed graph structure with features, enabling knowledge to have the characteristics of being reasonable and traversable.Distributed storage is implemented using grid encoding as the block index. For triples spanning grid blocks, copies are stored in the head entity grid block and the tail entity grid block respectively. A three-level retrieval index is maintained, connecting grids to entities, entities to associations, and associations to triples. When new spatiotemporal data is added, only the corresponding grid block needs to be updated, without the need for global graph reconstruction. This significantly improves the graph update efficiency and dynamic adaptation capability, generating a grid-blocked graph. By implementing this invention, the problems of insufficient semantic mining depth, fragmented spatiotemporal features, low association accuracy, knowledge conflict redundancy, and lagging dynamic updates in related spatiotemporal knowledge graph construction technologies are solved.

[0092] The above are embodiments of the knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints provided in this application. Other embodiments of the knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints provided in this application are described below.

[0093] This invention also discloses a knowledge graph construction system based on hierarchical semantic reasoning and spatiotemporal joint constraints, such as... Figure 2 As shown, the system includes: The index module is used to obtain a standardized multi-source spatiotemporal data set. It defines an ontology schema based on the standardized dataset and assigns multi-level grid codes to the data with spatial coordinates. It establishes a bidirectional mapping index table between geographic coordinates and grid codes. The ontology schema includes entity categories, attribute dimensions, and association types.

[0094] The extraction module is used to extract spatiotemporal entities and their corresponding attributes based on a standardized multi-source spatiotemporal data set using a named entity recognition model, to obtain an initial entity set, calculate the total entity similarity of each candidate entity in the initial entity set, and determine a normalized entity set based on a preset similarity threshold.

[0095] The explicit mining module is used to perform rule matching based on the normalized entity set using explicit association rules of ontology pattern to obtain a set of explicit triples.

[0096] The implicit reasoning module is used to read the bidirectional mapping index table to obtain grid neighborhood information, encode the grid neighborhood information into a structured sequence and concatenate it with entity attributes to form prompt words, and use the large model to mine implicit associations based on prompt words to obtain a set of implicit triples with confidence values.

[0097] The fusion module is used to merge the sets of explicit triples and implicit triples to obtain a deep and shallow semantic association library.

[0098] The verification module is used to read the head and tail entity grid codes, timestamps, and implicit triple confidence values ​​for deep and shallow semantic association libraries, respectively, to determine topological compliance and temporal logic, and obtain grid topology score, temporal consistency score, and inference confidence score.

[0099] The scoring module is used to calculate the joint verification score based on the grid topology score, the temporal consistency score, and the inference confidence score, and to generate the verified triplet based on the joint verification score and the preset verification score threshold.

[0100] The resolution module is used to identify conflicting triple groups based on the verified triple groups, calculate the comprehensive confidence level based on the conflicting triple groups, and generate a standardized triple group library. The comprehensive confidence level is calculated by weighting four factors: grid matching degree, temporal completeness, inference confidence, and data source authority.

[0101] The construction module is used to build a topological network for a standardized triplet library, with entities as nodes, associations as edges, and attributes and credibility as features. The triplets are distributed and stored using grid encoding as a block index, resulting in a grid-block graph.

[0102] The knowledge graph construction system based on hierarchical semantic reasoning and spatiotemporal joint constraints provided in this embodiment has the following beneficial effects: First, the index module acquires multi-source spatiotemporal data and performs standardized preprocessing, unifying alarm log data, video surveillance structured data, checkpoint vehicle data, and grid worker reported data into a standardized dataset with consistent time format and coordinate reference, eliminating format and coordinate reference differences between multi-source data. Using GeoSOT multi-level grid partitioning rules, a unified grid code is assigned to data with spatial coordinates, establishing a bidirectional mapping index table between geographic coordinates and grid codes, providing a unified data foundation and spatial index support for subsequent modules. The extraction module uses a named entity recognition model to extract spatiotemporal entities and corresponding attributes based on the standardized dataset. A fine-tuned BERT-CRF named entity recognition model is used to identify five types of entities, performing field alignment mapping and attribute extraction and attachment. The system integrates text similarity, temporal similarity, and grid similarity three-dimensional features to calculate the total entity similarity, completing multi-source entity fusion, deduplication, and assigning globally unique identifiers, generating a normalized entity set, and completely solving the problem of multi-source data entity redundancy. Secondly, the explicit mining module utilizes explicit association rules based on ontology patterns to perform rule matching on a normalized entity set. Entity pair matching is completed according to six association rule categories, and relation types and valid time intervals are labeled. Duplicate associations are merged and deduplicated to obtain an explicit triple set, ensuring the efficiency and accuracy of basic association extraction. The implicit inference module reads the bidirectional mapping index table to obtain grid neighborhood information, encodes the distribution of 8-neighborhood entities into a structured sequence, inserts prompt words, and inputs them into the fine-tuned LLaMA-7B large language model to perform implicit association inference. Low-confidence associations are filtered, and relation type normalization mapping is performed to obtain an implicit triple set with confidence values. The grid neighborhood information serves as spatial context, enhancing the deep association mining capability of the large model. The fusion module merges the explicit and implicit triple sets, identifies duplicate triple groups, deduplicates them according to inference confidence values, supplements complete attributes, and categorizes and organizes them to obtain a deep and shallow semantic association library, achieving full coverage mining of both surface explicit semantics and deep implicit semantics. Then, the verification module reads the head and tail entity grid codes, timestamps, and implicit triple confidence values ​​from the deep and shallow semantic association databases respectively to determine topological compliance and temporal logic. Based on the grid code prefix matching length and grid center distance, it determines four types of topological relationships and queries the spatial compliance scoring mapping table to obtain the grid topological score. Based on the intersection and order of timestamp intervals, it determines three types of temporal relationships and queries the temporal compliance scoring mapping table to obtain the temporal consistency score. The inference confidence value or the full score of the explicit triple is read as the inference confidence score, thus completing the quantitative evaluation of association quality from three dimensions. The scoring module multiplies the three scores to obtain a joint verification score. This multiplication method implements strong coupling constraints in three dimensions, eliminating invalid associations below a preset verification score threshold. Effective time correction is performed on temporal deviation triples to obtain verified triples, thus filtering out erroneous associations while retaining correctable valid knowledge.Subsequently, the conflicting triplet groups are identified based on the verified triplets using a resolution module. Conflicts are identified by grouping the head entity, relation type, and tail entity. Four factors—grid matching degree, temporal completeness, inference confidence, and data source authority—are calculated and weighted to obtain the comprehensive credibility. The weight coefficients are dynamically adjusted through Bayesian updates. Retention, removal, and pending verification marking are performed hierarchically according to the comprehensive credibility, resulting in a standardized triplet library. This achieves an organic combination of automatic processing and manual verification, effectively resolving multi-source knowledge conflicts. Finally, the construction module builds a topology network for the standardized triplet library, using entities as nodes, associations as edges, and attributes and credibility as features. Triples are distributed and stored using grid encoding as a block index. A dual-copy storage strategy is adopted for cross-block triples, and a three-level retrieval index is maintained to support local incremental updates of new data, resulting in a grid-block graph. This significantly improves the graph's update efficiency and dynamic adaptation capability. By implementing this invention, the problems of insufficient semantic mining depth, fragmented spatiotemporal features, low association accuracy, redundant knowledge conflicts, and lagging dynamic updates in related spatiotemporal knowledge graph construction technologies are solved.

[0103] The knowledge graph construction system based on hierarchical semantic reasoning and spatiotemporal joint constraints in this embodiment is presented in the form of functional units. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and other devices that can provide the above functions.

Claims

1. A knowledge graph construction method based on hierarchical semantic reasoning and spatiotemporal joint constraints, characterized in that, The method includes: Obtain a standardized multi-source spatiotemporal data set, define an ontology pattern based on the standardized dataset, assign multi-level grid codes to the data with spatial coordinates, and establish a bidirectional mapping index table between geographic coordinates and the grid codes. The ontology pattern includes entity categories, attribute dimensions, and association types. Using a named entity recognition model, spatiotemporal entities and corresponding attributes are extracted from a standardized dataset to generate an initial entity set. The total entity similarity of each candidate entity in the initial entity set is calculated, and a normalized entity set is determined based on a preset similarity threshold. By utilizing explicit association rules of ontology patterns, explicit triple sets are generated based on matching of normalized entity sets; Read the bidirectional mapping index table to obtain grid neighborhood information, encode the grid neighborhood information into a structured sequence and concatenate it with entity attributes to form prompt words, use a large model to mine implicit associations based on the prompt words, and generate a set of implicit triples with confidence values; Merge the sets of explicit triples and implicit triples to generate a deep and shallow semantic association library; For deep and shallow semantic association libraries, the head and tail entity grid codes, timestamps and implicit triple confidence values ​​are read respectively to determine topological compliance and temporal logic, and to calculate grid topology score, temporal consistency score and inference confidence score. The joint verification score is calculated based on the grid topology score, the temporal consistency score and the inference confidence score. The verification triplet is generated based on the joint verification score and the preset verification score threshold. Conflicting triplet groups are identified based on the verified triplet groups. The comprehensive confidence level is calculated based on the conflicting triplet groups and a standardized triplet library is generated. The comprehensive confidence level is obtained by weighting four factors: grid matching degree, temporal completeness, inference confidence and data source authority. For a standardized triplet library, entities are used as nodes, associations as edges, and attributes and credibility as features to construct a topological network. Triples are distributed and stored using grid encoding as a block index to generate a grid block graph.

2. The method based on claim 1, characterized in that, The process of generating the standardized multi-source spatiotemporal data set includes: Acquire alarm log data, structured video surveillance data, vehicle passage data at checkpoints, and data reported by grid workers in urban public safety scenarios, unify the time field to standard timestamps, unify the spatial coordinates to WGS84 latitude and longitude coordinates, and generate a format-normalized dataset. For a format-normalized dataset, data with a field missing rate exceeding a preset threshold are removed. Data with missing key fields are filled by interpolation based on adjacent data from the same data source. Data with completely duplicate data is deduplicated to generate a standardized multi-source spatiotemporal data set.

3. The method based on claim 2, characterized in that, The process of acquiring a standardized multi-source spatiotemporal data set, defining an ontology model based on the standardized dataset, assigning multi-level grid codes to data with spatial coordinates, and establishing a bidirectional mapping index table between geographic coordinates and the grid codes includes: Based on a standardized multi-source spatiotemporal dataset, the corresponding grid code is calculated for data with spatial coordinates according to the GeoSOT multi-level grid partitioning rules. A forward mapping from geographic coordinates to grid codes and a reverse mapping from grid codes to data lists are established, generating a bidirectional mapping index table. Based on standardized multi-source spatiotemporal data sets, urban public safety business scenarios define entity categories and corresponding static inherent attribute dimensions and dynamic spatiotemporal evolution attribute dimensions. The entity categories include event entity categories, personnel entity categories, vehicle entity categories, location entity categories, and police resource entity categories. Define core semantic association types and spatiotemporal constraint criteria to generate ontology patterns. The core semantic association types include event-associated personnel types, event-associated vehicle types, event-associated location types, event-associated police resource types, personnel-associated vehicle types, and location-associated police resource types.

4. The method based on claim 3, characterized in that, The process of using a named entity recognition model to extract spatiotemporal entities and corresponding attributes from a standardized dataset to generate an initial entity set, calculating the total entity similarity of each candidate entity in the initial entity set, and determining a normalized entity set based on a preset similarity threshold includes: The standardized multi-source spatiotemporal data set is input into the fine-tuned BERT-CRF named entity recognition model, which outputs entity fragments labeled with event entity tags, personnel entity tags, vehicle entity tags, location entity tags, and police resource entity tags, generating the initial entity recognition results; Based on the initial entity recognition results, field alignment mapping is performed on the entities in the structured ledger data and vector data, and the corresponding entities in the initial entity recognition results are associated and linked to the police incident number, license plate number, monitoring point number and the initial entity recognition results to generate an entity set with source data identifier; For an entity set with source data identifiers, the static inherent attributes and dynamic spatiotemporal evolution attributes of each entity are extracted based on the attribute dimensions in the ontology schema. The corresponding grid code is obtained by reading the bidirectional mapping index table and the attribute is attached to generate the initial entity set. For the initial entity set, cosine similarity is used to calculate the text similarity between the entity name and attribute description for each pair of candidate entities. The intersection-union ratio of the timestamp intervals is calculated as the temporal similarity, and the weighted value of the grid coding prefix matching length and the grid center distance is calculated as the grid similarity. The total entity similarity for each pair of candidate entities is calculated based on a preset formula. Based on the total entity similarity and a preset similarity threshold, candidate entities with a total entity similarity higher than the preset similarity threshold are identified as homologous entities. Attribute fusion and deduplication are then performed, and each fused entity is assigned a globally unique identifier to generate a normalized entity set.

5. The method based on claim 4, characterized in that, The method of generating an explicit triple set based on normalized entity set matching using explicit association rules of ontology patterns includes: Based on the normalized entity set and explicit association rules in the ontology schema, rule matching is performed on the entity pairs corresponding to the event-related personnel type, event-related vehicle type, event-related location type, event-related police resource type, and location-related police resource type to generate a candidate explicit association set; For the candidate explicit association set, based on the semantic association type in the ontology pattern, each association is labeled with a relation type and an effective time interval. An explicit semantic quintuple consisting of head entity, relation, tail entity, time interval, and grid code is generated. The time interval and grid code are added as attributes to generate an explicit triple set. Based on the set of explicit triples, cases where there are at least two associations of the same type between the head and tail entities of the same pair are merged according to time interval, retaining the association with the largest time span, and generating a set of explicit triples after deduplication.

6. The method based on claim 5, characterized in that, The process involves reading the bidirectional mapping index table to obtain grid neighborhood information, encoding the grid neighborhood information into a structured sequence, concatenating it with entity attributes to form prompt words, and using a large model to mine implicit associations based on the prompt words to generate a set of implicit triples with confidence values, including: For a normalized entity set, read the bidirectional mapping index table to obtain the grid code corresponding to each entity, query the entity distribution information in the 8 neighboring grids of the grid code, and generate grid neighborhood information. The entity distribution information includes the number of entities in the neighborhood, the distribution of entity categories, and the high-frequency event types. Based on grid neighborhood information, the distribution of neighborhood entities is encoded into a structured sequence. The structured sequence is then concatenated with entity attributes, event type constraints, and inference task instructions in the normalized entity set. The structured sequence is inserted after the entity attribute description of the prompt word and before the inference task instructions to generate the prompt word input sequence. Input the prompt word input sequence into the fine-tuned LLaMA-7B large language model, perform implicit association inference, and output implicit association inference results containing head entity, implicit relation type, tail entity, and inference confidence value; Filter out confidence-based associations with a confidence value lower than 0.3 in the implicit association reasoning results, normalize the implicit relations based on the semantic association type in the ontology pattern, and generate a set of implicit triples with confidence values.

7. The method based on claim 6, characterized in that, The merging of the explicit triplet set and the implicit triplet set generates a deep and shallow semantic association library, including: For both explicit and implicit triple sets, based on the global entity identifier, duplicate triple sets with identical head and tail entities and the same relation type are identified. The inference confidence values ​​of each duplicate triple set are compared, the triple with the largest inference confidence value is retained, and the remaining duplicate triples in each set are deleted to generate a deduplicated triple set. For the deduplicated triple set, each triple is supplemented with a head entity grid code, a tail entity grid code, an associated valid time interval, and an inference confidence value attribute to generate a triple set with complete attributes; For a set of triples with complete attributes, they are organized according to entity category and relation type to generate a deep and shallow semantic association library.

8. The method based on claim 7, characterized in that, For the deep and shallow semantic association libraries, the head and tail entity grid codes, timestamps, and implicit triple confidence values ​​are read respectively to determine topological compliance and temporal logic, and to calculate grid topology scores, temporal consistency scores, and inference confidence scores, including: For deep and shallow semantic association libraries, the mesh codes of the head and tail entities in each triple are read. The prefix matching length of the head and tail entity mesh codes is calculated, and the Euclidean distance between the center coordinates of the head and tail entity meshes is calculated. Based on the prefix matching length and Euclidean distance, the topological relationship type between the two entity meshes is determined. The topological relationship type includes containment, adjacency, intersection, and isolation. Based on the topological relationship type and the relationship type of the triple, a preset spatial compliance scoring mapping table is queried to obtain the mesh topological score. In the preset spatial compliance scoring mapping table, each relationship type that meets the spatial compliance constraints has a score of 1, while the corresponding intersection type does not meet the spatial compliance constraints. The spatial compliance constraint score is 0.6, and the corresponding isolation type score is 0.

3. The spatial compliance constraints are as follows: the event-related location type requires the topological relationship type to be one of the inclusion type and the adjacency type; the event-related police resource type requires the topological relationship type to be one of the adjacency type and the intersection type; the event-related personnel type requires the topological relationship type to be one of the inclusion type, the adjacency type and the intersection type; the event-related vehicle type requires the topological relationship type to be one of the inclusion type, the adjacency type and the intersection type; the personnel-related vehicle type requires the topological relationship type to be one of the inclusion type and the adjacency type; and the location-related police resource type requires the topological relationship type to be one of the inclusion type and the adjacency type. For the deep and shallow semantic association library, the timestamp intervals of the head entity and tail entity in each triple are read, and the intersection duration of the timestamp intervals of the head entity and tail entity is calculated. The time sequence relationship type is determined based on the intersection duration and the order of the timestamps. The time sequence relationship types include fully self-consistent type, time sequence inverted overlapping type, and non-overlapping type. The time sequence consistency score is obtained by querying the preset time sequence compliance score mapping table based on the time sequence relationship type. The score corresponding to the fully self-consistent type is 1, the score corresponding to the time sequence inverted overlapping type is 0.4, and the score corresponding to the non-overlapping type is 0.

2. The criteria for determining the fully self-consistent type are as follows: for the event-related personnel type, the personnel appearance time must fall within the event duration interval; for the event-related vehicle type, the vehicle appearance time must fall within the event duration interval; for the event-related location type, the event occurrence time must fall within the location's effective time interval; for the event-related police resource type, the event occurrence time must be earlier than the police dispatch time and the police dispatch time must fall within the event duration interval; for the personnel-related vehicle type, the personnel appearance time and the vehicle appearance time must overlap; and for the location-related police resource type, the police dispatch time must fall within the location's effective time interval. For implicit triples in the deep and shallow semantic association databases, the inference confidence value output by the large model is read as the inference confidence score. For explicit triples in the deep and shallow semantic association databases, the default inference confidence score is calculated as 1.

0.

9. The method based on claim 8, characterized in that, The process of identifying conflicting triplet groups based on verified triplets, calculating the overall credibility of conflicting triplet groups, and generating a standardized triplet library includes: For the validated triples, they are grouped based on the head entity, relation type, and tail entity. The head entity, relation type, and tail entity of each triple in the same group are completely identical. Triples with different attribute values ​​and different sources in the same group are classified into conflicting triple groups, generating a set of conflicting triples. For each conflicting triplet group in the conflicting triplet set, the grid matching degree, temporal completeness, inference confidence, and data source authority of each triplet within the group are calculated. The grid matching degree is the normalized value obtained by dividing the prefix matching length of the head entity grid code and the tail entity grid code by the total length of the grid code. The temporal completeness is the coverage obtained by dividing the intersection length of the associated valid time interval and the entity timestamp interval by the total length of the entity timestamp interval. The inference confidence is the inference confidence score carried by the triplet. The data source authority is based on the data type of the triplet source data, with 1.0 for alarm log data, 0.9 for checkpoint vehicle data, 0.8 for structured video surveillance data, and 0.6 for grid worker reported data. A four-factor index matrix is ​​generated. For the four-factor index matrix, the grid matching degree of each triple is multiplied by the grid matching degree weight coefficient, the temporal completeness is multiplied by the temporal completeness weight coefficient, the inference confidence is multiplied by the inference confidence weight coefficient, and the data source authority is multiplied by the data source authority weight coefficient, and then summed to obtain the comprehensive credibility of each triple. The initial value of the four weight coefficients is 0.

25. After each round of conflict resolution, the four weight coefficients are updated and adjusted through Bayesian method to generate the comprehensive credibility ranking of conflict triples. For the overall credibility ranking of conflicting triples, the triple with the highest overall credibility in each conflicting triple group is retained as standard knowledge. If the overall credibility is the same, the triple with higher data source authority is retained. Triples with an overall credibility lower than 0.4 are directly removed. Triples with an overall credibility between 0.4 and 0.7 are marked as pending review, and a standardized triple library is generated.

10. A knowledge graph construction system based on hierarchical semantic reasoning and spatiotemporal joint constraints, characterized in that, The system includes: The index module is used to acquire a standardized multi-source spatiotemporal data set, define an ontology pattern based on the standardized dataset, assign multi-level grid codes to the data with spatial coordinates, and establish a bidirectional mapping index table between geographic coordinates and the grid codes. The ontology pattern includes entity categories, attribute dimensions, and association types. The extraction module is used to extract spatiotemporal entities and corresponding attributes based on a standardized multi-source spatiotemporal data set using a named entity recognition model to obtain an initial entity set, calculate the total entity similarity of each candidate entity in the initial entity set, and determine a normalized entity set based on a preset similarity threshold. The explicit mining module is used to perform rule matching based on the normalized entity set using explicit association rules of ontology pattern to obtain a set of explicit triples; The implicit reasoning module is used to read the bidirectional mapping index table to obtain grid neighborhood information, encode the grid neighborhood information into a structured sequence and concatenate it with entity attributes to form prompt words, and use a large model to mine implicit associations based on the prompt words to obtain a set of implicit triples with confidence values. The fusion module is used to merge the sets of explicit triples and the sets of implicit triples to obtain a deep and shallow semantic association library; The verification module is used to read the head and tail entity grid codes, timestamps and implicit triple confidence values ​​for deep and shallow semantic association libraries, respectively, to determine topological compliance and temporal logic, and obtain grid topology score, temporal consistency score and inference confidence score. The scoring module is used to calculate the joint verification score based on grid topology score, time series consistency score and inference confidence score, and generate the verification triplet based on the joint verification score and the preset verification score threshold. The resolution module is used to identify conflicting triplet groups based on the verified triplet groups, calculate the comprehensive confidence level based on the conflicting triplet groups, and generate a standardized triplet library. The comprehensive confidence level is obtained by weighted calculation based on four factors: grid matching degree, temporal completeness, inference confidence, and data source authority. The construction module is used to build a topological network for a standardized triplet library, with entities as nodes, associations as edges, and attributes and credibility as features. The triplets are distributed and stored using grid encoding as a block index, resulting in a grid-block graph.