Ai large model reasoning method based on knowledge graph enhancement

By constructing a multi-level knowledge graph and multi-modal feature extraction, combined with reinforcement learning and large language models, the semantic distortion and path deviation problems in interdisciplinary knowledge fusion are solved, and high-quality cross-domain reasoning results are achieved, which are suitable for complex tasks such as medical diagnosis and insurance risk assessment.

CN120450043APending Publication Date: 2025-08-08HUNAN SANY IND VOCATIONAL & TECH COLLEGE
View PDF 0 Cites 28 Cited by

Patent Information

Application Number
CN202510541561.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

In the complex scenarios of interdisciplinary and cross-field, it is difficult for the existing technology to effectively integrate multidisciplinary knowledge, resulting in semantic distortion and path generation deviations, lack of dynamically adjusted cross-domain correlation mechanisms, and it is difficult to achieve explainable cross-perspective reasoning.

Method used

By constructing a multi-level knowledge graph, including the core ontology layer, the subject ontology layer and the dynamic mapping layer, combining multi-source data acquisition, multi-modal feature extraction, reinforcement learning and large language models, high-quality interdisciplinary correlation paths and inference results are generated.

Benefits of technology

It realizes dynamic optimization and effective correlation of interdisciplinary knowledge, improves the accuracy and interpretability of reasoning, and is suitable for multi-domain collaborative reasoning tasks in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120450043A_ABST
    Figure CN120450043A_ABST
Patent Text Reader

Abstract

The invention relates to a cross-domain intelligent reasoning method based on knowledge graph enhancement, and the method achieves the precise reasoning in a complex scene through the construction of a hierarchical knowledge expression framework and a dynamic optimization mechanism. A multi-source heterogeneous data fusion technology is adopted, subject fine-grained knowledge units are generated through multi-modal feature extraction, and a three-dimensional knowledge graph structure comprising a core common concept layer, a subject feature ontology layer and a dynamic semantic mapping layer is established; based on a path exploration algorithm driven by reinforcement learning, cross-domain implicit association is mined while subject independence is reserved, and controllability and interpretability of the reasoning process are achieved in combination with an attention fusion mechanism of a large language model. According to the method, the limitation of traditional unified ontology modeling is broken through, the problems of concept drift and path deviation existing in reasoning in the cross fields of medicine-finance, engineering-law and the like are effectively solved, and the accuracy and knowledge traceability of complex decision tasks are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of AI model reasoning technology, and specifically to an AI large model reasoning method based on knowledge graph enhancement. Background Art

[0002] With the rapid development of artificial intelligence (AI) technology, the combination of knowledge graphs and large language models has become a key research direction for improving the performance of complex reasoning tasks. Knowledge graphs provide explainable knowledge support for reasoning through structured entity-relationship networks, while large language models enable natural language interaction with their powerful semantic understanding capabilities. Existing technologies typically map heterogeneous multi-source data such as text, images, and structured databases into a unified knowledge graph framework, and utilize large models to generate reasoning paths. However, such approaches face significant challenges in complex, interdisciplinary and cross-domain scenarios.

[0003] Current methods typically employ a simplified unified ontology modeling approach when merging multidisciplinary knowledge, ignoring the inherent differences between disciplines in concept definition, knowledge granularity, and semantic expression. For example, "pathological mechanism" in medicine and "system failure mode" in engineering may be forcibly mapped to similar concepts within a unified framework, resulting in semantic distortion. Furthermore, existing methods lack a dynamically adjusted cross-domain association mechanism, making it difficult to establish effective cross-perspective reasoning links while preserving disciplinary characteristics. This results in the model suffering from defects such as large path generation bias and insufficient interpretability in tasks involving multi-domain collaborative reasoning, such as cross-analysis of medical diagnosis and insurance risk assessment. Summary of the Invention

[0004] Based on this, the purpose of the present invention is to provide an Ai large model reasoning method based on knowledge graph enhancement that can deeply integrate multidisciplinary knowledge, dynamically optimize reasoning paths, and take into account domain characteristics and cross-domain associations.

[0005] The purpose of the present invention is achieved by the following scheme:

[0006] In a first aspect, the present invention provides an AI large model reasoning method based on knowledge graph enhancement, comprising the following steps:

[0007] S1: Through the multi-source data acquisition interface, data collection, noise filtering and format standardization are performed on cross-domain text data, image data and structured databases to generate pre-processed cross-domain data sets;

[0008] S2: Perform multimodal feature extraction on the preprocessed cross-domain data set to generate a set of entity-relationship triples containing subject labels;

[0009] S3: Perform ontology layering processing on the entity-relationship triple set to generate a multi-level knowledge graph structure including a core ontology layer, a subject ontology layer, and a dynamic mapping layer;

[0010] Among them, the core ontology layer is used to store cross-domain common concepts, the subject ontology layer is used to store domain-specific concepts, and the dynamic mapping layer is used to store cross-ontology semantic linking rules;

[0011] S4: Based on the acquired user's reasoning questions, semantic mapping is performed on the multi-level knowledge graph, interdisciplinary association paths are searched, and an initial reasoning network containing interdisciplinary association paths is generated;

[0012] S5: Perform multi-hop path optimization on the initial reasoning network based on the reinforcement learning algorithm to generate the best reasoning path set;

[0013] S6: Process the optimal inference path set based on the preset large language model, perform feature fusion processing on the optimal inference path set through the attention mechanism, and generate the final inference result.

[0014] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement, wherein S1 specifically includes the following steps:

[0015] S11: Use API interface calling technology to collect and process structured data from third-party databases to generate standardized field data sets;

[0016] S12: Performing text extraction processing on the scanned document image based on optical character recognition technology to generate an editable text data set;

[0017] S13: Perform key-value pair conversion on the NoSQL database using a non-relational database parser to generate a structured data table;

[0018] S14: De-duplication and merging are performed on the standardized field data set, the editable text data set, and the structured data table to generate a pre-processed cross-domain data set.

[0019] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement S2, which specifically includes the following steps:

[0020] S21: An entity recognition model based on a combination of a bidirectional long short-term memory network and a conditional random field performs entity boundary detection on a preprocessed cross-domain data set to generate a candidate entity set;

[0021] S22: Perform semantic relationship prediction on the candidate entity set through the contextual relationship classifier to generate candidate relationship triples;

[0022] S23: Perform domain labeling processing on the candidate relationship triples based on the subject label classification model to generate a set of entity-relationship triples containing subject labels.

[0023] In one embodiment, the present invention provides an AI large model reasoning method based on knowledge graph enhancement S3, which specifically includes the following steps:

[0024] S31: Based on the improved DBSCAN clustering algorithm, the entity-relationship triple set is clustered into subject concepts, and subject concept clusters are generated by calculating the dual weight index of semantic similarity and domain relevance;

[0025] S32: A cross-domain relationship abstraction model based on a graph neural network is used to extract common relationships from subject concept clusters, and a relational attention mechanism is used to identify cross-disciplinary shared relationship patterns to generate a core ontology layer.

[0026] S33: Based on the ontology modeling tool, the attribute constraints of the discipline-specific concepts of the entity-relationship triple set are defined. The domain, range and function constraints of the domain attributes are defined using the OWL language to generate the discipline ontology layer.

[0027] S34: The cross-domain relationship between the core ontology layer and the subject ontology layer is derived through a dynamic semantic link generator. The TransE model is used to align the cross-ontology entity vector space and generate mapping rules to generate a dynamic mapping layer.

[0028] S35: Perform graph structure fusion processing on the core ontology layer, subject ontology layer and dynamic mapping layer to construct a multi-level knowledge graph structure including the core ontology layer, subject ontology layer and dynamic mapping layer.

[0029] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement S4, which specifically includes the following steps:

[0030] S41: Based on the user's reasoning questions, the semantic parser is used to identify the query intent of the multi-level knowledge graph and generate a structured query vector.

[0031] S42: Based on the cross-relational knowledge embedding model and structured query vectors, semantic alignment is performed on multi-level knowledge graphs to generate a query-oriented cross-ontology semantic space;

[0032] S43: Perform path search processing in the query-oriented cross-ontology semantic space through a heuristic graph traversal algorithm to generate a set of candidate association paths;

[0033] S44: Score the candidate associated path set based on the path confidence calculation formula to generate a path set with confidence scores. The calculation formula for the confidence score of the path set is:

[0034]

[0035] Among them, P rel (path i ) is the confidence score of the path set, P conf (path i ) is the confidence score of the path itself, q is the structured query vector, is the path feature vector, λ is the confidence weight coefficient, is the feature vector of the tth element in the path, and w is the weight vector;

[0036] S45: Filtering the path set with confidence scores based on a preset confidence threshold to generate an initial reasoning network containing interdisciplinary association paths.

