Clinical decision-making method and system based on large language model and knowledge graph

Through a method based on large language model and knowledge graph, combined with federated learning and encryption mechanism, semantic alignment and real-time update of multi-source heterogeneous medical data is achieved, which improves the accuracy, reliability, timeliness and security of clinical decision-making, and solves the limitations of traditional systems.

CN120372020AActive Publication Date: 2025-07-25FUJIAN THINKWIN BIG DATA APPLICATION SERVICE CO LTD

Patent Information

Application Number
CN202510857354.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-07-25
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

Traditional clinical decision support systems have limitations in the semantic gap in multimodal medical data, bottlenecks in knowledge update timeliness, deficiencies in the decision-making process, and system performance and privacy security, resulting in insufficient accuracy, reliability, timeliness and security of clinical decision-making.

Method used

Using a method based on large language model and knowledge graph, we use federated learning training, deployment and dynamic updates of generative large language model and knowledge extraction model, and combine medical knowledge graph to conduct medical Q&A, record decision-making basis links, and ensure data security through federated learning mechanisms and encryption mechanisms, so as to achieve semantic alignment and real-time updates of multi-source heterogeneous data.

Benefits of technology

It improves the accuracy, reliability, timeliness and security of clinical decision-making, solves the semantic gap and knowledge update lag in traditional systems in multimodal data processing, provides an interpretable decision-making basis link, and ensures data privacy and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372020A_ABST
    Figure CN120372020A_ABST
Patent Text Reader

Abstract

The invention provides a clinical decision-making method and system based on a large language model and a knowledge graph, and belongs to the technical field of artificial intelligence and intelligent diagnosis and treatment crossing. The method comprises the following steps: S1, training and deploying a created generative large language model and a knowledge extraction model; s2, extracting medical knowledge from the medical data set through a knowledge extraction model; s3, constructing a medical knowledge graph based on the medical knowledge; s4, acquiring an input medical question, inputting the medical question into the generative large language model, querying medical knowledge corresponding to the medical question by the generative large language model through the medical knowledge graph, generating a medical answer based on the medical knowledge, recording a decision basis chain in the query process, and feeding back the medical answer and the decision basis chain; and S5, recording a question and answer log including the medical questions, the medical answers and the decision basis chain. The method has the advantages that the accuracy, the reliability, the timeliness and the safety of clinical decision making are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the cross - technical field of artificial intelligence and intelligent diagnosis and treatment, and particularly to a clinical decision - making method and system based on a large - language model and a knowledge graph. Background Art

[0002] As a core component of the modern medical informatization system, the technology evolution of the Clinical Decision Support System (CDSS) has always resonated with the development of medical informatics. Since the MYCIN system pioneered the rule - based expert system in the 1970s, it has gone through four generations of technological changes: the first generation is centered around a logical reasoning engine, the second generation introduced probabilistic network models, the third generation integrated machine - learning algorithms, and the fourth generation began to explore the application of deep - learning technology. Currently, mainstream systems mostly adopt a hybrid architecture, integrating multi - source heterogeneous data such as the Electronic Medical Record System (EMR), Laboratory Information System (LIS), and Picture Archiving and Communication System (PACS), and providing services such as diagnostic suggestions, treatment plan recommendations, and medication safety warnings for medical staff through predefined clinical paths and diagnostic rule bases. However, with the advent of the era of precision medicine and the exponential growth of medical data volume, the limitations of traditional CDSS at the technical architecture level have become increasingly prominent, specifically manifested in the following dimensions: 1. The semantic gap problem of multi - modal medical data: Modern medical data has formed a "3V + 2M" feature system: the data volume (Volume) reaches the PB level; the data variety (Variety) covers structured electronic medical records, semi - structured inspection reports, unstructured imaging DICOM files, etc.; the data generation speed (Velocity) shows a real - time trend, and ICU monitoring devices generate about 10 - 15 physiological parameters per second. Traditional CDSS mostly uses relational databases (such as MySQL, Oracle) or document databases (such as MongoDB) for storage, and its rigid schema is difficult to achieve semantic alignment of cross - modal data. For example, in the lung cancer diagnosis scenario, the system cannot effectively associate the ground - glass nodule features in CT images, EGFR gene mutation sites with the patient's main complaint of hemoptysis symptoms, resulting in a decrease in the sensitivity of diagnostic suggestions.

[0003] 2. The timeliness bottleneck of knowledge update: The update cycle of medical knowledge has been shortened from the traditional 3 - 5 years to 3 - 6 months. In 2022 alone, 2,478 clinical guidelines and 136,000 randomized controlled trial (RCT) reports were newly added to PubMed. However, traditional CDSS still adopts a quarterly - level manual update mechanism, and its knowledge - base construction lags behind and cannot integrate real - world evidence (RWE) in real time.

[0004] 3. Interpretability Defects in the Decision-Making Process: Traditional CDSSs generally suffer from the "black-box decision-making" problem: Diagnostic models based on deep learning (such as ResNet-152, BERT-Med) perform excellently in terms of accuracy but cannot generate a decision basis chain that meets the requirements of evidence-based medicine. More seriously, large language models will produce the phenomenon of knowledge hallucination when generating diagnostic suggestions.

[0005] 4. System Performance and Privacy Security: Traditional CPU architectures cannot effectively support the parallel computing of Transformer models. Each single inference requires about 1.2×10^10 floating-point operations, making the average response time of traditional CDSSs for handling complex decisions (such as differential diagnosis of multiple organ failure) in time-sensitive scenarios such as emergency departments reach 5.2±1.3 seconds, exceeding the clinical golden decision-making window period (3-second threshold). The relevant data is only encrypted with a single static key, posing a security risk of being stolen and tampered with.

[0006] Therefore, how to provide a clinical decision-making method and system based on large language models and knowledge graphs to improve the accuracy, reliability, timeliness, and security of clinical decision-making has become an urgent technical problem to be solved. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to provide a clinical decision-making method and system based on large language models and knowledge graphs to improve the accuracy, reliability, timeliness, and security of clinical decision-making.

[0008] In the first aspect, the present invention provides a clinical decision-making method based on large language models and knowledge graphs, including the following steps: Step S1, create a generative large language model for medical Q&A and a knowledge extraction model for extracting medical knowledge from medical data; Step S2, obtain a large amount of historical Q&A data and historical medical data, and preprocess each of the historical Q&A data and historical medical data to construct a Q&A data set and a medical data set; Step S3, through the federated learning mechanism, respectively call the Q&A data set and the medical data set to train the generative large language model and the knowledge extraction model, and compress the generative large language model and the knowledge extraction model during the training process; Step S4, deploy the trained generative large language model and knowledge extraction model, and perform data drift compensation training on the deployed generative large language model and knowledge extraction model; Step S5: Extract medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model, construct a medical knowledge graph based on each piece of medical knowledge, store the medical knowledge graph in a preset graph database in several computing nodes in a distributed manner, set the authentication mechanism for each graph database, and dynamically update the medical knowledge graph based on the collected real-time medical data; Step S6: Obtain the input medical question, input the medical question into the deployed generative large language model through the streaming computing engine. The generative large language model queries the medical knowledge corresponding to the medical question through the medical knowledge graph, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feeds back the medical answer and the decision basis chain to support clinical decision-making; Step S7: Record the Q&A log including the medical question, medical answer, and decision basis chain in real time, and continuously optimize and iterate the generative large language model and the knowledge extraction model based on the Q&A log; Step S8: Encrypt the Q&A log into an encrypted log, and store and back up the encrypted log; In the above Step S1, the generative large language model is constructed based on an input processing layer, a feature extraction layer, a generation optimization layer, and a prediction output layer; The input processing layer is constructed based on a medical tokenizer, an adversarial embedding module, and a bidirectional attention encoder; the medical tokenizer is used to segment the input medical question into several medical terms through a Bi-LSTM-CRF network; the adversarial embedding module is used to perform adversarial training on each medical term through a bidirectional LSTM network to generate word vectors with anti-interference ability; the bidirectional attention encoder is used to capture the long-range symptom description dependency relationship from each word vector through a deep Transformer stacking network to obtain a dynamic semantic vector; The feature extraction layer is constructed based on a domain adaptation module and a multi-task learning head; the domain adaptation module is used to extract fine-grained medical entity features from the dynamic semantic vector through a knowledge-guided masked language model; the multi-task learning head is used to extract symptom association features and knowledge reasoning path features from the dynamic semantic vector; The generation optimization layer is constructed based on a knowledge graph query module, a safety boundary controller, and a logical consistency discriminator; the knowledge graph query module is used to query the corresponding medical knowledge from the medical knowledge graph according to the medical entity features, symptom association features, and knowledge reasoning path features; the safety boundary controller is used to perform safety boundary constraints on the queried medical knowledge through a reinforcement learning strategy; the logical consistency discriminator is used to optimize the logical consistency of the medically knowledge after safety boundary constraints through a contrastive learning framework to generate an intermediate semantic representation; The prediction output layer is constructed based on a term enhancement decoder and a confidence evaluation module of an integrated medical ontology tree retrieval mechanism; the term enhancement decoder is used to decode the intermediate semantic representation to generate a medical answer that conforms to clinical guidelines in natural language; the confidence evaluation module is used to generate the confidence of the medical answer and output the medical answer carrying the confidence. The knowledge extraction model is constructed based on a multi-modal encoding layer, a joint extraction layer, a domain adaptation layer, and a knowledge structuring layer. The multi-modal encoding layer is constructed based on a text encoding module, a table encoding module, an image encoding module, and a cross-modal attention module; the text encoding module is used to extract text semantic features from medical texts through a biomedical BERT model; the table encoding module is used to extract structured features from electronic case tables through a graph neural network; the image encoding module is used to extract visual features from medical images through a convolutional neural network; the cross-modal attention module is used to perform cross-modal feature alignment on the text semantic features, structured features, and visual features to generate a fused context representation. The joint extraction layer is constructed based on an entity channel, a relationship channel, and an attribute channel; the entity channel, the relationship channel, and the attribute channel share the fused context representation and perform parameter interaction through gated attention; the entity channel is used to identify entities from the fused context representation through a conditional random field decoder; the relationship channel is used to identify the relationships between entities from the fused context representation through a multi-head pointer network; the attribute channel is used to identify the attributes of entities from the fused context representation through a gating mechanism. The domain adaptation layer is constructed based on an ontology constraint module and a gradient reversal module; the ontology constraint module is used to use the UMLS medical ontology as external knowledge to enhance the entity type consistency of entities through a graph attention network; the gradient reversal module is used to eliminate the data distribution difference of entities through a domain discriminator. The knowledge structuring layer is used to standardize entities through a medical dictionary, verify relationships through a rule engine, associate the entities, relationships, and attributes, and output medical knowledge containing the entities, relationships, and attributes.

