Medical conversation context integrity guarantee and application method, system and storage medium
Patent Information
- Application Number
- CN202610997879.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-06
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2046-07-06
AI Technical Summary
[0005]本发明提供一种医疗对话上下文完整性保障及应用方法、系统及存储介质,旨在解决现有智能医疗对话系统难以整合全局信息、上下文数据撕裂的技术问题
[0017]本发明所达到的有益效果,在于提出了一种医疗对话上下文完整性保障及应用方法,该方法依托活跃缓冲器与记忆编译器,完成医疗对话和档案数据的缓存编译、结构化提取及分层存储,同时标记高危全局医疗约束实体;结合语义解析与强制召回机制拼装医疗用户数字画像,并通过双重校验推理输出医疗建议。本发明规避了传统医疗对话上下文截断、关键信息及高危约束遗漏的缺陷,提升了医疗用户画像完备度,保障医疗辅助决策的安全性与专业性,满足智能医疗问诊对上下文完整性、高安全性的应用需求。
Smart Images

Figure CN122494200B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a method, system and storage medium for ensuring the integrity of medical dialogue context. Background Technology
[0002] Interactive dialogues between medical users are the core interactive form of AI (Artificial Intelligence) assisted clinical diagnosis in healthcare. These dialogues are characterized by long cycles, multiple rounds, and highly specialized information. Key medical constraints such as allergy history, chronic disease history, and extreme vital signs must be fully preserved to ensure the clinical safety of AI-assisted decision-making.
[0003] Current medical AI dialogue systems are constrained by hardware and algorithms, particularly the length of input tokens for large language models, making it impossible to load all historical dialogue data and complete health records of medical users at once. The industry generally employs two text processing methods: one is a sliding window mechanism, which retains only the most recent N rounds of dialogue, discarding historical information beyond those rounds; the other is a basic summarization mechanism, which periodically summarizes the dialogue text, compressing the text length to fit the model's input limitations.
[0004] However, the above processing methods have significant technical drawbacks: sliding windows directly truncate core medical contraindications information at the beginning of the dialogue, such as medication allergy history, which can easily lead to safety risks such as incorrect medication due to the lack of key constraints during subsequent diagnosis and treatment reasoning; while simplified text summarization causes information erosion and feature smoothing, losing crucial decision-making data such as accurate biochemical indicators and subtle pathological changes, reducing the accuracy of medical judgment. At the same time, medical users' electronic medical records, historical consultation records, real-time symptom descriptions, and other data are stored in a scattered manner, making it difficult for the system to integrate global information in a single reasoning, resulting in contextual fragmentation and failing to support complete and accurate medical dialogue interaction and decision-making. Summary of the Invention
[0005] This invention provides a method, system, and storage medium for ensuring the integrity of medical dialogue context, aiming to solve the technical problems of existing intelligent medical dialogue systems that are difficult to integrate global information and suffer from contextual data fragmentation.
[0006] To address the aforementioned technical problems, in a first aspect, the present invention provides a method for ensuring and applying the integrity of the medical dialogue context, comprising the following steps:
[0007] S101. Real-time acquisition of dialogue data streams from medical user conversations, and simultaneous acquisition of electronic health record data of medical users; S102. The active buffer is used to temporarily cache the conversation semantic segments in the dialogue data stream. The conversation semantic segments are composed of several tokens generated after the dialogue text in the dialogue data stream is encoded. When the preset triggering condition is met, the conversation semantic segments temporarily cached in the active buffer are latched and sent to the memory compiler. S103. The memory compiler extracts multi-dimensional structured features from the conversation semantic fragments and the electronic health record data to obtain hierarchical clinical memory data. The clinical memory data is stored in the database according to the hierarchical structure. At the same time, according to the preset medical entity classification rules, medical entities belonging to the global constraint category in the clinical memory data are marked as global medical constraint entities. S104. Obtain the query content and perform intent and keyword parsing on the query content. Based on the obtained intent and keywords, retrieve the matching clinical memory data from the database. At the same time, forcibly recall the global medical constraint entity from the database and assemble the matching clinical memory data, the query content, and the global medical constraint entity into a digital profile of the medical user. S105. Input the digital profile of the medical user and the global medical constraint entity into the preset auxiliary decision model. After double verification and reasoning, the preset auxiliary decision model outputs medical auxiliary decision suggestions corresponding to the query content.
[0008] Furthermore, the preset triggering condition in step S102 includes at least one of the following: The length of the session semantic fragment cached by the active buffer reaches a preset storage threshold; The conversation recorded in the session semantic fragments cached by the active buffer contains preset trigger instructions; The active buffer caches the session semantic fragment for a duration exceeding a preset duration.
[0009] Furthermore, step S103 also includes: After the memory compiler completes the extraction and storage of the clinical memory data, it releases the cache of the active buffer.
[0010] Furthermore, the clinical memory data in step S103 includes: The conversation summary data is obtained by summarizing the content cached from the conversation semantic fragments, including at least one of the following: chief complaint, objective examination, clinical assessment, and treatment plan. Based on medical named entity recognition technology, medical entity data including at least one of allergies, chronic diseases, and vital signs are extracted from the conversation semantic fragments and electronic health record data. The structured key-value pairs consisting of entity type, entity value, and evidence fragments obtained from the medical entity data.
[0011] Furthermore, the hierarchical structure described in step S103 is a three-level storage structure consisting of a tenant layer, a user layer, and a session layer, wherein: The tenant layer corresponds to the medical service entity and is used for data isolation across multiple institutions; The user layer corresponds to the medical users seeking medical treatment and is used to store the global medical constraint entities corresponding to the medical users. The session layer corresponds to a single medical session and is used to store the clinical memory data.
[0012] Furthermore, the step of parsing the intent and keywords of the query content in step S104 specifically includes: A dual-path parsing method combining semantic classification and slot filling is adopted. The medical domain semantic classification identifies the consultation business intent of the query content, and the medical word segmentation extracts keywords from the query content. The intent and keywords are then mapped to preset medical slots to obtain structured query semantics for querying in the database.
[0013] Furthermore, the step S105, in which the preset auxiliary decision-making model outputs medical auxiliary decision-making suggestions corresponding to the query content after double-validation reasoning, specifically includes: Based on the aforementioned digital profiles of medical users and combined with a clinical knowledge base, medical logic is deduced to output preliminary diagnostic and treatment assistance plans. The preliminary treatment assistance plan is compared with the global medical constraint entity to check for medical contraindications and conflicts. If there are no contraindications and conflicts, the preliminary treatment assistance plan is used as the corresponding medical assistance decision suggestion and output. If there are contraindications and conflicts, the risk is marked and a new treatment assistance plan is generated through re-reasoning.
[0014] Secondly, the present invention also provides a medical dialogue context integrity protection and application system, comprising: The data capture module is used to collect the dialogue data stream of medical user conversations in real time and simultaneously acquire the electronic health record data of medical users. The data buffer module is used to temporarily cache the conversation semantic segments in the dialogue data stream using an active buffer. The conversation semantic segments are composed of several tokens generated after the dialogue text in the dialogue data stream is encoded. When a preset trigger condition is met, the conversation semantic segments temporarily cached in the active buffer are latched and sent to the memory compiler. The memory compilation and storage module is used to extract multi-dimensional structured features from the conversation semantic fragments and the electronic health record data through the memory compiler to obtain hierarchical clinical memory data. The clinical memory data is stored in the database according to the hierarchical structure. At the same time, according to the preset medical entity classification rules, medical entities belonging to the global constraint category in the clinical memory data are marked as global medical constraint entities. The intent reconstruction module is used to obtain query content and perform intent and keyword parsing on the query content. Based on the obtained intent and keywords, it retrieves the matching clinical memory data from the database. At the same time, it forcibly recalls the global medical constraint entity from the database and assembles the matching clinical memory data, the query content, and the global medical constraint entity into a digital profile of the medical user. The reasoning output module is used to input the digital profile of the medical user and the global medical constraint entity into a preset auxiliary decision model, and the preset auxiliary decision model outputs medical auxiliary decision suggestions corresponding to the query content after double verification and reasoning.
[0015] Thirdly, the present invention also provides a computer device, including: a memory, a processor, and a medical dialogue context integrity assurance and application program stored in the memory and executable on the processor, wherein the processor, when executing the medical dialogue context integrity assurance and application program, implements the steps in the medical dialogue context integrity assurance and application method as described in any of the above embodiments.
[0016] Fourthly, the present invention also provides a storage medium storing a medical dialogue context integrity guarantee and application program, wherein when the medical dialogue context integrity guarantee and application program is executed by a processor, the steps in the medical dialogue context integrity guarantee and application method as described in any of the above embodiments are implemented.
[0017] The beneficial effects achieved by this invention lie in proposing a method for ensuring and applying the integrity of medical dialogue context. This method relies on an active buffer and a memory compiler to complete the caching, compilation, structured extraction, and hierarchical storage of medical dialogue and archival data, while simultaneously marking high-risk global medical constraint entities. It combines semantic parsing and a forced recall mechanism to assemble a digital profile of the medical user and outputs medical suggestions through double-checked reasoning. This invention avoids the shortcomings of traditional medical dialogue context truncation and omissions of key information and high-risk constraints, improves the completeness of the medical user profile, ensures the security and professionalism of medical auxiliary decision-making, and meets the application requirements of intelligent medical consultation for context integrity and high security. Attached Figure Description
[0018] The present invention will now be described in detail with reference to the accompanying drawings. The above and other aspects of the present invention will become clearer and more readily understood through the detailed description following the accompanying drawings. In the drawings: Figure 1 This is a flowchart of the steps for ensuring and applying the medical dialogue context integrity provided in the embodiments of the present invention; Figure 2 This is a schematic diagram of the structure of the medical dialogue context integrity protection and application system provided in the embodiments of the present invention; Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0019] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0020] The specific embodiments / examples described herein are specific implementations of the present invention, used to illustrate the concept of the invention, and are illustrative and exemplary, and should not be construed as limiting the implementation methods or scope of the present invention. In addition to the embodiments described herein, those skilled in the art can employ other obvious technical solutions based on the content disclosed in the claims and specification of this application. These technical solutions include those that make any obvious substitutions and modifications to the embodiments described herein, all of which are within the protection scope of the present invention.
[0021] Example 1 Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of a method for ensuring and applying the integrity of a medical dialogue context provided in this invention. The method includes the following steps: S101. Real-time acquisition of dialogue data streams from medical user conversations, and simultaneous acquisition of electronic health record data from medical users.
[0022] Step S101 is the data acquisition stage. The dialogue data stream refers to the dialogue text data generated in real-time interaction with the medical user, which is the direct source for the medical AI dialogue system to obtain current diagnosis and treatment communication information. The electronic health record data collected simultaneously is the medical user's full-cycle medical dataset, which includes not only the medical user's basic medical records, past medical history, chronic disease records, allergy history, and other archive information, but also the medical user's past test indicators, imaging results, and other examination and examination data. In traditional medical AI dialogue scenarios, only dialogue text is usually collected separately, which can easily lead to the lack of objective examination data of medical users. In this embodiment of the invention, by simultaneously fusing multi-source medical data, it ensures that the subsequent structured extraction process takes into account both subjective consultation dialogue and objective medical examination results, laying a data foundation for building a complete and realistic medical user dataset.
[0023] S102. An active buffer is used to temporarily cache the conversation semantic segments in the dialogue data stream. The conversation semantic segments are composed of several tokens generated after the dialogue text in the dialogue data stream is encoded. When a preset trigger condition is met, the conversation semantic segments temporarily cached in the active buffer are latched and sent to the memory compiler.
[0024] Step S102 is the temporary caching and triggering transfer stage of session data. The active buffer is a temporary cache space set in the foreground of this invention, which is dedicated to storing the data of a single consultation in progress in real time. It is a volatile temporary storage, which is different from the traditional persistent database. The session semantic fragment is the smallest independent semantic unit (token) obtained by splitting the continuous dialogue data stream according to semantic logic. It is used to organize fragmented dialogues and facilitate unified cache management of the system.
[0025] Traditional medical AI dialogues generally employ a fixed sliding window mechanism, which can easily truncate early consultation information, resulting in context loss. This invention addresses this by using an active buffer to temporarily cache semantic fragments of the conversation without real-time compilation, thus reducing computational power consumption.
[0026] The preset triggering condition in step S102 includes at least one of the following: The length of the session semantic fragment cached by the active buffer reaches a preset storage threshold; The conversation recorded in the session semantic fragments cached by the active buffer contains preset trigger instructions; The active buffer caches the session semantic fragment for a duration exceeding a preset duration.
[0027] Multiple preset trigger conditions adapt to different dialogue scenarios: length threshold triggering is used to avoid model parsing distortion due to excessive data volume in a single session; trigger command triggering is adapted to scenarios where key diagnosis and treatment dialogues are actively saved manually; and duration triggering is used to periodically solidify long-term consultation data. After the trigger conditions are met, the data is latched and transferred to prevent cached data from being tampered with or lost, and the original session data is sent to the memory compiler in an orderly manner to complete subsequent structured processing.
[0028] S103. The memory compiler extracts multi-dimensional structured features from the conversation semantic fragments and the electronic health record data to obtain hierarchical clinical memory data. The clinical memory data is stored in the database according to the hierarchical structure. At the same time, according to the preset medical entity classification rules, medical entities belonging to the global constraint category in the clinical memory data are marked as global medical constraint entities.
[0029] Step S103 is the stage of compiling and structuring multi-source medical data, marking entities, and storing them hierarchically. The memory compiler is a custom-defined medical data processing unit in this embodiment of the invention, which realizes multi-dimensional unified structured purification for medical scenarios. The global medical constraint entities specifically refer to medical contraindications entities with long-term and high-risk characteristics, such as drug allergy history, severe organ dysfunction, pregnancy status, family history of genetic diseases, etc.
[0030] The memory compiler integrates conversational semantic fragments with electronic health record data to extract features, generating three types of clinical memory data, including: The conversation summary data is obtained by summarizing the content cached from the conversation semantic fragments, including at least one of the following: chief complaint, objective examination, clinical assessment, and treatment plan. Based on medical named entity recognition technology, medical entity data including at least one of allergies, chronic diseases, and vital signs are extracted from the conversation semantic fragments and electronic health record data. The structured key-value pairs consisting of entity type, entity value, and evidence fragments obtained from the medical entity data.
[0031] In this embodiment of the invention, the conversation summary data uses the SOAP standardized format to summarize the consultation content. For example, the conversation is summarized as a diagnosis summary such as {chief complaint and present illness history: cough, objective examination indicators: elevated body temperature, clinical assessment: upper respiratory tract infection, treatment plan: monitoring with increased water intake}. Medical entity data relies on medical named entity recognition technology to accurately extract specific medical entities such as penicillin allergy, hypertension, and blood pressure values. Structured key-value pairs solidify data in the format of entity type, entity value, and evidence fragment, such as data entries like {drug allergy: penicillin, evidence fragment: medical user's self-report of penicillin allergy}.
[0032] Meanwhile, since traditional medical AI dialogues only extract superficial information from text, the data is messy and lacks hierarchy, and high-risk medical information is not separately labeled, which can easily lead to diagnosis and treatment risks. In step S103, high-risk entities such as allergy history and organ dysfunction are marked as global medical constraint entities according to preset rules and stored in the database in a hierarchical structure to provide data support for subsequent permanent retention and forced recall.
[0033] In this embodiment of the invention, a three-tiered storage structure of tenant layer, user layer, and session layer is used to store the medical entity data. This differs from the traditional flat, unclassified, and disorganized storage method used in medical AI dialogues, enabling hierarchical isolation and long-term management of medical data. Specifically: The tenant layer corresponds to the medical service entity and is used for data isolation across multiple institutions; The user layer corresponds to the medical users seeking medical treatment and is used to store the global medical constraint entities corresponding to the medical users. The session layer corresponds to a single medical session and is used to store the clinical memory data.
[0034] The tenant layer, user layer, and session layer have clearly defined functions: The tenant layer is the top-level storage unit, and it is divided based on the main body of medical services. For example, different Internet hospitals and offline medical institutions are independently treated as one tenant, which strictly realizes the isolation of data across multiple institutions, avoids data confusion across institutions, and meets the compliance and confidentiality requirements of medical data. The user layer is the intermediate core storage unit, which uniquely corresponds to a single medical user. It is specifically used to classify and store the permanent global medical constraint entities of the medical user, such as high-risk contraindications such as permanent penicillin allergy or severe kidney damage, to ensure that high-risk information is not lost across sessions. The session layer is the underlying storage unit, which corresponds to a single consultation process. It is used to store clinical memory data such as session summaries and medical entities generated in this consultation, so as to realize the independent collection of single consultation data.
[0035] Step S103 also includes: After the memory compiler completes the extraction and storage of the clinical memory data, it releases the cache of the active buffer.
[0036] In this embodiment of the invention, since the active buffer is a foreground volatile temporary cache used only for short-term storage of uncompiled raw session data, the cache inside the active buffer can be automatically cleared and released after the memory compiler completes the structured extraction, hierarchical storage, and entity tagging operations of all clinical memory data. This design can release system memory resources in a timely manner, reduce device computing power consumption, avoid redundant and invalid data accumulation from multiple consecutive consultations, ensure long-term stable and efficient system operation, and form a complete closed loop of cache occupancy, compilation, and release.
[0037] Step S103 completes the mandatory extraction and structured solidification of medical entities into the database, transforming critical medical information such as vital signs and medical contraindications, which are easily lost and hidden in lengthy dialogue texts, into standardized database tags that can be stored long-term and are not lost. This fundamentally solves the problems of information forgetting and context truncation in traditional medical AI dialogue methods, and achieves zero-loss storage of critical medical information.
[0038] S104. Obtain the query content and perform intent and keyword parsing on the query content. Based on the obtained intent and keywords, retrieve the matching clinical memory data from the database. At the same time, forcibly recall the global medical constraint entity from the database and assemble the matching clinical memory data, the query content, and the global medical constraint entity into a digital profile of the medical user.
[0039] Step S104 is the stage of semantic parsing of medical consultation, memory retrieval, and medical user profile assembly. Among them, forced recall refers to a mandatory data retrieval mechanism. Unlike conventional similarity retrieval, forced recall is not restricted by the current query semantics and aims to unconditionally retrieve long-term high-risk medical data of medical users. The medical user digital profile is a dynamic structured diagnosis and treatment profile generated by integrating multi-source medical information. The medical slot is a professional semantic storage field preset in the medical field, used to standardize and store the semantic information of medical consultation.
[0040] The step of parsing the intent and keywords of the query content in step S104 specifically includes: A dual-path parsing method combining semantic classification and slot filling is adopted. The medical domain semantic classification identifies the consultation business intent of the query content, and the medical word segmentation extracts keywords from the query content. The intent and keywords are then mapped to preset medical slots to obtain structured query semantics for querying in the database.
[0041] Unlike traditional medical AI dialogues that typically rely on simple word segmentation and retrieval, this invention employs a dual-path parsing approach combining semantic classification and slot filling to refine the query content. For example, for the query "What medicine can I take for a headache?", semantic classification identifies the intent as medication consultation, medical word segmentation extracts the keywords "headache" and "medication," and maps them to the medical slots corresponding to symptoms and medication suggestions, generating a structured query semantic such as {current query question, historical headache-related SOAP summaries, mandatory constraint: penicillin allergy}.
[0042] Step S104 involves matching similar clinical memory data based on structured semantic retrieval on the one hand, and retrieving global medical constraint entities through a forced recall mechanism on the other hand. Finally, the query content, matching memory data, and constraint entities are assembled into a digital profile of the medical user, ensuring that the profile includes current consultation needs, historical treatment information, and high-risk contraindication information.
[0043] S105. Input the digital profile of the medical user and the global medical constraint entity into the preset auxiliary decision model. After double verification and reasoning, the preset auxiliary decision model outputs medical auxiliary decision suggestions corresponding to the query content.
[0044] Step S105 is the medical reasoning verification and intelligent decision output stage. The preset auxiliary decision model uses a medical-specific reasoning model, which is different from the general large language model. The preset auxiliary decision model has a built-in professional clinical knowledge base and is equipped with exclusive security verification logic to adapt to the compliance requirements of medical consultation. The dual verification reasoning is a customized two-layer security reasoning mechanism in this embodiment of the invention, which is the core security logic for auxiliary decision generation.
[0045] The step S105, in which the preset auxiliary decision-making model outputs medical auxiliary decision-making suggestions corresponding to the query content after double-validation reasoning, specifically includes: Based on the aforementioned digital profiles of medical users and combined with a clinical knowledge base, medical logic is deduced to output preliminary diagnostic and treatment assistance plans. The preliminary treatment assistance plan is compared with the global medical constraint entity to check for medical contraindications and conflicts. If there are no contraindications and conflicts, the preliminary treatment assistance plan is used as the corresponding medical assistance decision suggestion and output. If there are contraindications and conflicts, the risk is marked and a new treatment assistance plan is generated through re-reasoning.
[0046] Specifically, traditional medical AI dialogues mostly rely on single-step model reasoning to generate treatment suggestions, lacking an independent contraindication verification process. This easily overlooks implicit high-risk medical constraints of medical users, leading to potential medical risks such as medication conflicts and mismatched symptoms, resulting in low decision-making security. The embodiments of this invention employ a dual-verification reasoning mode to complete the decision output: The first layer is clinical logical reasoning. The preset auxiliary decision-making model relies on a complete digital profile of medical users and combines it with the built-in clinical knowledge base to perform compliant deduction and generate a preliminary diagnosis and treatment auxiliary plan that fits the current symptoms and medical history of medical users. For example, for medical users with headaches, the model can make a preliminary recommendation for appropriate analgesics based on their history of hypertension. The second layer is global constraint and contraindication verification, which forces the preliminary solution to match the medical user's global medical constraint entity. If the medical user has contraindications such as drug allergies or organ dysfunction, for example, an allergy to ibuprofen, the solution is determined to be conflicting, the drug allergy risk is marked, and a new compliant treatment solution is proposed. If there are no contraindication conflicts, the preliminary solution is output directly.
[0047] The dual verification logic proposed in this invention achieves dual control over the rationality of diagnosis and treatment and medical safety, avoids the security vulnerabilities caused by the one-way reasoning of traditional medical AI dialogue, and greatly improves the rigor and reliability of intelligent consultation.
[0048] Furthermore, based on the contextual dynamic reconstruction logic constructed in step S104, this embodiment of the invention only filters and assembles clinical memory points and conversation summaries that are highly related to the current query decision, filters out invalid and redundant dialogue content, and does not require inputting all the original conversation text into the auxiliary decision model. This not only improves the model's reasoning response rate, but also avoids the dilution and wear of core medical features, thereby reducing computing power costs while ensuring the accuracy of medical decisions.
[0049] The beneficial effects achieved by this invention lie in proposing a method for ensuring and applying the integrity of medical dialogue context. This method relies on an active buffer and a memory compiler to complete the caching, compilation, structured extraction, and hierarchical storage of medical dialogue and archival data, while simultaneously marking high-risk global medical constraint entities. It combines semantic parsing and a forced recall mechanism to assemble a digital profile of the medical user and outputs medical suggestions through double-checked reasoning. This invention avoids the shortcomings of traditional medical dialogue context truncation and omissions of key information and high-risk constraints, improves the completeness of the medical user profile, ensures the security and professionalism of medical auxiliary decision-making, and meets the application requirements of intelligent medical consultation for context integrity and high security.
[0050] Example 2 This invention also provides a medical dialogue context integrity protection and application system 200, please refer to... Figure 2 , Figure 2 This is a schematic diagram of the structure of the medical dialogue context integrity protection and application system provided in this embodiment of the invention, which includes: The data capture module 201 is used to collect the dialogue data stream of medical user conversations in real time and simultaneously acquire the electronic health record data of medical users. The data buffer module 202 is used to temporarily cache the conversation semantic fragments in the dialogue data stream using an active buffer. The conversation semantic fragments are composed of several tokens generated after the dialogue text in the dialogue data stream is encoded. When a preset trigger condition is met, the conversation semantic fragments temporarily cached in the active buffer are latched and sent to the memory compiler. The memory compilation and storage module 203 is used to extract multi-dimensional structured features from the conversation semantic fragments and the electronic health record data through the memory compiler to obtain hierarchical clinical memory data. The clinical memory data is stored in the database according to the hierarchical structure. At the same time, according to the preset medical entity classification rules, medical entities belonging to the global constraint category in the clinical memory data are marked as global medical constraint entities. The intent reconstruction module 204 is used to obtain query content and perform intent and keyword parsing on the query content. Based on the obtained intent and keywords, it retrieves the matching clinical memory data from the database. At the same time, it forcibly recalls the global medical constraint entity from the database and assembles the matching clinical memory data, the query content, and the global medical constraint entity into a digital profile of the medical user. The reasoning output module 205 is used to input the medical user digital profile and the global medical constraint entity into a preset auxiliary decision model, and the preset auxiliary decision model outputs medical auxiliary decision suggestions corresponding to the query content after double verification and reasoning.
[0051] The medical dialogue context integrity protection and application system 200 can implement the steps in the medical dialogue context integrity protection and application method as described in the above embodiments, and can achieve the same technical effect. Referring to the description in the above embodiments, it will not be repeated here.
[0052] Example 3 This invention also provides a computer device, please refer to... Figure 3 , Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. The computer device 300 includes: a memory 302, a processor 301, and a medical dialogue context integrity protection and application program stored in the memory 302 and capable of running on the processor 301.
[0053] The processor 301 calls the medical dialogue context integrity protection and application stored in the memory 302, and executes the steps in the medical dialogue context integrity protection and application method provided in this embodiment of the invention. Please refer to... Figure 1 Specifically, it includes the following steps: S101. Real-time acquisition of dialogue data streams from medical user conversations, and simultaneous acquisition of electronic health record data from medical users.
[0054] S102. An active buffer is used to temporarily cache the conversation semantic segments in the dialogue data stream. The conversation semantic segments are composed of several tokens generated after the dialogue text in the dialogue data stream is encoded. When a preset trigger condition is met, the conversation semantic segments temporarily cached in the active buffer are latched and sent to the memory compiler.
[0055] The preset triggering condition in step S102 includes at least one of the following: The length of the session semantic fragment cached by the active buffer reaches a preset storage threshold; The conversation recorded in the session semantic fragments cached by the active buffer contains preset trigger instructions; The active buffer caches the session semantic fragment for a duration exceeding a preset duration.
[0056] S103. The memory compiler extracts multi-dimensional structured features from the conversation semantic fragments and the electronic health record data to obtain hierarchical clinical memory data. The clinical memory data is stored in the database according to the hierarchical structure. At the same time, according to the preset medical entity classification rules, medical entities belonging to the global constraint category in the clinical memory data are marked as global medical constraint entities.
[0057] The clinical memory data in step S103 includes: The conversation summary data is obtained by summarizing the content cached from the conversation semantic fragments, including at least one of the following: chief complaint, objective examination, clinical assessment, and treatment plan. Based on medical named entity recognition technology, medical entity data including at least one of allergies, chronic diseases, and vital signs are extracted from the conversation semantic fragments and electronic health record data. The structured key-value pairs consisting of entity type, entity value, and evidence fragments obtained from the medical entity data.
[0058] The hierarchical structure mentioned in step S103 is a three-level storage structure consisting of a tenant layer, a user layer, and a session layer, wherein: The tenant layer corresponds to the medical service entity and is used for data isolation across multiple institutions; The user layer corresponds to the medical users seeking medical treatment and is used to store the global medical constraint entities corresponding to the medical users. The session layer corresponds to a single medical session and is used to store the clinical memory data.
[0059] Step S103 also includes: After the memory compiler completes the extraction and storage of the clinical memory data, it releases the cache of the active buffer.
[0060] S104. Obtain the query content and perform intent and keyword parsing on the query content. Based on the obtained intent and keywords, retrieve the matching clinical memory data from the database. At the same time, forcibly recall the global medical constraint entity from the database and assemble the matching clinical memory data, the query content, and the global medical constraint entity into a digital profile of the medical user.
[0061] The step of parsing the intent and keywords of the query content in step S104 specifically includes: A dual-path parsing method combining semantic classification and slot filling is adopted. The medical domain semantic classification identifies the consultation business intent of the query content, and the medical word segmentation extracts keywords from the query content. The intent and keywords are then mapped to preset medical slots to obtain structured query semantics for querying in the database.
[0062] S105. Input the digital profile of the medical user and the global medical constraint entity into the preset auxiliary decision model. After double verification and reasoning, the preset auxiliary decision model outputs medical auxiliary decision suggestions corresponding to the query content.
[0063] The step S105, in which the preset auxiliary decision-making model outputs medical auxiliary decision-making suggestions corresponding to the query content after double-validation reasoning, specifically includes: Based on the aforementioned digital profiles of medical users and combined with a clinical knowledge base, medical logic is deduced to output preliminary diagnostic and treatment assistance plans. The preliminary treatment assistance plan is compared with the global medical constraint entity to check for medical contraindications and conflicts. If there are no contraindications and conflicts, the preliminary treatment assistance plan is used as the corresponding medical assistance decision suggestion and output. If there are contraindications and conflicts, the risk is marked and a new treatment assistance plan is generated through re-reasoning.
[0064] The computer device 300 provided in this embodiment of the invention can implement the steps in the medical dialogue context integrity protection and application method as described in the above embodiments, and can achieve the same technical effect. Referring to the description in the above embodiments, it will not be repeated here.
[0065] Example 4 This invention also provides a storage medium storing a medical dialogue context integrity guarantee and application program. When the medical dialogue context integrity guarantee and application program is executed by a processor, it implements the various processes and steps in the medical dialogue context integrity guarantee and application method provided in this invention and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0066] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented through hardware related to medical dialogue context integrity and application or instruction. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0067] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0068] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0069] The embodiments of the present invention have been described above with reference to the accompanying drawings. The disclosed embodiments are merely preferred embodiments of the present invention. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many equivalent changes in form under the guidance of the present invention without departing from the spirit and scope of the claims. All such changes are within the protection scope of the present invention.
Claims
1. A method for ensuring and applying the integrity of medical dialogue context, based on hierarchical memory compilation, characterized in that: Includes the following steps: S101. Real-time acquisition of dialogue data streams from medical user conversations, and simultaneous acquisition of electronic health record data of medical users; S102. The active buffer is used to temporarily cache the conversation semantic segments in the dialogue data stream. The conversation semantic segments are composed of several tokens generated after the dialogue text in the dialogue data stream is encoded. When the preset triggering condition is met, the conversation semantic segments temporarily cached in the active buffer are latched and sent to the memory compiler. S103. The memory compiler extracts multi-dimensional structured features from the conversation semantic fragments and the electronic health record data to obtain hierarchical clinical memory data. The clinical memory data is stored in the database according to the hierarchical structure. At the same time, according to the preset medical entity classification rules, medical entities belonging to the global constraint category in the clinical memory data are marked as global medical constraint entities. S104. Obtain the query content and perform intent and keyword parsing on the query content. Based on the obtained intent and keywords, retrieve the matching clinical memory data from the database. At the same time, forcibly recall the global medical constraint entity from the database and assemble the matching clinical memory data, the query content, and the global medical constraint entity into a digital profile of the medical user. S105. Input the digital profile of the medical user and the global medical constraint entity into the preset auxiliary decision model. After double verification and reasoning, the preset auxiliary decision model outputs medical auxiliary decision suggestions corresponding to the query content.
2. The method for ensuring and applying the integrity of the medical dialogue context according to claim 1, characterized in that, The preset triggering condition in step S102 includes at least one of the following: The length of the session semantic fragment cached by the active buffer reaches a preset storage threshold; The conversation recorded in the session semantic fragments cached by the active buffer contains preset trigger instructions; The active buffer caches the session semantic fragment for a duration exceeding a preset duration.
3. The method for ensuring and applying the integrity of the medical dialogue context according to claim 1, characterized in that, Step S103 also includes: After the memory compiler completes the extraction and storage of the clinical memory data, it releases the cache of the active buffer.
4. The method for ensuring and applying the integrity of the medical dialogue context according to claim 1, characterized in that, The clinical memory data in step S103 includes: The conversation summary data is obtained by summarizing the content cached from the conversation semantic fragments, including at least one of the following: chief complaint, objective examination, clinical assessment, and treatment plan. Based on medical named entity recognition technology, medical entity data including at least one of allergies, chronic diseases, and vital signs are extracted from the conversation semantic fragments and electronic health record data. The structured key-value pairs consisting of entity type, entity value, and evidence fragments obtained from the medical entity data.
5. The method for ensuring and applying the integrity of the medical dialogue context according to claim 1, characterized in that, The hierarchical structure mentioned in step S103 is a three-level storage structure consisting of a tenant layer, a user layer, and a session layer, wherein: The tenant layer corresponds to the medical service entity and is used for data isolation across multiple institutions; The user layer corresponds to medical users and is used to store the global medical constraint entities corresponding to the medical users. The session layer corresponds to a single medical session and is used to store the clinical memory data.
6. The method for ensuring and applying the integrity of the medical dialogue context according to claim 1, characterized in that, The step of parsing the intent and keywords of the query content in step S104 specifically includes: A dual-path parsing method combining semantic classification and slot filling is adopted. The medical domain semantic classification identifies the consultation business intent of the query content, and the medical word segmentation extracts keywords from the query content. The intent and keywords are then mapped to preset medical slots to obtain structured query semantics for querying in the database.
7. The method for ensuring and applying the integrity of the medical dialogue context according to claim 1, characterized in that, The step S105, in which the preset auxiliary decision-making model outputs medical auxiliary decision-making suggestions corresponding to the query content after double-validation reasoning, specifically includes: Based on the aforementioned digital profiles of medical users and combined with a clinical knowledge base, medical logic is deduced to output preliminary diagnostic and treatment assistance plans. The preliminary treatment assistance plan is compared with the global medical constraint entity to check for medical contraindications and conflicts. If there are no contraindications and conflicts, the preliminary treatment assistance plan is used as the corresponding medical assistance decision suggestion and output. If there are contraindications and conflicts, the risk is marked and a new treatment assistance plan is generated through re-reasoning.
8. A medical dialogue context integrity assurance and application system, based on hierarchical memory compilation, characterized in that, include: The data capture module is used to collect the dialogue data stream of medical user conversations in real time and simultaneously acquire the electronic health record data of medical users. The data buffer module is used to temporarily cache the conversation semantic segments in the dialogue data stream using an active buffer. The conversation semantic segments are composed of several tokens generated after the dialogue text in the dialogue data stream is encoded. When a preset trigger condition is met, the conversation semantic segments temporarily cached in the active buffer are latched and sent to the memory compiler. The memory compilation and storage module is used to extract multi-dimensional structured features from the conversation semantic fragments and the electronic health record data through the memory compiler to obtain hierarchical clinical memory data. The clinical memory data is stored in the database according to the hierarchical structure. At the same time, according to the preset medical entity classification rules, medical entities belonging to the global constraint category in the clinical memory data are marked as global medical constraint entities. The intent reconstruction module is used to obtain query content and perform intent and keyword parsing on the query content. Based on the obtained intent and keywords, it retrieves the matching clinical memory data from the database. At the same time, it forcibly recalls the global medical constraint entity from the database and assembles the matching clinical memory data, the query content, and the global medical constraint entity into a digital profile of the medical user. The reasoning output module is used to input the digital profile of the medical user and the global medical constraint entity into a preset auxiliary decision model, and the preset auxiliary decision model outputs medical auxiliary decision suggestions corresponding to the query content after double verification and reasoning.
9. A computer device, characterized in that, include: The device includes a memory, a processor, and a medical dialogue context integrity assurance and application stored in the memory and executable on the processor, wherein the processor, when executing the medical dialogue context integrity assurance and application, implements the steps of the medical dialogue context integrity assurance and application method as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores a medical dialogue context integrity guarantee and application program, which, when executed by a processor, implements the steps in the medical dialogue context integrity guarantee and application method as described in any one of claims 1-7.
Citation Information
Patent Citations
Medical ward round record generation method and system based on large language model
CN122091061A
Multi-mode intelligent health management method and system based on continuous memory
CN122291041A