A mass unstructured data double-layer knowledge graph construction method and system

By constructing a two-layer structure of internal entity relationship graph and project-level graph, the challenges of document-level and project-level data management in enterprise knowledge graphs are solved, achieving data consistency and continuity of query paths, and improving query flexibility and efficiency.

CN123068653APending Publication Date: 2026-11-10GUANGZHOU ZHANGDONG INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611531704.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing technologies struggle to achieve unified management of document-level and project-level data in enterprise knowledge graph construction, resulting in insufficient query flexibility, low data consistency, and low update efficiency.

Method used

A two-layer structure is constructed, consisting of an internal entity relationship graph and a project-level graph. Two-way linkage is achieved through mapping relationships, with document-level data changes synchronized to the project-level graph and the project-level graph associated with the document-level graph.

Benefits of technology

It improves the efficiency of knowledge graph construction, takes into account query needs at different granularities, and enhances the usability and analyzability of enterprise unstructured document data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068653A_ABST
    Figure CN123068653A_ABST
Patent Text Reader

Abstract

The present application relates to the field of knowledge graph construction, and more particularly to a mass unstructured data double-layer knowledge graph construction method and system, comprising obtaining unstructured documents belonging to at least one project, analyzing document content and identifying project attribution; extracting entity relationship triplets from document content and generating document abstracts; collecting triplets of each document belonging to the same project to construct an internal associated entity relationship graph of the project; aggregating abstracts and triplets of each document belonging to the same project to generate project-level aggregated data and construct a project-level graph; establishing a mapping relationship between the two graphs; synchronizing changes in the fine-grained graph to the corresponding project node in the coarse-grained graph according to the mapping relationship, and associating the project node to all documents of the corresponding project in the fine-grained graph. The present application realizes the consideration of document-level fine-grained query and project-level coarse-grained analysis, and improves the construction efficiency and query flexibility of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of knowledge graph construction technology, and in particular to a method and system for constructing a two-layer knowledge graph from massive unstructured data. Background Technology

[0002] In the field of enterprise knowledge graph construction, there are already some solutions based on document extraction, which construct entity relationship networks from unstructured documents through named entity recognition and relation extraction. These solutions can provide document-level entity association queries at the retrieval level, but business users often need to answer comprehensive analytical questions across documents and projects in practice, such as querying which projects a partner has participated in or which suppliers a department is involved in in a procurement project. To answer these questions, it is necessary to abstract the document-level graph upwards and aggregate it at the project level. Existing solutions typically separate these two types of needs, with one system performing fine-grained document extraction and another system performing project-level statistics. These two systems are built independently and have different data sources, making it impossible for users to continuously drill down from one view to another, and it is also difficult to ensure that the project-level summary information is consistent with the original document-level information.

[0003] Furthermore, existing solutions have several shortcomings in knowledge representation and maintenance mechanisms. At the knowledge representation level, some solutions introduce large language models to generate document summaries. However, these summaries are in free text form and are stored independently from the metadata and entity-relationship triples extracted from the same document. They lack consistency constraints, and the summary content may contradict the structured data. It is also impossible to directly locate the corresponding entities and relationships from the descriptions in the summary. At the project-level summary generation level, multiple versions of the same contract and supplementary agreements modifying the main contract often coexist within the same project. Existing solutions typically aggregate all documents in a flat manner, failing to recognize version inheritance relationships between documents. This results in project-level summaries potentially containing historical information that has been modified or replaced by subsequent documents. At the maintenance mechanism level, documents are continuously added, changed, and obsolete. Existing solutions typically require a full reprocessing of all documents to update the graph after a document change, resulting in a long processing cycle. Moreover, changes to the document-level graph cannot trigger synchronized updates of the project-level aggregated data, making it difficult to guarantee data consistency between the two graph layers. Summary of the Invention

[0004] To address one or more problems in the existing technology, the main objective of this application is to provide a method and system for constructing a two-layer knowledge graph from massive unstructured data.

[0005] To achieve the aforementioned objectives, this application proposes a method for constructing a two-layer knowledge graph from massive unstructured data, the method comprising: Obtain several unstructured documents belonging to at least one project, parse the content of each unstructured document, extract the document content, and identify the project to which the document belongs; Extract entity relation triples from the document content and generate a document summary; The entity relationship triples of each document belonging to the same project are aggregated to construct an internal entity relationship graph of the project; The document summaries and entity relation triples of each document belonging to the same project are aggregated to generate project-level aggregated data for the project, and a project-level graph is constructed. Establish a mapping relationship between the internal entity relationship graph of the project and the project-level graph; Based on the mapping relationship, changes in the internal entity relationship graph of the project are synchronized to the corresponding project nodes in the project-level graph, and the project nodes in the project-level graph are associated with all documents of the corresponding project in the internal entity relationship graph of the project.

[0006] This application also provides a system for constructing a two-layer knowledge graph from massive unstructured data, including: The acquisition module is used to acquire several unstructured documents belonging to at least one project, perform content parsing on each unstructured document, extract the document content, and identify the project to which the document belongs; The information extraction module is used to extract entity relation triples from the document content and generate a document summary; The first graph construction module is used to collect the entity relationship triples of each document belonging to the same project and construct an internal association entity relationship graph of the project. The second graph construction module is used to aggregate the document summaries and entity relationship triples of each document belonging to the same project, generate project-level aggregated data of the project, and construct a project-level graph. The mapping relationship establishment module is used to establish the mapping relationship between the internal entity relationship graph of the project and the project-level graph. The linkage update module is used to synchronize changes in the internal entity relationship graph of the project to the corresponding project nodes in the project-level graph according to the mapping relationship, and to associate the project nodes in the project-level graph with all documents of the corresponding project in the internal entity relationship graph of the project.

[0007] This application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described above.

[0008] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0009] The method and system for constructing a two-layer knowledge graph for massive unstructured data in this application constructs a project-level internal entity relationship graph and a project-level graph. This enables the system to support both fine-grained entity relationship queries at the document level and coarse-grained global analysis at the project level, overcoming the limitations of a single-granularity graph in terms of query flexibility. A mapping relationship is established between the two graphs, enabling bidirectional interaction. When document-level data changes, the corresponding project nodes in the project-level graph are updated synchronously. Project nodes in the project-level graph are also associated with all documents and entity relationships belonging to that project in the document-level graph. This avoids the resource consumption of full reconstruction and ensures data consistency and query path continuity between the two graphs. Therefore, this method improves the efficiency of knowledge graph construction while addressing query needs at different granularities, enhancing the usability and analyzability of enterprise unstructured document data. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating a method for constructing a two-layer knowledge graph from massive unstructured data according to an embodiment of this application. Figure 2 This is a flowchart illustrating a method for constructing a two-layer knowledge graph from massive unstructured data according to another embodiment of this application. Figure 3 This is a schematic block diagram of a two-layer knowledge graph construction system for massive unstructured data according to an embodiment of this application; Figure 4 This is a schematic block diagram of the structure of a computer device according to an embodiment of this application.