[0009] In a second aspect, the present invention provides a clinical decision-making system based on a large language model and a knowledge graph, including the following modules: A model creation module, configured to create a generative large language model for medical question answering and a knowledge extraction model for extracting medical knowledge from medical data. A dataset construction module, configured to obtain a large amount of historical question-and-answer data and historical medical data, and preprocess each of the historical question-and-answer data and historical medical data to construct a question-and-answer dataset and a medical dataset. A model training module, which is used to train the generative large language model and the knowledge extraction model by separately calling the Q&A dataset and the medical dataset through a federated learning mechanism, and compress the generative large language model and the knowledge extraction model during the training process; A model deployment module, which is used to deploy the trained generative large language model and knowledge extraction model, and perform data drift compensation training on the deployed generative large language model and knowledge extraction model; A medical knowledge graph construction module, which is used to extract medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model, construct a medical knowledge graph based on each piece of medical knowledge, distribute and store the medical knowledge graph in a preset graph database in several computing nodes, set the authentication mechanism of each graph database, and dynamically update the medical knowledge graph based on the collected real-time medical data; A medical Q&A module, which is used to obtain an input medical question, input the medical question into the deployed generative large language model through a streaming computing engine, the generative large language model queries the medical knowledge corresponding to the medical question through the medical knowledge graph, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feeds back the medical answer and the decision basis chain to support clinical decision-making; A Q&A log recording module, which is used to record the Q&A log including medical questions, medical answers, and decision basis chains in real time, and continuously optimize and iterate the generative large language model and the knowledge extraction model based on the Q&A log; A Q&A log management module, which is used to encrypt the Q&A log into an encrypted log, and store and back up the encrypted log; In the model creation module, the generative large language model is constructed based on an input processing layer, a feature extraction layer, a generation optimization layer, and a prediction output layer; The input processing layer is constructed based on a medical tokenizer, an adversarial embedding module, and a bidirectional attention encoder; the medical tokenizer is used to perform term segmentation on the input medical question through a Bi-LSTM-CRF network to obtain a number of medical terms; the adversarial embedding module is used to perform adversarial training on each medical term through a bidirectional LSTM network to generate word vectors with anti-interference ability; the bidirectional attention encoder is used to capture long-range symptom description dependencies from each word vector through a deep Transformer stacking network to obtain a dynamic semantic vector; The feature extraction layer is constructed based on a domain adaptation module and a multi-task learning head; the domain adaptation module is used to extract fine-grained medical entity features from dynamic semantic vectors through a knowledge-guided masked language model; the multi-task learning head is used to extract symptom association features and knowledge inference path features from dynamic semantic vectors; The generation and optimization layer is constructed based on a knowledge graph query module, a safety boundary controller, and a logical consistency discriminator; the knowledge graph query module is used to query corresponding medical knowledge from a medical knowledge graph according to medical entity features, symptom association features, and knowledge inference path features; the safety boundary controller is used to perform safety boundary constraints on the queried medical knowledge through a reinforcement learning strategy; the logical consistency discriminator is used to optimize the logical consistency of the medical knowledge after safety boundary constraints through a contrastive learning framework to generate an intermediate semantic representation; The prediction and output layer is constructed based on a term enhancement decoder integrating a medical ontology tree retrieval mechanism and a credibility evaluation module; the term enhancement decoder is used to decode the intermediate semantic representation to generate a medical answer that conforms to clinical guidelines in natural language; the credibility evaluation module is used to generate the confidence of the medical answer and output the medical answer carrying the confidence; The knowledge extraction model is constructed based on a multi-modal encoding layer, a joint extraction layer, a domain adaptation layer, and a knowledge structuring layer; The multi-modal encoding layer is constructed based on a text encoding module, a table encoding module, an image encoding module, and a cross-modal attention module; the text encoding module is used to extract text semantic features from medical texts through a biomedical BERT model; the table encoding module is used to extract structured features from electronic case tables through a graph neural network; the image encoding module is used to extract visual features from medical images through a convolutional neural network; the cross-modal attention module is used to perform cross-modal feature alignment on text semantic features, structured features, and visual features to generate a fused context representation; The joint extraction layer is constructed based on an entity channel, a relationship channel, and an attribute channel; the entity channel, the relationship channel, and the attribute channel share the fused context representation and perform parameter interaction through gated attention; the entity channel is used to identify entities from the fused context representation through a conditional random field decoder; the relationship channel is used to identify the relationships between entities from the fused context representation through a multi-head pointer network; the attribute channel is used to identify the attributes of entities from the fused context representation through a gating mechanism; The domain adaptation layer is constructed based on an ontology constraint module and a gradient reversal module; the ontology constraint module is used to use the UMLS medical ontology as external knowledge to enhance the entity type consistency of entities through a graph attention network; the gradient reversal module is used to eliminate the data distribution difference of entities through a domain discriminator; The knowledge structuring layer is used to standardize entities through a medical dictionary, verify relationships through a rule engine, associate the entities, relationships, and attributes, and output medical knowledge containing the entities, relationships, and attributes.

[0010] The advantages of the present invention are as follows: 1. By creating a generative large language model for medical Q&A and a knowledge extraction model for extracting medical knowledge from medical data; obtaining a large amount of historical Q&A data and historical medical data, constructing a Q&A dataset and a medical dataset; then through a federated learning mechanism, respectively invoking the Q&A dataset and the medical dataset to train the generative large language model and the knowledge extraction model, and compressing the generative large language model and the knowledge extraction model during the training process; deploying the trained generative large language model and knowledge extraction model, and performing data drift compensation training on the deployed generative large language model and knowledge extraction model; then extracting medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model, constructing a medical knowledge graph based on each medical knowledge, distributing and storing the medical knowledge graph in a graph database preset in several computing nodes, setting an authentication mechanism for each graph database, and dynamically updating the medical knowledge graph based on the collected real-time medical data; then obtaining the input medical question, inputting the medical question into the deployed generative large language model through a streaming computing engine, the generative large language model queries the medical knowledge corresponding to the medical question through the medical knowledge graph to generate a medical answer, recording the decision basis chain during the query process, and feeding back the medical answer and the decision basis chain to support clinical decision-making; real-time recording the Q&A log including the medical question, medical answer, and decision basis chain, continuously dynamically optimizing and iterating the generative large language model and the knowledge extraction model based on the Q&A log, and encrypting the Q&A log into an encrypted log for storage and backup; that is, through the medical knowledge graph, semantic alignment of multi-source heterogeneous medical data is performed, and then combined with the generative large language model and the medical knowledge graph for medical Q&A, fully combining the advantages of the two to ensure the accuracy of medical answer generation; dynamically updating the medical knowledge graph by collecting real-time medical data to ensure the timeliness of medical knowledge update; and recording the decision basis chain while generating the medical answer to ensure the interpretability of the medical answer, and dynamically optimizing and iterating the generative large language model and the knowledge extraction model through the Q&A log, as much as possible avoiding the phenomenon of knowledge hallucination, combined with the federated learning mechanism, authentication mechanism, encryption of the Q&A log, and model compression, ultimately greatly improving the accuracy, reliability, timeliness, and security of clinical decision-making.

[0011] 2. By complementing the semantic understanding ability of the generative large language model (LLM) with the structured knowledge of the medical knowledge graph (KG), the problem of "hallucinations" (false reasoning) easily generated by traditional LLMs in the medical field is solved; through the combination of dynamic semantic vectors and medical knowledge graph queries, double verification is achieved to ensure the medical logic correctness of medical answers; through recording the decision basis chain, interpretability is provided to meet the transparency requirements of clinical decisions.

[0012] 3. By setting up a knowledge extraction model to support the joint coding of medical texts, electronic case sheets, and medical images (multi-modal coding layer), and through cross-modal attention modules to achieve feature alignment, the problem of medical data heterogeneity is solved.

[0013] 4. By setting up a question-and-answer dataset and a medical dataset to train the model using the federated learning mechanism, the leakage of original medical data is avoided; combined with a double encryption strategy (SM4+AES256, RC6+ECDH) to ensure the security of data transmission in federated learning, meeting the high security requirements of medical data.

[0014] 5. By adopting dynamic pruning during the training stage, the number of model parameters is reduced to adapt to the real-time inference requirements of medical scenarios; by adopting knowledge distillation to compress the model during the deployment stage, the consumption of hardware resources is reduced, facilitating the deployment of hospital edge devices, and thus greatly improving the timeliness of clinical decisions.

[0015] 6. By dividing the medical knowledge graph into several knowledge sub-graphs according to disease types for distributed storage, and subsequent queries can be made based on disease types in the corresponding knowledge sub-graphs, effectively improving the query efficiency.

[0016] 7. By setting up an authentication mechanism based on dynamic tokens, and the generation of dynamic tokens combines access time splicing, Bcrypt hash calculation, XXTEA algorithm, character swapping, and Base64 encoding. The authentication only allows access for a preset duration, and at least 6 security measures are taken before and after, greatly ensuring the security of the storage and invocation of the medical knowledge graph.

[0017] 8. By recording the log generation time of the Q&A log, rename the Q&A log based on the log generation time. Calculate the 256-bit hash value of the log generation time through the SHA-256 algorithm. Use the first 128 bits of the 256-bit hash value as the dynamic master key and the last 128 bits as the confusion factor. Divide the Q&A log into several data blocks based on the "day" number in the log generation time. Through the SM4 algorithm, encrypt each data block in CBC mode with the dynamic master key to obtain several first-level ciphertext blocks. XOR each first-level ciphertext block with the confusion factor to obtain second-level ciphertext blocks. Concatenate each second-level ciphertext block to obtain a concatenated ciphertext block. Encrypt the concatenated ciphertext block into an encrypted log through the AES256 algorithm. Perform distributed backup on the encrypted log. Calculate the data fingerprint of the encrypted log through the HMAC algorithm and upload it to the blockchain. That is, encrypt the Q&A log with the dynamic master key generated based on the log generation time, and also combine the SHA-256 algorithm, confusion factor, SM4 algorithm, CBC mode, AES256 algorithm, distributed backup, and data fingerprint, taking at least 7 security measures before and after, greatly ensuring the security of Q&A log storage.

[0018] 9. Through the authentication mechanism, adopt dynamic token obfuscation (Bcrypt + XXTEA + Base64) and access time binding to prevent unauthorized access. Through Q&A log encryption combined with SM4-CBC, AES256, and blockchain evidence storage, realize the full life cycle protection of medical data.

[0019] 10. Enhance the robustness against medical term spelling mistakes and abbreviations by setting the adversarial embedding module (Bi-LSTM-CRF) in the input processing layer. Constrain the knowledge query range by setting the security boundary controller (reinforcement learning) in the generation optimization layer to avoid generating medical answers beyond the guidelines. Ensure that the output conforms to the clinical guideline terminology system through the term enhancement decoder combined with medical ontology tree retrieval.

[0020] 11. Through the data drift compensation mechanism, that is, use actual data difference analysis to correct the model to solve the problem of data distribution offset (such as new diseases) in medical practice.

[0021] 12. Realize real-time parallel processing of medical problems through the streaming computing engine, combined with the distributed storage of the medical knowledge graph, to support high-concurrency clinical decision requests. Introduce GPU / NPU hardware acceleration in the query stage of the medical knowledge graph to compress the response time of typical medical problems to the millisecond level, significantly superior to traditional rule engine-based clinical decision support systems.

[0022] 13. By designing differentiated cleaning rules for the heterogeneity of medical texts, electronic case sheets, and medical images during the preprocessing stage (such as correcting error values in electronic case sheets and denoising medical images), the accuracy of subsequent model training is improved; during the construction stage of the medical knowledge graph, through entity alignment and rule engine verification, redundant or contradictory medical knowledge is effectively eliminated.

[0023] 14. By sharing model parameters rather than raw data through the federated learning framework, patient privacy is protected, and the generalization ability of the model is improved through global knowledge fusion; through the distributed knowledge graph, the merging and splitting of cross-institutional knowledge subgraphs are supported, facilitating collaborative diagnosis and treatment among regional medical consortia.

[0024] 15. By automatically backing up the old version of the model during the incremental training stage, a second-level rollback is triggered when the new model verification fails, avoiding the interruption of clinical decision-making caused by model update errors.

