Rock mechanics large model construction and knowledge interaction method

By systematically collecting and sorting out rock mechanics data, building vector databases and knowledge graphs, and fine-tuning large language models, the problem of general models performing poorly in the field of rock mechanics is solved, efficient knowledge interaction and question-and-answer capabilities are achieved, and rock mechanics is improved. Research efficiency and decision-making accuracy in the field.

CN119129742APending Publication Date: 2024-12-13NORTHEASTERN UNIV CHINA

Patent Information

Application Number
CN202411171638.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The general-purpose large-language model has poor application performance in the field of rock mechanics, lacks professional knowledge coverage, low acquisition efficiency, and the resources for pre-training large models are consumed in the beginning, making it difficult to respond quickly and adapt to new knowledge flexibly.

Method used

By systematically collecting and sorting out data in the field of rock mechanics, building vector databases and knowledge graphs, designing problem prompt templates, fine-tuning general large language models, enhancing their knowledge interaction capabilities in the field of rock mechanics, and providing document Q&A, mathematical Q&A and rule judgments. Module to improve knowledge retrieval and application efficiency.

Benefits of technology

It realizes comprehensive integration and efficient retrieval of rock mechanics expertise, enhances the knowledge Q&A ability of large models in the field of rock mechanics, improves the work efficiency and decision-making accuracy of researchers, and reduces the resource consumption of pre-trained models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129742A_ABST
    Figure CN119129742A_ABST
Patent Text Reader

Abstract

The invention provides a rock mechanics large model construction and knowledge interaction method, and relates to the technical field of rock mechanics. The method comprises the following steps: firstly, collecting and carding data in the field of rock mechanics to obtain a data document, and storing the data document into a vector database after partitioning and vectorizing the data document; knowledge is extracted from the vectorized document fragments, a knowledge tetrad is generated, and a knowledge graph is constructed; then, based on the vector database and the knowledge graph, an external knowledge base is constructed, an existing general large language model is finely adjusted through a prompt project, and a large model in the field of rock mechanics is constructed; and finally, applying the constructed large model in the field of rock mechanics to a knowledge interaction system in the field of rock mechanics, and providing accurate answers and professional knowledge support by classifying and processing different types of questions and utilizing an external knowledge base. The method solves the problems that a general large model is poor in performance when answering professional knowledge of rock mechanics, and resource consumption is large when a rock mechanics large model is pre-trained from the beginning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of rock mechanics, and in particular to a method for constructing a large rock mechanics model and interacting with knowledge. Background Art

[0002] In the field of rock mechanics, researchers and engineers need to deal with a large amount of complex data and expertise to solve practical engineering problems. With the emergence of large language models represented by ChatGPT, a new wave of research and application has been set off. These general large language models perform well in natural language understanding and generation, and can realize multiple functions such as text summarization and dialogue analysis. However, rock mechanics involves complex experimental data, theoretical models, and engineering cases. It is difficult for general models to cover these specific expertise, resulting in poor performance when answering professional questions. General models are prone to generate content that is inconsistent with the facts, which is particularly dangerous in the field of rock mechanics. False information may lead to engineering decision-making errors, resulting in serious safety hazards and economic losses. Therefore, it is particularly important to fine-tune a large model specifically for the field of rock mechanics.

[0003] At present, practitioners in various fields such as medicine, law, and finance apply general models to their respective vertical fields through continuous pre-training / instruction fine-tuning. However, these methods usually require a large amount of high-quality data and computing resources, and the process is complicated and time-consuming. This is not efficient and practical enough for the field of rock mechanics, which requires rapid response and flexible adaptation to new knowledge.

[0004] In the field of rock mechanics, researchers and engineers need to process a large amount of complex data and expertise to solve practical engineering problems. However, the current knowledge interaction in the field of rock mechanics still has significant defects:

[0005] (1) Insufficient coverage of rock mechanics expertise: The field of rock mechanics involves a variety of experimental methods and theoretical research, such as true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock bursts, large deformation, etc. These research data and knowledge are scattered in different books, documents and experimental reports, and general models cannot be systematically integrated and utilized, resulting in poor performance in answering professional questions in rock mechanics and a lack of comprehensive and systematic knowledge support.

[0006] (2) Low efficiency and lack of relevance in rock mechanics knowledge acquisition: Existing knowledge acquisition methods often rely on manual search and screening, which is not only inefficient but also prone to missing key information. Existing knowledge lacks relevance and cannot be fully utilized and shared, which affects researchers' ability to quickly and accurately obtain relevant knowledge and data support when solving complex problems.

[0007] (3) High resource consumption of pre-trained models: Training a large rock mechanics model from scratch requires a lot of computing resources and time. For most scientific research institutions and enterprises, this is an expensive and time-consuming task and is not suitable for the field of rock mechanics, which requires rapid response and flexible adaptation to new knowledge. Summary of the invention

[0008] The technical problem to be solved by the present invention is to provide a method for constructing a large rock mechanics model and interacting with knowledge in response to the above-mentioned deficiencies in the prior art, so as to solve the problems of poor performance of general large models in answering professional knowledge of rock mechanics and high resource consumption of pre-training large rock mechanics models from scratch, thereby improving the ability of the large model to answer knowledge questions in the field of rock mechanics.

[0009] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for constructing a large rock mechanics model and interacting with knowledge, comprising the following steps:

[0010] Step 1: Collect and sort out data in the field of rock mechanics and obtain data documents in the field of rock mechanics;

[0011] First, the research direction and experimental methods in the field of rock mechanics are clarified, including true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock burst and large deformation. In order to ensure the authority and reliability of data sources, data collection will cover books, academic papers, research reports, experimental data and technical specifications in related fields.