[0037] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement S5, which specifically includes the following steps:

[0038] S51: Based on the graph structure analysis of the initial reasoning network, a reinforcement learning network is constructed, and the state space of the reinforcement learning network is defined as the combination of the current entity node and the historical path features;

[0039] S52: Processing the initial reasoning network based on the reinforcement learning network, calculating the path action value function, and generating path value evaluation data;

[0040] S53: Sorting the path value evaluation data based on the optimal path selection formula to generate an optimal reasoning path set. The calculation formula for the optimal reasoning path set is:

[0041]

[0042] Among them, BestPaths is the best reasoning path set, r t is the immediate reward of the path, γ is the discount factor, and argtopk means selecting the top K paths with the highest total reward.

[0043] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement S6, which specifically includes the following steps:

[0044] S61: Perform semantic feature encoding on the best inference path set through the large language model encoder to generate a path feature vector;

[0045] S62: Perform importance weighting on the path feature vector based on the multi-dimensional attention weight calculation technology to generate a fused feature representation;

[0046] S63: The fused feature representation is sequentially decoded through the autoregressive text generation module to generate the final inference result.

[0047] In the second aspect, the present invention provides an AI large model reasoning system based on knowledge graph enhancement, which is configured with the following modules:

[0048] The data acquisition and processing module is used to collect, filter noise and standardize the format of cross-domain text data, image data and structured databases through a multi-source data acquisition interface to generate a pre-processed cross-domain data set;

[0049] The triple set construction module is used to perform multimodal feature extraction on the preprocessed cross-domain data set to generate a set of entity-relationship triples containing subject labels;

[0050] A multi-layer graph construction module is used to perform ontology layer construction processing on the entity-relationship triple set, generating a multi-layer knowledge graph structure including a core ontology layer, a subject ontology layer, and a dynamic mapping layer;

[0051] Among them, the core ontology layer is used to store cross-domain common concepts, the subject ontology layer is used to store domain-specific concepts, and the dynamic mapping layer is used to store cross-ontology semantic linking rules;

[0052] The reasoning network generation module is used to perform semantic mapping processing on the multi-level knowledge graph based on the acquired user reasoning questions, search for interdisciplinary association paths, and generate an initial reasoning network containing interdisciplinary association paths;

[0053] The inference path optimization module is used to perform multi-hop path optimization on the initial inference network based on the reinforcement learning algorithm to generate the best inference path set;

[0054] The inference result generation module is used to process the optimal inference path set based on the preset large language model, perform feature fusion processing on the optimal inference path set through the attention mechanism, and generate the final inference result.

[0055] In a third aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements any of the above-mentioned knowledge graph-enhanced Ai large model reasoning methods.

[0056] In a fourth aspect, the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements any of the above-mentioned Ai large model reasoning methods based on knowledge graph enhancement.

[0057] In summary, the present invention provides an AI large-scale model reasoning method based on knowledge graph enhancement. Through multi-source data collection and preprocessing, it can integrate multiple heterogeneous data across domains, thereby enriching the knowledge base for reasoning. Multimodal feature extraction retains the multimodal characteristics of the data and provides more comprehensive feature information for subsequent reasoning. Ontology hierarchical construction can effectively solve the problems of concept definition, knowledge granularity and semantic expression differences in multidisciplinary knowledge fusion, avoiding semantic distortion. At the same time, the dynamic mapping layer can achieve effective cross-domain association. Semantic mapping and path search find possible cross-disciplinary association paths for reasoning. Multi-hop path optimization can further improve the quality and accuracy of the reasoning path. Finally, through the feature fusion of the large language model and the attention mechanism, high-quality and interpretable reasoning results are generated. The entire process improves the reasoning performance of the AI model in complex cross-disciplinary and cross-domain scenarios, enabling it to better cope with multi-domain collaborative reasoning tasks such as cross-analysis of medical diagnosis and insurance risk assessment, thereby reducing path generation bias, enhancing the interpretability and accuracy of reasoning, and effectively promoting the combined application and development of knowledge graphs and large language models in complex reasoning tasks.

[0058] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 A flowchart of an AI large model reasoning method based on knowledge graph enhancement provided in an embodiment of the present application;

[0060] Figure 2 A schematic diagram of a process for generating an initial reasoning network according to an embodiment of the present application;

[0061] Figure 3 A schematic diagram of a process for generating an optimal reasoning path set provided in an embodiment of the present application;

[0062] Figure 4 A schematic structural diagram of an Ai large model reasoning system based on knowledge graph enhancement provided in another embodiment of the present application. DETAILED DESCRIPTION

[0063] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate preferred embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the disclosure.

[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which this invention pertains. The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0065] In one embodiment, Figure 1 As shown, a large-scale AI model reasoning method based on knowledge graph enhancement is provided. This embodiment uses the method applied to a terminal as an example. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0066] S1: Through the multi-source data acquisition interface, data collection, noise filtering and format standardization are performed on cross-domain text data, image data and structured databases to generate pre-processed cross-domain data sets.

[0067] Specifically, the system leverages multi-source data acquisition interfaces to comprehensively cover cross-domain text, image, and structured databases. Text data acquisition involves extracting key information from massive amounts of textual resources, such as documents, electronic medical records, and news reports; image data acquisition involves capturing key images from visual data sources, such as surveillance videos, satellite remote sensing images, and medical images; and structured database acquisition involves reading data from organized data repositories, such as enterprise resource planning systems and financial transaction databases.

[0068] Specifically, the system uses a variety of technical means to filter noise. For text data, it uses text cleaning technology in natural language processing to remove irrelevant characters, correct typos, and unify text formats. For example, it uses regular expressions to match and filter out garbled characters and meaningless symbols in the text. For image data, it uses image processing algorithms to remove noise, such as using Gaussian filtering algorithms to smooth images and enhance image clarity. At the same time, it adjusts the image size and resolution to meet subsequent processing requirements. For structured data, it performs data consistency checks, fills missing values, and detects and corrects outliers to ensure data accuracy and integrity. After noise filtering, the system standardizes the data format and converts text data into a unified text encoding format, such as UTF-8, for seamless transmission and processing between different systems. Image data is uniformly stored in common formats such as JPEG and PNG, and its size and color space parameters are standardized to make the image data universal in various image processing software and algorithms. Structured data is reorganized and stored according to predefined database models to ensure data consistency and integrity, and ultimately generates a preprocessed cross-domain data set, laying a solid foundation for subsequent feature extraction and knowledge construction.

[0069] S2: Perform multimodal feature extraction on the preprocessed cross-domain data set to generate a set of entity-relationship triples containing subject tags.

[0070] Specifically, in terms of text feature extraction, the system uses advanced natural language processing technologies, such as word embedding models Word2Vec or GloVe, to map words in the text to a low-dimensional vector space, capturing the semantic similarity and contextual relationships between words. At the same time, with the help of the pre-trained language model BERT or its variants, the text is deeply semantically encoded to generate a vector representation that can reflect the semantic information of the text. For example, for professional terms and symptom descriptions in medical literature, the system can accurately extract their semantic features and retain subject markers in order to distinguish text features in different fields. For image feature extraction, the system uses deep learning models such as Convolutional Neural Network (CNN), which automatically learns local features such as edges, textures, and shapes in the image through the convolutional layer, and the pooling layer reduces and abstracts the features, and finally outputs a high-dimensional feature vector.

[0071] Taking engineering design drawings as an example, CNN can extract features such as lines and geometric shapes in the drawings, and combine the annotation information and context of the drawings to add subject tags to the extracted image features, thereby realizing the association between image features and corresponding fields. In the structured data feature extraction link, the system extracts key features and attributes based on the data model and semantic meaning of the structured database. For tabular data in a relational database, each row is treated as a record, and the field values are extracted as features. The features are normalized and standardized based on the business logic and domain knowledge of the data. For example, in a financial database, fields such as transaction amount and transaction time are normalized to unify their numerical ranges for easy subsequent analysis. At the same time, the corresponding subject field information is annotated to generate a set of entity-relationship triples containing subject tags, providing rich feature information for constructing a knowledge graph.

[0072] S3: Perform ontology layering processing on the entity-relationship triple set to generate a multi-level knowledge graph structure including a core ontology layer, a subject ontology layer, and a dynamic mapping layer;

[0073] Among them, the core ontology layer is used to store cross-domain common concepts, the subject ontology layer is used to store domain-specific concepts, and the dynamic mapping layer is used to store cross-ontology semantic linking rules.