[0025] 16. By innovatively integrating generative large language models with medical knowledge graphs, the efficient utilization of medical privacy data is achieved through federated learning and multi-modal data processing. Combining adversarial embedding, dynamic knowledge graph update, and security boundary control technologies, the accuracy, interpretability, and anti-interference ability of clinical decision-making are significantly improved; based on the streaming computing engine, hardware acceleration, and distributed storage architecture, high-concurrency real-time inference is supported. At the same time, through modular design, containerized deployment, and incremental training mechanisms, the system achieves low-latency response, cross-platform compatibility, and adaptive optimization. On the premise of ensuring data security (double encryption, blockchain evidence storage), the problems of dynamic knowledge update, term standardization, and multi-source heterogeneous data governance in the medical field are solved, providing efficient, reliable, and traceable intelligent support for clinical decision-making. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The present invention will be further described below with reference to the accompanying drawings in conjunction with embodiments.

[0027] Figure 1 is a flowchart of a clinical decision-making method based on a large language model and a knowledge graph according to the present invention.

[0028] Figure 2 is a schematic structural diagram of a clinical decision-making system based on a large language model and a knowledge graph according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0029] The technical solution in the embodiments of the present application has the following overall idea: semantic alignment of multi-source heterogeneous medical data is performed through the medical knowledge graph, and then medical question and answer is performed in combination with the generative large language model and the medical knowledge graph, fully combining the advantages of the two to ensure the accuracy of medical answer generation; the medical knowledge graph is dynamically updated by collecting real-time medical data to ensure the timeliness of medical knowledge updates; and the decision-making basis chain is recorded while generating medical answers to ensure the interpretability of medical answers, and the generative large language model and the knowledge extraction model are dynamically optimized and iterated through the question and answer log to avoid knowledge hallucination as much as possible, combining the federated learning mechanism, authentication mechanism, and encryption and model compression of the question and answer log to improve the accuracy, reliability, timeliness and security of clinical decision-making.

[0030] Please refer to Figures 1 to 2 As shown, a preferred embodiment of a clinical decision-making method based on a large language model and a knowledge graph of the present invention includes the following steps: Step S1, creating a generative large language model for medical question answering and a knowledge extraction model for extracting medical knowledge from medical data; By complementing the semantic understanding ability of the generative large language model (LLM) with the structured knowledge of the medical knowledge graph (KG), the problem of traditional LLM being prone to "hallucinations" (erroneous reasoning) in the medical field is solved; by combining dynamic semantic vectors with medical knowledge graph queries, double verification is achieved to ensure the medical logical correctness of medical answers; by recording the decision-making basis chain, explainability is provided to meet the need for transparency in clinical decision-making.

[0031] Step S2: obtaining a large amount of historical question and answer data and historical medical data, and preprocessing each of the historical question and answer data and historical medical data to construct a question and answer data set and a medical data set; Step S3: through a federated learning mechanism, the question-answering dataset and the medical dataset are respectively called to train the generative large language model and the knowledge extraction model, and the generative large language model and the knowledge extraction model are compressed during the training process; Step S4: deploying the trained generative large language model and knowledge extraction model, and performing data drift compensation training on the deployed generative large language model and knowledge extraction model; Step S5: Extract medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model, construct a medical knowledge graph based on each piece of medical knowledge, store the medical knowledge graph distributively in the graph databases preset in several computing nodes, set the authentication mechanism for each graph database, and dynamically update the medical knowledge graph based on the collected real-time medical data; specifically, before generating the medical knowledge graph, verify the medical knowledge through Monte Carlo tree search to simulate clinical scenarios. Entities in the medical knowledge graph can represent diseases, drugs, symptoms, examinations and tests, medical devices, and medical procedures; relationships can represent treatment relationships, symptom relationships, side effect relationships, diagnostic relationships, and causal relationships; attributes can represent disease attributes, drug attributes, examination and test attributes, medical device attributes, and medical procedure attributes.

[0032] Step S6: Obtain the input medical question, input the medical question into the deployed generative large language model through the streaming computing engine. The generative large language model queries the medical knowledge corresponding to the medical question through the medical knowledge graph, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feedbacks the medical answer and the decision basis chain to support clinical decision-making. Step S7: Real-time record the Q&A log including the medical question, medical answer, and decision basis chain, and continuously optimize and iterate the generative large language model and the knowledge extraction model based on the Q&A log. Step S8: Encrypt the Q&A log into an encrypted log, and store and back up the encrypted log. In the above Step S1, the generative large language model is constructed based on an input processing layer, a feature extraction layer, a generation optimization layer, and a prediction output layer. The input processing layer is constructed based on a medical word segmenter, an adversarial embedding module, and a bidirectional attention encoder; the medical word segmenter is used to segment the input medical question into several medical terms through a Bi-LSTM-CRF network; the adversarial embedding module is used to perform adversarial training on each medical term through a bidirectional LSTM network to generate word vectors with anti-interference ability; the bidirectional attention encoder is used to capture long-range symptom description dependencies from each word vector through a deep Transformer stacking network to obtain a dynamic semantic vector. Enhance the robustness to medical term spelling mistakes and abbreviations by setting the adversarial embedding module (Bi-LSTM-CRF) in the input processing layer; constrain the knowledge query range by setting the safety boundary controller (reinforcement learning) in the generation optimization layer to avoid generating medical answers beyond the guidelines; ensure that the output conforms to the clinical guideline term system through the term reinforcement decoder combined with medical ontology tree retrieval.

[0033] In the medical field, especially when dealing with electronic health records (EHRs), it is often the case that a patient's symptom description may contain multiple related symptoms, and there is a certain logical relationship between these symptoms. For example, a patient may have two symptoms, "fever" and "cough" at the same time, and these two symptoms may be caused by the same reason (such as a cold), and there is a dependency relationship between them. The long-range symptom description dependency refers to the fact that in a longer text description, this logical relationship between symptoms may span multiple sentences or paragraphs. In other words, the occurrence of one symptom may depend on another symptom, and these two symptoms may not be in the same sentence. That is, the long-range symptom description dependency means that in a longer text description, the logical relationship between symptoms may span multiple sentences or paragraphs. By capturing the long-range symptom description dependency, the accuracy of diagnosis and medical efficiency can be effectively improved.

[0034] The feature extraction layer is constructed based on a domain adaptation module and a multi-task learning head. The domain adaptation module is used to extract fine-grained medical entity features from dynamic semantic vectors through a knowledge-guided masked language model. The multi-task learning head is used to extract symptom association features and knowledge inference path features from dynamic semantic vectors. A knowledge-guided masked language model (Knowledge-guided Masked Language Model, KMLM) is a technique that combines a knowledge graph and a masked language model (MLM), aiming to enhance the model's feature extraction ability by introducing external knowledge. This method performs well in natural language processing (NLP) and multi-modal tasks, especially in scenarios that require the use of domain-specific knowledge.

[0035] A multi-task learning head (Multi-Task Learning Head, MTL Head) is a structure in a deep learning model used to handle multiple related tasks simultaneously. It achieves multi-task learning by sharing the underlying feature extraction part of the model (usually called the "backbone network" or "backbone") and designing independent output layers (i.e., "task heads" or "heads") for each task at the top layer. The multi-task learning head parallelly executes symptom entity recognition, diagnostic path prediction, and question-answer generation tasks, sharing the underlying feature representation.

[0036] The generated optimization layer is constructed based on a knowledge graph query module, a security boundary controller, and a logical consistency discriminator; the knowledge graph query module is used to query corresponding medical knowledge from a medical knowledge graph according to medical entity features, symptom association features, and knowledge reasoning path features; the security boundary controller is used to perform security boundary constraints on the queried medical knowledge through a reinforcement learning strategy; the logical consistency discriminator is used to optimize the logical consistency of the medical knowledge after security boundary constraints through a contrastive learning framework to generate an intermediate semantic representation. The security boundary controller adopts a reinforcement learning strategy to impose dynamic penalties on high-risk outputs such as taboo drug combinations and dangerous symptom suggestions; the logical consistency discriminator is based on a contrastive learning framework to ensure the logical self-consistency of etiological explanations, treatment plans, and prognosis suggestions in the answer (medical knowledge).

[0037] The prediction output layer is constructed based on a term reinforcement decoder integrating a medical ontology tree retrieval mechanism and a credibility evaluation module; the term reinforcement decoder is used to decode the intermediate semantic representation to generate a medical answer that conforms to clinical guidelines in natural language; the credibility evaluation module is used to generate the confidence of the medical answer and output the medical answer carrying the confidence. The medical ontology tree retrieval mechanism is a retrieval technology based on medical ontology, aiming to improve the accuracy and efficiency of medical information retrieval through a structured medical knowledge system.

[0038] The knowledge extraction model is constructed based on a multi-modal encoding layer, a joint extraction layer, a domain adaptation layer, and a knowledge structuring layer. The multi-modal encoding layer is constructed based on a text encoding module, a table encoding module, an image encoding module, and a cross-modal attention module; the text encoding module is used to extract text semantic features from medical texts through a biomedical BERT model; the table encoding module is used to extract structured features from electronic case sheets through a graph neural network; the image encoding module is used to extract visual features from medical images through a convolutional neural network; the cross-modal attention module is used to perform cross-modal feature alignment on text semantic features, structured features, and visual features to generate a fused context representation. By setting the knowledge extraction model to support the joint encoding of medical texts, electronic case sheets, and medical images (multi-modal encoding layer) and achieving feature alignment through the cross-modal attention module, the problem of medical data heterogeneity is solved.

[0039] The Cross-Modal Attention Module (CMA) is a technology for multi-modal data processing. It aims to fuse information from different modalities (such as text, images, audio, etc.) through an attention mechanism, thereby improving the model's understanding and processing capabilities for multi-modal data. It calculates the attention weights between different modalities and dynamically adjusts the contributions of each modality to the final result to achieve more effective information fusion.

[0040] The joint extraction layer is constructed based on an entity channel, a relation channel, and an attribute channel; the entity channel, the relation channel, and the attribute channel share a fused context representation and perform parameter interaction through gated attention; the entity channel is used to identify entities from the fused context representation through a conditional random field decoder; the relation channel is used to identify the relationships between entities from the fused context representation through a multi-head pointer network; the attribute channel is used to identify the attributes of entities from the fused context representation through a gating mechanism; The domain adaptation layer is constructed based on an ontology constraint module and a gradient reversal module; the ontology constraint module is used to use the UMLS medical ontology as external knowledge and enhance the entity type consistency of entities through a graph attention network; the gradient reversal module is used to eliminate the data distribution differences of entities through a domain discriminator; The ontology constraint module is a tool used in knowledge graphs. Its role is to ensure that the entities (such as diseases, drugs, symptoms, etc.) and the relationships between them in the knowledge graph conform to certain rules and standards; this is like setting a set of "rule books" for the knowledge graph, so that all information is organized according to this set of rules, thereby ensuring the accuracy and consistency of the information.

[0041] The gradient reversal module is a technique used in deep learning. Its role is to "reverse" the direction of the gradient. When training a neural network, the gradient is the signal that tells the network how to adjust the weights to minimize the loss function. The gradient reversal module reverses these gradients, making the network "deliberately" do the opposite on certain tasks, thereby eliminating the differences between different datasets and enabling the model to better process data from different sources and improve its performance under different data distributions.

[0042] The knowledge structuring layer is used to standardize entities through a medical dictionary, verify relationships through a rule engine, associate the entities, relationships, and attributes, and output medical knowledge containing the entities, relationships, and attributes.