[0011] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0013] Reference Figure 1 This application provides a method for constructing a two-layer knowledge graph from massive unstructured data, the method comprising: S1. Obtain several unstructured documents belonging to at least one project, parse the content of each unstructured document, extract the document content, and identify the project to which the document belongs. S2. Extract entity relation triples from the document content and generate a document summary; S3. Collect the entity relationship triples of each document belonging to the same project and construct an internal entity relationship graph of the project; S4. Aggregate the document summaries and entity relationship triples of each document belonging to the same project to generate project-level aggregated data for the project, and construct a project-level graph; S5. Establish the mapping relationship between the internal entity relationship graph of the project and the project-level graph; S6. Based on the mapping relationship, synchronize the changes in the internal entity relationship graph of the project to the corresponding project nodes in the project-level graph, and associate the project nodes in the project-level graph with all documents of the corresponding project in the internal entity relationship graph of the project.

[0014] As described in steps S1-S3 above, several unstructured documents from within the enterprise are first acquired. Each of these documents belongs to at least one project. The sources of these documents can include file systems, document management platforms, or business system interfaces. Common document formats include PDF, Word, and Excel. For each acquired document, the system parses its content, converting the original binary or compressed format into readable plain text for subsequent information extraction operations. Simultaneously, the system needs to identify the project to which each document belongs. This project affiliation information can be identified in various ways, such as reading the project number from the document's metadata fields, parsing the project identifier from the document's directory path, or leveraging the document-project relationship recorded in the document management system. This lays the foundation for all subsequent data processing at the project level, such as grouping documents under the same project together or aggregating knowledge information by project. Without this project affiliation identification, subsequent collection and aggregation operations cannot be carried out at the project level.

[0015] After obtaining the plain text content of each document, structured knowledge units need to be extracted from this text. Specifically, on the one hand, core business entities are extracted from the document text through entity recognition. Common types include organization names, material names, monetary values, time nodes, project names, and personnel names. On the other hand, business relationships between these entities are identified through relation extraction, such as signing relationships, supply relationships, procurement relationships, attribution relationships, and responsibility relationships. Entity recognition and relation extraction can be used in conjunction to organize the business knowledge in each document into several subject-predicate-object structural expressions, i.e., entity-relationship triples. At the same time, the system also needs to generate a document summary for each document to summarize its core content. The summary generation here differs from conventional text summarization; its generation method and subsequent binding relationship with entity-relationship triples will be explained in detail in later embodiments. Transforming the originally unstructured document content into a structured knowledge representation not only preserves the key information in the original text but also enables the computer system to perform graph-structured storage and retrieval processing.

[0016] After obtaining the entity relationship triples for each document, the first-layer graph is constructed: the project-internal entity relationship graph. This is based on the project information identified in S1: all entity relationship triples corresponding to documents belonging to the same project are grouped under the same project boundary. These triples are then used to construct a fine-grained knowledge network in the graph database, with documents and entities as nodes and relationships between entities as edges. The key feature of this graph is its fine granularity, preserving details of entity relationships within documents and between different documents within the same project. For example, users can use this graph to query fine-grained questions such as which materials are involved in a contract or how much goods a supplier provided in multiple documents for a project. This constructs a project-boundary knowledge network supporting fine-grained queries, providing the data structure foundation for subsequent document-level queries and tracing.

[0017] As described in steps S4-S6 above, S3 constructs a fine-grained document-level graph. However, relying solely on this graph for project-level queries requires multiple hops through a large number of entities and relationships, resulting in low efficiency. Therefore, this method also constructs a second-layer graph, namely a project-level graph. This step uses projects as the basic granularity, aggregating document summaries and entity relationship triples belonging to the same project to the project level, generating project-level aggregated data for each project. The aggregated content can include information such as the project's total amount summary, core partner list, key time nodes, and document quantity statistics. Based on this aggregated data, the system constructs a coarse-grained knowledge network with projects as nodes. Each project node is associated with the project's aggregated statistics and global summary. This graph is characterized by its coarse granularity and a significantly smaller number of nodes than the fine-grained graph, making it suitable for answering comprehensive cross-project analysis questions. It provides a knowledge network that supports coarse-grained queries and cross-project analysis, complementing the fine-grained graph in S3.

[0018] In steps S3 and S4, two graphs with different granularities are constructed, but these two graphs currently exist independently. To enable them to work collaboratively, a mapping relationship needs to be established between them. Essentially, this mapping relationship establishes a structured correspondence between document-level data and project-level data: each document and its entity relationships in the fine-grained graph can be located to the corresponding project node in the coarse-grained graph through this mapping relationship; conversely, each project node in the coarse-grained graph can also be associated with all documents and their entity relationships belonging to that project in the fine-grained graph through this mapping relationship. Establishing this mapping relationship can be achieved in various ways, such as using project identifiers as association keys to record the correspondence between project nodes and document nodes in a relational database, or directly establishing cross-level association edges in a graph database. Regardless of the specific implementation method, this mapping relationship is the structural foundation for realizing the linkage between the two graphs; it is equivalent to building a two-way bridge between the two graphs.

[0019] After the mapping relationship is established, this bridge can be used to perform specific bidirectional linkage operations. Forward linkage means that when document-level data in the fine-grained graph changes—for example, a document is modified or a new document is added—the system finds the corresponding project node in the coarse-grained graph based on the mapping relationship, and then synchronously updates the aggregated data of that project node, ensuring the project-level graph remains up-to-date. Reverse linkage means that when a user views a project node in the coarse-grained graph, the system can directly link it to all documents and entity relationships belonging to that project in the fine-grained graph based on the mapping relationship, thus supporting continuous queries from the project-level view down to document-level details. Through the combination of steps S5 and S6, the two graphs are no longer independent data silos, but form a two-layer linkage architecture with shared data sources, synchronized updates, and interoperable queries, preserving both the query accuracy of the fine-grained graph and the analytical efficiency of the coarse-grained graph.

[0020] As described above, by constructing a two-layer structure—an internal project-level entity relationship graph and a project-level graph—the system can support both fine-grained entity relationship queries at the document level and coarse-grained global analysis at the project level, overcoming the limitations of a single-granularity graph in terms of query flexibility. A mapping relationship is established between the two graph layers, enabling bidirectional interaction. When document-level data changes, the corresponding project nodes in the project-level graph are synchronously updated. Conversely, project nodes in the project-level graph are linked to all documents and entity relationships belonging to that project in the document-level graph. This avoids the resource consumption of full reconstruction and ensures data consistency and query path continuity between the two graph layers. Therefore, this method improves the efficiency of knowledge graph construction while addressing query needs at different granularities, enhancing the usability and analyzability of enterprise unstructured document data.

[0021] Reference Figure 2 In one embodiment, generating a document summary includes: S21. Obtain the document type and metadata of the document, wherein the metadata includes document ownership information; S22. Based on the document type of the document, select the corresponding template from a plurality of preset prompt word templates, and fill the metadata into the corresponding fields in the template to generate prompt words; S23. Input the prompt words into a preset large language model and constrain the large language model to output a business summary in a structured format, wherein the business summary includes six types of information: business subject, business behavior, business target, business value, business time, and management affiliation. S24. Using the document identifier as the association key, associate and store the business summary with the entity relationship triple and the metadata to obtain the document summary.