[0012] In the process of data sorting, the collected data are first systematically organized, archived and classified according to six categories: true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock burst, and large deformation, to ensure the systematicness and orderliness of the data; in order to unify the data format, data from different sources will be formatted to ensure its readability and consistency; at the same time, duplicate data will be deduplicated, and omissions will be checked and supplemented to ensure the integrity and uniqueness of the data.

[0013] In order to facilitate subsequent data processing and knowledge extraction, the experimental data, diagrams and key paragraphs related to rock mechanics are marked and annotated in detail, the theoretical knowledge is annotated, and the relevant concepts and formulas are extracted;

[0014] Step 2: Divide and vectorize the collected and sorted data documents in the field of rock mechanics;

[0015] First, the sorted data documents are divided into blocks, that is, each document is divided into several segments, each segment contains a relatively independent knowledge unit;

[0016] After the document segmentation is completed, each segmented text segment is vectorized to capture the semantic information and features of the text segment; after the text segment vectorization is completed, the vectorized text segments are stored in a vector database;

[0017] Step 3: Extract knowledge from the vectorized document fragments, generate knowledge quadruples, and construct a knowledge graph;

[0018] First, the existing general large language model is used to identify entities and relations in document fragments and extract all knowledge triples involved in the document;

[0019] Set the following prompts for the large language model:

[0020] Suppose you are an expert in rock mechanics knowledge extraction and need to build a knowledge graph based on the document content. Please extract all single-hop and multi-hop triplets.

[0021] When you encounter a sentence, break it down into triplets;

[0022] If the tail entity in a triple contains multiple attributes or features, the triple is decomposed into multiple independent triples;

[0023] Please extract all triples involved in the document;

[0024] After the knowledge triples are extracted, the document fragments for knowledge extraction are integrated into the triples as context to form knowledge quadruples. Each knowledge quadruplet consists of four parts: head entity, relationship, tail entity and context. The head entity and tail entity represent two related knowledge points respectively, the relationship represents the type of association between the two entities, and the context provides the background information and context of the relationship.

[0025] After generating knowledge quadruplets, a knowledge graph is constructed based on these quadruplets. First, all extracted knowledge quadruplets are summarized to eliminate duplicate and redundant information to ensure the uniqueness and accuracy of knowledge. Then, the head and tail entities in the quadruplets are used as nodes and the relationships as edges to construct a preliminary knowledge graph. On this basis, semantic clustering is used to identify and merge synonymous or similar entities and relationships to further optimize the graph structure and improve the integrity and coherence of the graph.

[0026] Step 4: Based on the vector database and knowledge graph constructed in steps 2 and 3, an external knowledge base is constructed, and the existing general large language model is fine-tuned through prompt engineering to enhance its knowledge interaction ability in the field of rock mechanics and build a large model in the field of rock mechanics;

[0027] 1) Design question prompt templates: Design question prompts for each specific knowledge point and question type to ensure that the question prompts cover a wide range of knowledge and application scenarios in the field of rock mechanics;

[0028] 2) Retrieve external knowledge base to generate training data: Extract knowledge fragments that match the question prompt template from the external knowledge base; annotate the extracted data to ensure that the answer corresponding to each prompt word is accurate; the annotation process includes detailed description of knowledge points, formulas, experimental data and rules, and then generate a training data set containing question prompt words and corresponding answers;

[0029] 3) Model training: The training data is input into a general large language model, which will generate answers corresponding to the prompt words of the question; the answers generated by the model are then verified to ensure that they are consistent with the marked correct answers;

[0030] Step 5: Apply the constructed large model in the field of rock mechanics to the knowledge interaction system in the field of rock mechanics, handle different types of problems by classification, and use external knowledge bases to provide accurate answers and professional knowledge support;

[0031] The knowledge interaction system includes a classification module, a document question-answering module, a mathematical question-answering module, and a rule identification module. These modules process different types of questions through classification and use external knowledge bases to provide accurate answers and professional knowledge support.

[0032] The classification module uses a large model of the rock mechanics field to parse the questions input by the user, extract entities and professional terms related to rock mechanics, and classify the questions into document questions and answers, mathematical questions and answers, or rule discrimination based on the extracted entities and terms using predefined classification rules; the classification rules are the following prompt words: "If the question contains terms and formulas related to calculations, it is classified as a mathematical question and answer; if it involves specific specifications or judgment rules, it is classified as a rule discrimination; other questions involving explanations or descriptions are classified as document questions and answers;"

[0033] The document question-answering module searches for document question-answering questions based on the knowledge graph and vector database; for the document question-answering questions raised by the user, firstly, the relevant entities and their relationships are searched in the knowledge graph; then, semantic similarity matching is performed based on the extracted entities and the entities in the knowledge graph in the external knowledge base; after the entity matching is successful, quadruple retrieval is performed based on the relationship; the retrieved quadruple is spliced ​​after removing the "," and spliced ​​with the original question, and then the spliced ​​text is input into the large model of the rock mechanics field to generate an accurate answer;

[0034] If no relevant content is found in the knowledge graph, a similarity search is performed based on the vector database. The retrieved similar content is combined with the original question and input into the large model of rock mechanics to generate an answer.

[0035] The math question-answering module identifies methods and formulas for math question-answering questions, and performs formula calculations and result generation;

[0036] For the mathematical problems input by the user, the rock mechanics model will analyze the problems and extract the formula names and related parameters that need to be calculated. Then, it will search the vector database for related formulas and descriptions based on the content to ensure that the correct formulas and methods are matched. Formula calculations will be performed based on the retrieved formulas and matching parameters.