[0043] The specific content of step S2 is as follows: Obtain a large amount of historical Q&A data and historical medical data; the historical Q&A data includes medical questions, medical answers, and decision-making basis chains; the historical medical data includes medical texts, electronic case sheets, and medical images; Perform preprocessing on each of the historical Q&A data, including at least deleting noise data, standardizing formats, and removing stop words. Annotate the answer satisfaction of each preprocessed historical Q&A data, and construct a Q&A data set based on the annotated historical Q&A data; Perform preprocessing on the medical texts in each of the historical medical data, including at least removing irrelevant information, word segmentation, and removing stop words. Perform preprocessing on each of the electronic case sheets, including at least removing duplicates, correcting error values, filling in missing values, and unifying date formats. Perform preprocessing on each of the medical images, including at least unifying image formats, enhancing contrast, and reducing noise. Annotate entities, relationships, and attributes of each preprocessed historical medical data, and construct a medical data set based on the annotated historical medical data; Expand the sample sizes of the Q&A data set and the medical data set through a generative adversarial network; Improve the accuracy of subsequent model training by designing differentiated cleaning rules (such as correcting error values in electronic case sheets and reducing noise in medical images) for the heterogeneity of medical texts, electronic case sheets, and medical images in the preprocessing stage. In the medical knowledge graph construction stage, effectively eliminate redundant or contradictory medical knowledge through entity alignment and rule engine verification.

[0044] The specific steps of step S3 are as follows: Deploy the generative large language model and the knowledge extraction model to a training server, synchronously deploy the generative large language model to a number of first training clients, and synchronously deploy the knowledge extraction model to a number of second training clients; Divide the Q&A data set into several Q&A data subsets, encrypt each Q&A data subset into a first encrypted Q&A subset through the SM4 algorithm, encrypt each first encrypted Q&A subset into a second encrypted Q&A subset through the AES256 algorithm, and send each second encrypted Q&A subset to a first training client respectively. The first training client decrypts the second encrypted Q&A subset through the AES256 algorithm and the SM4 algorithm to obtain the Q&A data subset; Divide the medical data set into several medical data subsets, encrypt each medical data subset into a first encrypted medical subset through the RC6 algorithm, encrypt each first encrypted medical subset into a second encrypted medical subset through the ECDH algorithm, and send each second encrypted medical subset to a second training client respectively. The second training client decrypts the second encrypted medical subset through the ECDH algorithm and the RC6 algorithm to obtain the medical data subset; Each first training client trains the local generative large language model with the subset of the Q&A data until the preset first convergence condition is met, completing the first round of training. The first model parameters of the generative large language model are uploaded as the first local parameters to the training server. The training server performs federated averaging on the first local parameters uploaded by each first training client to obtain the first global parameters, and distributes the first global parameters to each first training client to execute the second round of training until the preset first round threshold is completed. After initializing the local generative large language model based on the first global parameters, the training server sequentially validates and tests the generative large language model. If the validation or test fails, the Q&A dataset is expanded and training continues; Each second training client trains the local knowledge extraction model with the subset of the medical data until the preset second convergence condition is met, completing the first round of training. The second model parameters of the knowledge extraction model are uploaded as the second local parameters to the training server. The training server performs federated averaging on the second local parameters uploaded by each second training client to obtain the second global parameters, and distributes the second global parameters to each second training client to execute the second round of training until the preset second round threshold is completed. After initializing the local knowledge extraction model based on the second global parameters, the training server sequentially validates and tests the knowledge extraction model. If the validation or test fails, the medical dataset is expanded and training continues; During the training process, each first training client and second training client compresses the generative large language model and the knowledge extraction model through dynamic pruning technology.

[0045] By setting the Q&A dataset and the medical dataset to use the federated learning mechanism to train the model, the leakage of original medical data is avoided; combined with the dual encryption strategy (SM4+AES256, RC6+ECDH) to ensure the security of data transmission in federated learning, meeting the high security requirements of medical data.

[0046] Sharing model parameters instead of original data through the federated learning framework not only protects patient privacy but also improves the generalization ability of the model through global knowledge fusion; through the distributed knowledge graph, the merging and splitting of cross-institutional knowledge subgraphs are supported, facilitating collaborative diagnosis and treatment among regional medical consortia.

[0047] The specific step S4 is as follows: Compress the trained generative large language model and knowledge extraction model through knowledge distillation technology, and deploy the generative large language model and knowledge extraction model after knowledge distillation through containerization technology; Collect a preset number of actual question and answer data and actual medical data, compare the differences between the actual question and answer data and the question and answer data set to obtain a first difference data set, and use the first difference data set to perform data drift compensation training on the deployed generative large language model; compare the differences between the actual medical data and the medical data set to obtain a second difference data set, and use the second difference data set to perform data drift compensation training on the deployed knowledge extraction model.

[0048] The step S5 is specifically as follows: Medical knowledge including entities, relationships and attributes are extracted from the medical data set through the knowledge extraction model, and the entities and relationships of medical knowledge in different data sources are aligned using entity alignment technology and relationship alignment technology. A medical knowledge graph is constructed with the entities of each medical knowledge as nodes, relationships as edges, and attributes as descriptions of nodes or edges. The medical knowledge graph is divided into a number of knowledge sub-graphs based on disease types, and each of the knowledge sub-graphs is stored in a preset graph database in a computing node, and an authentication mechanism is set for each of the graph databases; real-time medical data is collected, and the real-time medical data is checked for repeatability based on the medical knowledge graph. If there is no repeatability, the medical knowledge graph is dynamically updated based on the real-time medical data; By dividing the medical knowledge graph into several knowledge sub-graphs according to disease type for distributed storage, subsequent queries can be performed in the corresponding knowledge sub-graphs based on the disease type, effectively improving query efficiency.

[0049] In the Knowledge Graph, Entity Alignment and Relation Alignment are two key tasks that aim to identify and merge the same entities and relations from different knowledge graphs or data sources. These tasks are crucial for the fusion, extension, and application of knowledge graphs. Entity alignment refers to identifying and merging the same entities from different knowledge graphs or data sources. For example, "Apple" and "Apple Inc." in different databases are actually the same entity, and the goal of entity alignment is to identify and merge them into one entity. Relation alignment refers to identifying and merging the same relations from different knowledge graphs or data sources. For example, "treatment" and "cure" in different databases are actually the same relation, and the goal of relation alignment is to identify and merge them into one relation.

[0050] The authentication mechanism is specifically: Obtaining an access request carrying an access time, a first dynamic token, and a user account; Parse the access request to obtain the access time, the first dynamic token, and the user account. Match the user password from the preset user management table through the user account. Concatenate the user password and the access time to obtain concatenated data. Perform Bcrypt hashing calculation on the concatenated data to obtain a temporary token. Encrypt the temporary token through the XXTEA algorithm to obtain a 16-byte ciphertext. Swap the number 0 and the letter A, the number 1 and the letter C, and the number 2 and the letter E in the 16-byte ciphertext to obtain obfuscated data. Perform Base64 encoding on the obfuscated data to obtain the second dynamic token. Match the first dynamic token through the second dynamic token to perform an authentication operation. If the authentication passes, allow access to the graph database for a preset duration; By setting an authentication mechanism based on dynamic tokens, and the generation of dynamic tokens combines access time concatenation, Bcrypt hashing calculation, XXTEA algorithm, character swapping, and Base64 encoding. Only allowing access for a preset duration when the authentication passes, at least 6 security measures are taken before and after, greatly ensuring the security of the storage and call of the medical knowledge graph.

[0051] The specific step S6 is as follows: Obtain the input access request through the visualization interface. After parsing and authenticating the access request, allow access to the graph database for a preset duration, and display the authentication result through the visualization interface; Obtain the input medical problem through the visualization interface. Preprocess the medical problem through the streaming computing engine and then input it into the deployed generative large language model. The generative large language model queries the medical knowledge corresponding to the medical problem from the medical knowledge graph through hardware acceleration technology, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feedbacks the medical answer and the decision basis chain through the visualization interface to support clinical decision-making. When the generative large language model queries medical knowledge, it queries from the corresponding knowledge sub-graph based on the disease type to improve the query efficiency.

[0052] Realize the real-time parallel processing of medical problems through the streaming computing engine. Combine with the distributed storage of the medical knowledge graph to support high-concurrency clinical decision requests; By introducing GPU / NPU hardware acceleration in the medical knowledge graph query stage, compress the response time of typical medical problems to the millisecond level, significantly superior to the traditional rule engine-based clinical decision support system.

[0053] The Decision Justification Chain refers to the process of a series of logical inferences and evidence supports from problem identification to the final decision during the decision-making process. The Decision Justification Chain of the present invention details each step of generating a medical answer and its basis, ensuring the transparency and traceability of medical answer generation. In the medical field, especially in Clinical Decision Support Systems (CDSS), the Decision Justification Chain is particularly important because it can help doctors understand why a certain diagnosis or treatment plan is recommended, thereby enhancing the credibility and acceptance of the decision. Generating a Decision Justification Chain that meets the requirements of evidence-based medicine is a systematic process, involving multiple steps such as asking questions, obtaining evidence, evaluating evidence, synthesizing evidence, applying evidence, and evaluating results; through these steps, it can be ensured that each step is supported by sufficient evidence, improving the scientificity and accuracy of clinical decisions.

[0054] The specific step S7 is as follows: Real-time record the Q&A log including medical questions, medical answers, Decision Justification Chain, and Q&A time, back up the current generative large language model and knowledge extraction model based on a preset optimization period, perform incremental training on the generative large language model and knowledge extraction model through the Q&A log, verify the trained generative large language model and knowledge extraction model, and if the verification fails, roll back to the old version, thereby continuously dynamically optimizing and iterating the generative large language model and knowledge extraction model; By automatically backing up the old version model during the incremental training stage, triggering a second-level rollback when the new model verification fails, to avoid clinical decision interruption caused by model update errors.

[0055] The specific step S8 is as follows: Record the log generation time of the Q&A log, rename the Q&A log based on the log generation time, calculate the 256-bit hash value of the log generation time through the SHA-256 algorithm, use the first 128 bits of the 256-bit hash value as the dynamic master key, and the last 128 bits as the confusion factor; Based on the "day" number in the log generation time, split the Q&A log into several data blocks, through the SM4 algorithm, encrypt each data block in CBC mode with the dynamic master key to obtain several first-level ciphertext blocks, perform exclusive OR on each first-level ciphertext block with the confusion factor to obtain second-level ciphertext blocks, splice the second-level ciphertext blocks to obtain a spliced ciphertext block, encrypt the spliced ciphertext block into an encrypted log through the AES256 algorithm, store the encrypted log in a specified path, perform distributed backup on the encrypted log, calculate the data fingerprint of the encrypted log through the HMAC algorithm, and upload the data fingerprint to the blockchain.

[0056] Unauthorized access is prevented through an authentication mechanism that uses dynamic token obfuscation (Bcrypt + XXTEA + Base64) and access time binding; the full life cycle protection of medical data is achieved through the combination of question and answer log encryption, SM4-CBC, AES256, and blockchain evidence storage.

[0057] A preferred embodiment of a clinical decision-making system based on a large language model and a knowledge graph according to the present invention includes the following modules: A model creation module for creating a generative large language model for medical question answering and a knowledge extraction model for extracting medical knowledge from medical data; By complementing the semantic understanding ability of the generative large language model (LLM) with the structured knowledge of the medical knowledge graph (KG), the problem that traditional LLMs are prone to "hallucinations" (false reasoning) in the medical field is solved; through the combination of dynamic semantic vectors and medical knowledge graph queries, double verification is achieved to ensure the medical logic correctness of medical answers; by recording the decision basis chain, interpretability is provided to meet the transparency requirements of clinical decision-making.