[0022] As described above, before generating the summary, it is necessary to obtain the document's type information and metadata. Document type identification can be completed in the document classification stage before this step, or it can be determined in real-time based on the document content during this step. Common document types include project documents, contract documents, procurement documents, and office documents. Different types of documents may have different focuses when generating the summary. Metadata mainly includes document ownership information, such as which project the document belongs to, which department it belongs to, and who the responsible person is. This document type and metadata information will be used in subsequent steps to guide the direction of summary generation, enabling the summary to output different business descriptions with different focuses for different types of documents. After obtaining the document type and metadata, a matching template is selected from several preset prompt word templates based on the document type. A prompt word template is a pre-designed guiding text with some replaceable field positions. These field positions correspond to various information in the metadata, such as project name, partner name, contract amount, and signing date. After filling the values ​​of the corresponding fields in the metadata into these positions in the template, a complete prompt word is formed. This prompt word is then fed into a large language model to drive the model to generate the summary. By pre-configuring templates, the scope and direction of subsequent summary generation are pre-defined within business-related domains, preventing large language models from outputting irrelevant content without guidance. Simultaneously, embedding metadata into the templates allows the model to accurately understand key facts such as the document's project affiliation, amount, and subject when generating summaries, ensuring consistency between the generated summary content and the factual information in the metadata. Compared to allowing the model to read the entire document and generate summaries freely, this template- and metadata-based approach offers significant advantages in terms of output controllability and factual consistency.

[0023] The prompts generated in the previous step are input into the large language model, which then generates corresponding text output based on the prompts. However, this step involves more than just feeding the prompts into the model; more importantly, it constrains the model's output format, requiring it to output a business summary in a structured format. This structured format means the summary content must include six categories of information: business entity, business behavior, business target, business value, business time, and management affiliation. In other words, the model output is not free text, but a structured description containing these six dimensions. For example, it specifies who the contracting entity is, what business behavior occurred, what the target is, the amount and quantity involved, the specific time of the business transaction, and the document's management affiliation. By explicitly requiring the model to output according to the specified format and dimensions in the prompts, and combining this with the large language model's own instruction-following capabilities, the output meets business requirements in terms of semantic content and satisfies the needs of subsequent processing in terms of data format. Compared to traditional solutions where the summary exists only as free text, the structured output summary is easier for subsequent computer processing to parse, retrieve, and aggregate, laying the data format foundation for later association and storage of the summary with entity relation triples and metadata. In the process of generating summaries, the large language model relies on its language understanding and summarization capabilities, acquired through training on a large amount of text, to accurately extract the core content of the document. On the other hand, it is constrained by the format constraints and dimensional requirements in the prompt words. During the output generation process, it is continuously guided by these constraints, so that the final output fully covers the six dimensions in terms of content and has consistency in terms of format. This allows it to be aggregated and analyzed in subsequent projects according to the same structure.

[0024] The generated business summary, entity relation triples, and metadata extracted from the document are linked and stored using the document identifier as the association key. The document identifier is a unique identifier used to identify the document within the system. Throughout the process, metadata, entity relation triples, and the business summary are all organized and stored under this identifier. Specifically, this information can be stored in the same table or multiple tables linked by foreign keys in a relational database, or in a graph database, summary and metadata can be attached as attributes to document nodes. The core function of using the document identifier as the association key is that when subsequently needing to find the summary, entity relations, or metadata of a document, all three types of information can be quickly located using the same identifier. Similarly, when a user drills down to a document using a project-level graph, all structured information of that document can be retrieved at once using this association key. This ensures that the three types of information can be managed, updated, and retrieved as a whole. Without this step, there is no unified association key between metadata, digest, and triples. They are stored independently, requiring additional association logic for subsequent data consistency checks or cross-category queries, which increases the complexity of the system and the possibility of errors.

[0025] In one embodiment, constructing the internal entity relationship graph of the project includes: The entities in the entity relationship triples of each document belonging to the same project are taken as entities to be processed; Perform exact string matching between each entity to be processed and the standard entity name in the pre-set alias dictionary; Based on the matching results, the entities that successfully match will be named using the standard entity name as the merged entity name; For each entity to be processed that failed to achieve an exact match, based on the type attribute of the entity in the entity relationship triple, the semantic vector similarity between entity names is calculated among entities of the same type, and those with similarity reaching a preset threshold are selected as candidate merging pairs. Perform rule verification on each candidate merge pair, merge the entities in the candidate merge pairs that pass the rule verification into the same entity node, and update the relationship pointers in the graph.

[0026] As mentioned above, during graph construction, entity relation triples have been extracted from documents belonging to the same project. These triples contain various business entities identified in the document, such as organization name, material name, and personnel name. Before writing these entities into the graph database, they need to be aligned and merged. This step extracts all entities scattered across different documents, serving as the set of objects to be processed in subsequent alignment operations. Different documents may contain multiple different representations pointing to the same business object. If they are not compared together beforehand, redundancy will occur when multiple nodes refer to the same thing when writing them into the graph. After obtaining the set of entities to be processed, the first level of alignment is exact matching, which involves a complete string comparison between each entity name and the standard entity name in a pre-defined alias dictionary. The alias dictionary records the standard names of various business entities known to the enterprise and their common aliases. For example, the standard name is the full name of a company, and the dictionary also records various abbreviations commonly used by the company in internal documents. When the name of an entity to be processed is exactly the same as a standard name or alias in the dictionary, it can be directly classified as that standard name. The principle is a complete string comparison; no additional text processing is required, simply determining if two strings are completely identical. The dictionary can be pre-maintained by business personnel or automatically generated by mining equivalence relationships between entities from historical documents. The advantage of exact matching is high accuracy, preventing misclassification of different entities as the same entity. The disadvantage is that it can only cover aliases already registered in the dictionary; it cannot handle unseen aliases appearing for the first time.

[0027] After precise matching, successfully matched entities have obtained corresponding standard entity names. These entities will be uniformly identified using these standard names as node identifiers when subsequently written to the graph database. While this step is simple in itself, its purpose is to complete the merging of a portion of entities with minimal computational cost while ensuring accuracy. Entities not covered by precise matching may refer to known business objects but using new aliases not included in the dictionary, or they may refer to entirely new business objects that have never appeared in historical data. For these entities, semantic vector similarity is used for further processing. The prerequisite for this processing is to first classify entities based on the type attributes recorded in the entity relation triples, comparing only entities of the same type, such as comparing organizations with organizations, or materials with materials, to avoid incorrectly including entities of different semantic types in the same candidate set. Specifically, during the comparison, the name text of each entity is input into the semantic vector model and converted into a fixed-length vector representation. The smaller the angle between the vectors of two entity names, the closer the two names are semantically. The system calculates pairwise vector similarity between all entities of the same type. When the similarity exceeds a preset threshold, the two entity names are considered to point to the same business object, and they are output as candidate merge pairs. The design logic relies on the generalization ability of the semantic vector model to identify different expressions that have never appeared in the dictionary but are semantically clearly pointing to the same object. Large language models or specialized semantic vector models, through training on large corpora, have the ability to map semantically similar texts to similar positions in the vector space. The drawback of simply using vector similarity is that there may be erroneous merging. Therefore, this solution positions it as a candidate generation stage rather than a final decision stage—first, potential merge pairs are identified through vector similarity, and then further confirmed by subsequent rule verification to prevent erroneous merging from taking effect.

