Search

CN-121597662-B - Data processing method and system for dynamic knowledge graph

CN121597662BCN 121597662 BCN121597662 BCN 121597662BCN-121597662-B

Abstract

The invention discloses a data processing method and a system for dynamic knowledge graph, in particular to the technical field of knowledge graph data processing, which are used for solving the problem of consistency of multisource data in a park; the method is directed to a park, system records are normalized to a park event frame carrying object identifications, event types and time information, association is realized through a unified object identification set, sub-graph templates are queried according to the event types, object nodes are positioned and expanded according to template paths, affected sub-graphs are limited, incremental updating is only performed in the range, a time version chain is built for recording writing effective time, failure time and source event identifications, a current state is generated by combining conflict detection of a preset time window and source priority decision, a current view and a historical view are built, additional time filtering conditions are queried, time sequence retrieval of scenes such as equipment operation, lease change and the like is realized, and updating efficiency and data consistency of the park knowledge graph are improved.

Inventors

  • Lu Huiben
  • LU DAN
  • HE JUNHAO
  • LI XIAOFEI
  • REN CHUNJIE
  • WU ZEYU
  • ZHANG DINGYU
  • LIU YANNI

Assignees

  • 上海陟明信息技术有限责任公司

Dates

Publication Date
20260512
Application Date
20260128