[0058] A dataset construction module for obtaining a large amount of historical question and answer data and historical medical data, and preprocessing each of the historical question and answer data and historical medical data to construct a question and answer dataset and a medical dataset; A model training module for training the generative large language model and the knowledge extraction model by respectively calling the question and answer dataset and the medical dataset through a federated learning mechanism, and compressing the generative large language model and the knowledge extraction model during the training process; A model deployment module for deploying the trained generative large language model and knowledge extraction model, and performing data drift compensation training on the deployed generative large language model and knowledge extraction model; A medical knowledge graph construction module for extracting medical knowledge including entities, relationships, and attributes from a medical dataset through the knowledge extraction model, constructing a medical knowledge graph based on each of the medical knowledge, storing the medical knowledge graph in a preset graph database in a plurality of computing nodes in a distributed manner, setting an authentication mechanism for each of the graph databases, and dynamically updating the medical knowledge graph based on the collected real-time medical data; specifically, before generating the medical knowledge graph, the medical knowledge is verified through Monte Carlo tree search to simulate a clinical scenario; Entities in the medical knowledge graph can represent diseases, drugs, symptoms, examinations and tests, medical devices, medical procedures; relationships can represent treatment relationships, symptom relationships, side effect relationships, diagnostic relationships, causal relationships; attributes can represent disease attributes, drug attributes, examination and test attributes, medical device attributes, medical procedure attributes.

[0059] A medical Q&A module for obtaining an input medical question, inputting the medical question into a deployed generative large language model through a streaming computing engine. The generative large language model queries medical knowledge corresponding to the medical question through a medical knowledge graph, generates a medical answer based on the medical knowledge, records a decision basis chain during the query process, and feeds back the medical answer and the decision basis chain to support clinical decision-making; A Q&A log recording module for real-time recording of Q&A logs including medical questions, medical answers, and decision basis chains, and continuously optimizing and iterating the generative large language model and the knowledge extraction model based on the Q&A logs; A Q&A log management module for encrypting the Q&A log into an encrypted log and storing and backing up the encrypted log; In the model creation module, the generative large language model is constructed based on an input processing layer, a feature extraction layer, a generation optimization layer, and a prediction output layer; The input processing layer is constructed based on a medical tokenizer, an adversarial embedding module, and a bidirectional attention encoder; the medical tokenizer is used to perform term segmentation on the input medical question through a Bi-LSTM-CRF network to obtain a number of medical terms; the adversarial embedding module is used to perform adversarial training on each medical term through a bidirectional LSTM network to generate word vectors with anti-interference capabilities; the bidirectional attention encoder is used to capture long-range symptom description dependencies from each word vector through a deep Transformer stacking network to obtain a dynamic semantic vector; Enhance the robustness to medical term spelling mistakes and abbreviations by setting the adversarial embedding module (Bi-LSTM-CRF) in the input processing layer; constrain the knowledge query range by setting a safety boundary controller (reinforcement learning) in the generation optimization layer to avoid generating medical answers beyond the guidelines; ensure that the output conforms to the clinical guideline term system through a term reinforcement decoder combined with medical ontology tree retrieval.

[0060] In the medical field, especially when dealing with electronic health records (EHRs), it is often the case that a patient's symptom description may contain multiple related symptoms, and there is a certain logical relationship between these symptoms. For example, a patient may have two symptoms, "fever" and "cough" at the same time, and these two symptoms may be caused by the same reason (such as a cold), and there is a dependency relationship between them. The long-range symptom description dependency refers to the fact that in a longer text description, this logical relationship between symptoms may span multiple sentences or paragraphs. In other words, the occurrence of one symptom may depend on another symptom, and these two symptoms may not be in the same sentence. That is, the long-range symptom description dependency means that in a longer text description, the logical relationship between symptoms may span multiple sentences or paragraphs. By capturing the long-range symptom description dependency, the accuracy of diagnosis and medical efficiency can be effectively improved.

[0061] The feature extraction layer is constructed based on a domain adaptation module and a multi-task learning head. The domain adaptation module is used to extract fine-grained medical entity features from dynamic semantic vectors through a knowledge-guided masked language model. The multi-task learning head is used to extract symptom association features and knowledge inference path features from dynamic semantic vectors. The Knowledge-guided Masked Language Model (KMLM) is a technique that combines a knowledge graph and a masked language model (MLM), aiming to enhance the model's feature extraction ability by introducing external knowledge. This method performs well in natural language processing (NLP) and multi-modal tasks, especially in scenarios that require the use of domain-specific knowledge.

[0062] The Multi-Task Learning Head (MTL Head) is a structure in a deep learning model used to handle multiple related tasks simultaneously. It achieves multi-task learning by sharing the underlying feature extraction part of the model (usually called the "backbone network" or "backbone") and designing independent output layers (i.e., "task heads" or "heads") for each task at the top layer. The multi-task learning head performs symptom entity recognition, diagnostic path prediction, and question answering generation tasks in parallel, sharing the underlying feature representation.

[0063] The generated optimization layer is constructed based on a knowledge graph query module, a security boundary controller, and a logical consistency discriminator. The knowledge graph query module is used to query corresponding medical knowledge from a medical knowledge graph according to medical entity features, symptom association features, and knowledge reasoning path features. The security boundary controller is used to perform security boundary constraints on the queried medical knowledge through a reinforcement learning strategy. The logical consistency discriminator is used to optimize the logical consistency of the medical knowledge after security boundary constraints through a contrastive learning framework to generate an intermediate semantic representation. The security boundary controller adopts a reinforcement learning strategy to impose dynamic penalties on high-risk outputs such as taboo drug combinations and dangerous symptom suggestions. The logical consistency discriminator is based on a contrastive learning framework to ensure the logical self-consistency of the cause explanation, treatment plan, and prognosis suggestion in the answer (medical knowledge).

[0064] The prediction output layer is constructed based on a term reinforcement decoder integrating a medical ontology tree retrieval mechanism and a credibility evaluation module. The term reinforcement decoder is used to decode the intermediate semantic representation to generate a medical answer that conforms to clinical guidelines in natural language. The credibility evaluation module is used to generate the confidence of the medical answer and output the medical answer carrying the confidence. The medical ontology tree retrieval mechanism is a retrieval technology based on medical ontology, aiming to improve the accuracy and efficiency of medical information retrieval through a structured medical knowledge system.

[0065] The knowledge extraction model is constructed based on a multi-modal encoding layer, a joint extraction layer, a domain adaptation layer, and a knowledge structuring layer. The multi-modal encoding layer is constructed based on a text encoding module, a table encoding module, an image encoding module, and a cross-modal attention module. The text encoding module is used to extract text semantic features from medical texts through a biomedical BERT model. The table encoding module is used to extract structured features from electronic case sheets through a graph neural network. The image encoding module is used to extract visual features from medical images through a convolutional neural network. The cross-modal attention module is used to perform cross-modal feature alignment on the text semantic features, structured features, and visual features to generate a fused context representation. By setting up the knowledge extraction model to support the joint encoding of medical texts, electronic case sheets, and medical images (multi-modal encoding layer) and achieving feature alignment through the cross-modal attention module, the problem of medical data heterogeneity is solved.

[0066] The Cross-Modal Attention Module (CMA) is a technique for processing multi-modal data. It aims to fuse information from different modalities (such as text, images, audio, etc.) through an attention mechanism, thereby enhancing the model's ability to understand and process multi-modal data. It calculates the attention weights between different modalities and dynamically adjusts the contribution of each modality to the final result to achieve more effective information fusion.

[0067] The joint extraction layer is constructed based on an entity channel, a relation channel, and an attribute channel; the entity channel, the relation channel, and the attribute channel share a fused context representation and perform parameter interaction through gated attention; the entity channel is used to identify entities from the fused context representation through a conditional random field decoder; the relation channel is used to identify the relationships between entities from the fused context representation through a multi-head pointer network; the attribute channel is used to identify the attributes of entities from the fused context representation through a gating mechanism; The domain adaptation layer is constructed based on an ontology constraint module and a gradient reversal module; the ontology constraint module is used to use the UMLS medical ontology as external knowledge and enhance the entity type consistency of entities through a graph attention network; the gradient reversal module is used to eliminate the data distribution differences of entities through a domain discriminator; The ontology constraint module is a tool used in knowledge graphs. Its role is to ensure that the entities (such as diseases, drugs, symptoms, etc.) and the relationships between them in the knowledge graph conform to certain rules and standards; this is like setting a "rule book" for the knowledge graph, allowing all information to be organized according to this set of rules, thereby ensuring the accuracy and consistency of the information.

[0068] The gradient reversal module is a technique used in deep learning. Its role is to "reverse" the direction of the gradient. When training a neural network, the gradient is the signal that tells the network how to adjust the weights to minimize the loss function. The gradient reversal module reverses these gradients, causing the network to "deliberately" do the opposite on certain tasks, thereby eliminating the differences between different datasets and enabling the model to better process data from different sources and improve its performance under different data distributions.

[0069] The knowledge structuring layer is used to standardize entities through a medical dictionary, verify relationships through a rule engine, associate the entities, relationships, and attributes, and output medical knowledge containing the entities, relationships, and attributes.

[0070] The dataset construction module is specifically used for: Obtain a large amount of historical Q&A data and historical medical data; the historical Q&A data includes medical questions, medical answers, and decision-making basis chains; the historical medical data includes medical texts, electronic case sheets, and medical images; Perform preprocessing on each of the historical Q&A data, including at least deleting noise data, standardizing formats, and removing stop words. Annotate the answer satisfaction of each preprocessed historical Q&A data, and construct a Q&A dataset based on the annotated historical Q&A data; Perform preprocessing on the medical texts in each of the historical medical data, including at least removing irrelevant information, word segmentation, and removing stop words. Perform preprocessing on each of the electronic case sheets, including at least removing duplicates, correcting error values, filling in missing values, and unifying date formats. Perform preprocessing on each of the medical images, including at least unifying image formats, enhancing contrast, and reducing noise. Annotate entities, relationships, and attributes of each preprocessed historical medical data, and construct a medical dataset based on the annotated historical medical data; Expand the sample sizes of the Q&A dataset and the medical dataset through a generative adversarial network; Design differentiated cleaning rules (such as correcting error values in electronic case sheets and reducing noise in medical images) for the heterogeneity of medical texts, electronic case sheets, and medical images in the preprocessing stage to improve the accuracy of subsequent model training. In the medical knowledge graph construction stage, effectively eliminate redundant or contradictory medical knowledge through entity alignment and rule engine verification.