[0037] The rule discrimination module performs rule retrieval for rule judgment problems; for problems involving rule discrimination, the rock mechanics domain big model will analyze the user's questions, make a comprehensive judgment based on the rules retrieved from the external knowledge base, and give an answer.

[0038] The present invention provides a method for constructing a large rock mechanics model and interacting with knowledge, aiming to improve the ability of the large model to answer questions in the field of rock mechanics, which specifically includes the following key points:

[0039] (1) Improving the efficiency of integrating rock mechanics expertise:

[0040] Data collection and sorting: Comprehensively and systematically collect and sort out books, literature and experimental data in the field of rock mechanics, covering six major aspects: true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock burst, and large deformation.

[0041] Document segmentation and vectorization: Documents are segmented into several fragments, and these fragments are vectorized and stored in a vector database for efficient retrieval.

[0042] Knowledge graph construction: extract knowledge from vectorized document fragments, generate knowledge quadruples (head entity, relationship, tail entity, context), build knowledge graphs, store knowledge relationships in a structured manner, mine knowledge relevance, and improve the efficiency of knowledge management and retrieval.

[0043] Integration of external knowledge base: Integrate the vector database with the knowledge graph to form a comprehensive external knowledge base to provide rich and structured domain knowledge support for the model.

[0044] (2) Enhance the knowledge interaction capability of large models in the field of rock mechanics:

[0045] Prompt Engineering: Through prompt engineering, prompt templates suitable for the field of rock mechanics are designed to guide the general large language model to focus on specific knowledge points and question types, thereby building a large model suitable for the field of rock mechanics. This method avoids the large amount of computing resources and time required to train a pre-trained model from scratch, providing an efficient and economical solution.

[0046] (3) Multiple knowledge interaction functions:

[0047] Classification module design: Use a large language model to extract question entities and classify questions raised by users, corresponding to document question and answer, mathematical question and answer, and rule discrimination functions respectively.

[0048] Document question-answering module: Knowledge graph-based retrieval: For questions raised by users, first search for related entities and relationships based on the knowledge graph, concatenate the retrieved content with the original question, and send it to LLM to output an accurate answer. Similarity retrieval based on vector database: If the knowledge graph retrieval fails to find relevant content, similarity retrieval is performed based on the vector database, and the retrieved similar content is concatenated with the original question and sent to LLM to output an accurate answer.

[0049] Mathematical question-answering module: Method and formula identification: Identify the specific method and formula requirements in the questions raised by the user, and retrieve relevant formulas and descriptions based on the vector database. Formula calculation and result generation: Perform formula calculation based on the retrieved formula and the parameters provided by the user, and return the calculation results and related descriptions to the user.

[0050] Rule identification module: Rule retrieval: For problems involving rule identification, the relevant content in the search vector database is matched. Result generation: The conclusion of rule identification is output based on the matching results, and the basis and process of the identification are explained.

[0051] The beneficial effects of the above technical solution are as follows: the method for constructing a large rock mechanics model and interacting with knowledge provided by the present invention achieves the following significant effects by constructing a large model in the field of rock mechanics:

[0052] (1) Rock mechanics knowledge integration:

[0053] By systematically collecting and sorting out professional knowledge in the field of rock mechanics, covering true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock burst, large deformation and other experimental methods and theoretical research, based on vector databases and knowledge graphs, a comprehensive and systematic external knowledge base has been constructed to systematically store and manage knowledge, thereby improving the efficiency of knowledge retrieval and application.

[0054] (2) Questions and answers on rock mechanics expertise:

[0055] The document question-and-answer module of the present invention can retrieve rock mechanics expertise from a systematic external knowledge base, enhance the knowledge question-and-answer capability in the large model field, and generate detailed and accurate answers. The document question-and-answer module achieves efficient query and accurate answer to professional questions through the combination of knowledge graph and vector database, significantly improving the work efficiency and decision-making accuracy of researchers in the field of rock mechanics.

[0056] (3) Mathematics Questions and Answers:

[0057] The mathematical question-answering module of the present invention can identify and calculate complex mechanical formulas in the field of rock mechanics, provide accurate mathematical calculation results, and support specific application scenarios such as true triaxial mechanical tests, rock stress analysis, and large deformation calculations. By providing accurate mathematical calculation results and real-time answers, the mathematical question-answering module allows researchers to obtain answers to complex mechanical problems in rock mechanics in real time, avoiding the tedious manual calculations and improving work efficiency.

[0058] (4) Rule determination:

[0059] The rule discrimination module of the present invention plays an important role in multiple key application scenarios in the field of rock mechanics. By providing accurate discrimination in rockburst grade judgment, test result judgment, rock mass classification, etc., it significantly improves the scientificity, rationality and safety of engineering decision-making, effectively ensures the long-term stability and safety of the project, and provides strong technical support for researchers and engineers. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A flowchart of a method for constructing a large rock mechanics model and interacting with knowledge provided by an embodiment of the present invention;

[0061] Figure 2 A schematic diagram of constructing an external knowledge base provided by an embodiment of the present invention;

[0062] Figure 3 A structural block diagram of a knowledge interaction system provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0064] The present invention provides a large rock mechanics model construction and knowledge interaction method, which aims to improve the accuracy and efficiency of knowledge interaction in the field of rock mechanics. Specifically, it mainly includes:

[0065] (1) Improve the coverage of rock mechanics expertise: Through systematic collection and sorting of expertise in the field of rock mechanics, various experimental methods and theoretical research such as true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock burst, and large deformation are covered. A comprehensive and systematic external knowledge base is built, and knowledge is structured and stored through document segmentation and vectorization. A knowledge graph is constructed to achieve systematic integration and correlation management of knowledge, so that the large model can integrate and utilize research data and knowledge scattered in different books, literature, and experimental reports, and provide reliable knowledge support.

[0066] (2) Reduce resource consumption of pre-trained models: Based on the existing general large model, by introducing an external knowledge base, special training and optimization for the field of rock mechanics are carried out to build a large model suitable for the field of rock mechanics. This invention avoids the large amount of computing resources and time required to train a large model from scratch, and provides an efficient and economical solution to meet the needs of scientific research institutions and enterprises for rapid response and flexible adaptation to new knowledge in the field of rock mechanics.

[0067] (3) Realize multiple knowledge interaction functions: Design and implement knowledge interaction modules with multiple knowledge interaction capabilities such as document question and answer, mathematical question and answer, and rule judgment. Through the document question and answer module, the present invention can retrieve rock mechanics expertise from an external knowledge base and generate accurate answers; through the mathematical question and answer module, the present invention can identify and calculate complex mechanical formulas; through the rule judgment module, the present invention can make judgments based on predefined judgment rules. This method significantly improves the work efficiency and decision-making accuracy of researchers and engineers in the field of rock mechanics.

[0068] In this embodiment, a rock mechanics large model construction and knowledge interaction method is provided, such as Figure 1 As shown, the following steps are included:

[0069] Step 1: Collect and sort out data in the field of rock mechanics and obtain data documents in the field of rock mechanics;

[0070] First, the key research directions and experimental methods in the field of rock mechanics are clarified, including but not limited to true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock burst, large deformation and other six aspects. In order to ensure the authority and reliability of the data source, the data collection will cover books, academic papers, research reports, experimental data and technical specifications in related fields. Specifically, relevant content will be obtained from classic and latest books in the field of rock mechanics, relevant papers will be retrieved and downloaded through academic databases (such as IEEE, Springer, ScienceDirect, etc.), research reports and technical white papers published by scientific research institutions and laboratories will be collected, and various experimental data and relevant technical specifications issued by national or international standardization organizations will be sorted out.

[0071] In the process of data sorting, the collected data are first systematically sorted, and archived and classified according to six categories: true triaxial mechanical test, similar simulation experiment, field test technology, mechanical theory, rock burst, and large deformation, to ensure the systematic and orderly nature of the data. In order to unify the data format, data from different sources will be converted to ensure readability and consistency. For example, paper books and reports will be digitized, and electronic documents in different formats will be converted to a unified storage format. At the same time, duplicate data will be deduplicated, and omissions will be checked and supplemented to ensure the integrity and uniqueness of the data.

[0072] In order to facilitate subsequent data processing and knowledge extraction, important experimental data, charts and key paragraphs are marked and annotated in detail. For example, experimental data such as true triaxial mechanical tests, similar simulation experiments and field test technologies are marked in detail, including experimental conditions, parameters and results; theoretical knowledge such as mechanical theory, rock burst and large deformation are annotated in detail to extract key concepts and formulas.

[0073] Step 2: Divide and vectorize the collected and sorted data documents in the field of rock mechanics;

[0074] After comprehensively collecting and sorting out the data in the field of rock mechanics, the next step is to process these data documents into blocks and vectorize them for subsequent rapid retrieval and knowledge application. Figure 2 As shown in the upper left corner. First, the sorted documents are divided into blocks, that is, each document is divided into several fragments (chunks), each fragment contains relatively independent knowledge units. The purpose of this step is to break down long documents into smaller, easier-to-process fragments, so that each fragment can independently represent a specific knowledge point or information, thereby improving the efficiency of subsequent processing and retrieval.

[0075] After the document is segmented, each segmented text fragment is vectorized. Vectorization is the process of converting text fragments into vector representations, which can capture the semantic information and features of the text fragments. Specifically, the text vector model bge-large-zh-v1.5 is used to vectorize the text fragments and convert them into high-dimensional vectors. bge-large-zh-v1.5 is a pre-trained language model based on deep learning, designed to process and understand Chinese natural language. The model is trained on a large-scale Chinese corpus and has strong language understanding and generation capabilities. These vectorized fragments can efficiently represent the semantic information of the text, facilitating subsequent rapid retrieval and knowledge matching.

[0076] After the text fragments are vectorized, they are stored in the vector database Faiss (Facebook AI Similarity Search). Faiss is a library developed by Facebook for large-scale vector retrieval and similarity search. It is mainly used to process high-dimensional vectors, such as image features, text vectors, etc. Faiss provides an efficient index structure and query algorithm that can quickly find the most similar vectors in massive data sets. By storing the vectorized fragments in Faiss, the system can quickly retrieve the text fragments that are most similar to the query content, achieving efficient knowledge search and question-answering support.

[0077] Through the above-mentioned block processing and vectorization steps, not only can complex rock mechanics documents be converted into small fragments that are easy to process, but also through the application of vectorization and vector database, efficient text fragment storage and retrieval can be achieved, providing a solid data foundation for subsequent knowledge graph construction and intelligent question and answer.

[0078] Step 3: Extract knowledge from the vectorized document fragments, generate knowledge quadruples, and construct a knowledge graph;

[0079] In order to capture the knowledge relationship between documents, the present invention further extracts knowledge from the vectorized document fragments after vectorization processing and generates knowledge quadruplets, such as Figure 2 Shown in the lower part.