[0074] Specifically, the core ontology layer is constructed through in-depth analysis and abstraction of common concepts in cross-domain data, identifying fundamental concepts and relationships that are widely recognized and shared across multiple domains. For example, "entity" can represent any objectively existing thing, whether physical or abstract; "attribute" describes the characteristics and properties of an entity; and "relationship" represents the various connections between entities, such as association, inclusion, and inheritance. These core concepts and relationships provide a unified framework and semantic foundation for knowledge across different domains, enabling data from different domains to be integrated and shared within the same framework.

[0075] The construction of the subject ontology layer focuses on each specific field, deeply exploring the specialized knowledge and characteristics of that field to construct a detailed subject ontology. Taking medicine as an example, the system-constructed subject ontology encompasses concepts such as disease, symptoms, diagnostic methods, treatment plans, and medications, as well as their interrelationships. Diseases can present with a variety of symptoms, diagnostic methods are used to determine the disease type, treatment plans are tailored to specific diseases, and there are correlations between medications and treatment plans. These subject ontologies not only encompass the specialized terminology and concepts within the field but also reflect the hierarchical structure and logical relationships of knowledge within the field, providing strong support for the representation and reasoning of knowledge within the field.

[0076] The construction of the dynamic mapping layer aims to achieve semantic association and cross-domain reasoning between different ontologies. The system stores cross-ontology semantic linking rules in the dynamic mapping layer. These rules define the mapping relationship, conversion method, and semantic similarity calculation method between concepts in different fields. For example, when it is necessary to associate the "pathological mechanism" in the medical field with the "system failure mode" in the engineering field, the rules in the dynamic mapping layer can calculate the semantic similarity based on the concept definition, attribute characteristics, and relationship structure of the two, and find the potential connection and mapping method between them. Through the dynamic mapping layer, the system can dynamically establish connections between different subject ontologies and the core ontology according to actual reasoning needs, realize the integration and sharing of knowledge, and provide support for complex cross-domain reasoning tasks.

[0077] S4: Based on the acquired user's reasoning questions, semantic mapping is performed on the multi-level knowledge graph, interdisciplinary association paths are searched, and an initial reasoning network containing interdisciplinary association paths is generated.

[0078] Specifically, the system uses natural language processing technology to perform lexical analysis, syntactic analysis, and semantic role labeling on the question text, converting it into a machine-processable semantic representation. For example, for the question "What environmental factors are associated with the pathogenesis of a certain disease?", the system uses semantic analysis to extract the key entities "disease," "pathogenesis," and "environmental factors," as well as the semantic relationship "related" between them. The system then performs semantic mapping within a multi-level knowledge graph based on this semantic information, matching and associating the question with relevant entities, relationships, and concepts in the knowledge graph, and determining the knowledge area and starting node relevant to the question.

[0079] In the knowledge graph, the system uses the semantic mapping results as a starting point and a graph search algorithm to search for interdisciplinary association paths. For example, the A* search results are used. This algorithm is a heuristic search algorithm that introduces a heuristic function to guide the search direction, efficiently finding the optimal path from the starting node to the target node. During the search process, the system combines the semantic linking rules in the dynamic mapping layer to explore the connection paths between different disciplinary ontologies and the core ontology, searching for reasoning paths that connect relevant concepts and answers to the question. For example, in the above question, the system might start from the disease node in the medical field and, using the rules in the dynamic mapping layer, link it to the environmental factor node in the environmental science field. Then, searching along the relationship edges in the knowledge graph, it can find the association path between disease pathogenesis and environmental factors, such as "disease-pathogenesis-biological factor-environmental factor." In this way, the system generates an initial reasoning network containing interdisciplinary association paths, providing a foundation for subsequent path optimization and reasoning result generation.

[0080] S5: Based on the reinforcement learning algorithm, the initial reasoning network is optimized for multi-hop paths to generate the best reasoning path set.

[0081] Specifically, reinforcement learning is a machine learning method that learns optimal behavioral strategies to maximize cumulative rewards through the interaction between an agent and its environment. In this example, the optimization process of the inference path is considered a sequential decision-making problem, with the agent acting as the inference model and the environment as a multi-level knowledge graph. The agent explores and selects paths within the environment, taking actions based on its current state and evaluating the quality of the selected path based on reward signals fed back by the environment.

[0082] The design of a reward function is a key component of the reinforcement learning algorithm. The system evaluates the searched multi-hop paths based on a preset reward function. The reward function comprehensively considers multiple factors, including path length, semantic relevance, and credibility. For example, shorter paths may be more efficient, but paths that are too short may not contain sufficient semantic information. Paths with high semantic relevance more accurately reflect the relationship between questions and answers. Paths with high credibility are based on more reliable knowledge sources and relationship derivations. Through continuous trial and error and learning, the reinforcement learning algorithm gradually adjusts the probability distribution of path selection, gradually eliminating paths that are too long, have low semantic relevance, or have low credibility, while retaining and optimizing high-quality paths. As the learning process progresses, the agent gradually masters the optimal path selection strategy, ultimately generating an optimal set of inference paths, providing a strong guarantee for generating accurate and reliable inference results.

[0083] S6: Process the optimal inference path set based on the preset large language model, perform feature fusion processing on the optimal inference path set through the attention mechanism, and generate the final inference result.

[0084] Specifically, large language models typically possess a massive number of parameters and powerful language generation capabilities. Pre-trained on large amounts of text data, they acquire a wealth of linguistic knowledge and semantic information. When processing an inference path, the system feeds the feature vectors of each node and edge in the path into the large language model. To better integrate this feature information, the system employs an attention mechanism. The attention mechanism is a neural network structure that mimics human visual attention, automatically learning the importance and attention given to different parts of the input data.

[0085] In this embodiment, the attention mechanism assigns different weights to nodes and edges in the reasoning path based on factors such as their semantic relevance and location. For example, nodes and relationships directly related to the answer to a question are assigned higher weights, while less important information is assigned lower weights. In this way, the system can highlight key information and suppress interference from irrelevant information, achieving feature fusion processing for the optimal set of reasoning paths. The feature information fused by the attention mechanism is integrated into a large language model, and the system utilizes the model's generative capabilities to generate the final reasoning result. The reasoning result not only contains the answer to the question but also provides corresponding explanations and evidence, explaining the reasoning process and the source of the answer. For example, for the question "Which environmental factors are related to the pathogenesis of a certain disease?" the system's reasoning result may include the specific environmental factors, their relationship to the disease pathogenesis, and relevant medical research evidence. In this way, the system improves the interpretability and credibility of the reasoning results, providing users with more comprehensive and accurate information.

[0086] In summary, the present invention provides an AI large-scale model reasoning method based on knowledge graph enhancement. Through multi-source data collection and preprocessing, it can integrate multiple heterogeneous data across domains, thereby enriching the knowledge base for reasoning. Multimodal feature extraction retains the multimodal characteristics of the data and provides more comprehensive feature information for subsequent reasoning. Ontology hierarchical construction can effectively solve the problems of concept definition, knowledge granularity and semantic expression differences in multidisciplinary knowledge fusion, avoiding semantic distortion. At the same time, the dynamic mapping layer can achieve effective cross-domain association. Semantic mapping and path search find possible cross-disciplinary association paths for reasoning. Multi-hop path optimization can further improve the quality and accuracy of the reasoning path. Finally, through the feature fusion of the large language model and the attention mechanism, high-quality and interpretable reasoning results are generated. The entire process improves the reasoning performance of the AI model in complex cross-disciplinary and cross-domain scenarios, enabling it to better cope with multi-domain collaborative reasoning tasks such as cross-analysis of medical diagnosis and insurance risk assessment, thereby reducing path generation bias, enhancing the interpretability and accuracy of reasoning, and effectively promoting the combined application and development of knowledge graphs and large language models in complex reasoning tasks.

[0087] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement, wherein S1 specifically includes the following steps:

[0088] S11: Use API interface calling technology to collect and process structured data from third-party databases to generate standardized field data sets.

[0089] Specifically, API interface calling technology is a programmatic data access method that enables seamless data interaction between different systems by defining clear request and response formats. The system first sends an API request containing specific parameters to the third-party database. These parameters may include the data table name, required fields, query conditions, etc. For example, the system can request to obtain field data such as order ID, user ID, order amount, etc. within a specific time period in a certain order table. After receiving the request, the third-party database retrieves the corresponding data according to the preset access control policy and data query logic, and returns it to the system in a structured format such as JSON or XML. After receiving the returned data, the system parses and converts it, maps it to an internal unified data model, and generates a standardized field data set. This process not only ensures the accuracy and completeness of data collection, but also can adapt to the differences in data formats and structures of different third-party databases, realizing efficient data integration and utilization.

[0090] S12: Perform text extraction processing on the scanned document image based on optical character recognition technology to generate an editable text data set.