[0071] The model training module is specifically used for: Deploy the generative large language model and the knowledge extraction model to a training server, synchronously deploy the generative large language model to a number of first training clients, and synchronously deploy the knowledge extraction model to a number of second training clients; Divide the Q&A dataset into several Q&A data subsets equally, encrypt each Q&A data subset into a first encrypted Q&A subset through the SM4 algorithm, encrypt each first encrypted Q&A subset into a second encrypted Q&A subset through the AES256 algorithm, and send each second encrypted Q&A subset to a first training client respectively. The first training client decrypts the second encrypted Q&A subset through the AES256 algorithm and the SM4 algorithm to obtain the Q&A data subset; Divide the medical data set into several equal medical data subsets, encrypt each medical data subset into a first encrypted medical subset through the RC6 algorithm, encrypt each first encrypted medical subset into a second encrypted medical subset through the ECDH algorithm, and send each second encrypted medical subset to a second training client respectively. The second training client decrypts the second encrypted medical subset through the ECDH algorithm and the RC6 algorithm to obtain the medical data subset; Each first training client trains the local generative large language model through the question-and-answer data subset until the preset first convergence condition is met, completing the first round of training. Upload the first model parameters of the generative large language model as the first local parameters to the training server. The training server performs federated averaging on the first local parameters uploaded by each first training client to obtain the first global parameters, and sends the first global parameters to each first training client to execute the second round of training until the preset first-round threshold is completed; After initializing the local generative large language model based on the first global parameters, the training server verifies and tests the generative large language model in sequence. If the verification or test fails, expand the question-and-answer data set and continue training; Each second training client trains the local knowledge extraction model through the medical data subset until the preset second convergence condition is met, completing the first round of training. Upload the second model parameters of the knowledge extraction model as the second local parameters to the training server. The training server performs federated averaging on the second local parameters uploaded by each second training client to obtain the second global parameters, and sends the second global parameters to each second training client to execute the second round of training until the preset second-round threshold is completed; After initializing the local knowledge extraction model based on the second global parameters, the training server verifies and tests the knowledge extraction model in sequence. If the verification or test fails, expand the medical data set and continue training; During the training process, each first training client and second training client compress the generative large language model and the knowledge extraction model through the dynamic pruning technique.

[0072] By setting the question-and-answer data set and the medical data set to adopt the federated learning mechanism to train the model, the leakage of original medical data is avoided; combined with the dual encryption strategy (SM4+AES256, RC6+ECDH) to ensure the security of data transmission in federated learning, meeting the high security requirements of medical data.

[0073] Sharing model parameters instead of original data through the federated learning framework not only protects patient privacy but also improves the generalization ability of the model through global knowledge fusion; supporting the merging and splitting of cross-institutional knowledge subgraphs through the distributed knowledge graph facilitates collaborative diagnosis and treatment among regional medical consortia.

[0074] The model deployment module is specifically used for: Compressing the trained generative large language model and knowledge extraction model through knowledge distillation technology, and deploying the generative large language model and knowledge extraction model after knowledge distillation through containerization technology; Collect a preset number of actual question and answer data and actual medical data, compare the differences between the actual question and answer data and the question and answer data set to obtain a first difference data set, and use the first difference data set to perform data drift compensation training on the deployed generative large language model; compare the differences between the actual medical data and the medical data set to obtain a second difference data set, and use the second difference data set to perform data drift compensation training on the deployed knowledge extraction model.

[0075] The medical knowledge graph construction module is specifically used for: Medical knowledge including entities, relationships and attributes are extracted from the medical data set through the knowledge extraction model, and the entities and relationships of medical knowledge in different data sources are aligned using entity alignment technology and relationship alignment technology. A medical knowledge graph is constructed with the entities of each medical knowledge as nodes, relationships as edges, and attributes as descriptions of nodes or edges. The medical knowledge graph is divided into a number of knowledge sub-graphs based on disease types, and each of the knowledge sub-graphs is stored in a preset graph database in a computing node, and an authentication mechanism is set for each of the graph databases; real-time medical data is collected, and the real-time medical data is checked for repeatability based on the medical knowledge graph. If there is no repeatability, the medical knowledge graph is dynamically updated based on the real-time medical data; By dividing the medical knowledge graph into several knowledge sub-graphs according to disease type for distributed storage, subsequent queries can be performed in the corresponding knowledge sub-graphs based on the disease type, effectively improving query efficiency.

[0076] In the Knowledge Graph, Entity Alignment and Relation Alignment are two key tasks that aim to identify and merge the same entities and relations from different knowledge graphs or data sources. These tasks are crucial for the fusion, extension, and application of knowledge graphs. Entity alignment refers to identifying and merging the same entities from different knowledge graphs or data sources. For example, "Apple" and "Apple Inc." in different databases are actually the same entity, and the goal of entity alignment is to identify and merge them into one entity. Relation alignment refers to identifying and merging the same relations from different knowledge graphs or data sources. For example, "treatment" and "cure" in different databases are actually the same relation, and the goal of relation alignment is to identify and merge them into one relation.

[0077] The authentication mechanism is specifically as follows: Obtain an access request carrying the access time, the first dynamic token, and the user account; Parse the access request to obtain the access time, the first dynamic token, and the user account. Match the user password from the preset user management table through the user account, splice the user password and the access time to obtain spliced data, perform Bcrypt hashing calculation on the spliced data to obtain a temporary token, encrypt the temporary token through the XXTEA algorithm to obtain a 16-byte ciphertext, swap the number 0 and the letter A, the number 1 and the letter C, and the number 2 and the letter E in the 16-byte ciphertext to obtain confused data, perform Base64 encoding on the confused data to obtain a second dynamic token, and match the first dynamic token through the second dynamic token to perform an authentication operation. If the authentication is passed, access to the graph database is allowed for a preset duration; By setting the authentication mechanism based on dynamic tokens, and the generation of dynamic tokens combines access time splicing, Bcrypt hashing calculation, XXTEA algorithm, character swapping, and Base64 encoding. Only allowing access for a preset duration after successful authentication, at least six security measures are taken before and after, greatly ensuring the security of the storage and invocation of the medical knowledge graph.

[0078] The medical Q&A module is specifically used for: Obtain the input access request through the visual interface. After parsing and authenticating the access request, allow access to the graph database for a preset duration, and display the authentication result through the visual interface; Obtain the input medical question through the visual interface, preprocess the medical question through the streaming computing engine and then input it into the deployed generative large language model. The generative large language model queries the medical knowledge corresponding to the medical question from the medical knowledge graph through hardware acceleration technology, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feeds back the medical answer and the decision basis chain through the visual interface to support clinical decision-making. When the generative large language model queries medical knowledge, it queries from the corresponding knowledge sub-graph based on the disease type to improve the query efficiency.

[0079] Realize the real-time parallel processing of medical questions through the streaming computing engine, combined with the distributed storage of the medical knowledge graph, to support high-concurrency clinical decision requests; by introducing GPU / NPU hardware acceleration in the medical knowledge graph query stage, compress the response time of typical medical questions to the millisecond level, which is significantly better than traditional rule engine-based clinical decision support systems.

[0080] The Decision Justification Chain refers to a process of a series of logical inferences and evidence supports from problem identification to the final decision during the decision-making process. The Decision Justification Chain of the present invention details each step of generating a medical answer and its basis, ensuring the transparency and traceability of medical answer generation. In the medical field, especially in Clinical Decision Support Systems (CDSS), the Decision Justification Chain is particularly important because it can help doctors understand why a certain diagnosis or treatment plan is recommended, thereby enhancing the credibility and acceptance of the decision. Generating a Decision Justification Chain that meets the requirements of evidence-based medicine is a systematic process, involving multiple steps such as asking questions, obtaining evidence, evaluating evidence, synthesizing evidence, applying evidence, and evaluating results; through these steps, it can be ensured that each step is supported by sufficient evidence, improving the scientificity and accuracy of clinical decisions.

[0081] The question-and-answer log recording module is specifically used for: Real-time recording of question-and-answer logs including medical questions, medical answers, decision justification chains, and question-and-answer times, backing up the current generative large language model and knowledge extraction model based on a preset optimization period, performing incremental training on the generative large language model and knowledge extraction model through the question-and-answer logs, verifying the trained generative large language model and knowledge extraction model, and rolling back to the old version if the verification fails, thereby continuously dynamically optimizing and iterating the generative large language model and knowledge extraction model; By automatically backing up the old version model during the incremental training stage, triggering a second-level rollback when the new model verification fails, and avoiding clinical decision interruption caused by model update errors.

[0082] The question-and-answer log management module is specifically used for: Recording the log generation time of the question-and-answer log, renaming the question-and-answer log based on the log generation time, calculating the 256-bit hash value of the log generation time through the SHA-256 algorithm, taking the first 128 bits of the 256-bit hash value as the dynamic master key, and the last 128 bits as the confusion factor; Dividing the question-and-answer log into several data blocks based on the "day" number in the log generation time, encrypting each data block in CBC mode with the dynamic master key through the SM4 algorithm to obtain several first-level ciphertext blocks, performing exclusive OR on each first-level ciphertext block with the confusion factor to obtain second-level ciphertext blocks, splicing each second-level ciphertext block to obtain a spliced ciphertext block, encrypting the spliced ciphertext block into an encrypted log through the AES256 algorithm, storing the encrypted log in a specified path, performing distributed backup on the encrypted log, calculating the data fingerprint of the encrypted log through the HMAC algorithm, and uploading the data fingerprint to the blockchain.

[0083] Unauthorized access is prevented through an authentication mechanism that uses dynamic token obfuscation (Bcrypt + XXTEA + Base64) and access time binding; the full life cycle protection of medical data is achieved through the combination of Q&A log encryption, SM4-CBC, AES256, and blockchain evidence storage.

[0084] Although the specific implementation manners of the present invention have been described above, those skilled in the art of this technology should understand that the specific embodiments we described are illustrative rather than used to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should all be covered by the scope protected by the claims of the present invention.

Claims

1. A clinical decision-making method based on large language models and knowledge graphs, characterized in that: The steps are as follows: Step S1: Create a generative large language model for medical Q&A and a knowledge extraction model for extracting medical knowledge from medical data; Step S2: Obtain a large amount of historical Q&A data and historical medical data, and preprocess each piece of the historical Q&A data and historical medical data to construct a Q&A dataset and a medical dataset; Step S3: Through the federated learning mechanism, respectively call the Q&A dataset and the medical dataset to train the generative large language model and the knowledge extraction model, and compress the generative large language model and the knowledge extraction model during the training process; Step S4: Deploy the trained generative large language model and knowledge extraction model, and perform data drift compensation training on the deployed generative large language model and knowledge extraction model; Step S5: Extract medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model, construct a medical knowledge graph based on each piece of the medical knowledge, distribute and store the medical knowledge graph in a preset graph database in several computing nodes, set the authentication mechanism for each graph database, and dynamically update the medical knowledge graph based on the collected real-time medical data; Step S6: Obtain the input medical question, input the medical question into the deployed generative large language model through the streaming computing engine, the generative large language model queries the medical knowledge corresponding to the medical question through the medical knowledge graph, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feeds back the medical answer and the decision basis chain to support clinical decision-making; Step S7: Real-time record the Q&A log including the medical question, the medical answer, and the decision basis chain, and continuously perform dynamic optimization and iteration on the generative large language model and the knowledge extraction model based on the Q&A log; Step S8: Encrypt the Q&A log into an encrypted log, and store and back up the encrypted log.