[0080] First, knowledge triples are extracted. Specifically, the large model LLaMA3 is used to identify entities and relations in the fragment. We set the following prompts for LLaMA3: "If you are an expert in rock mechanics knowledge extraction and now need to build a knowledge graph based on the document content, please extract all single-hop and multi-hop triples. Single-hop triples are directly extracted from a single sentence, and the head entity, relationship, and tail entity are directly associated in the same sentence. Multi-hop triples are extracted by spanning multiple sentences or indirectly associated through intermediate concepts to form an association relationship spanning multiple logical steps. When encountering a sentence, please break it into triples. For example, the sentence 'During the construction process, a dynamic rock burst control method should be adopted, and the rock burst level and area should be reviewed and corrected according to the newly revealed geological conditions, as well as the excavation, stress relief holes, and support schemes should be dynamically adjusted to avoid the occurrence of rock bursts or reduce the level of rock bursts' can extract the following triples, [Construction process, adopt, rock burst dynamic control method], [Construction process, according to, newly revealed geological conditions], [Newly revealed geological conditions, conduct, rock burst level and area review and correction], [Newly revealed geological conditions, dynamic Adjustment, excavation plan], [Newly revealed geological conditions, dynamic adjustment, stress relief hole plan], [Newly revealed geological conditions, dynamic adjustment, support plan], [Rock burst level and area review and correction, avoid, rock burst occurrence], [Rock burst level and area review and correction, reduce, rock burst occurrence level], [Excavation plan, avoid, rock burst occurrence], [Excavation plan, reduce, rock burst occurrence level], [Stress relief hole plan, avoid, rock burst occurrence], [Stress relief hole plan, reduce, rock burst occurrence level] , [Support scheme, avoid, rock burst], [Support scheme, reduce, rock burst level], if the tail entity in a triple contains multiple attributes or features, decompose the triple into multiple independent triples. Specifically, when the extracted triple is [rock burst, feature, suddenness, randomness, and harmfulness], decompose it into several independent triples: [rock burst, feature, suddenness], [rock burst, feature, randomness], and [rock burst, feature, harmfulness]. Please extract all triples involved in the document. ”

[0081] After the knowledge triples are extracted, the document fragments for knowledge extraction are integrated into the triples as context to form knowledge quads. Each knowledge quad consists of four parts: head entity, relationship, tail entity and context. The head entity and tail entity represent two related knowledge points, the relationship represents the type of association between the two entities, and the context provides the background information and context of the relationship.

[0082] After generating knowledge quadruplets, the present invention constructs a knowledge graph based on these quadruplets. Knowledge graph is a structured knowledge representation method that stores extracted knowledge relationships in the form of a graph, with nodes representing entities and edges representing relationships. The specific construction process includes the following steps: First, all extracted knowledge quadruplets are summarized to eliminate duplicate and redundant information to ensure the uniqueness and accuracy of knowledge. Then, the head entity and tail entity in the quadruplet are used as nodes and the relationships as edges to construct a preliminary knowledge graph. On this basis, the graph structure is further optimized, and synonymous or similar entities and relationships are identified and merged through semantic clustering to improve the integrity and coherence of the graph.

[0083] By constructing a knowledge graph, the present invention realizes the structured storage of knowledge, explores the relevance of knowledge, and enables the systematic and intuitive display of various knowledge relationships. This not only improves the efficiency of knowledge organization and management, but also significantly improves the accuracy of knowledge retrieval and question-answering. During the knowledge retrieval process, the system can quickly locate relevant entities and relationships, and perform reasoning based on the graph structure to provide more accurate and comprehensive answers.

[0084] Step 4: Based on the vector database and knowledge graph constructed in steps 2 and 3, an external knowledge base is constructed, and the existing general large language model is fine-tuned through prompt engineering to enhance its knowledge interaction ability in the field of rock mechanics and construct a large model in the field of rock mechanics; The present invention constructs an external knowledge base based on the vector database and knowledge graph constructed in steps 2 and 3, and realizes the extensive coverage and efficient management of knowledge in the field of rock mechanics, such as Figure 2 shown.

[0085] In order to build a large model with excellent knowledge interaction ability in the field of rock mechanics, this paper proposes a method for training a large rock mechanics model based on external knowledge base enhancement. This method uses the integrated external knowledge base to fine-tune the existing general large language model through prompt engineering to enhance its knowledge interaction ability in the field of rock mechanics. The specific steps are as follows:

[0086] 1) Design question prompt template: Design question prompt words for each specific knowledge point and question type to ensure that the question prompt words cover a wide range of knowledge and application scenarios in the field of rock mechanics. In this embodiment, some question prompt words are designed as follows:

[0087] In view of the knowledge related to true triaxial mechanical test, the following question prompts are set:

[0088] "List the key steps in true triaxial mechanical testing."

[0089] "List the apparatus and methods used in true triaxial mechanical testing."

[0090] “Describe the common problems and solutions in true triaxial mechanical testing.”

[0091] For similar simulation experiment related knowledge, set the following question prompts:

[0092] “List the objectives, equipment and methods of similar simulation experiments.

[0093] “List the components of the simulation sample and describe their functions.”

[0094] “Describe the steps to determine compliance with test results.”

[0095] For the knowledge related to field testing technology, the following question prompts are set:

[0096] “List the equipment and tools commonly used in field testing techniques.

[0097] "Help me design a field test plan, including details on how to use the test methods, etc."

[0098] For the knowledge related to mechanical theory, the following question prompts are set:

[0099] “Deep Engineering Hard Rock Failure Indicators.

[0100] "Give a formula for the total strain energy under true triaxial stress."