[0028] For the generated candidate merge pairs, a final layer of verification is required: rule verification. Rule verification is based on business logic, such as checking whether the two entities have the same type, whether their business registration information matches, and whether they appear in the same business context. Only candidate merge pairs that pass rule verification are ultimately merged into a single entity node. During merging, the name with higher frequency of occurrence or higher dictionary matching is used as the node name. After merging, the existing relationship pointers in the graph need to be updated. All relationship edges pointing to the merged old entity node are redirected to the new merge node, and the old node is deleted to ensure that the connectivity of the graph is not affected. By superimposing precise constraints of business rules on the generalized recall of vector similarity, the merging decision can cover newly emerging alias forms without causing incorrect merging of different entities due to misjudgment of semantic vectors.

[0029] In one embodiment, synchronizing changes in the internal entity relationship graph of the project to the corresponding project node in the project-level graph according to the mapping relationship includes: In response to changes in documents within the project's internal entity relationship graph, calculate the differences between the changed document and the original document. Based on the aforementioned discrepancy information, only the entities and relationships involved in the changed documents are partially updated in the project's internal entity relationship graph. Based on the mapping relationship, the project node in the project-level graph corresponding to the project to which the change document belongs is located, and incremental updates are performed on the project-level aggregated data of the project node based on the difference information, wherein the incremental update only updates the data items involved in the difference information.

[0030] As mentioned above, when a document in the project's internal entity relationship graph changes, a response is required. Document changes can manifest as content modification, deletion, or the addition of a new document. After a change occurs, the system needs to calculate the differences between the modified and original documents. This calculation can be based on a comparison of document content. For modification scenarios, the range of differences can be determined by comparing the document versions before and after the change, dividing the document content into added, deleted, and retained parts. This is then mapped to changes in entity relationships and metadata, such as which entities were added, which relationships were deleted, and which attribute values ​​changed. For addition scenarios, the original document was empty, and the difference information is the entire content of the document. For deletion scenarios, the new document is empty, and the difference information is the removal of the entire document's content. Document-level difference detection transforms the coarse-grained event of document change into specific, fine-grained change items that can be processed by subsequent steps. Without this step, subsequent update operations would have to be processed on a per-document basis, preventing true incremental updates. After obtaining the discrepancy information, instead of reprocessing the entire document to update the graph, a local update is performed only on the scope affected by the discrepancy information. Specifically, newly added entities and relations are written to the graph, modified entity attributes or relation attributes are updated with new values, and deleted entities and relations are removed from the graph. The discrepancy information is mapped to a specific set of operations on the graph database, updating in a way that precisely matches the scope of changes, rather than re-extracting the entire document. This ensures that the update scope of the fine-grained graph is strictly limited to the actual changes in the document, avoiding unnecessary computational overhead. Furthermore, since the update operation is performed with the change boundaries clearly known, the updated graph state is logically equivalent to the state obtained by directly reprocessing the entire document, but the amount of data processed and the time consumed are significantly reduced.

[0031] After the fine-grained graph is updated, the project node corresponding to the project in the project-level graph of the changed document needs to be found through the previously established mapping relationship. Then, based on the difference information, the aggregated data of the project node is adjusted accordingly, and this adjustment also follows the incremental principle, updating only the data items involved in the difference information. For example, if the contract amount of a document is changed from 5 million yuan to 6 million yuan, then in the project-level graph, only the total cooperation amount of the project needs to be increased by 1 million yuan, without having to re-traverse all documents under the project and sum them. If a document adds a new partner entity, then only the partner needs to be added to the partner list associated with the project node. If a document is deleted, then only the aggregated data previously contributed by that document needs to be deducted from the project node. Changes in the fine-grained graph are passed to the coarse-grained graph through mapping relationships, keeping the two graphs consistent. Its function is to ensure that any changes at the document level are automatically reflected at the project level. The project-level graph always reflects the latest aggregation status of each project, and there will be no inconsistency where the document-level data has been updated but the project-level aggregation data still remains the old version.

[0032] It's worth noting that there's a clear causal dependency between Step 2 and the partial update in Step 3. The partial update is completed within the project's internal entity relationship graph, and its results are only reflected at the fine-grained level. The nodes in the project-level graph remain in their pre-change aggregated state and haven't yet perceived the changes at the fine-grained level. The purpose of Step 3 is to transmit the update results from Step 2 to the coarse-grained graph through mapping relationships, ensuring that project-level nodes also update their aggregated data synchronously. Together, these two steps constitute a complete two-layer, interconnected incremental update process. If only Step 2 is present and Step 3 is missing, the fine-grained graph will be updated, but the project-level graph won't update synchronously, leading to data inconsistency between the two graphs. Conversely, if only Step 3 is present and Step 2 is missing, the mapping relationships lack any transferable changes, making it impossible to execute the incremental update of the project-level graph. The two steps are causally linked, jointly ensuring data consistency between the two graphs.

[0033] This embodiment addresses the problem of efficiently updating a two-layer knowledge graph in document change scenarios. Conventionally, once a document changes, the entire document's content needs to be reprocessed to update the graph. This approach is time-consuming and resource-intensive, especially when dealing with a large number of documents or long documents. More importantly, even after the fine-grained graph is updated, project-level aggregated data often requires full recalculation, preventing synchronized updates between document and project levels. The core design logic of this solution starts with the change event and refines and transmits the update content layer by layer. The first step transforms the abstract event of document change into concrete difference information, allowing subsequent operations to clearly understand the boundaries and scope of the change. The second step performs local updates at the fine-grained level, enabling the document-level graph to achieve the same state as a full reprocessing with minimal operational cost. The third step locates and incrementally updates the aggregated data of project nodes at the coarse-grained level through mapping relationships, allowing the project-level graph to synchronously reflect the document-level change results with minimal computational cost. A key constraint in this embodiment is that each layer's update is a local operation driven by difference information, precisely controlling the update boundaries at its respective level. Discrepancy information serves as the boundary condition for precise updates at the fine-grained level and as the data source for incremental adjustments at the coarse-grained level. The two-layer knowledge graph is linked through mapping relationships, enabling document changes to be propagated layer by layer from fine-grained to coarse-grained in the two-layer structure, ultimately achieving consistent updates from local changes in a single document to the entire two-layer knowledge graph.

[0034] In one embodiment, the step of responding to a change in a document within the project's internal entity relationship graph and calculating the difference information between the changed document and the document before the change includes: Receive a document addition event, calculate the content hash value of the new document, and based on the calculation result, query whether there are documents with the same hash value in the internal related entity relationship graph of the project; If it exists, then abandon the subsequent processing of the newly added document; If it does not exist, perform document content parsing on the newly added document, extract entity relation triples, and generate a document summary; Write the entity relationship triple of the newly added document into the internal association entity relationship graph of the project, create document nodes and entity relationship edges, and create the affiliation relationship between the document node and the project node corresponding to the project to which the document belongs; Based on the mapping relationship, locate the project node in the project-level graph that corresponds to the project to which the document belongs, aggregate the document summary and entity relationship triple of the newly added document into the project-level aggregated data of the project node, and update the project global summary and aggregated statistics of the project node.