[0091] Specifically, optical character recognition (OCR) technology converts text content in images into machine-readable text. It includes steps such as image preprocessing, text detection and segmentation, feature extraction, and character recognition. During the image preprocessing stage, the system performs operations such as grayscale, binarization, denoising, and deskew on the scanned document image to improve image quality and text recognition accuracy. For example, grayscale can reduce the interference of color information, making the image easier to process; denoising can remove noise points in the image, making the text clearer. During the text detection and segmentation stage, the OCR system uses technologies such as connected region analysis, text line segmentation, and character segmentation to accurately locate the text area in the image and segment the text line by line and character by character. During the feature extraction stage, the system extracts the shape and structural features of each character, such as stroke width, shape outline, edges, corner points, etc. These features will serve as the basis for subsequent character recognition. Finally, by matching with the character recognition model, the extracted character features are converted into corresponding text content, generating an editable text data set, thereby achieving efficient conversion from image to editable text, facilitating subsequent text analysis and knowledge extraction.

[0092] S13: Perform key-value pair conversion on the NoSQL database through a non-relational database parser to generate a structured data table.

[0093] Specifically, non-relational (NoSQL) databases have flexible data storage structures and usually store data in the form of key-value pairs, such as document databases, column family databases, key-value databases, etc. The non-relational database parser extracts the key-value pair data by parsing the data model and storage structure of the NoSQL database. For example, for each document in the document database, the parser can split it into multiple key-value pairs, where the key is the field name and the value is the corresponding field value. Then, the system converts these key-value pair data into the table structure in the relational database according to predefined data conversion rules and mapping relationships. During the conversion process, the system will create a corresponding table field for each key, and convert and store the values according to the field type. For example, string type values are stored in character fields, and numeric type values are stored in numeric fields. Finally, a structured data table is generated, so that the data originally stored in the NoSQL database can be stored and queried in the format of a relational database, which is convenient for integration and analysis with data from other systems.

[0094] S14: De-duplication and merging are performed on the standardized field data set, the editable text data set, and the structured data table to generate a pre-processed cross-domain data set.

[0095] Specifically, deduplication is a crucial step in data cleaning, aiming to eliminate duplicate records and improve data quality and consistency. The system compares and deduplicates data from different sources by establishing unique identifiers or primary keys. For example, for a dataset containing user information, the user's unique ID can be used as the primary key to remove duplicate user records. Merging integrates data from different sources according to predefined rules to form a unified dataset. Based on the data's business logic and relationships, the system associates and merges structured data in standardized field datasets, text data in editable text datasets, and data in structured data tables. For example, user basic information data can be associated with order data using the user ID, and product descriptions in text data can be merged with product information in product data tables. During the merging process, the system also performs operations such as data format conversion and data type unification to ensure data consistency and integrity. The resulting preprocessed cross-domain dataset, encompassing data from various sources and formats, provides a comprehensive and accurate data foundation for subsequent knowledge graph construction and data analysis.

[0096] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement S2, which specifically includes the following steps:

[0097] S21: An entity recognition model based on a combination of a bidirectional long short-term memory network and a conditional random field performs entity boundary detection on a preprocessed cross-domain data set to generate a candidate entity set.

[0098] Specifically, BiLSTM is a neural network structure capable of processing sequential data. By introducing bidirectional information flow based on traditional LSTM, it enables the model to simultaneously capture contextual information in both the forward and backward directions of the sequence, thereby more accurately understanding the semantic information at each position. CRF, on the other hand, is a discriminative probabilistic model that excels at annotating sequential data and can determine the optimal annotation sequence based on the transition probabilities between annotations. The combined BiLSTM and CRF model is widely used in named entity recognition tasks, leveraging the strengths of both models to learn the deep features of the sequence while leveraging the constraints between annotations to improve entity recognition accuracy.

[0099] During entity boundary detection, the system inputs preprocessed text data into the BiLSTM-CRF model. The model first extracts features from the text sequence through the BiLSTM layer, obtaining contextual feature representations for each word. These features are then fed into the CRF layer, which calculates the optimal annotation sequence based on the transition probability matrix, marking the boundary locations and entity types of the entities in the text. For example, in a medical text, the model can accurately identify the boundaries of entities such as "disease," "symptoms," and "drug," and label the corresponding types. This process generates a collection of candidate entities, providing the foundational data for subsequent semantic relationship prediction.

[0100] S22: Perform semantic relationship prediction on the candidate entity set through the contextual relationship classifier to generate candidate relationship triples.

[0101] Specifically, the contextual relationship classifier is a model based on deep learning, which is usually based on a pre-trained language model and further adds a classification layer for fine-tuning. The pre-trained language model has learned rich language knowledge and semantic information through unsupervised pre-training on large-scale text data, and can provide a deep semantic representation for the text. During the fine-tuning stage, the system takes the candidate entity pairs and their contextual information as input and inputs them into the pre-trained model to obtain the semantic feature representation of the entity pairs; then, the classification layer is used to classify and predict the semantic relationship between the entity pairs to determine whether there is a certain specific relationship between them, such as "treatment", "causality", "belonging to", etc.

[0102] Specifically, for each entity pair in the candidate entity set, the system extracts the surrounding contextual information, including the text segments between the entity pairs and the sentence-level or paragraph-level context in which the entity pairs appear. This contextual information can provide rich semantic clues for the relationship between entity pairs. For example, if the two entities "aspirin" and "heart disease" appear in a text, the system will extract the text content between them and the sentence context in which they are located, and use the contextual relationship classifier to predict whether there is a "treatment" relationship between them. After predicting the semantic relationships of all entity pairs, the system generates a set of multiple candidate relationship triplets, each of which represents a semantic relationship between two entities, providing rich semantic information for the subsequent construction of the knowledge graph.

[0103] S23: Perform domain labeling processing on the candidate relationship triples based on the subject label classification model to generate a set of entity-relationship triples containing subject labels.

[0104] Specifically, the subject label classification model is a machine learning model specifically designed for domain classification. It typically uses the semantic features of text as input and, through training, learns the characteristic representations of text from different domains, enabling it to classify new text data by domain. During training, the system uses a large amount of text data that has been annotated with domain information to train the model, enabling it to learn the different characteristics of text from different domains in terms of vocabulary usage, semantic structure, and subject content.

[0105] When domain-labeling candidate relationship triples, the system uses the entities, relationships, and related contextual text in the triples as input features and inputs them into the subject label classification model. Based on the learned domain feature knowledge, the model makes a domain classification prediction for each candidate relationship triple, determines which specific subject field the triple belongs to, such as medicine, engineering, finance, etc., and adds the corresponding subject label to the triple. For example, for a candidate relationship triple containing "heart bypass surgery," "treatment," and "coronary heart disease," the model will label it as belonging to the medical field based on its semantic features and domain knowledge. After this processing, the system generates a set of entity-relationship triples containing subject labels. These triples not only contain the semantic information of entities and relationships, but also clarify the subject fields to which they belong. This provides an important basis for domain distinction for the subsequent construction and fusion of cross-domain knowledge graphs, and helps to achieve accurate integration and reasoning of knowledge from different fields.

[0106] In one embodiment, the present invention provides an AI large model reasoning method based on knowledge graph enhancement S3, which specifically includes the following steps:

[0107] S31: Based on the improved DBSCAN clustering algorithm, the entity-relationship triple set is clustered into subject concepts, and subject concept clusters are generated by calculating the dual weight indicators of semantic similarity and domain relevance.

[0108] Specifically, DBSCAN is a density-based spatial clustering algorithm that can effectively identify clusters of arbitrary shapes and is robust to noise. While the traditional DBSCAN algorithm clusters based on the density of sample points, the improved version employed by this system innovatively introduces semantic similarity and domain relevance as dual-weighted metrics to more accurately measure the similarity between triples. Semantic similarity is calculated using a pretrained language model, such as the BERT model, which encodes textual descriptions of entities and relationships to generate high-dimensional vector representations. Similarity between these vectors is then calculated using methods such as cosine similarity, reflecting the semantic similarity of triples. Domain relevance is calculated based on the output of a subject label classification model, combined with predefined domain association rules in a domain knowledge base, to measure the closeness of the disciplinary domains to which different triples belong. During the clustering process, the system dynamically adjusts the neighborhood range and density threshold of the sample points based on these two weighted metrics, ensuring that triplets belonging to the same disciplinary concept are clustered together while triplets belonging to different disciplinary concepts are effectively distinguished, ultimately generating multiple disciplinary concept clusters.

[0109] S32: The common relationships of subject concept clusters are extracted and processed through a cross-domain relationship abstraction model based on graph neural networks, and the relational attention mechanism is used to identify cross-disciplinary shared relationship patterns to generate a core ontology layer.