[0101] "Calculation of the failure stress of a rock sample using rock failure criteria."

[0102] For rock burst related knowledge, the following question prompts are set:

[0103] "Define rockbursts and explain why they form."

[0104] "The level of rockburst is determined based on corresponding characteristics and phenomena."

[0105] "List the corresponding methods and specific contents of different rock burst types."

[0106] For knowledge related to large deformation, the following question prompts are set:

[0107] “List the characteristics and mechanisms of large deformation induced by deep fracture of hard rock in deep engineering.”

[0108] "List the conditions under which large deformation of the surrounding rock occurs."

[0109] "Explain the process of large deformation of surrounding rocks."

[0110] 2) Retrieve external knowledge base to generate training data: Extract knowledge fragments that match the question prompt template from the external knowledge base. Annotate the extracted data to ensure that the answer corresponding to each prompt word is accurate. The annotation process includes detailed descriptions of knowledge points, formulas, experimental data, and rules. Then generate a training data set containing question prompt words and corresponding answers.

[0111] 3) Model training: Input the training data into the LLaMA3 model, and LLaMA3 will generate answers corresponding to the prompt words of the question. Then verify the answers generated by the model to ensure that they are consistent with the annotated correct answers. It is necessary to verify the effectiveness of the prompt words in different test scenarios to ensure that the model can handle various types of questions.

[0112] Based on step 3), the basic large model LLaMA3 is guided to focus on specific knowledge points and problem types, and a large model in the field of rock mechanics is constructed, so that it can focus on specific problems in the field of rock mechanics while maintaining the original basic large model capabilities.

[0113] Step 5: Apply the constructed large model in the field of rock mechanics to the knowledge interaction system in the field of rock mechanics, handle different types of problems by classification, and use external knowledge bases to provide accurate answers and professional knowledge support;

[0114] The constructed rock mechanics model will be applied to the rock mechanics knowledge interaction system. In order to give full play to the knowledge interaction capability of the rock mechanics model, the knowledge interaction system includes a classification module, a document question and answer module, a mathematical question and answer module, and a rule discrimination module. Figure 3 As shown in the figure. These modules handle different types of questions by classification and use external knowledge bases to provide accurate answers and professional knowledge support. The design and implementation details of each module will be explained in detail below.

[0115] 1) Classification module:

[0116] Problem entity extraction: Use the rock mechanics domain model to parse the user's input questions and extract entities and professional terms related to rock mechanics. At this stage, the present invention sets the following prompt: "Please extract entities related to rock mechanics." Based on this prompt, the rock mechanics domain model will identify core words related to the field of rock mechanics, such as "true triaxial mechanical test", "stress tensor", "rock burst", etc.

[0117] Question classification: Based on the extracted entities and terms, the questions are classified into document questions and answers, math questions and answers, or rule judgments using predefined classification rules. The classification rules are as follows: "If the question contains terms and formulas related to calculations, it is classified as math questions and answers; if it involves specific specifications or judgment rules, it is classified as rule judgment; other questions involving explanations or descriptions are classified as document questions and answers."

[0118] 2) Document Q&A module:

[0119] Retrieval based on knowledge graph: For questions raised by users, first search for related entities and their relationships in the knowledge graph. For example, when a user inputs a question: "What are the classification criteria for rock burst?", the rock mechanics domain model will extract the entity "rock burst" and the relationship "classification basis". Then, semantic similarity matching is performed based on the extracted entity and the entity in the knowledge graph in the external knowledge base. After the entity matching is successful, retrieval is performed based on the relationship. At this time, the following four-tuple will be retrieved [rock burst, classification basis, breeding mechanism, 'In order to better carry out targeted monitoring, early warning and control of rock bursts, rock bursts are classified according to the time and spatial characteristics of rock bursts and breeding mechanisms'], [rock burst, classification basis, occurrence time and space, 'In order to better carry out targeted monitoring, early warning and control of rock bursts, rock bursts are classified according to the time and spatial characteristics of rock bursts and breeding mechanisms']. Next, remove the "," from the retrieved quadruple and splice it with the original question. Then input the spliced ​​text into the large model of rock mechanics to generate an accurate answer. "There are two classification bases for rock bursts. One is to classify them according to their breeding mechanism, and the other is to divide them into different types based on the time and space of their occurrence."

[0120] Retrieval based on vector database: If no relevant content is found in the knowledge graph, similarity retrieval is performed based on the vector database. The vector database stores vectorized document fragments, and can quickly find text related to the user's question by calculating vector similarity. The retrieved similar content is spliced ​​with the original question and input into the large model in the field of rock mechanics to generate an answer. In this way, the model can extract the most relevant information from a large number of document fragments and give accurate answers. For example, when a user inputs the question "What are the levels of rock burst?", based on the vector database search, the rock mechanics model will answer according to the knowledge base content: "Based on the text content you provided, rock burst levels are generally divided into the following categories: Minor rock burst: Low hazard, may cause damage to vulnerable parts of small mechanical equipment during drilling and blasting construction, affecting normal use. During TBM (tunnel boring machine) construction, the anchor drill of the TBM may occasionally be damaged. Moderate rock burst: The text does not provide a specific description of the characteristics of moderate rock burst, but based on the classification of rock burst levels, it can be inferred that the hazard and degree of damage of moderate rock burst are between minor rock burst and severe rock burst. Severe rock burst: The text does not provide a specific description of the characteristics, but usually this type of rock is more hazardous and destructive, and the damage to the surrounding rock and structures is also more serious. Extremely strong rock burst: Similarly, the text does not provide a specific description of the characteristics, but usually this type of rock is more hazardous and destructive, and the damage to the surrounding rock and structures is also more serious. The specific characteristics of extremely strong rockbursts are provided, but it can be inferred that this is the most serious level of rockburst, which is extremely harmful and destructive. The text also mentions the classification of rockbursts, including classification by the time and space of rockburst occurrence, and classification by the mechanism of rockburst incubation. Among them, according to the time and space of rockburst occurrence, rockbursts can be divided into immediate rockbursts, time-delayed rockbursts and intermittent rockbursts. Immediate rockbursts usually occur within a few hours after excavation, time-delayed rockbursts may occur a few days, a month, or a few months after excavation, and intermittent rockbursts refer to multiple rockbursts of the same or higher level in the same area within a certain period of time. Please note that the text does not provide specific descriptions of the characteristics of moderate rockbursts, strong rockbursts, and extremely strong rockbursts. The above information is inferred based on the general concept of rockburst levels. If a more detailed description of the characteristics is required, you may need to consult more professional literature or materials. "