[0035] As mentioned above, when a new document is added to the system, the system first receives the addition event. For this new document, the system calculates a hash value for its content. A hash value is a fixed-length digital fingerprint generated based on the document content using a specific mathematical algorithm. Documents with the same content will calculate the exact same hash value, while documents with different content, even differing by only one character, will produce drastically different hash values. Subsequently, using this hash value as a query condition, the system searches the existing internal entity relationship graph of the project to see if there are any documents with the exact same hash value. The technical principle behind this step is the uniqueness and determinism of hash values. The nature of the hash algorithm itself determines that the same input will inevitably produce the same output; therefore, the result of this query is deterministic, eliminating probabilistic misjudgments. This makes hash-based deduplication fundamentally more reliable than deduplication methods based on filenames or document paths. Its function is to set up a pre-filter before entering any resource-intensive processing flow. If the content of a document already exists in the graph, then no matter how many times it is submitted repeatedly, it will not trigger subsequent extraction and writing operations.

[0036] If the query results show that a document with identical content already exists in the graph, it means that the newly added document is actually a duplicate. In this case, the system will abandon further processing of the document; that is, it will not continue with subsequent operations such as parsing, extraction, writing to the graph, and updating aggregated data. At the same time, the new document itself will not be written to the storage system, nor will it consume the computing resources involved in subsequent steps. This eliminates the unnecessary storage of duplicate documents and the ineffective consumption after storage. Without this check, when the same document is submitted multiple times, the system will repeatedly perform entity extraction, relation extraction, summary generation, and graph writing operations, and the consumption of these operations will accumulate continuously with a large number of repeated submissions. If the hash query results show that no document with the same content exists in the graph, it means that this is a truly new document. Only then will the complete processing flow for this document begin: first, the document content is parsed to extract the plain text content; then, entity relation triples are extracted from the text to identify the core entities involved in the document and their relationships; simultaneously, a summary of the document is generated to summarize the core business information of the document. The technical principle is path selection: based on the boolean value of the hash query result, a unique choice is made between two branches. One branch corresponds to the endpoint where all subsequent operations terminate, and the other branch corresponds to the starting point where the complete processing flow begins. Only new documents that pass the hash deduplication verification will enter the entity extraction and graph writing stages; old documents with existing hash values ​​are directly filtered out.

[0037] The processed document is confirmed to be a genuine new document, and its extracted entity relation triples need to be written into the project's internal entity relation graph. Specific operations include creating a document node corresponding to the document in the graph, creating or associating entity nodes for each entity, and creating relational edges between entity nodes. Furthermore, it is necessary to create a hierarchical relationship between the document node and the project node corresponding to the project to which the document belongs, for example, connecting them with a BELONG_TO type relationship, so that the document explicitly belongs to its project in the graph. The structured knowledge extracted from the unstructured document is entityized into the graph database, transforming the knowledge from textual form into nodes and edges that can be retrieved using a graph query language. The explicit establishment of hierarchical relationships allows subsequent queries through the graph to navigate directly from a document to its project, or backward from a project to all its documents, providing graph structure-level support for the linkage between the two-layer graphs. After completing the creation of document nodes and related entities in the fine-grained graph, the knowledge increment brought by this new document also needs to be synchronized to the project-level graph. The specific approach involves locating the project node in the project-level graph corresponding to the project to which the document belongs, based on the attribution relationships established in step four. Then, the document's summary and entity relationship triples are aggregated into the aggregated data of that project node. This aggregation operation requires synchronously updating multiple data points maintained on the project node: adding the business content from the new document to the project's global summary, adding newly appearing partners to the partner list, increasing the cumulative contract amount by the amount value in the new document, incrementing the document count, and adding the time nodes recorded in the new document to the key milestones and key time nodes. If the project involved in the new document does not yet exist in the project-level graph, the corresponding project node can be created before aggregation. New knowledge at the document level is transferred to the coarse-grained graph through mapping relationships, ensuring that the project-level knowledge state is updated synchronously with the addition of the new document. Its purpose is to integrate the information of a new document into the project-level knowledge incrementally, without recalculating all documents in the entire project, thus keeping the project-level graph always up-to-date.

[0038] In one embodiment, the aggregation of the document summaries and entity relation triples of documents belonging to the same project to generate project-level aggregated data for the project includes: Obtain the metadata of each document belonging to the same project, including the status identifier of each document, the reference relationship between documents, and the document version information; Based on the document reference relationships and document version information, determine whether there is a version inheritance relationship between the documents; If a version inheritance relationship exists, the version inheritance chain is traced according to the document reference relationship and the document version information, and documents in a valid state are selected according to the status identifier of each document in the version inheritance chain. Based on the filtering results, the document summaries and entity relation triples of the filtered documents in a valid state are used as the aggregation source data to generate project-level aggregated data for the project.

[0039] As mentioned above, before aggregating the summaries and triples of documents belonging to the same project, it is first necessary to obtain the metadata of each document under that project. The metadata contains three key types of information: document status identifiers, indicating whether the document is currently valid, obsolete, or deleted; document reference relationships, recording whether there are mutual references or substitution relationships between documents; and document version information, identifying the chronological order of different versions of the same document. This metadata is usually stored and maintained along with the documents when they are added to the database or updated, and can be retrieved at any time when aggregation is needed. Without this metadata, the system cannot distinguish whether there are version relationships between documents under the project, nor can it determine which documents are currently valid. After obtaining the metadata of each document, it is necessary to determine whether there are version inheritance relationships between these documents based on the document reference relationships and document version information. Version inheritance refers to a situation where one document replaces, modifies, or supplements another document in terms of content or legal effect. This relationship is common in corporate documents. For example, a supplementary agreement may revise certain clauses of the main contract, and a new version of a procurement specification may replace the old version of the technical requirements. Determining the existence of version inheritance relationships can be based on the reference relationships between documents. Documents typically contain explicit reference information; for example, a supplementary agreement might state "This agreement amends Article X of Contract XX," or a technical document might indicate "This document replaces version XX." If such reference relationships exist between documents, and the document version information is used to determine if the direction of the reference is correct, the existence of a version inheritance relationship can be confirmed. Logical judgments are performed based on the relationship and version fields in the document metadata, transforming the explicitly recorded reference information into a version inheritance structure that can be processed in subsequent steps. Its function is to identify which documents within a project have replacement or revision relationships, organizing independent document sets into one or more version chains based on version associations.

[0040] If the analysis reveals a version inheritance relationship between documents, the complete version inheritance chain needs to be traced along this relationship. A version inheritance chain is a chain formed by multiple versions of the same topic linked chronologically, where each document represents the knowledge state of that topic at a specific point in time. For example, a procurement contract might go through four versions: initial draft, revised draft, final draft, and supplementary agreement. These four versions, in chronological order, constitute a version inheritance chain. After tracing the version inheritance chain, the documents in the chain need to be filtered according to their status identifiers, retaining only those in a valid state. Document status identifiers are pre-set when documents are added to the database or changed. For example, an old version document that has been replaced by a newer version can be marked as obsolete, while the currently effective latest version document is marked as valid. After tracing the version inheritance chain, only the valid parts of all documents in the chain need to be extracted. The principle is to combine the tracing of the version inheritance chain with the filtering based on status identifiers. The version inheritance chain tracing answers the question "which documents belong to the same version family," while the status identifier filtering answers the question "which documents in this version family are still valid." The combination of these two methods ensures that the data scope of subsequent aggregation processing covers the complete version relationship while excluding information on versions that have been replaced or obsolete.