[0110] Specifically, the Convolutional Neural Network (CNN) is a type of deep learning model designed specifically for graph-structured data that can fully utilize the relationship information between nodes and edges in the graph for feature learning. In this embodiment, the subject concept cluster is constructed into a graph structure, in which entities serve as nodes and relationships serve as edges. The GNN model propagates and updates features on the graph structure through a message passing mechanism. The feature vector of each node aggregates the feature information of its neighboring nodes, and after multiple layers of propagation and transformation, it gradually captures the position and role characteristics of the entity in the complex relationship network.

[0111] During this process, the system introduces a relational attention mechanism, which assigns a learnable attention weight to each relationship type. During the training process, the model automatically learns the importance of different relationships in knowledge representation. For example, basic relationship types such as "causal relationship" and "attribute relationship" that exist in multiple disciplines will receive higher attention weights. In this way, the model can identify shared relationship patterns across different disciplines. These common relationships constitute the key components of the core ontology layer. As the basic framework of the knowledge graph, the core ontology layer stores cross-domain common entity types, relationship types, and the basic structure between them, providing a unified semantic foundation for knowledge fusion and reasoning in different disciplines, enabling subsequent knowledge graphs to achieve seamless knowledge sharing and migration between multiple fields.

[0112] S33: Based on the ontology modeling tool, the attribute constraints of the discipline-specific concepts of the entity-relationship triple set are defined and processed. The domain, value range and function constraints of the domain attributes are defined through the OWL language to generate the discipline ontology layer.

[0113] Specifically, the ontology modeling tool provides a visual interface and rich modeling capabilities, enabling domain experts to conveniently participate in the ontology construction process. During this process, the system fully leverages the powerful expressive capabilities of the Web Ontology Language (OWL). OWL is a language specifically designed for constructing semantic web ontologies. Based on description logic, it precisely defines concepts, relationships, and the semantic constraints between them. For each discipline-specific concept, the system first identifies its attributes. For example, in the medical field, the concept "disease" has attributes such as "symptoms," "treatment methods," and "site of disease onset." The OWL language then defines the domain and range of these attributes. The domain specifies the scope of the attribute's applicability; for example, the domain of the "symptom" attribute is "disease." The range specifies the types of attribute values; for example, the range of the "symptom" attribute can be a specific set of "symptom"-class concepts. Furthermore, the system defines functional constraints to ensure that certain attributes have unique values or a specific number of values. For example, the "International Classification of Diseases Code" attribute of the "disease" attribute must have unique values.

[0114] S34: The cross-domain relationship between the core ontology layer and the subject ontology layer is derived through a dynamic semantic link generator. The TransE model is used to align the cross-ontology entity vector space and generate mapping rules to generate a dynamic mapping layer.

[0115] Specifically, the translation embedding (TransE) model is a classic knowledge graph embedding method. This algorithm maps entities and relationships in the knowledge graph into a low-dimensional vector space. By optimizing the structure in which the sum of the head entity vector and the relationship vector equals the tail entity vector, the semantic information of the entities and relationships is effectively encoded in the vector space. When processing cross-ontology entities, the system first learns the TransE vector representation of the entities in the core ontology layer and the subject ontology layer respectively. Then, by introducing the mapping matrix and bias terms, a mapping function is constructed from the core ontology layer entity vector space to the subject ontology layer entity vector space. This mapping function can convert the general entity vector in the core ontology layer into a representation that is aligned with the subject ontology layer entity vector space, thereby achieving the alignment of cross-ontology entities in the semantic space.

[0116] Based on this aligned vector representation, the dynamic semantic link generator can identify potential semantic associations between the core ontology layer and the subject ontology layer and generate corresponding mapping rules. These mapping rules include not only the corresponding relationships between entities, but also the conversion logic of relationships, such as mapping the "association" relationship in the core ontology layer to the domain-specific relationship in the subject ontology layer. By storing these mapping rules and semantic links, the dynamic mapping layer enables the knowledge graph to flexibly convert and integrate knowledge between the core ontology layer and the subject ontology layer, supports complex cross-domain reasoning tasks, and provides a mechanism for the dynamic expansion and updating of the knowledge graph.

[0117] S35: Perform graph structure fusion processing on the core ontology layer, subject ontology layer and dynamic mapping layer to construct a multi-level knowledge graph structure including the core ontology layer, subject ontology layer and dynamic mapping layer.

[0118] Specifically, during the integration process, the core ontology layer first serves as the foundational framework for the knowledge graph. It provides common cross-domain concepts, relationships, and basic structure, effectively serving as the "skeleton" of the knowledge graph. Subsequently, the various disciplinary ontology layers are gradually integrated into this layer. Discipline-specific concepts within the disciplinary ontology layers are added by expanding and refining the core ontology layer. For example, building upon the core ontology concept of "disease," the medical discipline ontology layer further adds specific concepts such as "symptoms," "pathological mechanisms," and "treatment options," along with their relationships. The dynamic mapping layer, with its stored cross-domain mapping rules and semantic links, guides the connection between the different ontology layers. Based on the mapping rules in the dynamic mapping layer, the system establishes corresponding edges and relationships between the core and disciplinary ontology layers, enabling a smooth flow of knowledge between the different layers. For example, when addressing a complex problem involving multiple disciplines, the dynamic mapping layer can guide the system from the general concepts in the core ontology layer and, through mapping relationships, drill down to specific concepts in the relevant disciplinary ontology layers, thereby acquiring detailed domain knowledge. The multi-level knowledge graph structure finally constructed not only covers general knowledge across fields, but also deeply integrates professional knowledge in various disciplines. It also realizes flexible association and conversion of knowledge through the dynamic mapping layer, forming a knowledge network system that is both widely applicable and deeply professional, providing a powerful knowledge support platform for knowledge reasoning, query and application in complex scenarios.

[0119] In one embodiment, Figure 2 As shown, the S4 of the Ai large model reasoning method based on knowledge graph enhancement provided by the present invention specifically includes the following steps:

[0120] S41: Based on the user's reasoning questions, the semantic parser is used to identify the query intent of the multi-level knowledge graph and generate a structured query vector.

[0121] Specifically, the semantic parser can deeply analyze the semantic structure of natural language questions and convert them into structured query representations. In this process, the system first performs word segmentation and part-of-speech tagging on the user's questions to identify the key entities, relationships, and query targets. For example, for the question "Treatment methods for a certain disease and its insurance claims process", the system will identify key entities such as "disease", "treatment methods", "insurance claims", and the potential relationships between them. Then, dependency syntax analysis is used to determine the grammatical and semantic relationships between these entities, and a syntax tree is constructed to represent the structure of the question. Based on these analysis results, the system further maps the question to a predefined query template or semantic framework to generate a structured query vector. The structured query vector is a low-dimensional, dense vector representation that can comprehensively capture the semantic characteristics of the user's questions, including the subject area of the query, the entity types involved, the relationship information expected to be obtained, etc.

[0122] S42: Based on the cross-relational knowledge embedding model and structured query vectors, semantic alignment of multi-level knowledge graphs is performed to generate a query-oriented cross-ontology semantic space.

[0123] Specifically, the cross-relational knowledge embedding model aims to map entities, relations, and their semantic associations in a knowledge graph into a unified vector space. Compared to traditional knowledge embedding models, this model places particular emphasis on capturing and modeling cross-relational semantics. When processing multi-layered knowledge graphs, the model learns representations of entities and relations at different semantic levels by jointly training the core ontology layer, the subject ontology layer, and the dynamic mapping layer.

[0124] Specifically, the model uses methods such as TransR to learn a mapping matrix for each relationship type, mapping entities from the original vector space to a specific relational space, thereby better capturing the semantic features of entities under different relationships. When combined with a structured query vector, the system compares and aligns the query vector with the entity and relationship vectors of each layer in the knowledge graph. By calculating the similarity between the query vector and the element vectors in the knowledge graph, such as using methods such as cosine similarity or inner product, the system can determine the relevant areas and key entities of the query in the knowledge graph. Based on this similarity calculation, a query-oriented cross-ontology semantic space is generated, which highlights the parts that are highly relevant to the user query, while retaining the semantic associations and structural information between different ontology layers in the knowledge graph, providing precise semantic guidance for subsequent path searches.

[0125] S43: Perform path search processing in the query-oriented cross-ontology semantic space through a heuristic graph traversal algorithm to generate a set of candidate association paths.