2. The clinical decision-making method based on a large language model and a knowledge graph according to claim 1, wherein: In step S1, the generative large language model is constructed based on an input processing layer, a feature extraction layer, a generation optimization layer, and a prediction output layer; The input processing layer is constructed based on a medical tokenizer, an adversarial embedding module, and a bidirectional attention encoder; the medical tokenizer is used to perform term segmentation on the input medical question through a Bi-LSTM-CRF network to obtain a number of medical terms; the adversarial embedding module is used to perform adversarial training on each medical term through a bidirectional LSTM network to generate word vectors with anti-interference ability; the bidirectional attention encoder is used to capture long-range symptom description dependencies from each word vector through a deep Transformer stacking network to obtain a dynamic semantic vector; The feature extraction layer is constructed based on a domain adaptation module and a multi-task learning head; the domain adaptation module is used to extract fine-grained medical entity features from the dynamic semantic vector through a knowledge-guided masked language model; the multi-task learning head is used to extract symptom association features and knowledge inference path features from the dynamic semantic vector; The generated optimization layer is constructed based on a knowledge graph query module, a security boundary controller, and a logical consistency discriminator; the knowledge graph query module is used to query corresponding medical knowledge from a medical knowledge graph according to medical entity features, symptom association features, and knowledge reasoning path features; the security boundary controller is used to perform security boundary constraints on the queried medical knowledge through a reinforcement learning strategy; the logical consistency discriminator is used to optimize the logical consistency of the medical knowledge after security boundary constraints through a contrastive learning framework to generate an intermediate semantic representation; The prediction output layer is constructed based on a term reinforcement decoder integrating a medical ontology tree retrieval mechanism and a credibility evaluation module; the term reinforcement decoder is used to decode the intermediate semantic representation to generate a medical answer that conforms to clinical guidelines in natural language; The credibility evaluation module is used to generate the confidence of the medical answer and output the medical answer carrying the confidence; The knowledge extraction model is constructed based on a multi-modal encoding layer, a joint extraction layer, a domain adaptation layer, and a knowledge structuring layer; The multi-modal encoding layer is constructed based on a text encoding module, a table encoding module, an image encoding module, and a cross-modal attention module; the text encoding module is used to extract text semantic features from medical texts through a biomedical BERT model; the table encoding module is used to extract structured features from electronic case tables through a graph neural network; the image encoding module is used to extract visual features from medical images through a convolutional neural network; the cross-modal attention module is used to perform cross-modal feature alignment on text semantic features, structured features, and visual features to generate a fused context representation; The joint extraction layer is constructed based on an entity channel, a relationship channel, and an attribute channel; the entity channel, the relationship channel, and the attribute channel share the fused context representation and perform parameter interaction through gated attention; the entity channel is used to identify entities from the fused context representation through a conditional random field decoder; the relationship channel is used to identify the relationships between entities from the fused context representation through a multi-head pointer network; the attribute channel is used to identify the attributes of entities from the fused context representation through a gating mechanism; The domain adaptation layer is constructed based on an ontology constraint module and a gradient reversal module; the ontology constraint module is used to use the UMLS medical ontology as external knowledge to enhance the entity type consistency of entities through a graph attention network; the gradient reversal module is used to eliminate the data distribution differences of entities through a domain discriminator; The knowledge structuring layer is used to standardize entities through a medical dictionary, verify relationships through a rule engine, associate the entities, relationships, and attributes, and output medical knowledge including the entities, relationships, and attributes; The specific content of step S2 is as follows: Obtain a large amount of historical Q&A data and historical medical data; the historical Q&A data includes medical questions, medical answers, and decision basis chains; the historical medical data includes medical texts, electronic case tables, and medical images; Perform preprocessing on each of the historical Q&A data, including at least deleting noise data, standardizing formats, and removing stop words. Annotate the answer satisfaction of each preprocessed historical Q&A data, and construct a Q&A dataset based on the annotated historical Q&A data; Perform preprocessing on the medical texts in each of the historical medical data, including at least removing irrelevant information, word segmentation, and removing stop words. Perform preprocessing on each electronic case table, including at least removing duplicates, correcting error values, filling in missing values, and unifying date formats. Perform preprocessing on each medical image, including at least unifying image formats, enhancing contrast, and reducing noise; Annotate entities, relationships, and attributes for each preprocessed historical medical data, and construct a medical dataset based on the annotated historical medical data; Expand the sample sizes of the Q&A dataset and the medical dataset through a generative adversarial network; The specific steps of step S3 are as follows: Deploy the generative large language model and the knowledge extraction model to the training server, synchronously deploy the generative large language model to a number of first training clients, and synchronously deploy the knowledge extraction model to a number of second training clients; Divide the Q&A dataset into several Q&A data subsets equally. Encrypt each Q&A data subset into a first encrypted Q&A subset through the SM4 algorithm, and encrypt each first encrypted Q&A subset into a second encrypted Q&A subset through the AES256 algorithm. Send each second encrypted Q&A subset to a first training client respectively. The first training client decrypts the second encrypted Q&A subset through the AES256 algorithm and the SM4 algorithm to obtain the Q&A data subset; Divide the medical dataset into several medical data subsets equally. Encrypt each medical data subset into a first encrypted medical subset through the RC6 algorithm, and encrypt each first encrypted medical subset into a second encrypted medical subset through the ECDH algorithm. Send each second encrypted medical subset to a second training client respectively. The second training client decrypts the second encrypted medical subset through the ECDH algorithm and the RC6 algorithm to obtain the medical data subset; Each first training client trains the local generative large language model through the Q&A data subset until a preset first convergence condition is met, completing the first round of training. Take the first model parameters of the generative large language model as the first local parameters and upload them to the training server. The training server performs federated averaging on the first local parameters uploaded by each first training client to obtain the first global parameters, and send the first global parameters to each first training client to execute the second round of training until the preset first round threshold is completed; After initializing the local generative large language model based on the first global parameters, the training server verifies and tests the generative large language model in turn. If the verification or test fails, expand the Q&A dataset and continue training; Each second training client trains the local knowledge extraction model with the medical data subset until the preset second convergence condition is met, completing the first round of training. The second model parameters of the knowledge extraction model are uploaded to the training server as second local parameters. The training server performs federated averaging on the second local parameters uploaded by each second training client to obtain second global parameters, and distributes the second global parameters to each second training client to execute the second round of training until the preset second-round threshold is completed; After initializing the local knowledge extraction model based on the second global parameters, the training server verifies and tests the knowledge extraction model in sequence. If the verification or test fails, the medical dataset is expanded for continued training; During the training process, each first training client and second training client compresses the generative large language model and the knowledge extraction model through dynamic pruning technology.

3. The clinical decision-making method based on large language model and knowledge graph according to claim 1, characterized in that: The specific content of step S4 is as follows: Compress the trained generative large language model and knowledge extraction model through knowledge distillation technology, and deploy the generative large language model and knowledge extraction model after knowledge distillation through containerization technology; Collect a preset number of actual Q&A data and actual medical data, compare the differences between each actual Q&A data and the Q&A dataset to obtain a first difference dataset, and perform data drift compensation training on the deployed generative large language model through the first difference dataset; compare the differences between each actual medical data and the medical dataset to obtain a second difference dataset, and perform data drift compensation training on the deployed knowledge extraction model through the second difference dataset.

4. The clinical decision-making method based on a large language model and a knowledge graph according to claim 1, characterized in that: The specific content of step S5 is as follows: Extract medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model. Use entity alignment technology and relationship alignment technology to align the entities and relationships of medical knowledge from different data sources. Construct a medical knowledge graph with the entities of each medical knowledge as nodes, relationships as edges, and attributes as descriptions of nodes or edges. Divide the medical knowledge graph into several knowledge sub-graphs based on disease types, store each knowledge sub-graph in a preset graph database in a computing node, and set the authentication mechanism for each graph database; collect real-time medical data, and perform duplicate verification on the real-time medical data based on the medical knowledge graph. If there is no duplication, dynamically update the medical knowledge graph based on the real-time medical data; The specific authentication mechanism is as follows: Obtain an access request carrying the access time, the first dynamic token, and the user account; Parse the access request to obtain the access time, the first dynamic token, and the user account. Match the user password from the preset user management table through the user account, splice the user password and the access time to obtain spliced data, perform Bcrypt hashing calculation on the spliced data to obtain a temporary token, encrypt the temporary token through the XXTEA algorithm to obtain a 16-byte ciphertext, swap the number 0 and the letter A, the number 1 and the letter C, and the number 2 and the letter E in the 16-byte ciphertext to obtain obfuscated data, perform Base64 encoding on the obfuscated data to obtain the second dynamic token, and match the first dynamic token through the second dynamic token to perform an authentication operation. If the authentication passes, allow access to the graph database for a preset duration; The specific steps of step S6 are as follows: Obtain the input access request through the visual interface. After parsing and authenticating the access request, allow access to the graph database for a preset duration, and display the authentication result through the visual interface; Obtain the input medical question through the visual interface, preprocess the medical question through the streaming computing engine and then input it into the deployed generative large language model. The generative large language model queries the medical knowledge corresponding to the medical question from the medical knowledge graph through hardware acceleration technology, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feedback the medical answer and the decision basis chain through the visual interface to support clinical decision-making.

5. The clinical decision-making method based on a large language model and a knowledge graph according to claim 1, characterized in that: The specific steps of step S7 are as follows: Record the Q&A log including the medical question, medical answer, decision basis chain, and Q&A time in real time. Back up the current generative large language model and knowledge extraction model based on a preset optimization period, perform incremental training on the generative large language model and knowledge extraction model through the Q&A log, verify the trained generative large language model and knowledge extraction model, and roll back to the old version if the verification fails, thereby continuously optimizing and iterating the generative large language model and knowledge extraction model dynamically; The specific steps of step S8 are as follows: Record the log generation time of the Q&A log, rename the Q&A log based on the log generation time, calculate the 256-bit hash value of the log generation time through the SHA-256 algorithm, use the first 128 bits of the 256-bit hash value as the dynamic master key, and the last 128 bits as the obfuscation factor; Divide the Q&A log into several data blocks based on the "day" number in the log generation time. Through the SM4 algorithm, encrypt each data block in CBC mode with the dynamic master key to obtain several first-level ciphertext blocks, perform exclusive OR on each first-level ciphertext block with the obfuscation factor to obtain second-level ciphertext blocks, splice the second-level ciphertext blocks to obtain a spliced ciphertext block, encrypt the spliced ciphertext block into an encrypted log through the AES256 algorithm, store the encrypted log in the specified path, perform distributed backup on the encrypted log, calculate the data fingerprint of the encrypted log through the HMAC algorithm, and upload the data fingerprint to the blockchain.

6. A clinical decision-making system based on a large language model and a knowledge graph, characterized in that: It includes the following modules: A model creation module, which is used to create a generative large language model for medical Q&A and a knowledge extraction model for extracting medical knowledge from medical data; A dataset construction module, which is used to obtain a large amount of historical Q&A data and historical medical data, and preprocess each of the historical Q&A data and historical medical data to construct a Q&A dataset and a medical dataset; A model training module, which is used to call the Q&A dataset and the medical dataset respectively through a federated learning mechanism to train the generative large language model and the knowledge extraction model, and compress the generative large language model and the knowledge extraction model during the training process; A model deployment module, which is used to deploy the trained generative large language model and knowledge extraction model, and perform data drift compensation training on the deployed generative large language model and knowledge extraction model; A medical knowledge graph construction module, which is used to extract medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model, construct a medical knowledge graph based on each of the medical knowledge, distribute and store the medical knowledge graph in a preset graph database in several computing nodes, set the authentication mechanism of each of the graph databases, and dynamically update the medical knowledge graph based on the collected real-time medical data; A medical Q&A module, which is used to obtain an input medical question, input the medical question into the deployed generative large language model through a streaming computing engine, the generative large language model queries the medical knowledge corresponding to the medical question through the medical knowledge graph, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feeds back the medical answer and the decision basis chain to support clinical decision-making; A Q&A log recording module, which is used to record Q&A logs including medical questions, medical answers, and decision basis chains in real time, and continuously optimize and iterate the generative large language model and the knowledge extraction model based on the Q&A logs; A Q&A log management module, which is used to encrypt the Q&A logs into encrypted logs, and store and back up the encrypted logs.