Claims (8)

  1. 1. The data processing method for the dynamic knowledge graph is characterized by comprising the following steps of: S1, constructing a park event frame model, and carrying out format unification, field mapping and time alignment on property, access control, parking, energy consumption and park portal service records to generate an event frame sequence carrying an object identifier, an event type and a time stamp; S2, establishing an index table from event types to sub-graph templates, positioning basic object nodes in the knowledge graph according to indexes for each event frame, calling corresponding sub-graph templates, and expanding from the basic object nodes according to template paths to obtain affected sub-graph ranges; S3, local increment updating is executed within the scope of the affected subgraph according to the updating rule associated with the event type, additional writing is performed on newly added nodes and edges, dead time is written in a replaced relation, effective time and source event identification are written in newly added and changed records, and a time version chain is generated according to the object and time sequence; S4, before local increment updating, carrying out conflict detection on candidate states of the same object in a preset time window, selecting a current state writing time version chain based on source priority and event time sequence, and attaching conflict labels to unselected states; S5, constructing a current view and a historical view according to a time version chain in a graph query stage, adding time filtering conditions to a query request, returning only a non-failure state in the current view, and returning a sub-graph matched with the time conditions in the historical view; The event type to sub-template index table in the step S2 takes the event type identifier as an index key, and takes the sub-template identifier as an index value, wherein the sub-template at least comprises a template initial node type, a template path node type sequence and a template path relation type sequence; The template path node type sequence is used for defining node categories sequentially passing from a template initial node, and the template path relation type sequence is used for defining relation categories between adjacent nodes; selecting a corresponding sub-graph template from the index table according to the event type identifier when processing the event frame, and taking a basic object node positioned in the knowledge graph as a template starting node; Performing path expansion in the knowledge graph according to the template path node type sequence and the template path relation type sequence, and determining nodes and relation sets obtained by the path expansion as affected sub-graph ranges corresponding to the event; the local increment updating in the step S3 is executed through an updating rule set associated with the event type, and the updating rule set is divided into three types of a newly added node rule, a relation updating rule and a state recording rule according to the event type; the newly added node rule is used for creating a work order node, an alarm node, a lease relation node or a vehicle passing record node in the affected sub-graph range according to the main object identifier and the association object identifier in the event frame and establishing association with the existing object node; the relation updating rule is used for writing failure time into the original object relation record according to the event state in the affected sub-graph range and newly adding the current effective relation record; The state record rule is used for adding state records to the attributes of the running state, the leasing state and the parking space occupation state of the equipment in the affected sub-graph range without deleting the existing records; The local delta update is defined to be performed within the affected sub-graph scope obtained by the sub-graph template without modifying nodes and relationships outside the affected sub-graph scope.
  2. 2. The method for processing data of dynamic knowledge graph according to claim 1, wherein the campus event frame model in step S1 comprises six fields including event type identification, main object identification, associated object identification set, event occurrence time, source system identification and original service record identification, and the normalization processing comprises unified naming of field names from different service systems, unified conversion of measurement units, calibration of time fields according to unified time standard, and unified coding mapping of internal codes of each system; The generated event frames are arranged according to the event occurrence time sequence to form a time-ordered event frame sequence, and the corresponding relation between the source system identification and the original service record identification is reserved in the event frames.
  3. 3. The method for data processing of dynamic knowledge graph according to claim 1, wherein the object identification mapping and matching rule in step S2 implements unified object positioning by constructing a unified object identification set, the unified object identification being formed by combining an object category identification, an object coding field, an object name field, a spatial location information field, and a device or room type field; when receiving an event frame, firstly inquiring corresponding unified object identifiers in a pre-established coding mapping table according to object coding fields, and when no matching entry exists in the coding mapping table, performing candidate unified object identifier matching according to the combined similarity of an object name field, a spatial position information field and a type field; and positioning the successfully matched object to the corresponding node in the knowledge graph, and creating a new object node in the knowledge graph and writing in a unified object identifier for the unmatched object.
  4. 4. The method of claim 3, wherein the time version chain in the step S3 is formed by state records arranged in time sequence for the same object or the same relationship, and each state record at least comprises effective time, optional failure time, source event identification and state value; Inserting the newly added state record into the tail end of a time version chain of a corresponding object or relation when the local increment updating is executed, writing the failure time of the replaced original state record and keeping the original state record not deleted in the time version chain, grouping the state records of the same object or relation through an object identifier or relation identifier, and sequencing the state records according to the effective time; And establishing a precursor and a subsequent link of adjacent state records according to time sequence to form a time version chain structure of sequential traversal, wherein the time version chain is used as a time index basis for current view construction and historical view construction.
  5. 5. The method for data processing of dynamic knowledge graph according to claim 4, wherein the collision detection in step S4 is determined by using a preset time window, and the preset time window includes a start time offset and an end time offset with respect to an event occurrence time; Retrieving candidate state records with time falling within a preset time window from a time version chain according to the main object identification after receiving the event frame; and determining a record set with inconsistent state values in the candidate state records as a conflict candidate set, recognizing that the current object has state conflict in a time window when the number of the state records in the conflict candidate set exceeds one, and submitting the conflict candidate set to a consistency decision process.
  6. 6. The method for dynamic knowledge graph data processing according to claim 5, wherein the consistency decision in step S4 is performed based on source priority and event time sequence, and corresponding priority is searched in a preset source priority list for each record in the conflict candidate set according to the source system identification; Sorting candidate state records from high to low according to source priority, sorting from near to far according to event occurrence time under the condition of the same source priority, selecting the state record with the highest priority and the nearest time in the sorting result as a current state writing time version chain and marking the state record as a current mark in the corresponding record; The conflict tag field is appended to the unselected state records and kept in the temporal version chain, and the conflict tag field records are overridden by the reason and the type of difference from the current state.
  7. 7. The method for data processing of dynamic knowledge graph according to claim 6, wherein the graph query in step S5 constructs a current view and a history view through a time version chain and rewrites the time condition of the query request; When the current view is constructed, selecting a state record with latest effective time and no written failure time in a corresponding time version chain for each object or relation as a current state; When the historical view is constructed, state records with effective time and ineffective time meeting the condition that the time point falls between the effective time and the ineffective time or the time interval intersects with the recorded effective interval are screened in a time version chain according to the time point or the time interval carried by the query request, the query request automatically adds time filtering conditions according to the selection of the current view or the historical view before entering a graph query engine, so that the query of the current view is only executed on the current state set, and the query of the historical view is executed on the state records meeting the time filtering conditions and returns a corresponding sub graph.
  8. 8. A data processing system for dynamic knowledge-graph, for implementing a data processing method for dynamic knowledge-graph according to any one of claims 1-7, comprising: The event frame construction module is used for constructing a park event frame model, carrying out format unification, field mapping and time alignment on property, access control, parking, energy consumption and park portal service records, and generating an event frame sequence carrying an object identifier, an event type and a time stamp; The influence sub-graph determining module is used for establishing an index table from event types to sub-graph templates, positioning basic object nodes in the knowledge graph according to indexes for each event frame, calling corresponding sub-graph templates, and expanding the basic object nodes according to template paths to obtain an influenced sub-graph range; The rule updating module is used for executing local increment updating within the scope of the affected subgraph according to the updating rule associated with the event type, additionally writing the newly added node and the edge, writing the dead time into the replaced relation, writing the effective time and the source event identifier into the newly added and changed record, and generating a time version chain according to the object and the time sequence; the conflict detection module is used for carrying out conflict detection on candidate states of the same object in a preset time window before local increment updating, selecting a current state writing time version chain based on source priority and event time sequence, and attaching a conflict label to the unselected state; and the view determining module is used for constructing a current view and a historical view according to the time version chain in the view query stage, adding time filtering conditions to the query request, returning only a non-failure state in the current view, and returning a sub-graph matched with the time conditions in the historical view.