[0126] Specifically, the heuristic graph traversal algorithm is an efficient path exploration method that combines graph search strategies and heuristic information. In this embodiment, the algorithm uses a structured query vector as a starting point and gradually expands the search path within the graph structure of the knowledge graph. During the search process, the algorithm comprehensively considers factors such as path length, semantic relevance, and proximity to the query target. For example, for each current node, the algorithm evaluates the potential relevance of its neighboring nodes to the query target and prioritizes nodes with high semantic relevance and a greater likelihood of being close to the query answer for expansion. Furthermore, to improve search efficiency, the algorithm introduces a heuristic function. This function assigns an estimated value to each node based on the structural features and semantic information of the knowledge graph, representing the expected cost or distance from that node to the query target. For example, the heuristic function can use the similarity between the node and the query vector as an estimation basis, guiding the search direction towards areas more likely to contain the answer. In this way, the system can efficiently search a series of possible association paths within the vast knowledge graph. These paths cover entities and relationships in different ontology layers, forming a set of candidate association paths, providing a rich selection for subsequent path evaluation and screening.

[0127] S44: Score the candidate associated path set based on the path confidence calculation formula to generate a path set with confidence scores.

[0128] Specifically, the calculation formula for the path confidence score comprehensively considers two key factors: the confidence of the path itself and the semantic similarity between the path and the query vector. The calculation formula for the confidence score of the path set is:

[0129]

[0130] Among them, P rel (path i ) is the confidence score of the path set, P conf (path i ) is the confidence score of the path itself, q is the structured query vector, is the path feature vector, λ is the confidence weight coefficient, is the feature vector of the tth element in the path, and w is the weight vector.

[0131] Path confidence score P conf (path i ) is calculated using a logical function, by taking the characteristic vector of each element in the path The weighted sum is then mapped to the interval (0,1) to reflect the credibility of each element in the path. The weight vector w is learned through model training and can distinguish the contribution of different elements to the credibility of the path. The semantic similarity between the path and the query vector is measured by cosine similarity. Calculate and measure the path eigenvector The semantic consistency between the structured query vector q and the confidence weight coefficient λ is used to balance the influence of these two factors. Its value range is between [0,1] and can be adjusted according to the actual application scenario and data characteristics. Finally, the confidence score P of the path set is rel (path i ) is a weighted combination of these two components, comprehensively reflecting the path's credibility and relevance to the query. After calculation, each candidate path is assigned a confidence score. These scores enable the system to sort and filter paths, retaining those most likely to accurately answer the user's question, providing a basis for generating a high-quality initial inference network.

[0132] S45: Filtering the path set with confidence scores based on a preset confidence threshold to generate an initial reasoning network containing interdisciplinary association paths.

[0133] Specifically, the confidence threshold is a key screening parameter used to distinguish high-quality paths from low-quality paths. The setting of this threshold is based on a comprehensive consideration of system performance and application scenarios, and is usually determined through experiments and experience. During the screening process, the system compares the confidence score of each path with the preset threshold one by one. Only those paths with a confidence score higher than or equal to the threshold can pass the screening and enter the initial reasoning network. These paths are not only highly relevant to the user query in semantics, but also meet the requirements in terms of credibility, and can provide users with more reliable answers. The initial reasoning network is composed of these screened paths. It contains interdisciplinary related paths, which can integrate knowledge from different fields and provide support for solving complex cross-domain problems.

[0134] The above-mentioned Ai large model reasoning method based on knowledge graph enhancement accurately grasps the user's query intention through semantic analysis, uses cross-relational knowledge embedding to achieve semantic alignment, and uses heuristic graph traversal to efficiently search paths. Through a scientific path scoring and screening mechanism, it finally generates a reliable initial reasoning network, which can effectively solve the problem of semantic differences and cross-domain associations in multidisciplinary knowledge fusion. It can improve the performance and accuracy of the Ai large model in complex cross-domain reasoning tasks, so that it can better cope with multi-domain collaborative reasoning scenarios such as cross-analysis of medical diagnosis and insurance risk assessment, and provide strong support for the subsequent generation of high-quality reasoning results.

[0135] In one embodiment, Figure 3 As shown, the S5 of the Ai large model reasoning method based on knowledge graph enhancement provided by the present invention specifically includes the following steps:

[0136] S51: Based on the graph structure analysis of the initial inference network, a reinforcement learning network is constructed, and the state space of the reinforcement learning network is defined as a combination of the current entity node and the historical path features.

[0137] Specifically, graph structure parsing converts the entity nodes, relationship edges, and their connections in the initial reasoning network into a format that can be processed by the reinforcement learning network. The system defines the state space of the reinforcement learning network as a combination of the current entity node and historical path features. Specifically, the current entity node represents the current position in the reasoning process, while the historical path features record the path information from the starting point to the current node, including the sequence of entity types and relationship types on the path, as well as the confidence score of each node. For example, in the cross-reasoning scenario of medical diagnosis and insurance risk assessment, the current entity node may be a certain disease, and the historical path features may contain the path information from the symptoms to the disease node through a series of examinations and diagnostic processes. This definition of the state space enables the reinforcement learning network to fully consider the influence of the current state and the historical path, providing a rich information foundation for the subsequent calculation of the path action value function.

[0138] S52: Process the initial reasoning network based on the reinforcement learning network, calculate the path action value function, and generate path value evaluation data.

[0139] Specifically, the path-action value function measures the long-term cumulative reward that can be obtained by taking a certain action in a specific state. In this embodiment, the state corresponds to the combination of the current entity node and the historical path features, and the action corresponds to selecting an edge from the current node for reasoning extension. The system collects a large number of state-action-reward samples by simulating path exploration during the reasoning process. For example, at each path extension, the next entity node is reached according to the selected relationship, and an immediate reward r is given based on factors such as the semantic relevance, credibility, and whether the path is close to the reasoning target. t The path-action-value function is then updated using reinforcement learning algorithms, such as Q-learning or the policy gradient method in deep reinforcement learning. The policy network outputs the probability distribution of each possible action based on the current state, while the value network estimates the expected cumulative reward after taking a specific action in a specific state. Through continuous iterative training, the system gradually optimizes the path-action-value function, enabling it to accurately evaluate the value of different paths. Ultimately, a dataset containing the value evaluation data of each path is generated, providing a quantitative basis for subsequent optimal path selection.

[0140] S53: Sort the path value evaluation data based on the optimal path selection formula to generate the best reasoning path set.

[0141] Specifically, the calculation formula for the optimal reasoning path set is:

[0142]

[0143] Among them, BestPaths is the best reasoning path set, r t is the immediate reward of the path, reflecting the semantic relevance, credibility, and proximity of the path to the reasoning goal at each step; γ is the discount factor, which is used to balance the weight of immediate rewards and future potential rewards. Its value range is between [0,1). A smaller γ value indicates more emphasis on immediate rewards, while a larger γ value indicates more emphasis on long-term rewards. argtopk indicates selecting the top K paths with the highest total rewards. The system first calculates the cumulative discounted reward for each candidate path. This metric comprehensively considers the reward at each step of the path and the time value of the reward. The candidate paths are then sorted in descending order based on the cumulative discounted reward, and the top K paths are selected as the optimal inference path set. These paths are not only highly semantically relevant to the user query, but also have accumulated high rewards during the inference process, indicating that they can more accurately answer user questions while also possessing high credibility and logical coherence. The resulting optimal inference path set provides a high-quality path basis for subsequent inference result generation, ensuring that the system's inference results are both accurate and reliable, meeting the user's inference needs in complex cross-domain scenarios.

[0144] The aforementioned knowledge graph-enhanced AI large-model reasoning method constructs a reinforcement learning network, uses a path-action value function to evaluate the value of paths in the initial reasoning network, and selects the optimal set of reasoning paths based on the optimal path selection formula, effectively improving the quality and accuracy of reasoning paths. This process not only improves the performance of AI models in complex cross-domain reasoning tasks, but also enhances the interpretability and credibility of reasoning results, enabling them to better cope with multi-domain collaborative reasoning scenarios such as cross-analysis of medical diagnosis and insurance risk assessment, providing a solid guarantee for generating high-quality reasoning results.

[0145] In one embodiment, the present invention provides an Ai large model reasoning method based on knowledge graph enhancement S6, which specifically includes the following steps:

[0146] S61: Perform semantic feature encoding processing on the best inference path set through the large language model encoder to generate a path feature vector.

[0147] Specifically, a large language model encoder, such as BERT or its variants based on the Transformer architecture, can perform deep semantic encoding on text sequences, capturing the complex semantic information and contextual dependencies within the text. During this process, the system first converts each path in the set of optimal inference paths into a textual description. For example, a path might be described as "Disease A is linked to examination C via symptom B, and then to treatment E via examination result D." This textual description is then fed into the large language model encoder. The encoder processes the input text through its multi-layer Transformer architecture. In each layer, a self-attention mechanism calculates the correlation between different words in the text, capturing long-range semantic dependencies. Simultaneously, a feedforward neural network performs nonlinear transformations on the representation of each word, progressively extracting higher-level semantic features. Ultimately, the encoder outputs a semantic feature vector for each path text. These vectors not only capture the semantic information of the entities and relations involved in the path, but also reflect their combined semantics in context. These path feature vectors provide the basis for subsequent feature fusion, enabling the system to represent each inference path in a compact and semantically rich manner.

