Underground engineering on-demand ventilation knowledge graph retrieval enhancement generation method and system
By combining knowledge graphs and large language models to enhance retrieval and generation methods, the problem of low knowledge management efficiency in the field of underground engineering ventilation has been solved, achieving efficient and accurate knowledge acquisition and decision support, and improving the system's professionalism and user experience.
Patent Information
- Application Number
- CN202510853956.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-11-18
AI Technical Summary
Existing technologies in the field of underground engineering ventilation suffer from problems such as low timeliness, poor interpretability, and insufficient domain knowledge, resulting in low efficiency in knowledge and information management of ventilation systems and difficulty in providing accurate decision support.
This paper adopts a retrieval enhancement generation method that combines knowledge graphs and large language models. By constructing a top-down ontology library, data cleaning and extraction, entity matching and subgraph extraction, structured entity annotation results are generated. The Neo4j graph database is used for storage and BERT vectorization for semantic matching to generate accurate answers.
It significantly improves the efficiency of acquiring and managing knowledge about ventilation in underground engineering, enhances the professionalism and accuracy of the question-and-answer system, provides a convenient user experience and knowledge traceability function, reduces the cost of manual sorting and error correction, and improves decision-making efficiency and system reliability.
Smart Images

Figure CN120973979A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a method and system for enhancing the generation of knowledge graphs for on-demand ventilation in underground engineering. Background Technology
[0002] Underground ventilation is a crucial foundation for ensuring the safety of the construction and operation of underground cavern complexes. It is inextricably linked to the engineering physical structure, ventilation system types, regulation and control methods, and management mechanisms, exhibiting strong systematic and professional characteristics. Furthermore, ventilation organization forms are diverse, catering to various scenarios including construction, operation and maintenance, and emergency response. In particular, ventilation modes with refined regulation and intelligent management involve multiple disciplines such as space science, information science, construction technology, mathematics, and fundamental theories of fluid mechanics. With the increasing demands for intelligent engineering construction, intelligent ventilation is a major development trend in maximizing the environmental protection value and sustainable creation of ventilation systems. Currently, in the field of underground engineering ventilation, knowledge and information about ventilation systems generally rely on manual cross-domain analysis, leading to problems such as low timeliness, high process costs, insufficient domain knowledge, and poor scientific credibility of conclusions. Therefore, considering the unique characteristics of underground engineering ventilation in terms of environmental conditions, design objectives, system complexity, hazardous substance handling, energy consumption, safety standards, emergency systems, and maintenance management, there is an urgent need to construct a ventilation knowledge service system based on knowledge graphs, driven by knowledge, and enabling multi-objective dynamic decision-making. This system aims to improve the cognitive response, collaborative sharing capabilities, and the usability of data assets within the ventilation system.
[0003] Knowledge graphs use graph structures to describe knowledge, with their basic components being triples consisting of nodes and edges. As a representative technology of the symbolism school of artificial intelligence, knowledge graphs aim to create a structured semantic knowledge base that connects entities and their attributes into a network with various relationships. They are a crucial pathway to achieving interpretable artificial intelligence and have wide applications in semantic retrieval, intelligent question answering, and recommender systems.
[0004] Large Language Models (LLMs) are natural language processing models based on deep learning technology. Through expanding corpora, efficient fine-tuning of model parameters, and task-specific fine-tuning, they possess strong professional language understanding capabilities and extensive technological knowledge reserves, thus enhancing the reasoning ability and interpretability of artificial intelligence in scientific problems to a certain extent. Examples include BERT, FinGPT, and Chatlaw. LLM-based AI technologies provide intelligent services in construction safety identification and management, and flood control early warning in water conservancy. However, large language models also have many drawbacks. For example, the interpretability of neural network "black box" models is poor, and they suffer from the "illusion" problem, making it difficult to guarantee the accuracy and reliability of the content generated by the model. Furthermore, due to the lack of domain-specific knowledge and training data, LLMs trained on general corpora cannot effectively generalize to specific domains. Combining Knowledge Graph (KG), Retrieval-Augmented Generation (RAG), and Large Language Model (LLM), leveraging the structured knowledge representation of KG, using RAG technology to provide external knowledge to enhance LLM, and extracting relevant contextual information from KG is an effective way to solve the problem of precise knowledge services for specific domains.
[0005] To address the issues of timeliness, poor interpretability, and insufficient domain knowledge in practical applications of large language models, Retrieval-Augmented Generation (RAG) introduces external databases specific to a particular domain. It concatenates relevant document fragments and the original query content to form prompt words, which are then input into the large model to improve the accuracy of the generated results. However, the knowledge organization of document databases is relatively coarse, and more refined knowledge organization forms, represented by knowledge graphs, are gradually being incorporated into research on retrieval enhancement generation methods. Optimizing the query methods of knowledge graphs can improve the effectiveness of retrieval enhancement generation. Furthermore, some studies have shown that knowledge graphs can reduce the illusion problem in large language models.
[0006] In summary, given the unique characteristics of on-demand ventilation in underground engineering projects, simply storing complex, multi-category data in a database lacks organization and fails to enable precise, on-demand ventilation adjustments in practical applications. Furthermore, decision-making support questions for underground engineering ventilation fall under the vertical domain of question-answering tasks. Large language models trained on general corpora lack specific scenario knowledge and cannot provide satisfactory answers; specific scenario information and professional knowledge are required for accurate responses. Therefore, a top-down knowledge modeling approach combining general corpus training with specific ventilation knowledge is employed to construct an on-demand ventilation knowledge graph. Retrieval-enhanced generation is used as a crucial technique to improve the performance of the general model in vertical domain question-answering. By constructing a vertical domain document vector database, word vector matching is used to retrieve the most relevant document fragments to the user's question from the database. These fragments are then merged with the user's question and used as input prompts for the large model, enabling it to acquire vertical domain document information and provide more accurate answers. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to provide a method and system for enhancing the generation of knowledge graphs for on-demand ventilation in underground engineering, which can improve the efficiency of acquiring and managing knowledge of ventilation in underground engineering, enhance the professionalism and accuracy of the question-and-answer system, have a user-friendly interface, support knowledge traceability, and provide users with a convenient experience.
[0008] The technical solution of this invention is as follows: An enhanced generation method for knowledge graph retrieval of on-demand ventilation in underground engineering includes the following steps: Step 1, data cleaning and ontology layer modeling, includes: Step 1.1, Data Collection and Cleaning: Collect textual materials related to underground engineering ventilation, including engineering drawings, technical documents, construction business documents, and standards and specifications; use OCR recognition and document format conversion tools to convert PDF or image formats into Word documents or text document formats; unify encoding, remove garbled characters, ensure data quality, and form a high-quality text dataset; Step 1.2, Ontology Layer Modeling: Construct a comprehensive intelligent ventilation ontology library based on the five key elements of engineering management in a top-down manner. The formula is as follows: , In the formula, This refers to the intelligent ventilation integrated system library. Represents the ontology of resource elements, Indicates the main body of the process. Represents the business process entity. Indicates the progress of the project. Represents the physical cost entity; At the same time, define concepts, attributes, and behavioral relationships for each of the above ontology; Step 1.3, Data Layer Population and Physical Layer Classification: Based on the ontology layer template, entities, behavioral relationships, and attributes are extracted from the cleaned data; the physical layer classifies entity types into three categories: physical spatial structure, ventilation and fluid development, and process assurance requirements. Step 2: Knowledge extraction based on prompting engineering, including: Step 2.1, Knowledge Extraction Definition: Using Functions This represents the knowledge extraction process, where... This represents raw data, including text, logs, and tables. This represents the set of entities extracted. Represents a set of relationships between entities. It represents a set of attributes, that is, descriptive information about entities or relationships; Step 2.2, Prompt Project, including: Step 2.2.1, Construct sub-hint template: For each token Generate a sub-hint The sub-hint transforms the named entity recognition task into a classification task, expressed as: , , In the formula, Indicates targeting the token Sub-prompt templates are used for named entity recognition; The input text sample consists of n basic units, i.e., tokens, each... It is a token in the sample; Indicates sample The i-th token in the middle, This represents a conditional function associated with the i-th token, specifically in the form of: Used to determine Does it belong to ; This represents the mask marker for the i-th token, used to prompt the large language model to predict the entity type of that token. Indicates the candidate entity type, belonging to the entity type set. Each In This is the type of target entity that the large language model needs to predict; Step 2.2.2: Integrate the hint template: Combine all the sub-hints of all tokens into a complete hint template. The expression is: , In the formula, Represents the entire sample The integrated hint template consists of sub-hint templates for all tokens; n represents the sample. The total number of tokens in the system; Step 2.2.3, Answer Search: For each Entity type Fill in the blanks and calculate their probabilities; use a large language model to calculate the probability of each candidate answer. It selects the entity type with the highest probability; all entities in the entire sentence are accurately identified. The cumulative product of the probabilities of each sub-probability is expressed as follows: , In the formula, This represents the probability that the i-th entity type is accurately identified; Step 2.2.4 Entity type output: According to the predictions of the Big Prophecy model, Replace with the corresponding entity type This generates structured entity annotation results; Step 3, Knowledge Graph Data Population and Storage: Import the JSON format data generated in Step 2 into the Neo4j graph database using a Python program based on the py2neo library; Step 4: Retrieve and enhance the generative inference engine, including: Step 4.1, Keyword Extraction: Extract keywords from user-input text. Perform word segmentation and extract keyword sets. In the formula, This refers to the query text entered by the user. The set of keywords extracted from it. Represents a set of keywords The i-th keyword in the set, m represents the keyword set. The total number of keywords in the text; Step 4.2, Entity Matching: Use cosine similarity to match entities in the knowledge graph. Define the target entity set, expressed as: , In the formula, This represents the target entity set, containing entities relevant to the user's query selected from the knowledge graph; 'e' represents a variable of a single entity in the knowledge graph; 'E' represents the complete entity set in the knowledge graph, containing all stored entity nodes; and 'j' represents the index, corresponding to the keyword set. A keyword in ; m represents the set of keywords The total number; Represents a set of keywords The j-th keyword in The embedding vector of entity e. Keywords Embedded vector, The threshold representing cosine similarity is used to determine e and Are they similar enough? Step 4.3, Subgraph Extraction: Extract the subgraph of the target entity e, expressed as: , In the formula, This represents the relevant information extracted for the target entity e in application scenario i. This represents a subgraph centered on the target entity e, specifically in application scenario i; Subgraph The set of entities in the target entity e, that is, the set of nodes associated with the target entity e; Subgraph The set of relations in the set, i.e., the connection The edges of the entities in the graph; i represents the specific application scenario that affects the subgraph. The construction; Step 4.4, Prompt Generation and Answer Generation: The user question, knowledge graph information, real-time data, and general rules are concatenated into a prompt, expressed as: , In the formula, This represents the complete prompt words generated for the user's input query q, which are used to input into the large language model to generate an answer; q represents the original query text input by the user, i.e., the natural language question raised by the user through the intelligent question answering platform. This represents the general scheduling rules retrieved from the document database in application scenario i. This represents the target entity set, which contains entities selected from the knowledge graph that are relevant to the user query q. The subgraph information representing the target entity e in application scenario i is converted into a string format; Step 5: Development of Intelligent Question Answering Platform: Based on the underground engineering ventilation knowledge graph and retrieval enhancement generation reasoning engine constructed in the above steps, an intelligent question answering platform is developed. During the development of the intelligent question answering platform, the left side of the platform interface provides a knowledge graph visualization and node information query window, and the right side is a user question interaction window. It also supports knowledge tracing function, highlighting key information in the answer and linking it to relevant nodes in the knowledge graph.
[0009] Furthermore, in step 1.1, the OCR recognition and document format conversion tools specifically include using the TesseractOCR engine for image text recognition and using the pdf2docx library to convert PDF files into Word document format.
[0010] Furthermore, in step 1.2, the resource element ontology This includes sensing resources, computing resources, and control resources; the process ontology. Includes ventilation processes and fluid development processes; business process ontology. Includes construction management and maintenance management; project schedule body Includes time planning and progress monitoring; physical cost entity. This includes energy costs and equipment costs.
[0011] Furthermore, in step 1.3, the physical spatial structure includes the geometry of the underground project, the location of ventilation shafts, and the layout of ventilation ducts; the development of ventilation fluid includes air velocity, pressure distribution, and temperature changes; and the process assurance requirements include the configuration of ventilation equipment, energy consumption requirements, and safety standards.
[0012] Furthermore, in step 3, the Neo4j graph database supports single-graph storage management with hundreds of billions of nodes, and uses the py2neo library to achieve automated data import based on the Python language.
[0013] Furthermore, in step 4.1, the jieba word segmentation tool is used to perform Chinese word segmentation on the user input text, and nouns are extracted as keywords through stop word filtering and part-of-speech tagging.
[0014] Furthermore, in step 4.2, the embedding vector and embedding vector All were generated by a pre-trained BERT model, with a cosine similarity threshold. Set it to 0.9 or higher.
[0015] A system for enhancing the generation of knowledge graph retrieval for on-demand ventilation in underground engineering includes: a data acquisition and preprocessing layer, an ontology and knowledge extraction layer, a graph storage layer, a semantic indexing and entity linking layer, a subgraph arrangement and prompt word generation layer, a generation and reasoning layer, and an application and interaction layer. The data acquisition and preprocessing layer includes: a multi-source data interface module, an OCR recognition and format conversion module, and an encoding cleaning module. The ontology and knowledge extraction layer includes: five major ontology libraries. The graph storage layer includes a Prompt-Tuning module and an information extraction service module. The graph storage layer includes a Neo4j graph database cluster module and an ETL import script module. The semantic indexing and entity linking layer includes a vectorization service module, a FAISS index module, and a keyword parser. The subgraph arrangement and prompt word generation layer includes a subgraph extractor, a template manager, and a context splicer. The generation and inference layer includes a large language model inference service module and a RAG scheduler controller. The application and interaction layer includes a front-end visualization module and an API gateway module. The front-end visualization module includes a knowledge graph window and a question-and-answer window. The data acquisition and preprocessing layer collects heterogeneous data such as engineering drawings, monitoring logs, and specification documents, unifying them into parsable text. The ontology and knowledge extraction layer defines concepts, attributes, and behavioral relationships, extracting entity, behavioral, and attribute triples from small sample corpora. The graph storage layer stores on-demand knowledge graphs and supports k-hop queries and visualization. The semantic indexing and entity linking layer converts questions and graph nodes into embedded vectors, using thresholding... Select target entity set The subgraph arrangement and prompt word generation layer extracts relevant subgraphs. Generate text And assemble The generation and inference layer input The system generates answers containing specific and accurate technical information, knowledge, and traceability tags related to underground engineering ventilation. The application and interaction layer provides natural language retrieval, node drilling, and answer tracing functions. The ontology, knowledge extraction layer, and graph storage layer are connected to form an underground engineering on-demand ventilation knowledge graph. The semantic index and entity linking layer, subgraph arrangement and prompt word generation layer, and generation and reasoning layer are connected to form a retrieval-enhanced generation and reasoning engine. The application and interaction layer is an intelligent question-answering software platform. The underground engineering on-demand ventilation knowledge graph, through ontology modeling, knowledge extraction, and graph database storage, constitutes the system's knowledge foundation. The retrieval-enhanced generation and reasoning engine includes semantic matching, subgraph arrangement and prompt word generation, and large language model reasoning, completing the core processing from query to answer. The intelligent question-answering software platform provides a user interface, interactive question answering, and knowledge tracing.
[0016] The beneficial effects of this invention are: 1. Significantly improved data quality: This invention uses tools such as Tesseract OCR and pdf2docx to convert heterogeneous files such as drawings, logs, and specifications into parsable text, and performs deep cleaning in stages such as encoding consistency and garbled character removal to ensure the accuracy and usability of subsequent extraction, and greatly reduce the cost of manual sorting and error correction. 2. A semantically consistent five-element ontology framework: This invention adopts a five-element top-level ontology of "resource elements - technological process - business process - project progress - physical cost", which unifies the semantics of equipment, processes, timing and cost involved in underground engineering ventilation, avoiding the retrieval deviation caused by conceptual ambiguity in traditional keyword indexing, and providing a stable framework for cross-project knowledge reuse. 3. Three-layer entity classification supports multi-dimensional query: This invention uses a three-layer fine-grained entity classification of "physical spatial structure - ventilation fluid development - process assurance requirements" to cross-retrieve and compare the same problem in geometric, aerodynamic and management dimensions, which significantly improves the comprehensive decision-making efficiency in complex scenarios; 4. Prompt-Tuning knowledge extraction reduces labeling dependence: This invention utilizes a hierarchical prompting engineering of sub-prompt templates-integrated prompts-answer search to transform named entity recognition into a large model classification task, reducing the amount of manually labeled samples while maintaining high recall and high accuracy, and adapting to the characteristics of underground engineering corpora with many terms and complex formats. 5. Neo4j's billion-level graph storage and Py2neo's automatic ETL: A single graph supports billions of nodes and hundreds of billions of relationships. With the help of automated import scripts, it can achieve near real-time incremental updates. Compared with relational or lightweight graph databases, query latency and expansion costs are significantly reduced, meeting the knowledge accumulation needs of large complexes or long tunnels throughout their entire lifecycle. 6. BERT Vectorization and FAISS Semantic Matching: This invention unifies questions and graph nodes into high-dimensional semantic embeddings and sets a cosine similarity threshold of 0.9 or higher, which can effectively filter noise such as homophones and abbreviations; compared with pure keyword retrieval, the entity recall rate and precision are significantly improved, especially in polysemous word scenarios. 7. Subgraph orchestration drives RAG generation, reducing illusions: This invention automatically extracts scene-related k-hop subgraphs for matching entities and concatenates them with real-time monitoring data and scheduling rules to input prompt words into a large model, realizing the second-order constraint of "fact-reasoning"; experiments show that compared with direct end-to-end generation, the verifiability of the answer and the accuracy of details are significantly improved. 8. Knowledge traceability and visualization enhance trust: The front end of this invention provides a linked display of a graph window and a question-and-answer window, highlighting key entities in the answer and allowing one-click jump to the source node; operation and maintenance and front-line technical personnel can intuitively verify the source of generated content, reducing "black box" doubts and improving the system's adoption rate; In summary, this invention provides significant and quantifiable technical advantages in terms of data quality, semantic modeling, retrieval accuracy, generation reliability, system scalability, and energy-saving and safety benefits, fully demonstrating its innovation and practical value in the field of on-demand ventilation in underground engineering. Attached Figure Description
[0017] Figure 1This is a schematic diagram of the knowledge graph ontology construction process of an enhanced knowledge graph retrieval and generation method for on-demand ventilation in underground engineering, according to the present invention.
[0018] Figure 2 This is a schematic diagram of the knowledge graph construction technology route for an enhanced knowledge graph retrieval and generation method for on-demand ventilation in underground engineering, as described in this invention.
[0019] Figure 3 This is a schematic diagram of the knowledge extraction process of an enhanced knowledge graph retrieval and generation method for on-demand ventilation in underground engineering, according to the present invention.
[0020] Figure 4 This is a schematic diagram of the workflow of the retrieval enhancement generation inference engine for a knowledge graph retrieval enhancement generation method for on-demand ventilation in underground engineering according to the present invention.
[0021] Figure 5 This is a schematic diagram of the intelligent question-and-answer platform interface of the system for the enhanced generation method of knowledge graph retrieval for on-demand ventilation in underground engineering, which is based on the present invention. Detailed Implementation
[0022] like Figure 1-5 As shown, an enhanced generation method for knowledge graph retrieval of on-demand ventilation in underground engineering includes the following steps: Step 1, data cleaning and ontology layer modeling, includes:
[0023] Step 1.1, Data Collection and Cleaning: Collect textual materials related to underground engineering ventilation, including engineering drawings, technical documents, construction business documents, and standards and specifications; use OCR recognition and document format conversion tools to convert PDF or image formats into Word documents or text document formats; unify encoding, remove garbled characters, ensure data quality, and form a high-quality text dataset; Step 1.2, Ontology Layer Modeling: Construct a comprehensive intelligent ventilation ontology library based on the five key elements of engineering management in a top-down manner. The formula is as follows: , In the formula, This refers to the intelligent ventilation integrated system library. Represents the ontology of resource elements, Indicates the main body of the process. Represents the business process entity. Indicates the progress of the project. Represents the physical cost entity; At the same time, define concepts, attributes, and behavioral relationships for each of the above ontology; Step 1.3, Data Layer Population and Physical Layer Classification: Based on the ontology layer template, entities, behavioral relationships, and attributes are extracted from the cleaned data; the physical layer classifies entity types into three categories: physical spatial structure, ventilation and fluid development, and process assurance requirements. Step 2: Knowledge extraction based on prompting engineering, including: Step 2.1, Knowledge Extraction Definition: Using Functions This represents the knowledge extraction process, where... This represents raw data, including text, logs, and tables. This represents the set of entities extracted. Represents a set of relationships between entities. It represents a set of attributes, that is, descriptive information about entities or relationships; Step 2.2, Prompt Project, including: Step 2.2.1, Construct sub-hint template: For each token Generate a sub-hint The sub-hint transforms the named entity recognition task into a classification task, expressed as: , , In the formula, Indicates targeting the token Sub-prompt templates are used for named entity recognition; The input text sample consists of n basic units, i.e., tokens, each... It is a token in the sample; Indicates sample The i-th token in the middle, This represents a conditional function associated with the i-th token, specifically in the form of: Used to determine Does it belong to ; This represents the mask marker for the i-th token, used to prompt the large language model to predict the entity type of that token. Indicates the candidate entity type, belonging to the entity type set. Each In This is the type of target entity that the large language model needs to predict; Step 2.2.2: Integrate the hint template: Combine all the sub-hints of all tokens into a complete hint template. The expression is: , In the formula, Represents the entire sample The integrated hint template consists of sub-hint templates for all tokens; n represents the sample. The total number of tokens in the system; Step 2.2.3, Answer Search: For each Entity type Fill in the blanks and calculate their probabilities; use a large language model to calculate the probability of each candidate answer. It selects the entity type with the highest probability; all entities in the entire sentence are accurately identified. The cumulative product of the probabilities of each sub-probability is expressed as follows: , In the formula, This represents the probability that the i-th entity type is accurately identified; Step 2.2.4 Entity type output: According to the predictions of the Big Prophecy model, Replace with the corresponding entity type This generates structured entity annotation results; Step 3, Knowledge Graph Data Population and Storage: Import the JSON format data generated in Step 2 into the Neo4j graph database using a Python program based on the py2neo library; Step 4: Retrieve and enhance the generative inference engine, including: Step 4.1, Keyword Extraction: Extract keywords from user-input text. Perform word segmentation and extract keyword sets. In the formula, This refers to the query text entered by the user. The set of keywords extracted from it. Represents a set of keywords The i-th keyword in the set, m represents the keyword set. The total number of keywords in the text; Step 4.2, Entity Matching: Use cosine similarity to match entities in the knowledge graph. Define the target entity set, expressed as: , In the formula, This represents the target entity set, containing entities relevant to the user's query selected from the knowledge graph; 'e' represents a variable of a single entity in the knowledge graph; 'E' represents the complete entity set in the knowledge graph, containing all stored entity nodes; and 'j' represents the index, corresponding to the keyword set. A keyword in ; m represents the set of keywords The total number; Represents a set of keywords The j-th keyword in The embedding vector of entity e. Keywords Embedded vector, The threshold representing cosine similarity is used to determine e and Are they similar enough? Step 4.3, Subgraph Extraction: Extract the subgraph of the target entity e (obtain the target node from the knowledge graph). Information such as node attributes and triples constitutes the subgraph. In the subgraph In this context, the general expression for a node attribute is: entity, attribute name, attribute value; the template for converting it to a string is "{entity}'s {attribute name} is {attribute value}"; the general expression for a triple is: entity1, relation name, entity2; the template for converting it to a string is "{entity1}{relation name}{entity2}", and the expression is: , In the formula, This represents the relevant information extracted for the target entity e in application scenario i. This represents a subgraph centered on the target entity e, specifically in application scenario i; Subgraph The set of entities in the target entity e, that is, the set of nodes associated with the target entity e; Subgraph The set of relations in the set, i.e., the connection The edges of the entities in the graph; i represents the specific application scenario that affects the subgraph. The construction; Step 4.4, Prompt Generation and Answer Generation: The user question, knowledge graph information, real-time data, and general rules are concatenated into a prompt, expressed as: , In the formula, This represents the complete prompt words generated for the user's input query q, which are used to input into the large language model to generate an answer; q represents the original query text input by the user, i.e., the natural language question raised by the user through the intelligent question answering platform. This represents the general scheduling rules retrieved from the document database in application scenario i. This represents the target entity set, which contains entities selected from the knowledge graph that are relevant to the user query q. The subgraph information representing the target entity e in application scenario i is converted into a string format; Step 5: Development of Intelligent Question Answering Platform: Based on the underground engineering ventilation knowledge graph and retrieval enhancement generation reasoning engine constructed in the above steps, an intelligent question answering platform is developed. During the development of the intelligent question answering platform, the left side of the platform interface provides a knowledge graph visualization and node information query window, and the right side is a user question interaction window. It also supports knowledge tracing function, highlighting key information in the answer and linking it to relevant nodes in the knowledge graph.
[0024] Preferably, in step 1.1, the OCR recognition and document format conversion tools specifically include using the TesseractOCR engine for image text recognition and using the pdf2docx library to convert PDF files into Word document format.
[0025] Preferably, in step 1.2, the resource element ontology This includes sensing resources, computing resources, and control resources; the process ontology. Includes ventilation processes and fluid development processes; business process ontology. Includes construction management and maintenance management; project schedule body Includes time planning and progress monitoring; physical cost entity. This includes energy costs and equipment costs.
[0026] Preferably, in step 1.3, the physical spatial structure includes the geometry of the underground project, the location of ventilation shafts, and the layout of ventilation ducts; the development of ventilation fluid includes air velocity, pressure distribution, and temperature changes; and the process assurance requirements include the configuration of ventilation equipment, energy consumption requirements, and safety standards.
[0027] Preferably, in step 3, the Neo4j graph database supports single-graph storage management with hundreds of billions of nodes, and uses the py2neo library to achieve automated data import based on the Python language.
[0028] Preferably, in step 4.1, the jieba word segmentation tool is used to perform Chinese word segmentation on the user input text, and nouns are extracted as keywords through stop word filtering and part-of-speech tagging.
[0029] Preferably, in step 4.2, the embedding vector and embedding vector All were generated by a pre-trained BERT model, with a cosine similarity threshold. Set it to 0.9 or higher (the cosine similarity threshold needs to be adjusted appropriately according to the domain corpus and application scenario. Generally speaking, the threshold is set to a value of 0.9 or higher: 0.98 or higher when the retrieval accuracy requirement is high, and around 0.95 when the retrieval accuracy requirement is not high and the information diversity requirement is high).
[0030] A system for enhancing the generation of knowledge graph retrieval for on-demand ventilation in underground engineering includes: a data acquisition and preprocessing layer, an ontology and knowledge extraction layer, a graph storage layer, a semantic indexing and entity linking layer, a subgraph arrangement and prompt word generation layer, a generation and reasoning layer, and an application and interaction layer. The data acquisition and preprocessing layer includes: a multi-source data interface module, an OCR recognition and format conversion module, and an encoding cleaning module. The ontology and knowledge extraction layer includes: five major ontology libraries. The graph storage layer includes a Prompt-Tuning module and an information extraction service module. The graph storage layer includes a Neo4j graph database cluster module and an ETL import script module. The semantic indexing and entity linking layer includes a vectorization service module, a FAISS index module, and a keyword parser. The subgraph arrangement and prompt word generation layer includes a subgraph extractor, a template manager, and a context splicer. The generation and inference layer includes a large language model inference service module and a RAG scheduler controller. The application and interaction layer includes a front-end visualization module and an API gateway module. The front-end visualization module includes a knowledge graph window and a question-and-answer window. The data acquisition and preprocessing layer collects heterogeneous data such as engineering drawings, monitoring logs, and specification documents, unifying them into parsable text. The ontology and knowledge extraction layer defines concepts, attributes, and behavioral relationships, extracting entity, behavioral, and attribute triples from small sample corpora. The graph storage layer stores on-demand knowledge graphs and supports k-hop queries and visualization. The semantic indexing and entity linking layer converts questions and graph nodes into embedded vectors, using thresholding... Select target entity set The subgraph arrangement and prompt word generation layer extracts relevant subgraphs. Generate text And assemble The generation and inference layer input The system generates answers containing specific and accurate technical information, knowledge, and traceability tags related to underground engineering ventilation. The application and interaction layer provides natural language retrieval, node drilling, and answer tracing functions. The ontology, knowledge extraction layer, and graph storage layer are connected to form an underground engineering on-demand ventilation knowledge graph. The semantic index and entity linking layer, subgraph arrangement and prompt word generation layer, and generation and reasoning layer are connected to form a retrieval-enhanced generation and reasoning engine. The application and interaction layer is an intelligent question-answering software platform. The underground engineering on-demand ventilation knowledge graph, through ontology modeling, knowledge extraction, and graph database storage, constitutes the system's knowledge foundation. The retrieval-enhanced generation and reasoning engine includes semantic matching, subgraph arrangement and prompt word generation, and large language model reasoning, completing the core processing from query to answer. The intelligent question-answering software platform provides a user interface, interactive question answering, and knowledge tracing.
[0031] In practical use, ventilation engineers from construction units or design institutes open a browser, log in to the intelligent Q&A platform, and select the current tunnel or underground station project. The system automatically loads the ventilation knowledge graph and monitoring data already built for that project. If engineers have new construction logs, on-site wind speed measurement point tables, or supplementary specification documents, they can directly drag and drop to upload PDFs / images. The background immediately triggers OCR and format conversion, and performs data cleaning and knowledge extraction processes. A few minutes later, the newly added entry flashes "Updated" in the graph window. Entering natural language in the "Q&A" input box on the right, such as "After a nighttime blast in a vertical shaft section, how do I estimate the necessary fan power and the shortest smoke exhaust time?" or quickly clicking on a graph node on the left (such as "vertical shaft" or "blast exhaust"), the system automatically writes the node label into the question box. The system first uses jieba word segmentation and stop word filtering to extract keywords, then uses BERT embedding vectors to match relevant entities in the Neo4j+FAISS dual index; several core nodes are then found. The system then extracts 1-2 hop subgraphs, assembling information such as wind speed thresholds, residual pressure curves, and existing blasting cases into a Prompt. This Prompt is fed into a large language model on the GPU node, typically returning a streaming answer in 2-3 seconds. The answer text on the right side of the interface refreshes line by line, while the graph on the left automatically highlights key information within the answer text. Engineers can click on any highlighted edge to view the source file and page number. Simultaneously, the system can generate a report with a single click, exporting the Q&A content along with screenshots of referenced nodes and parameter tables to Word / PDF format for easy submission with construction logs or design review. If an engineer finds a parameter inconsistent with the latest standards, they can directly modify it or add comments in the node properties window. Modifications enter a "review queue," are confirmed by the technical lead, and then written back to the knowledge graph and indexed, enabling continuous iteration. During operation, the monitoring system pushes wind speed or concentration data streams to the platform every 5 minutes. In case of anomalies, the system automatically triggers a Q&A session and pushes emergency plans to on-duty personnel for decision support.
[0032] Through actual testing, a test set containing over 5,000 test cases was constructed based on real-world engineering business information in scenarios such as construction ventilation. The test set included true / false, fill-in-the-blank, and short-answer questions. Using this test set, the output accuracy of the large language model was tested under conditions with and without a knowledge graph. The test results showed that the output accuracy of the large language model was approximately 48% without a knowledge graph, while it was 90% with a knowledge graph. This demonstrates that the retrieval-enhanced generation method can significantly improve the accuracy of ventilation-related professional knowledge question answering in the large model.
[0033] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples of the present invention and are not intended to limit the present invention. Various changes and modifications can be made to the present invention without departing from the spirit and scope thereof, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for enhancing the generation of knowledge graphs for on-demand ventilation in underground engineering, characterized in that, Includes the following steps: Step 1, data cleaning and ontology layer modeling, includes: Step 1.1, Data Collection and Cleaning: Collect textual materials related to underground engineering ventilation, including engineering drawings, technical documents, construction business documents, and standards and specifications; use OCR recognition and document format conversion tools to convert PDF or image formats into Word documents or text document formats; unify encoding, remove garbled characters, ensure data quality, and form a high-quality text dataset; Step 1.2, Ontology Layer Modeling: Construct a comprehensive intelligent ventilation ontology library based on the five key elements of engineering management in a top-down manner. The formula is as follows: , In the formula, This refers to the intelligent ventilation integrated system library. Represents the ontology of resource elements, Indicates the main body of the process. Represents the business process entity. Indicates the progress of the project. Represents the physical cost entity; At the same time, define concepts, attributes, and behavioral relationships for each of the above ontology; Step 1.3, Data Layer Population and Physical Layer Classification: Based on the ontology layer template, entities, behavioral relationships, and attributes are extracted from the cleaned data; the physical layer classifies entity types into three categories: physical spatial structure, ventilation and fluid development, and process assurance requirements. Step 2: Knowledge extraction based on prompting engineering, including: Step 2.1, Knowledge Extraction Definition: Using Functions This represents the knowledge extraction process, where... This represents raw data, including text, logs, and tables. This represents the set of entities extracted. Represents a set of relationships between entities. It represents a set of attributes, that is, descriptive information about entities or relationships; Step 2.2, Prompt Project, including: Step 2.2.1, Construct sub-hint template: For each token Generate a sub-hint The sub-hint transforms the named entity recognition task into a classification task, expressed as: , , In the formula, Indicates targeting the token Sub-prompt templates are used for named entity recognition; The input text sample consists of n basic units, i.e., tokens, each... It is a token in the sample; Indicates sample The i-th token in the middle, This represents a conditional function associated with the i-th token, specifically in the form of: Used to determine Does it belong to ; This represents the mask marker for the i-th token, used to prompt the large language model to predict the entity type of that token. Indicates the candidate entity type, belonging to the entity type set. Each In This is the type of target entity that the large language model needs to predict; Step 2.2.2: Integrate the hint template: Combine all the sub-hints of all tokens into a complete hint template. The expression is: , In the formula, Represents the entire sample The integrated hint template consists of sub-hint templates for all tokens; n represents the sample. The total number of tokens in the system; Step 2.2.3, Answer Search: For each Entity type Fill in the blanks and calculate their probabilities; use a large language model to calculate the probability of each candidate answer. It selects the entity type with the highest probability; all entities in the entire sentence are accurately identified. The cumulative product of the probabilities of each sub-probability is expressed as follows: , In the formula, This represents the probability that the i-th entity type is accurately identified; Step 2.2.4 Entity type output: According to the predictions of the Big Prophecy model, Replace with the corresponding entity type This generates structured entity annotation results; Step 3, Knowledge Graph Data Population and Storage: Import the JSON format data generated in Step 2 into the Neo4j graph database using a Python program based on the py2neo library; Step 4: Retrieve and enhance the generative inference engine, including: Step 4.1, Keyword Extraction: Extract keywords from user-input text. Perform word segmentation and extract keyword sets. In the formula, This refers to the query text entered by the user. The set of keywords extracted from it. Represents a set of keywords The i-th keyword in the set, m represents the keyword set. The total number of keywords in the text; Step 4.2, Entity Matching: Use cosine similarity to match entities in the knowledge graph. Define the target entity set, expressed as: , In the formula, This represents the target entity set, containing entities relevant to the user's query selected from the knowledge graph; 'e' represents a variable of a single entity in the knowledge graph; 'E' represents the complete entity set in the knowledge graph, containing all stored entity nodes; and 'j' represents the index, corresponding to the keyword set. A keyword in ; m represents the set of keywords The total number; Represents a set of keywords The j-th keyword in The embedding vector of entity e. Keywords Embedded vector, The threshold representing cosine similarity is used to determine e and Are they similar enough? Step 4.3, Subgraph Extraction: Extract the subgraph of the target entity e, expressed as: , In the formula, This represents the relevant information extracted for the target entity e in application scenario i. This represents a subgraph centered on the target entity e, specifically in application scenario i; Subgraph The set of entities in the target entity e, that is, the set of nodes associated with the target entity e; Subgraph The set of relations in the set, i.e., the connection The edges of the entities in the graph; i represents the specific application scenario that affects the subgraph. The construction; Step 4.4, Prompt Generation and Answer Generation: The user question, knowledge graph information, real-time data, and general rules are concatenated into a prompt, expressed as: , In the formula, This represents the complete prompt words generated for the user's input query q, which are used to input into the large language model to generate an answer; q represents the original query text input by the user, i.e., the natural language question raised by the user through the intelligent question answering platform. This represents the general scheduling rules retrieved from the document database in application scenario i. This represents the target entity set, which contains entities selected from the knowledge graph that are relevant to the user query q. The subgraph information representing the target entity e in application scenario i is converted into a string format; Step 5: Development of Intelligent Question Answering Platform: Based on the underground engineering ventilation knowledge graph and retrieval enhancement generation reasoning engine constructed in the above steps, an intelligent question answering platform is developed. During the development of the intelligent question answering platform, the left side of the platform interface provides a knowledge graph visualization and node information query window, and the right side is a user question interaction window. It also supports knowledge tracing function, highlighting key information in the answer and linking it to relevant nodes in the knowledge graph.
2. The method for enhancing the generation of knowledge graphs for on-demand ventilation in underground engineering according to claim 1, characterized in that, In step 1.1, the OCR recognition and document format conversion tools specifically include using the Tesseract OCR engine for image text recognition and using the pdf2docx library to convert PDF files into Word document format.
3. The method for enhancing the generation of knowledge graphs for on-demand ventilation in underground engineering according to claim 1, characterized in that, In step 1.2, the resource element ontology This includes sensing resources, computing resources, and control resources; the process ontology. Includes ventilation processes and fluid development processes; business process ontology. Includes construction management and maintenance management; project schedule body Includes time planning and progress monitoring; physical cost entity. This includes energy costs and equipment costs.
4. The method for enhancing the generation of knowledge graph retrieval for on-demand ventilation in underground engineering according to claim 1, characterized in that, In step 1.3, the physical spatial structure includes the geometry of the underground project, the location of ventilation shafts, and the layout of ventilation ducts; the development of ventilation fluid includes air velocity, pressure distribution, and temperature changes; and the process assurance requirements include the configuration of ventilation equipment, energy consumption requirements, and safety standards.
5. The method for enhancing the generation of knowledge graph retrieval for on-demand ventilation in underground engineering according to claim 1, characterized in that, In step 3, the Neo4j graph database supports single-graph storage management with hundreds of billions of nodes and uses the py2neo library to achieve automated data import based on the Python language.
6. The method for enhancing the generation of knowledge graph retrieval for on-demand ventilation in underground engineering according to claim 1, characterized in that, In step 4.1, the jieba word segmentation tool is used to segment the user input text into Chinese words, and nouns are extracted as keywords through stop word filtering and part-of-speech tagging.
7. The method for enhancing the generation of knowledge graph retrieval for underground engineering ventilation according to claim 1, characterized in that, In step 4.2, the embedding vector and embedding vector All were generated by a pre-trained BERT model, with a cosine similarity threshold. Set it to 0.9 or higher.
8. A system based on the enhanced generation method for knowledge graph retrieval of on-demand ventilation in underground engineering as described in claim 1, characterized in that, include: The system comprises a data acquisition and preprocessing layer, an ontology and knowledge extraction layer, a graph storage layer, a semantic indexing and entity linking layer, a subgraph arrangement and prompt word generation layer, a generation and reasoning layer, and an application and interaction layer. The data acquisition and preprocessing layer includes a multi-source data interface module, an OCR recognition and format conversion module, and an encoding cleaning module. The ontology and knowledge extraction layer includes five major ontology libraries. The graph storage layer includes a Prompt-Tuning module and an information extraction service module. The graph storage layer includes a Neo4j graph database cluster module and an ETL import script module. The semantic indexing and entity linking layer includes a vectorization service module, a FAISS index module, and a keyword parser. The subgraph arrangement and prompt word generation layer includes a subgraph extractor, a template manager, and a context splicer. The generation and inference layer includes a large language model inference service module and a RAG scheduler controller. The application and interaction layer includes a front-end visualization module and an API gateway module. The front-end visualization module includes a knowledge graph window and a question-and-answer window. The data acquisition and preprocessing layer collects heterogeneous data such as engineering drawings, monitoring logs, and specification documents, unifying them into parsable text. The ontology and knowledge extraction layer defines concepts, attributes, and behavioral relationships, extracting entity, behavioral, and attribute triples from small sample corpora. The graph storage layer stores on-demand knowledge graphs and supports k-hop queries and visualization. The semantic indexing and entity linking layer converts questions and graph nodes into embedded vectors, using thresholding... Select target entity set The subgraph arrangement and prompt word generation layer extracts relevant subgraphs. Generate text And assemble The generation and inference layer input The system generates answers containing specific and accurate technical information, knowledge, and traceability tags related to underground engineering ventilation. The application and interaction layer provides natural language retrieval, node drilling, and answer tracing functions. The ontology, knowledge extraction layer, and graph storage layer are connected to form an underground engineering on-demand ventilation knowledge graph. The semantic index and entity linking layer, subgraph arrangement and prompt word generation layer, and generation and reasoning layer are connected to form a retrieval-enhanced generation and reasoning engine. The application and interaction layer is an intelligent question-answering software platform. The underground engineering on-demand ventilation knowledge graph, through ontology modeling, knowledge extraction, and graph database storage, constitutes the system's knowledge foundation. The retrieval-enhanced generation and reasoning engine includes semantic matching, subgraph arrangement and prompt word generation, and large language model reasoning, completing the core processing from query to answer. The intelligent question-answering software platform provides a user interface, interactive question answering, and knowledge tracing.
Citation Information
Cited By
Knowledge graph construction and embedding method in welding process field
CN121638423A
Semiconductor secondary configuration-oriented multi-source document intelligent question-answering method and device
CN122112053A