[0121] 3) Mathematics Question and Answer Module:

[0122] Method and formula identification: Users input mathematical problems, such as "There is a rock column. When it is subjected to unidirectional pressure, the minimum principal stress of the rock is 30MPa, the cohesion is 60MPa, and the internal friction angle of the rock is 30 degrees. Find the maximum principal stress of the rock." The large model in the field of rock mechanics will analyze the problem and extract the formula to be calculated as the Mohr-Coulomb strength criterion formula. The relevant parameters include the minimum principal stress of the rock is 30MPa, the cohesion is 60MPa, and the internal friction angle of the rock is 30 degrees. Then, the relevant formulas and descriptions will be retrieved in the vector database based on the content to ensure that the correct formulas and methods are matched. The matching formulas are:

[0123] σ1-σ3=σ c +μ(σ1+σ3) / 2 (1)

[0124] The corresponding parameters are the minimum principal stress σ3 of 30 MPa and the cohesion σ c It is 60MPa and the internal friction angle μ of the rock is 30 degrees.

[0125] Formula calculation and result generation: Formula calculation is performed according to the above retrieved formula and matching parameters. In order to ensure the accuracy of the calculation results, this embodiment sets the following prompt words: "If you are a mathematics expert, please solve it step by step and use a calculator to calculate to ensure the correctness of the results. The large model of the rock mechanics field returns the calculation process and results together with the relevant description to the user. The calculation result is σ1=98.655 / 0.7115≈138.66. In this way, users can not only obtain the calculation results, but also understand the background and methods of the calculation.

[0126] 4) Rule identification module:

[0127] Rule retrieval: For problems involving rule identification, relevant rules and standards are retrieved in the vector database. The knowledge base stores vectorized representations of various specifications and standards, which can quickly find rules related to the problem. For example, a user inputs a question: "We often hear crackling and tearing sounds, which usually indicate that the rock formation is experiencing bursting, loosening or peeling. At this time, the shape of the rock is mostly thin flakes or thin lenses, and sometimes it presents a fresh shell-like structure. The bursting sound is sporadic and intermittent, indicating that the rock formation is continuously under stress. The surface cracks are generally less than 0.1 mm. What level of rockburst is this?" The large model in the field of rock mechanics will analyze the user's question, make a comprehensive judgment based on the rules retrieved from the external knowledge base, and give the following answer: "According to the description you provided, the sound characteristics of rockburst are "crackling, tearing", and the bursting sound is sporadic and intermittent, and the surface cracks are generally less than 0.1 mm. These characteristics are consistent with the characteristics of minor rockbursts in Table 3 you provided. The description of minor rock is: Hazard description: low hazard. Rockburst damage depth (D): surface <0.1 meter. Explosion block characteristics: bursting, loosening, peeling phenomenon. Sound characteristics: crisp bursting sound. Therefore, based on these characteristics, it can be judged that the described rockburst is a minor rockburst."

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.

Claims

1. A method for constructing a large rock mechanics model and interacting with knowledge, characterized by: The following steps are involved: Step 1: Collect and sort out data in the field of rock mechanics and obtain data documents in the field of rock mechanics; Step 2: Divide and vectorize the collected and sorted data documents in the field of rock mechanics, and store the vectorized text fragments in the vector database; Step 3: Extract knowledge from the vectorized document fragments, generate knowledge quadruples, and construct a knowledge graph; Step 4: Based on the vector database and knowledge graph constructed in steps 2 and 3, an external knowledge base is constructed, and the existing general large language model is fine-tuned through prompt engineering to enhance its knowledge interaction ability in the field of rock mechanics and build a large model in the field of rock mechanics; Step 5: Apply the constructed large model in the field of rock mechanics to the knowledge interaction system in the field of rock mechanics, handle different types of problems by classification, and use external knowledge bases to provide accurate answers and professional knowledge support.

2. A rock mechanics large model construction and knowledge interaction method according to claim 1, characterized in that: The specific method of step 1 is: First, the research direction and experimental methods in the field of rock mechanics are clarified, including true triaxial mechanical tests, similar simulation experiments, field testing technology, mechanical theory, rock burst and large deformation. In order to ensure the authority and reliability of data sources, data collection will cover books, academic papers, research reports, experimental data and technical specifications in related fields. In the process of data sorting, the collected data are first systematically sorted, and archived and classified according to six categories: true triaxial mechanical test, similar simulation experiment, field test technology, mechanical theory, rock burst, and large deformation, to ensure the systematicness and orderliness of the data; in order to unify the data format, the data from different sources will be converted to ensure its readability and consistency; at the same time, duplicate data will be deduplicated, and omissions will be checked and supplemented to ensure the integrity and uniqueness of the data; In order to facilitate subsequent data processing and knowledge extraction, the experimental data, diagrams and key paragraphs related to rock mechanics are marked and annotated in detail, the theoretical knowledge is annotated, and the relevant concepts and formulas are extracted.