[0148] S62: Based on the multi-dimensional attention weight calculation technology, the path feature vector is importance-weighted to generate a fused feature representation.

[0149] Specifically, the core of the multi-dimensional attention weight calculation technique lies in evaluating the importance of different components of the path feature vector from multiple perspectives to more accurately capture the semantic information that critically affects the inference result. Specifically, the system employs multiple attention heads, each focusing on different aspects of the path features, such as the importance of entities, the credibility of relationships, and the semantic coherence of the path. For example, one attention head might focus on the characteristics of key entities in the path, such as the name of a disease or treatment, while another might emphasize the semantic strength of relationships within the path, such as the weight of relationships such as "leads to" or "used for." Using the multi-dimensional attention mechanism, the system calculates a weight for each element in the path feature vector, reflecting its importance in the corresponding dimension. These weights are then element-wise multiplied by the path feature vector to weight the feature vector. This weighted feature vector emphasizes components that contribute significantly to the inference result while deemphasizing less important information. Finally, the system fuses all weighted path feature vectors through concatenation or summation to generate a fused feature representation.

[0150] S63: The fused feature representation is sequentially decoded through the autoregressive text generation module to generate the final inference result.

[0151] Specifically, the autoregressive text generation module is a component based on a sequence-to-sequence (seq2seq) model, typically consisting of a decoder network, such as a Transformer-based decoder or a recurrent neural network (RNN) decoder. During the decoding process, the module takes the fused feature representation as initial input and gradually generates a text sequence of inference results. First, the decoder generates a probability distribution for the first word based on the fused feature representation and selects the word with the highest probability as the first output word. Then, the first output word is fed back to the decoder together with the fused feature representation to generate a probability distribution for the second word, and the second output word is selected. This process is repeated until a complete inference result text sequence is generated or the preset maximum sequence length is reached. For example, for reasoning tasks involving medical diagnosis and insurance claims, the generated reasoning result might be: "Based on your symptom description and test results, you may have disease A. We recommend that you undergo further test C to confirm the diagnosis. If diagnosed with disease A, common treatments include methods E and F. In terms of insurance claims, disease A falls under situation X in the insurance terms. You can submit relevant medical documents according to process Y to apply for a claim." In this way, the autoregressive text generation module converts complex reasoning processes and multi-domain knowledge into user-readable and easy-to-understand natural language text, providing users with more intuitive and clear reasoning results to meet their information needs in different scenarios.

[0152] Preferably, if Figure 4 As shown, the present invention provides an Ai large model reasoning system 700 based on knowledge graph enhancement, which is configured with the following modules:

[0153] The data acquisition and processing module 710 is used to collect, filter noise, and standardize the format of cross-domain text data, image data, and structured databases through a multi-source data acquisition interface to generate a pre-processed cross-domain data set;

[0154] The triple set construction module 720 is used to perform multimodal feature extraction processing on the pre-processed cross-domain data set to generate an entity-relationship triple set containing subject labels;

[0155] A multi-layer graph construction module 730 is used to perform ontology layer construction processing on the entity-relationship triple set to generate a multi-layer knowledge graph structure including a core ontology layer, a subject ontology layer, and a dynamic mapping layer;

[0156] Among them, the core ontology layer is used to store cross-domain common concepts, the subject ontology layer is used to store domain-specific concepts, and the dynamic mapping layer is used to store cross-ontology semantic linking rules;

[0157] The reasoning network generation module 740 is used to perform semantic mapping processing on the multi-level knowledge graph based on the acquired user's reasoning questions, search for interdisciplinary association paths, and generate an initial reasoning network containing the interdisciplinary association paths;

[0158] The reasoning path optimization module 750 is used to perform multi-hop path optimization processing on the initial reasoning network based on the reinforcement learning algorithm to generate an optimal reasoning path set;

[0159] The inference result generation module 760 is used to process the optimal inference path set based on the preset large language model, perform feature fusion processing on the optimal inference path set through the attention mechanism, and generate the final inference result.

[0160] In summary, the present invention provides an AI large-scale model reasoning system based on knowledge graph enhancement. Through multi-source data collection and preprocessing, it can integrate multiple heterogeneous data across domains, thereby enriching the knowledge base for reasoning. Multimodal feature extraction retains the multimodal characteristics of the data and provides more comprehensive feature information for subsequent reasoning. Ontology hierarchical construction can effectively solve the problems of concept definition, knowledge granularity and semantic expression differences in multidisciplinary knowledge fusion, avoiding semantic distortion. At the same time, the dynamic mapping layer can achieve effective cross-domain association. Semantic mapping and path search find possible cross-disciplinary association paths for reasoning. Multi-hop path optimization can further improve the quality and accuracy of the reasoning path. Finally, through the feature fusion of the large language model and the attention mechanism, high-quality and interpretable reasoning results are generated. The entire process improves the reasoning performance of the AI model in complex cross-disciplinary and cross-domain scenarios, enabling it to better cope with multi-domain collaborative reasoning tasks such as cross-analysis of medical diagnosis and insurance risk assessment, thereby reducing path generation bias, enhancing the interpretability and accuracy of reasoning, and effectively promoting the combined application and development of knowledge graphs and large language models in complex reasoning tasks.

[0161] Preferably, the data acquisition and processing module 710 is configured with the following units:

[0162] The structured data collection unit is used to collect and process structured data from third-party databases through API interface calling technology to generate standardized field data sets;

[0163] A text data extraction unit, configured to perform text extraction processing on the scanned document image based on optical character recognition technology to generate an editable text data set;

[0164] A data conversion unit is used to convert key-value pairs of a NoSQL database using a non-relational database parser to generate a structured data table;

[0165] The data preprocessing unit is used to remove duplicates and merge the standardized field data set, the editable text data set and the structured data table to generate a preprocessed cross-domain data set.

[0166] Preferably, the triple set building module 720 is configured with the following units:

[0167] A candidate entity set generation unit is used to perform entity boundary detection on a pre-processed cross-domain data set based on an entity recognition model combining a bidirectional long short-term memory network and a conditional random field, and generate a candidate entity set;

[0168] A candidate relationship triple generation unit is used to perform semantic relationship prediction processing on the candidate entity set through a contextual relationship classifier to generate candidate relationship triples;

[0169] The entity-relationship triple set generation unit is used to perform domain labeling processing on the candidate relationship triples based on the subject label classification model to generate an entity-relationship triple set containing subject labels.

[0170] Preferably, the multi-layer graph construction module 730 is configured with the following units:

[0171] The discipline concept cluster generation unit is used to perform discipline concept clustering on the entity-relationship triple set based on the improved DBSCAN clustering algorithm, and generate discipline concept clusters by calculating the dual weight index of semantic similarity and domain relevance;

[0172] The core ontology layer generation unit is used to extract common relationships from subject concept clusters through a cross-domain relationship abstraction model based on a graph neural network, and uses a relational attention mechanism to identify cross-disciplinary shared relationship patterns to generate the core ontology layer.

[0173] The discipline ontology layer generation unit is used to define attribute constraints on discipline-specific concepts of entity-relationship triple sets based on the ontology modeling tool, and to define the domain, range, and function constraints of domain attributes using the OWL language to generate the discipline ontology layer.

[0174] The dynamic mapping layer generation unit is used to deduce the cross-domain relationship between the core ontology layer and the subject ontology layer through the dynamic semantic link generator, align the cross-ontology entity vector space using the TransE model and generate mapping rules to generate the dynamic mapping layer;

[0175] The knowledge graph construction unit is used to perform graph structure fusion processing on the core ontology layer, subject ontology layer and dynamic mapping layer, and construct a multi-level knowledge graph structure including the core ontology layer, subject ontology layer and dynamic mapping layer.

[0176] Preferably, the inference network generation module 740 is configured with the following units:

[0177] The query vector generation unit is used to identify the query intent of the multi-level knowledge graph through the semantic parser based on the user's reasoning question and generate a structured query vector;

[0178] The semantic space generation unit is used to perform semantic alignment processing on the multi-level knowledge graph based on the cross-relational knowledge embedding model combined with the structured query vector to generate a query-oriented cross-ontology semantic space;

[0179] A candidate path set generation unit is used to perform path search processing in the query-oriented cross-ontology semantic space through a heuristic graph traversal algorithm to generate a candidate association path set;

[0180] A confidence score path set generation unit is used to score the candidate associated path set based on the path confidence calculation formula to generate a path set with confidence score;

[0181] The initial reasoning network generation unit is used to screen the path set with confidence scores based on a preset confidence threshold to generate an initial reasoning network containing interdisciplinary association paths.