[0041] Aggregation is performed based on the filtering results. Specifically, the documents that are in a valid state, filtered in step three, are used as the aggregation source data. Only the summaries and entity relation triples of these valid documents are used to generate project-level aggregated data for the project, including a summary of the total project amount, a list of partners, key time nodes, and a global project summary. The version filtering results are used as input constraints for aggregation. This ensures that the generated project-level aggregated data only reflects the business information carried by the currently valid document versions; historical version information that has been replaced or obsolete by subsequent versions is not included in the project-level aggregated data, thus avoiding the inclusion of outdated or revised business information in project-level knowledge.

[0042] It's worth noting that in enterprise document management, multiple versions of the same topic often exist within the same project. For example, a procurement contract might undergo multiple revisions, each resulting in a new version. These new and old versions objectively coexist within the same project as a version chain. The conventional aggregation approach is to include all documents under the project indiscriminately in the aggregation source data, regardless of version. This leads to the final project summary containing outdated historical information. More specifically, when all documents are processed flatly during aggregation, a contract with an amount of 5 million yuan in the initial draft, 6 million yuan in the final draft, and 5.8 million yuan in the supplementary agreement will all appear in the aggregation source data. However, in actual business operations, only the 5.8 million yuan figure in the supplementary agreement is currently valid. Flat aggregation lacks a mechanism to express version inheritance relationships and a means to determine the timeliness of information; it can only treat all information as equally valid and aggregate it.

[0043] In this embodiment, three pre-judgment and filtering operations change this situation: first, it identifies whether there is a version inheritance relationship between documents and reorganizes the documents according to the version chain; then, it filters out the currently valid versions from the version chain according to their status identifiers; finally, it aggregates based on the summaries and triples of these valid versions. The essence of this processing logic is to change the input data for aggregation from "all summaries and triples of all documents under the project" to "summaries and triples of those documents under the project that are currently valid," thus ensuring that the project-level aggregated data always consists of currently valid knowledge and does not include replaced historical version information.

[0044] In one embodiment, determining whether a version inheritance relationship exists between documents based on the document reference relationships and the document version information includes: For any two documents belonging to the same project, calculate the semantic similarity between the summaries of the two documents and the degree of conflict between the entity relation triples of the two documents. If the semantic similarity reaches a first preset threshold and the degree of conflict reaches a second preset threshold, then it is determined that there is a version inheritance relationship between the two documents. If the semantic similarity reaches a first preset threshold and the degree of conflict is lower than a second preset threshold, then the two documents are determined to be duplicate documents. If the semantic similarity is lower than the first preset threshold, it is determined that there is no version inheritance relationship between the two documents.

[0045] As mentioned above, to determine whether a version inheritance relationship exists between two documents under the same project, pairwise comparisons are necessary. This comparison cannot rely solely on external information such as document titles or names, because documents with similar titles do not necessarily have a version relationship, while documents with different titles may have a substitution relationship. Therefore, calculations need to be based on the actual content of the documents. One dimension of the comparison is the semantic similarity between document summaries. A document summary is a concise description of the core content of a document. If the semantic similarity between two document summaries is high, it indicates that they are highly related in terms of subject matter and business scope, which meets the basic premise of a version inheritance relationship. The method for calculating semantic similarity is to input the summary text into a semantic vector model, convert it into a vector representation, and then calculate the distance between the two vectors. The closer the distance, the closer the semantics. Another dimension of the comparison is the degree of conflict between entity relationship triples. Specifically, this involves extracting entities of the same type or pointing to the same business object from the two documents, comparing whether there are substantial differences in attributes such as quantity, amount, and time, and whether there are logical contradictions or conflicts in their associations with external entities. If two documents have substantial conflicts in core business data, it often indicates that the latter has revised or modified the former, which is a key indicator of version inheritance. The content relationship between documents can be characterized by two features: semantic similarity, which describes the consistency of the content's theme, and the degree of conflict, which describes substantial differences at the content data level. No single dimension of information is sufficient to accurately determine the existence of a version inheritance relationship.

[0046] After performing the aforementioned two-dimensional calculations on the two documents, different judgments are made based on the different intervals the calculation results fall into. If the semantic similarity of the summaries of the two documents is higher than the first preset threshold, it indicates that they are highly related in terms of subject content; at the same time, the degree of conflict between the entity relation triples is also higher than the second preset threshold, indicating that they have substantial differences in key business data. When both conditions are met, it is determined that there is a version inheritance relationship between the two documents. This is because if two documents are highly related in subject but have obvious conflicts in core data, a reasonable explanation is that they represent different versions of the same subject at different times or stages, with one being a revision or update of the other. The two documents may record different versions of the same contract, different specifications of the same purchased materials at different times, or different agreements of the same cooperation at different stages. If the semantic similarity of the summaries of the two documents is higher than the first preset threshold, but the degree of conflict between the entity relation triples is lower than the second preset threshold, then they are determined to be duplicate documents. In this scenario, the two documents are highly related in topic, but there are no substantial differences between the core business data. This suggests that they may be the same document stored at different times in different file formats, or multiple copies with essentially identical content but slightly different layouts or formats. The fundamental difference between duplicate documents and version inheritance lies in the presence of substantial data differences. Version inheritance inevitably involves modifications to critical business data, while duplicate documents are highly consistent in content with only minor or no differences.

[0047] If the semantic similarity of the summaries of two documents is below a first preset threshold, it is directly determined that there is no version inheritance relationship between them. This is because a basic premise of version inheritance is that the two documents are related in terms of subject content. If the semantic similarity of the summaries of two documents is very low, it means that they discuss business content on different topics and are unlikely to constitute a version series on the same topic. In this case, regardless of the degree of conflict between the entity relationship triples, no further judgment is needed. Because there cannot be a version inheritance relationship between a version of a procurement contract and a meeting minutes, even if there happens to be some statistical difference in their monetary data, this difference has no significance in terms of version relationship.

[0048] In one specific embodiment, in the aforementioned versioned aggregation scheme, when version inheritance relationships exist within a project, aggregated data is generated by tracing the version chain and filtering documents in valid states according to their status identifiers. This scheme implicitly assumes that the last document in a valid state within the version chain contains complete knowledge of the topic. However, in real-world business scenarios, this assumption does not always hold. Consider a procurement contract that has undergone multiple revisions. The initial draft includes confidentiality clauses, liability for breach of contract, dispute resolution methods, etc. The second draft modifies the procurement quantity and amount, the third draft modifies the delivery time, and the final draft adds acceptance criteria. Under the scheme of filtering valid states by status identifier, if only the final version is marked as valid, aggregation only uses the summary and triples of the final version. However, the final version may only involve entities and relationships related to the acceptance criteria. The confidentiality clauses, liability for breach of contract, etc., in the initial draft are never mentioned or modified in subsequent versions. These clauses remain valid in business terms but are lost during aggregation because it relies solely on the last document. The essence of this problem lies in the fact that modifications in the version inheritance chain are partial modifications. Subsequent documents only modify certain information in the preceding documents; the unmodified parts remain valid. End documents with valid status are aggregated based on their status indicators. The default coverage is full, but the actual scope of modification is localized. When a subsequent document is an acceptance report or similar document covering only a specific phase of the project, completely replacing the entire preceding document with its content would result in the loss of a significant amount of uncovered, valid information.