3. A rock mechanics large model construction and knowledge interaction method according to claim 1, characterized in that: The step 2 first divides the sorted data documents into blocks, that is, divides each document into several segments, each segment contains a relatively independent knowledge unit; After the document segmentation is completed, each segmented text segment is vectorized to capture the semantic information and features of the text segment; after the text segment vectorization is completed, these vectorized text segments are stored in a vector database.

4. A rock mechanics large model construction and knowledge interaction method according to claim 1, characterized in that: The step 3 first uses the existing general large language model to identify entities and relations in the document fragment and extract all knowledge triples involved in the document; After the knowledge triples are extracted, the document fragments for knowledge extraction are integrated into the triples as context to form knowledge quadruples. Each knowledge quadruplet consists of four parts: head entity, relationship, tail entity and context. The head entity and tail entity represent two related knowledge points respectively, the relationship represents the type of association between the two entities, and the context provides the background information and context of the relationship. After generating knowledge quadruplets, a knowledge graph is constructed based on these quadruplets. First, all extracted knowledge quadruplets are summarized to eliminate duplicate and redundant information to ensure the uniqueness and accuracy of knowledge. Then, the head entity and tail entity in the quadruple are used as nodes and the relationships as edges to construct a preliminary knowledge graph. On this basis, semantic clustering is used to identify and merge synonymous or similar entities and relationships to further optimize the graph structure and improve the integrity and coherence of the graph.

5. A rock mechanics large model construction and knowledge interaction method according to claim 4, characterized in that: When step 3 extracts all knowledge triples involved in the document, the following prompt content is set for the large language model: Suppose you are an expert in rock mechanics knowledge extraction and need to build a knowledge graph based on the document content. Please extract all single-hop and multi-hop triplets. When you encounter a sentence, break it down into triplets; If the tail entity in a triple contains multiple attributes or features, the triple is decomposed into multiple independent triples; Please extract all triples involved in the document.

6. A rock mechanics large model construction and knowledge interaction method according to claim 1, characterized in that: The specific method of step 4 is: 1) Design question prompt templates: Design question prompt words for each specific knowledge point and question type to ensure that the question prompt words cover a wide range of knowledge and application scenarios in the field of rock mechanics; 2) Retrieve external knowledge base to generate training data: Extract knowledge fragments that match the question prompt template from the external knowledge base; annotate the extracted data to ensure that the answer corresponding to each prompt word is accurate; the annotation process includes detailed description of knowledge points, formulas, experimental data and rules, and then generate a training data set containing question prompt words and corresponding answers; 3) Model training: The training data is input into a general large language model, which will generate answers corresponding to the question prompts; the answers generated by the model are then verified to ensure that they are consistent with the marked correct answers.

7. A rock mechanics large model construction and knowledge interaction method according to claim 6, characterized in that: The knowledge interaction system described in step 5 includes a classification module, a document question-answering module, a mathematical question-answering module, and a rule identification module. These modules process different types of questions by classification and use an external knowledge base to provide accurate answers and professional knowledge support; The classification module uses a large model in the field of rock mechanics to parse the questions input by the user and extract entities and professional terms related to rock mechanics; and based on the extracted entities and terms, the module uses predefined classification rules to classify the questions into document questions and answers, mathematical questions and answers, or rule discrimination; The document question-answering module searches for document question-answering questions based on the knowledge graph and vector database; for the document question-answering questions raised by the user, firstly, the relevant entities and their relationships are searched in the knowledge graph; then, semantic similarity matching is performed based on the extracted entities and the entities in the knowledge graph in the external knowledge base; after the entity matching is successful, quadruple retrieval is performed based on the relationship; the retrieved quadruple is spliced ​​after removing the "," and spliced ​​with the original question, and then the spliced ​​text is input into the large model of the rock mechanics field to generate an accurate answer; If no relevant content is found in the knowledge graph, a similarity search is performed based on the vector database. The retrieved similar content is combined with the original question and input into the large model of rock mechanics to generate an answer. The math question-answering module identifies methods and formulas for math question-answering questions, and performs formula calculations and result generation; For the mathematical problems input by users, the large model in the field of rock mechanics will analyze the problems and extract the formula names and related parameters that need to be calculated; Then, the relevant formulas and descriptions will be retrieved from the vector database based on the content to ensure that the correct formulas and methods are matched; the formula calculation will be performed based on the retrieved formulas and matching parameters; The rule discrimination module performs rule retrieval for rule judgment problems; for problems involving rule discrimination, the rock mechanics domain big model will analyze the user's questions, make a comprehensive judgment based on the rules retrieved from the external knowledge base, and give an answer.

8. A rock mechanics large model construction and knowledge interaction method according to claim 7, characterized in that: The classification rules are as follows: "If the question contains calculation-related terms and formulas, it is classified as a math question and answer; if it involves specific specifications or judgment rules, it is classified as rule identification; others involving explanations or descriptions are classified as document questions and answers;".

Citation Information

Patent Citations

  • Large language model time sequence knowledge question answering method based on sentence granularity prompt

    CN117271740A

  • Poultry health data processing method based on knowledge graph and big language model fusion reasoning

    CN118522443A

Cited By

  • Construction process data retrieval method and system

    CN119557430A