7. The clinical decision-making system based on a large language model and a knowledge graph according to claim 6, characterized in that: In the model creation module, the generative large language model is constructed based on an input processing layer, a feature extraction layer, a generation optimization layer, and a prediction output layer; The input processing layer is constructed based on a medical tokenizer, an adversarial embedding module, and a bidirectional attention encoder; the medical tokenizer is used to perform term segmentation on the input medical question through a Bi-LSTM-CRF network to obtain a number of medical terms; the adversarial embedding module is used to perform adversarial training on each medical term through a bidirectional LSTM network to generate word vectors with anti-interference ability; the bidirectional attention encoder is used to capture long-range symptom description dependencies from each word vector through a deep Transformer stacking network to obtain a dynamic semantic vector; The feature extraction layer is constructed based on a domain adaptation module and a multi-task learning head; the domain adaptation module is used to extract fine-grained medical entity features from dynamic semantic vectors through a knowledge-guided masked language model; the multi-task learning head is used to extract symptom association features and knowledge inference path features from dynamic semantic vectors; The generation optimization layer is constructed based on a knowledge graph query module, a safety boundary controller, and a logical consistency discriminator; the knowledge graph query module is used to query corresponding medical knowledge from a medical knowledge graph according to medical entity features, symptom association features, and knowledge inference path features; the safety boundary controller is used to perform safety boundary constraints on the queried medical knowledge through a reinforcement learning strategy; the logical consistency discriminator is used to optimize the logical consistency of the medically knowledgeable after safety boundary constraints through a contrastive learning framework to generate an intermediate semantic representation; The prediction output layer is constructed based on a term reinforcement decoder integrating a medical ontology tree retrieval mechanism and a confidence evaluation module; the term reinforcement decoder is used to decode the intermediate semantic representation to generate a medical answer that conforms to clinical guidelines in natural language; The confidence evaluation module is used to generate the confidence of the medical answer and output the medical answer carrying the confidence; The knowledge extraction model is constructed based on a multi-modal encoding layer, a joint extraction layer, a domain adaptation layer, and a knowledge structuring layer; The multi-modal encoding layer is constructed based on a text encoding module, a table encoding module, an image encoding module, and a cross-modal attention module; the text encoding module is used to extract text semantic features from medical texts through a biomedical BERT model; the table encoding module is used to extract structured features from electronic case tables through a graph neural network; the image encoding module is used to extract visual features from medical images through a convolutional neural network; the cross-modal attention module is used to perform cross-modal feature alignment on text semantic features, structured features, and visual features to generate a fused context representation; The joint extraction layer is constructed based on an entity channel, a relationship channel, and an attribute channel; the entity channel, the relationship channel, and the attribute channel share the fused context representation and perform parameter interaction through gated attention; the entity channel is used to identify entities from the fused context representation through a conditional random field decoder; the relationship channel is used to identify the relationships between entities from the fused context representation through a multi-head pointer network; the attribute channel is used to identify the attributes of entities from the fused context representation through a gating mechanism; The domain adaptation layer is constructed based on an ontology constraint module and a gradient reversal module; the ontology constraint module is used to use the UMLS medical ontology as external knowledge to enhance the entity type consistency of entities through a graph attention network; the gradient reversal module is used to eliminate the data distribution differences of entities through a domain discriminator; The knowledge structuring layer is used to standardize entities through a medical dictionary, verify relationships through a rule engine, associate the entities, relationships, and attributes, and output medical knowledge including the entities, relationships, and attributes; The dataset construction module is specifically used for: Obtaining a large amount of historical Q&A data and historical medical data; the historical Q&A data includes medical questions, medical answers, and decision basis chains; the historical medical data includes medical texts, electronic case sheets, and medical images; Performing preprocessing on each of the historical Q&A data, including at least deleting noise data, standardizing formats, and removing stop words, annotating the answer satisfaction of the preprocessed historical Q&A data, and constructing a Q&A dataset based on the annotated historical Q&A data; Performing preprocessing on the medical texts in each of the historical medical data, including at least removing irrelevant information, word segmentation, and removing stop words, performing preprocessing on each of the electronic case sheets, including at least removing duplicates, correcting error values, filling in missing values, and unifying date formats, and performing preprocessing on each of the medical images, including at least unifying image formats, enhancing contrast, and reducing noise; Annotating entities, relationships, and attributes of each of the preprocessed historical medical data, and constructing a medical dataset based on the annotated historical medical data; Expanding the sample sizes of the Q&A dataset and the medical dataset through a generative adversarial network; The model training module is specifically used for: Deploying the generative large language model and the knowledge extraction model to a training server, synchronously deploying the generative large language model to a number of first training clients, and synchronously deploying the knowledge extraction model to a number of second training clients; Dividing the Q&A dataset into several Q&A data subsets equally, encrypting each of the Q&A data subsets into a first encrypted Q&A subset through the SM4 algorithm, encrypting each of the first encrypted Q&A subsets into a second encrypted Q&A subset through the AES256 algorithm, sending each of the second encrypted Q&A subsets to a first training client respectively, and the first training client decrypts the second encrypted Q&A subset through the AES256 algorithm and the SM4 algorithm to obtain the Q&A data subset; Dividing the medical dataset into several medical data subsets equally, encrypting each of the medical data subsets into a first encrypted medical subset through the RC6 algorithm, encrypting each of the first encrypted medical subsets into a second encrypted medical subset through the ECDH algorithm, sending each of the second encrypted medical subsets to a second training client respectively, and the second training client decrypts the second encrypted medical subset through the ECDH algorithm and the RC6 algorithm to obtain the medical data subset; Each first training client trains the local generative large language model through the Q&A data subset until a preset first convergence condition is met, completing the first round of training, uploading the first model parameters of the generative large language model as the first local parameters to the training server, the training server performs federated averaging on the first local parameters uploaded by each first training client to obtain the first global parameters, and sending the first global parameters to each first training client to execute the second round of training until the preset first round threshold is completed; After the training server initializes the local generative large language model based on the first global parameter, it sequentially validates and tests the generative large language model. If the validation or test fails, the Q&A dataset is expanded and training continues; Each second training client trains the local knowledge extraction model with the medical data subset until the preset second convergence condition is met, completing the first round of training. The second model parameters of the knowledge extraction model are uploaded as second local parameters to the training server. The training server performs federated averaging on the second local parameters uploaded by each second training client to obtain the second global parameter, and distributes the second global parameter to each second training client to execute the second round of training until the preset second round threshold is completed; After the training server initializes the local knowledge extraction model based on the second global parameter, it sequentially validates and tests the knowledge extraction model. If the validation or test fails, the medical dataset is expanded and training continues; During the training process, each first training client and second training client compresses the generative large language model and the knowledge extraction model through dynamic pruning technology.

8. The clinical decision-making system based on a large language model and a knowledge graph according to claim 6, characterized in that: The model deployment module is specifically used for: Compressing the trained generative large language model and knowledge extraction model through knowledge distillation technology, and deploying the generative large language model and knowledge extraction model after knowledge distillation through containerization technology; Collect a preset number of actual Q&A data and actual medical data, compare the differences between each actual Q&A data and the Q&A dataset to obtain the first difference dataset, and perform data drift compensation training on the deployed generative large language model through the first difference dataset; compare the differences between each actual medical data and the medical dataset to obtain the second difference dataset, and perform data drift compensation training on the deployed knowledge extraction model through the second difference dataset.

9. The clinical decision-making system based on a large language model and a knowledge graph according to claim 6, characterized in that: The medical knowledge graph construction module is specifically used for: Extracting medical knowledge including entities, relationships, and attributes from the medical dataset through the knowledge extraction model, using entity alignment technology and relationship alignment technology to align the entities and relationships of medical knowledge from different data sources. Using each entity of the medical knowledge as a node, the relationship as an edge, and the attribute as a description of the node or edge to construct a medical knowledge graph, dividing the medical knowledge graph into several knowledge sub-graphs based on disease types, storing each knowledge sub-graph in a preset graph database in a computing node, and setting the authentication mechanism for each graph database; collecting real-time medical data, performing repeatability verification on the real-time medical data based on the medical knowledge graph, and if there is no repetition, dynamically updating the medical knowledge graph based on the real-time medical data; The authentication mechanism is specifically: Obtain an access request carrying the access time, the first dynamic token, and the user account; Parse the access request to obtain the access time, the first dynamic token, and the user account. Match the user password from the preset user management table through the user account, splice the user password with the access time to obtain spliced data, perform Bcrypt hashing calculation on the spliced data to obtain a temporary token, encrypt the temporary token through the XXTEA algorithm to obtain a 16-byte ciphertext, swap the number 0 and the letter A, the number 1 and the letter C, and the number 2 and the letter E in the 16-byte ciphertext to obtain obfuscated data, perform Base64 encoding on the obfuscated data to obtain a second dynamic token, and match the first dynamic token through the second dynamic token to perform an authentication operation. If the authentication passes, access to the graph database is allowed for a preset duration; The medical Q&A module is specifically used for: Obtain the input access request through the visual interface. After parsing and authenticating the access request, allow access to the graph database for a preset duration, and display the authentication result through the visual interface; Obtain the input medical question through the visual interface, preprocess the medical question through the streaming computing engine and then input it into the deployed generative large language model. The generative large language model queries the medical knowledge corresponding to the medical question from the medical knowledge graph through hardware acceleration technology, generates a medical answer based on the medical knowledge, records the decision basis chain during the query process, and feeds back the medical answer and the decision basis chain through the visual interface to support clinical decision-making.

10. The clinical decision-making system based on a large language model and a knowledge graph according to claim 6, wherein: The Q&A log recording module is specifically used for: Real-time record the Q&A log including the medical question, the medical answer, the decision basis chain, and the Q&A time. Back up the current generative large language model and the knowledge extraction model based on a preset optimization period. Perform incremental training on the generative large language model and the knowledge extraction model through the Q&A log, verify the trained generative large language model and knowledge extraction model. If the verification fails, roll back to the old version, and then continuously perform dynamic optimization and iteration on the generative large language model and the knowledge extraction model; The Q&A log management module is specifically used for: Record the log generation time of the Q&A log, rename the Q&A log based on the log generation time, calculate the 256-bit hash value of the log generation time through the SHA-256 algorithm, use the first 128 bits of the 256-bit hash value as the dynamic master key, and the last 128 bits as the obfuscation factor; The Q&A logs are segmented into several data blocks based on the number of "days" in the log generation time. Through the SM4 algorithm, each data block is encrypted in CBC mode with the dynamic master key to obtain several first-level ciphertext blocks. Each first-level ciphertext block is XORed with the confusion factor to obtain a second-level ciphertext block. The second-level ciphertext blocks are concatenated to obtain a concatenated ciphertext block. The concatenated ciphertext block is encrypted into an encrypted log through the AES256 algorithm. The encrypted log is stored in a specified path, and the encrypted log is distributedly backed up. The data fingerprint of the encrypted log is calculated through the HMAC algorithm, and the data fingerprint is uploaded to the blockchain.

Citation Information

Patent Citations

  • Traditional Chinese medicine question-answering system construction method based on large language model and knowledge graph

    CN118838996A

  • Medical text big data intelligent labeling and knowledge graph construction method and system

    CN119851968A

  • Multi-center knowledge graph joint decision support method and system

    WO2023061377A1

  • Knowledge graph assisted large language models

    WO2025071818A1

Cited By

  • Cooperative reasoning method and system fusing medical knowledge graph and large model

    CN120544940A

  • Triage classification training system and method based on large language model and knowledge graph

    CN121032748A

  • Wisdom medical query question and answer service system based on large model

    CN121092673A

  • AI auxiliary inquiry method and system based on large language model and drug knowledge base

    CN121393723A

  • AI-assisted inquiry method and system based on large language model and drug knowledge base

    CN121393723B