[0049] Therefore, this embodiment provides a method for inheriting differences in version chains, specifically: tracing the version inheritance chain and filtering out documents in a valid state according to the status identifier of each document in the version inheritance chain includes: Sort the documents in the version inheritance chain in chronological order to determine the end document of the version inheritance chain; Obtain the entity relationship difference set for each adjacent document pair in the version inheritance chain. The entity relationship difference set is used to characterize the modified entity relationship in the successor document relative to the predecessor document. Based on the entity relation triples of the end document, the entity relation triples in each predecessor document that are not covered by the entity relation difference set are supplemented layer by layer along the version inheritance chain from the end to the beginning, thereby generating the effective entity relation set of the project.

[0050] Furthermore, after generating the valid entity relationship set for the project, the process also includes: The set of valid entity relationships is marked with version source information, which indicates which document version in the version inheritance chain each entity relationship triple originates from.

[0051] As described above, after identifying the version inheritance chain, the documents in the chain are first arranged chronologically to form an ordered sequence from the earliest version to the latest version, and the most recent document in this sequence is designated as the last document. This step establishes the chronological order of documents in the version chain, providing a clear direction for subsequent layer-by-layer comparisons of differences. The direction of the version chain is from oldest to newest, and the direction of difference comparison is also from oldest to newest; the last document represents the current latest version state of the topic. After the version chain is sorted chronologically, for each pair of adjacent documents in the chain, the entity relationship difference set between the successor document and its predecessor document is calculated. For example, for a version chain containing four documents, the differences between the second and first documents, the third and second documents, and the fourth and third documents need to be calculated. The entity relationship difference set is used to characterize the modified entity relationships in the successor document relative to the predecessor document. If an entity relationship exists in the predecessor document but no longer appears in the successor document, or if a value in the predecessor document is modified to a different value in the successor document, then this entity relationship or this value is included in the difference set. The difference set records the substantive modifications made by subsequent documents to the predecessor document. The technical principle behind this step is to break down the differences between versions segment by segment using adjacent comparisons, decomposing a complete modification process spanning multiple versions into several local modification steps between adjacent versions. Its purpose is to accurately locate the scope of modifications in each version, providing a basis for subsequent information backfilling. Using the entity relation triples of the last document as the basic data, backfilling is performed layer by layer along the version chain from the end to the beginning. For each entity relation triple in the predecessor document, it is checked whether it appears in the difference set of the adjacent document pair. If the difference set records that this triple was modified by the subsequent document, it means that this information has been replaced by new information in the subsequent document and no longer needs to be extracted from the predecessor document. If the difference set does not record that this triple was modified, it means that this information has not changed in the subsequent document, it is still valid, and needs to be backfilled into the valid entity relation set. The meaning of "coverage" here needs to be understood in conjunction with the level of the entity relation triple set. If a triple in a predecessor document is modified to a different expression, a different value, or is deleted in a subsequent document, then this triple is covered by the difference set, indicating that it has been replaced by the subsequent document. If a triple in a predecessor document still exists in the subsequent document and its content is identical, or although it does not appear in the subsequent document, it has not been explicitly modified or deleted, then it is not covered by the difference set and should still be retained. This process proceeds layer by layer forward until the head of the version chain, ultimately resulting in a complete and valid set of entity relationships. Subsequent documents typically only modify parts of the predecessor document; the unmodified parts remain valid. The difference set defines the boundaries of modification, limiting the scope of modification to those triples covered by the difference set; the parts not covered by the difference set are retained.Its purpose is to avoid information loss caused by simply overwriting the old version with the new version. The final generated set of valid entity relationships includes both the latest information in the final document and historical information from previous versions that has not been overwritten by subsequent modifications and is still valid.

[0052] As a further optional implementation, after generating a valid set of entity relationships, version source information can be labeled for each entity relationship triple in the set. Version source information indicates which document in the version inheritance chain this triple ultimately originates from. If a triple exists in the last document, its source is labeled as the last document; if a triple is added back from a predecessor document, its source is labeled as that predecessor document. This process preserves the traceability information of the data during aggregation. Its function is to retain the historical source of each entity relationship in the project-level aggregated data. When users or business personnel view the project-level graph, if they have questions about the accuracy of a specific piece of information or need further contextual understanding, they can directly trace back to the original document and specific version through the version source information, rather than only seeing the aggregated summary result.

[0053] This embodiment addresses this issue from the perspective of difference inheritance. Instead of simply covering the entire version chain with the content of the last document, it calculates the difference set by comparing adjacent document pairs layer by layer, and then uses the difference set to define the boundaries of each modification. When backtracking layer by layer from the end to the beginning, whether each triple is included in the final valid set depends on whether it is marked as modified by the difference set in subsequent versions. Essentially, this mechanism treats the version chain as a progressive modification sequence, where each version only modifies a portion of the preceding document's content, with the unmodified parts propagating forward along the version chain. The final generated set may contain the latest data from the last document, or it may contain unmodified and still valid clauses from the beginning or intermediate versions. During aggregation, valid information from each historical version is preserved and incorporated into the aggregation source data, improving the completeness and accuracy of the project-level aggregated data while maintaining the traceability of the difference relationships between versions.

[0054] Reference Figure 3 This application also provides a system for constructing a two-layer knowledge graph from massive unstructured data, including: The acquisition module 1 is used to acquire a number of unstructured documents belonging to at least one project, perform content parsing on each unstructured document, extract the document content, and identify the project to which the document belongs. Information extraction module 2 is used to extract entity relation triples from the document content and generate a document summary; The first graph construction module 3 is used to collect the entity relationship triples of each document belonging to the same project and construct the internal association entity relationship graph of the project. The second graph construction module 4 is used to aggregate the document summaries and entity relationship triples of each document belonging to the same project, generate project-level aggregated data of the project, and construct a project-level graph. The mapping relationship establishment module 5 is used to establish the mapping relationship between the internal associated entity relationship graph of the project and the project-level graph. The linkage update module 6 is used to synchronize changes in the internal association entity relationship graph of the project to the corresponding project nodes in the project-level graph according to the mapping relationship, and to associate the project nodes in the project-level graph with all documents of the corresponding project in the internal association entity relationship graph of the project.

[0055] As described above, it is understood that each component of the massive unstructured data two-layer knowledge graph construction system proposed in this application can realize the function of any of the massive unstructured data two-layer knowledge graph construction methods described above, and the specific structure will not be repeated.

[0056] Reference Figure 4 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores monitoring data and other data. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for constructing a two-layer knowledge graph of massive unstructured data.

[0057] The processor described above executes the method for constructing a two-layer knowledge graph of massive unstructured data, including: acquiring several unstructured documents belonging to at least one project; parsing the content of each unstructured document, extracting document content, and identifying the project to which the document belongs; extracting entity relation triples from the document content and generating a document summary; aggregating the entity relation triples of documents belonging to the same project to construct an internal project-related entity relation graph; aggregating the document summaries and entity relation triples of documents belonging to the same project to generate project-level aggregated data and constructing a project-level graph; establishing a mapping relationship between the internal project-related entity relation graph and the project-level graph; and, based on the mapping relationship, synchronizing changes in the internal project-related entity relation graph to the corresponding project nodes in the project-level graph, and associating project nodes in the project-level graph with all documents of the corresponding project in the internal project-related entity relation graph.