[0182] Preferably, the reasoning path optimization module 750 is configured with the following units:

[0183] A reinforcement learning network construction unit is used to construct a reinforcement learning network based on the graph structure analysis of the initial inference network, and define the state space of the reinforcement learning network as a combination of the current entity node and the historical path features;

[0184] A path value evaluation data generation unit is used to process the initial reasoning network based on the reinforcement learning network, calculate the path action value function, and generate path value evaluation data;

[0185] The optimal reasoning path set generation unit is used to sort the path value evaluation data based on the optimal path selection formula to generate the optimal reasoning path set.

[0186] Preferably, the inference result generation module 760 is configured with the following units:

[0187] A path feature vector generation unit is used to perform semantic feature encoding processing on the optimal inference path set through a large language model encoder to generate a path feature vector;

[0188] A fusion feature representation generation unit is used to perform importance weighting processing on the path feature vector based on the multi-dimensional attention weight calculation technology to generate a fusion feature representation;

[0189] The final inference result generation unit is used to perform sequence decoding processing on the fused feature representation through the autoregressive text generation module to generate the final inference result.

[0190] In one embodiment, the present application also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the above-mentioned knowledge graph-enhanced Ai large model reasoning method is implemented.

[0191] In one embodiment, the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned knowledge graph-enhanced Ai large model reasoning method is implemented.

[0192] In the description of this specification, the reference terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" mean that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described may be combined in any appropriate manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and integrate different embodiments or examples described in this specification, as well as features of different embodiments or examples, unless they are mutually inconsistent.

[0193] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art can understand and implement it without expending creative work.

[0194] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. The AI large model reasoning method based on knowledge graph enhancement is characterized by: The following steps are involved: S1: Through the multi-source data acquisition interface, data collection, noise filtering and format standardization are performed on cross-domain text data, image data and structured databases to generate pre-processed cross-domain data sets; S2: performing multimodal feature extraction processing on the preprocessed cross-domain data set to generate a set of entity-relationship triples containing subject labels; S3: Performing ontology hierarchical construction processing on the entity-relationship triple set to generate a multi-level knowledge graph structure including a core ontology layer, a subject ontology layer, and a dynamic mapping layer; The core ontology layer is used to store cross-domain common concepts, the subject ontology layer is used to store domain-specific concepts, and the dynamic mapping layer is used to store cross-ontology semantic linking rules; S4: performing semantic mapping processing on the multi-level knowledge graph based on the acquired user's reasoning questions, searching for interdisciplinary association paths, and generating an initial reasoning network containing the interdisciplinary association paths; S5: performing multi-hop path optimization processing on the initial reasoning network based on a reinforcement learning algorithm to generate an optimal reasoning path set; S6: Processing the optimal reasoning path set based on a preset large language model, performing feature fusion processing on the optimal reasoning path set through an attention mechanism, and generating a final reasoning result.

2. The method according to claim 1, characterized in that Said S1 comprises: S11: Use API interface calling technology to collect and process structured data from third-party databases to generate standardized field data sets; S12: Performing text extraction processing on the scanned document image based on optical character recognition technology to generate an editable text data set; S13: Perform key-value pair conversion on the NoSQL database using a non-relational database parser to generate a structured data table; S14: performing deduplication and merging processing on the standardized field data set, the editable text data set and the structured data table to generate a pre-processed cross-domain data set.

3. The method according to claim 1, characterized in that The S2 includes: S21: An entity recognition model based on a combination of a bidirectional long short-term memory network and a conditional random field performs entity boundary detection on a preprocessed cross-domain data set to generate a candidate entity set; S22: Perform semantic relationship prediction on the candidate entity set through the contextual relationship classifier to generate candidate relationship triples; S23: Perform domain labeling processing on the candidate relationship triples based on the subject label classification model to generate a set of entity-relationship triples containing subject labels.

4. The method according to claim 1, wherein The S3 includes: S31: performing subject concept clustering processing on the entity-relationship triple set based on the improved DBSCAN clustering algorithm, and generating subject concept clusters by calculating the dual weight index of semantic similarity and domain relevance; S32: extracting common relationships from the subject concept clusters using a cross-domain relationship abstraction model based on a graph neural network, identifying cross-disciplinary shared relationship patterns using a relationship attention mechanism, and generating the core ontology layer; S33: performing attribute constraint definition processing on the subject-specific concepts of the entity-relationship triple set based on an ontology modeling tool, defining the domain, value range, and function constraints of domain attributes using the OWL language, and generating a subject ontology layer; S34: The cross-domain relationship between the core ontology layer and the subject ontology layer is derived through a dynamic semantic link generator. The TransE model is used to align the cross-ontology entity vector space and generate mapping rules to generate a dynamic mapping layer. S35: Perform graph structure fusion processing on the core ontology layer, the subject ontology layer and the dynamic mapping layer to construct a multi-level knowledge graph structure including the core ontology layer, the subject ontology layer and the dynamic mapping layer.

5. The method according to claim 1, wherein The S4 includes: S41: Based on the acquired user's reasoning question, query intent recognition processing is performed on the multi-level knowledge graph through a semantic parser to generate a structured query vector; S42: performing semantic alignment processing on the multi-level knowledge graph based on the cross-relational knowledge embedding model and the structured query vector to generate a query-oriented cross-ontology semantic space; S43: performing a path search process in the query-oriented cross-ontology semantic space by using a heuristic graph traversal algorithm to generate a set of candidate association paths; S44: Score the candidate associated path set based on a path confidence calculation formula to generate a path set with a confidence score. The calculation formula for the confidence score of the path set is: Among them, P rel (path i ) is the confidence score of the path set, P conf (path i ) is the confidence score of the path itself, q is the structured query vector, is the path feature vector, λ is the confidence weight coefficient, is the feature vector of the tth element in the path, and w is the weight vector; S45: Screening the path set with confidence scores based on a preset confidence threshold to generate the initial reasoning network containing the interdisciplinary association paths.

6. The method according to claim 1, wherein The S5 includes: S51: Based on the graph structure analysis processing of the initial reasoning network, a reinforcement learning network is constructed, and the state space of the reinforcement learning network is defined as a combination of current entity nodes and historical path features; S52: Processing the initial reasoning network based on the reinforcement learning network, calculating the path action value function, and generating path value evaluation data; S53: Sorting the path value evaluation data based on the optimal path selection formula to generate an optimal reasoning path set. The calculation formula for the optimal reasoning path set is: Among them, BesPaths is the best reasoning path set, r t is the immediate reward of the path, γ is the discount factor, and argtopk means selecting the top K paths with the highest total reward.

7. The method according to any one of claims 1 to 6, characterized in that The S6 includes: S61: Perform semantic feature encoding on the best inference path set through the large language model encoder to generate a path feature vector; S62: performing importance weighting processing on the path feature vector based on a multi-dimensional attention weight calculation technology to generate a fused feature representation; S63: Performing sequence decoding processing on the fused feature representation through an autoregressive text generation module to generate the final inference result.

8. An AI large model reasoning system based on knowledge graph enhancement, characterized by: The system comprises: The data acquisition and processing module is used to collect, filter noise and standardize the format of cross-domain text data, image data and structured databases through a multi-source data acquisition interface to generate a pre-processed cross-domain data set; A triplet set construction module is used to perform multimodal feature extraction processing on the pre-processed cross-domain data set to generate an entity-relationship triplet set containing subject labels; A multi-layer graph construction module is used to perform ontology layer construction processing on the entity-relationship triple set to generate a multi-layer knowledge graph structure including a core ontology layer, a subject ontology layer and a dynamic mapping layer; The core ontology layer is used to store cross-domain common concepts, the subject ontology layer is used to store domain-specific concepts, and the dynamic mapping layer is used to store cross-ontology semantic linking rules; An inference network generation module is used to perform semantic mapping processing on the multi-level knowledge graph based on the acquired user's inference questions, search for interdisciplinary association paths, and generate an initial inference network containing the interdisciplinary association paths; An inference path optimization module, configured to perform multi-hop path optimization processing on the initial inference network based on a reinforcement learning algorithm to generate an optimal inference path set; The inference result generation module is used to process the optimal inference path set based on a preset large language model, perform feature fusion processing on the optimal inference path set through an attention mechanism, and generate a final inference result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

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

Citation Information

Cited By

  • Oil and gas field service management and control method and device

    CN120723756A

  • Project intelligent management analysis platform based on security risk standardization

    CN120746499A

  • Project intelligent management and analysis device based on security risk standardization

    CN120746499B

  • Quantifiable index system construction method and device based on semantic extraction and alignment

    CN120781821A

  • Method and device for constructing quantifiable index system based on semantic extraction and alignment

    CN120781821B