Description

Data processing method and system for dynamic knowledge graph Technical Field The invention relates to the technical field of knowledge graph data processing, in particular to a data processing method and system for dynamic knowledge graphs. Background In the field of intelligent park operation management, information systems such as a property management system, an access control system, a parking management system, an energy consumption monitoring system and a park portal system are widely deployed, each system gathers business records to a park data platform in a database synchronization, interface subscription and timing extraction mode, a part of schemes further construct static or semi-static park knowledge maps on the basis, and the functions such as enterprise portraits, equipment accounts, lease relations, parking space occupation and energy consumption statistics are realized. However, the multi-source service system independently generates logs in the form of log records and state snapshots, lacks fine-grained event frame modeling based on unified event time and unified object identification, and is difficult to timely resolve differences among different systems in time reference, coding system and state meanings, so that map updating often depends on batch coverage or global reconstruction, and has lag updating and large calculation cost; on the other hand, the existing atlas is mainly extracted from the current state, lacks a time version chain and conflict resolution mechanism aiming at the same object or relation, is difficult to explicitly record and uniformly judge contradictory states from multi-source systems such as property, access control, energy consumption and the like in the same period, is difficult to flexibly switch between the current view and the historical view, and cannot accurately answer equipment states, lease relations and parking space occupation conditions in a certain time point or time interval, so that the supporting capability of dynamic knowledge atlas in fine operation analysis, responsibility tracing and strategy optimization is weakened. Disclosure of Invention In order to overcome the above-mentioned drawbacks of the prior art, the present invention provides a data processing method and system for dynamic knowledge graph, so as to solve the problem of consistency of multi-source data in a park in the above-mentioned background art. In order to achieve the above purpose, the present invention provides the following technical solutions: A data processing method for dynamic knowledge graph includes the following steps: S1, constructing a park event frame model, and carrying out format unification, field mapping and time alignment on property, access control, parking, energy consumption and park portal service records to generate an event frame sequence carrying an object identifier, an event type and a time stamp; S2, establishing an index table from event types to sub-graph templates, positioning basic object nodes in the knowledge graph according to indexes for each event frame, calling corresponding sub-graph templates, and expanding from the basic object nodes according to template paths to obtain affected sub-graph ranges; S3, local increment updating is executed within the scope of the affected subgraph according to the updating rule associated with the event type, additional writing is performed on newly added nodes and edges, dead time is written in a replaced relation, effective time and source event identification are written in newly added and changed records, and a time version chain is generated according to the object and time sequence; S4, before local increment updating, carrying out conflict detection on candidate states of the same object in a preset time window, selecting a current state writing time version chain based on source priority and event time sequence, and attaching conflict labels to unselected states; s5, constructing a current view and a historical view according to a time version chain in a map query stage, adding time filtering conditions to a query request, returning only a non-failure state in the current view, and returning a sub-graph matched with the time conditions in the historical view. In a preferred embodiment, the campus event frame model in step S1 includes six fields including an event type identifier, a body object identifier, a set of associated object identifiers, an event occurrence time, a source system identifier, and an original service record identifier, and the normalization processing includes unified naming of field names from different service systems, unified conversion of measurement units, calibration of time fields according to a unified time reference, and unified code mapping of internal codes of each system; The generated event frames are arranged according to the event occurrence time sequence to form a time-ordered event frame sequence, and the corresponding relation between the source system ide