[0058] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a method for constructing a two-layer knowledge graph of massive unstructured data, including the following steps: acquiring several unstructured documents belonging to at least one project; parsing the content of each unstructured document, extracting document content, and identifying the project to which the document belongs; extracting entity relation triples from the document content and generating a document summary; aggregating the entity relation triples of documents belonging to the same project to construct an internal project-related entity relation graph; aggregating the document summaries and entity relation triples of documents belonging to the same project to generate project-level aggregated data and constructing a project-level graph; establishing a mapping relationship between the internal project-related entity relation graph and the project-level graph; and, according to the mapping relationship, synchronizing changes in the internal project-related entity relation graph to the corresponding project nodes in the project-level graph, and associating project nodes in the project-level graph with all documents of the corresponding project in the internal project-related entity relation graph.

[0059] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in this application and in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0060] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for constructing a two-layer knowledge graph from massive unstructured data, characterized in that, The method includes: Obtain several unstructured documents belonging to at least one project, parse the content of each unstructured document, extract the document content, and identify the project to which the document belongs; Extract entity relation triples from the document content and generate a document summary; The entity relationship triples of each document belonging to the same project are aggregated to construct an internal entity relationship graph of the project; The document summaries and entity relation triples of each document belonging to the same project are aggregated to generate project-level aggregated data for the project, and a project-level graph is constructed. Establish a mapping relationship between the internal entity relationship graph of the project and the project-level graph; Based on the mapping relationship, changes in the internal entity relationship graph of the project are synchronized to the corresponding project nodes in the project-level graph, and the project nodes in the project-level graph are associated with all documents of the corresponding project in the internal entity relationship graph of the project.

2. The method for constructing a two-layer knowledge graph of massive unstructured data according to claim 1, characterized in that, The generated document summary includes: Obtain the document type and metadata of the document, wherein the metadata includes document ownership information; Based on the document type, a corresponding template is selected from a set of preset prompt word templates, and the metadata is filled into the corresponding fields of the template to generate prompt words; The prompt words are input into a preset large language model, and the large language model is constrained to output a business summary in a structured format. The business summary includes six types of information: business subject, business behavior, business target, business value, business time, and management affiliation. Using the document identifier as the association key, the business summary is associated and stored with the entity relationship triple and the metadata to obtain the document summary.

3. The method for constructing a two-layer knowledge graph of massive unstructured data according to claim 1, characterized in that, The construction of the internal entity relationship graph of the project includes: The entities in the entity relationship triples of each document belonging to the same project are taken as entities to be processed; Perform exact string matching between each entity to be processed and the standard entity name in the pre-set alias dictionary; Based on the matching results, the entities that successfully match will be named using the standard entity name as the merged entity name; For each entity to be processed that failed to achieve an exact match, based on the type attribute of the entity in the entity relationship triple, the semantic vector similarity between entity names is calculated among entities of the same type, and those with similarity reaching a preset threshold are selected as candidate merging pairs. Perform rule verification on each candidate merge pair, merge the entities in the candidate merge pairs that pass the rule verification into the same entity node, and update the relationship pointers in the graph.

4. The method for constructing a two-layer knowledge graph of massive unstructured data according to claim 1, characterized in that, The step of synchronizing changes in the internal entity relationship graph of the project to the corresponding project nodes in the project-level graph based on the mapping relationship includes: In response to changes in documents within the project's internal entity relationship graph, calculate the differences between the changed document and the original document. Based on the aforementioned discrepancy information, only the entities and relationships involved in the changed documents are partially updated in the project's internal entity relationship graph. Based on the mapping relationship, the project node in the project-level graph corresponding to the project to which the change document belongs is located, and incremental updates are performed on the project-level aggregated data of the project node based on the difference information, wherein the incremental update only updates the data items involved in the difference information.

5. The method for constructing a two-layer knowledge graph of massive unstructured data according to claim 4, characterized in that, The response to a document change in the internal entity relationship graph of the project calculates the difference information between the changed document and the document before the change, including: Receive a document addition event, calculate the content hash value of the new document, and based on the calculation result, query whether there are documents with the same hash value in the internal related entity relationship graph of the project; If it exists, then abandon the subsequent processing of the newly added document; If it does not exist, perform document content parsing on the newly added document, extract entity relation triples, and generate a document summary; Write the entity relationship triple of the newly added document into the internal association entity relationship graph of the project, create document nodes and entity relationship edges, and create the affiliation relationship between the document node and the project node corresponding to the project to which the document belongs; Based on the mapping relationship, locate the project node in the project-level graph that corresponds to the project to which the document belongs, aggregate the document summary and entity relationship triple of the newly added document into the project-level aggregated data of the project node, and update the project global summary and aggregated statistics of the project node.

6. The method for constructing a two-layer knowledge graph of massive unstructured data according to claim 1, characterized in that, The aggregation of document summaries and entity relation triples of documents belonging to the same project to generate project-level aggregated data includes: Obtain the metadata of each document belonging to the same project, including the status identifier of each document, the reference relationship between documents, and the document version information; Based on the document reference relationships and document version information, determine whether there is a version inheritance relationship between the documents; If a version inheritance relationship exists, the version inheritance chain is traced according to the document reference relationship and the document version information, and documents in a valid state are selected according to the status identifier of each document in the version inheritance chain. Based on the filtering results, the document summaries and entity relation triples of the filtered documents in a valid state are used as the aggregation source data to generate project-level aggregated data for the project.

7. The method for constructing a two-layer knowledge graph of massive unstructured data according to claim 6, characterized in that, The step of determining whether a version inheritance relationship exists between documents based on the document reference relationships and the document version information includes: For any two documents belonging to the same project, calculate the semantic similarity between the summaries of the two documents and the degree of conflict between the entity relation triples of the two documents. If the semantic similarity reaches a first preset threshold and the degree of conflict reaches a second preset threshold, then it is determined that there is a version inheritance relationship between the two documents. If the semantic similarity reaches a first preset threshold and the degree of conflict is lower than a second preset threshold, then the two documents are determined to be duplicate documents. If the semantic similarity is lower than the first preset threshold, it is determined that there is no version inheritance relationship between the two documents.

8. A two-layer knowledge graph construction system for massive unstructured data, characterized in that, include: The acquisition module is used to acquire several unstructured documents belonging to at least one project, perform content parsing on each unstructured document, extract the document content, and identify the project to which the document belongs; The information extraction module is used to extract entity relation triples from the document content and generate a document summary; The first graph construction module is used to collect the entity relationship triples of each document belonging to the same project and construct an internal association entity relationship graph of the project. The second graph construction module is used to aggregate the document summaries and entity relationship triples of each document belonging to the same project, generate project-level aggregated data of the project, and construct a project-level graph. The mapping relationship establishment module is used to establish the mapping relationship between the internal entity relationship graph of the project and the project-level graph. The linkage update module is used to synchronize changes in the internal entity relationship graph of the project to the corresponding project nodes in the project-level graph according to the mapping relationship, and to associate the project nodes in the project-level graph with all documents of the corresponding project in the internal entity relationship graph of the project.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.