A method for emergency real-time detection and interruption processing in a dialogue flow

CN122889340APending Publication Date: 2026-10-09BEIJING XIAOYI YANNIAN INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611201128.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

此类方案存在以下不足:分诊为咨询后的事后分析而非咨询中的实时检测,无法在对话过程中即时发现急症;依赖医生人工反馈而非自动生成急症指导,响应时间长;分诊结果为科室推荐而非急救行动指导

Benefits of technology

[0013]1)路由前实时检测:在模型路由之前优先执行急症关键词检测,确保急症消息被第一时间识别,不因其他路由规则而延误,区别于导诊分诊的事后分析和客服打断的行为检测。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122889340A_ABST
    Figure CN122889340A_ABST
Patent Text Reader

Abstract

The application discloses a method and system for real-time detection and interruption processing of emergency in a dialogue flow, and belongs to the technical field of artificial intelligence dialogue systems. The method determines the certainty matching detection of six types of emergency keywords on the user message before model routing, interrupts the dialogue flow level when hit, and routes to the medical special model. According to the difference of emergency categories, first-aid guidance is generated, and after outputting the reminder, the blocked safety confirmation waits for user feedback, and after confirmation, the dialogue flow is recovered at the context level. The application is different from the post-analysis of the guide diagnosis and the behavior detection of the customer service interruption, and realizes the real-time detection and complete processing pipeline of the emergency in the dialogue.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence dialogue system technology, specifically to a method and system for real-time detection and interruption handling of acute conditions in a dialogue stream, applicable to dialogue application scenarios involving user health and safety such as intelligent care, health consultation, and elderly care assessment. Background Technology

[0002] In intelligent care AI dialogue systems, users may describe sudden acute symptoms in daily conversations, such as chest pain, stroke warning signs, or confusion. Existing AI dialogue systems face the following technical challenges when handling such situations:

[0003] First, existing systems typically route all user messages to the same language model for processing, lacking a real-time detection mechanism for emergency keywords. Emergency messages may be routed to a general-purpose model that lacks medical expertise, resulting in responses that lack urgency and professionalism.

[0004] Second, some existing medical AI systems adopt a triage and referral system, where the system recommends a referral after the user completes the consultation and then waits for the doctor's feedback. This approach has the following shortcomings: triage is a post-consultation analysis rather than a real-time detection during the consultation, and it cannot detect emergencies in real time during the conversation; it relies on manual feedback from doctors rather than automatically generating emergency guidance, resulting in long response times; and the triage result is a departmental recommendation rather than emergency action guidance.

[0005] Third, some existing customer service AI systems employ an intent interruption detection scheme, which involves taking special action after detecting user interruption behavior during a conversation. This approach has the following shortcomings: interruption detection focuses on user behavior (such as frequent interruptions) rather than critical keywords in the message content; the post-interruption handling involves transferring the user to a human agent instead of generating emergency guidance; and there is a lack of safety confirmation and conversation flow recovery mechanisms after emergency handling.

[0006] Fourth, the existing system lacks a process interruption mechanism after detecting an emergency, and emergency treatment is mixed with the regular dialogue process, so users may not be able to get clear first aid guidance in a timely manner.

[0007] Fifth, the existing system lacks a safety confirmation mechanism after emergency treatment. After issuing an emergency alert, it directly continues the regular conversation without confirming whether the user is currently safe.

[0008] Sixth, the existing system lacks a dialogue flow recovery mechanism after emergency treatment, resulting in the loss of dialogue context after the emergency is interrupted, affecting the continuity of subsequent dialogue. Summary of the Invention

[0009] To address the shortcomings of existing technologies, this invention provides a method and system for real-time detection and interruption handling of emergencies in a dialogue stream. It achieves a complete technical solution in the dialogue stream by performing deterministic matching detection before model routing using an emergency keyword library, interrupting the regular process routing to the medical model, generating differentiated emergency guidance, and restoring the dialogue context after blocking safety confirmation.

[0010] The core difference between this invention and existing technologies is that: emergency detection is performed before model routing (preprocessing before routing), rather than a secondary judgment after triage or detection interrupted by customer service; emergency handling is a dialogue flow-level interruption (a complete pipeline of interruption → routing → guidance → confirmation → recovery), rather than message-level marking or transfer to human customer service; safety confirmation is a blocking wait, with the dialogue flow paused before user confirmation; recovery is a context-level recovery, retaining all dialogue context before interruption.

[0011] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: a method for real-time detection and interruption handling of acute illnesses in a dialogue flow, comprising: pre-setting a keyword library of six types of acute illnesses; performing deterministic matching of acute illness keywords before model routing; interrupting the dialogue flow at the level of matching and routing to the medical model when a match is found; generating first aid guidance based on the differences in acute illness categories; outputting a reminder and then performing a blocking safety confirmation; and restoring the dialogue flow at the context level after confirming safety.

[0012] The beneficial effects of this invention are as follows:

[0013] 1) Real-time detection before routing: Prioritize emergency keyword detection before model routing to ensure that emergency messages are identified as soon as possible and are not delayed by other routing rules. This is different from post-event analysis of triage and detection of customer service interruptions.

[0014] 2) Professional Response: Emergency messages are routed to a medical-specific language model rather than a general model, ensuring that responses are generated by a model with medical expertise.

[0015] 3) Dialogue flow level interruption and recovery: Emergency treatment interrupts the regular dialogue flow (rather than message-level marking), and automatically restores the dialogue context before the interruption after blocking safety confirmation (rather than restarting a new session), ensuring dialogue continuity and the integrity of emergency treatment.

[0016] 4) Differentiated classification guidance: Generate corresponding differentiated medical guidance based on different emergency categories, such as guiding patients with cardiac conditions to call emergency services, and guiding patients with bleeding conditions to call emergency services and apply pressure to stop the bleeding. Attached Figure Description

[0017] Figure 1 A flowchart of a method for real-time detection and interruption handling of acute conditions in a dialogue stream provided in an embodiment of the present invention;

[0018] Figure 2This is a schematic diagram of the model routing priority provided in an embodiment of the present invention. Detailed Implementation

[0019] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0020] like Figure 1 As shown, this embodiment provides a method for real-time detection and interruption handling of emergencies in a dialogue stream, including the following steps:

[0021] Step S1: Pre-set a keyword database for emergency care. The database includes six categories: Cardiac (containing keywords such as "chest pain," "chest tightness," and "left arm"); Cerebrovascular (containing keywords such as "stroke," "cerebral infarction," "cerebral hemorrhage," "hemiplegia," and "slurred speech"); Consciousness (containing keywords such as "coma," "confusion," "slumber," and "unresponsive"); Respiratory (containing keywords such as "dyspnea"); Hemorrhage (containing keywords such as "massive hemorrhage"); and Postoperative Abnormalities (containing keywords such as "wound dehiscence," "exudation," and "persistent high fever"). In addition, the database includes emergency phone numbers such as "120" as general emergency keywords.

[0022] Step S2: After receiving the natural language message input by the user during the dialogue interaction, before model routing, the message is subjected to deterministic substring matching against an emergency keyword database. The matching uses a word-by-word substring matching method to detect whether the user message contains any emergency keywords. This step has higher priority than all other intent recognition and model routing rules, and is executed first before the message enters the model routing logic. This detection is preprocessing before routing, not post-routing analysis or a secondary judgment after triage, ensuring that emergency messages are prioritized for identification before entering the regular routing process.

[0023] Step S3: When an emergency keyword is matched, the normal processing path of the current dialogue is interrupted, and the message is routed to the medical-specific language model. This interruption is at the dialogue flow level, not the message level; that is, the normal processing path of the current dialogue is completely suspended, and the message enters the emergency treatment-specific path. The medical-specific language model possesses medical expertise and can provide professional judgment and guidance on emergency symptoms. When no emergency keyword is matched, the message enters the normal model routing process.

[0024] Step S4: Based on preset emergency treatment instructions, generate an emergency alert message containing specific medical guidance. The medical guidance is generated differently according to the type of emergency: Cardiac (chest pain, chest tightness, radiating pain in the left arm) corresponds to "This may be a sign of a heart problem, please call 120 immediately"; Cerebrovascular (slurred speech, weakness on one side of the body, facial asymmetry) corresponds to "This may be a sign of a stroke, please call 120 immediately"; Consciousness (confusion, drowsiness, unresponsive) corresponds to "Please call 120 immediately"; Respiratory (severe difficulty breathing) corresponds to "Please call 120 immediately"; Bleeding (massive bleeding) corresponds to "Please call 120 immediately and apply pressure to stop the bleeding"; Postoperative abnormalities (wound dehiscence, excessive effusion, persistent high fever) corresponds to "Please contact the surgeon immediately or call 120."

[0025] Step S5: After outputting the emergency alert message, send a safety confirmation question to the user and wait for their feedback. The safety confirmation question includes asking the user whether they are currently safe and whether they need further assistance. This safety confirmation is a blocking wait rather than a non-blocking prompt; that is, the conversation is paused until the user confirms safety and the normal conversation flow is not resumed.

[0026] Step S6: After receiving the user's security confirmation feedback, resume the previous dialogue flow. This resumption is a context-level resumption rather than restarting a new session; that is, it preserves the dialogue context before the interruption, allowing the dialogue to continue from the state before the emergency treatment.

[0027] like Figure 2 As shown, the model routing priority mechanism in this embodiment follows a fixed sorting rule: emergency keyword hits take precedence over image input (highest priority); image input takes precedence over evaluation initiation words; evaluation initiation words take precedence over medication consultation keywords; the medical language model is used throughout the evaluation process; and other messages are routed to the general dialogue model (lowest priority).

[0028] This embodiment also includes a model degradation mechanism: when the main model (such as a medical language model or a visual language model) fails to be called, it automatically switches to a backup general text generation model to generate a response. During degradation, the dialogue context is not lost, ensuring that the system can still provide basic services when the model is unavailable.

[0029] This embodiment also provides a real-time emergency detection and interruption handling system in a dialogue flow, including: an emergency keyword library module, an emergency detection module (preprocessing before routing), a process interruption module (dialogue flow-level interruption), a model routing module, an emergency reminder generation module (differentiated guidance), a safety confirmation module (blocking waiting), and a process recovery module (context-level recovery). These modules work collaboratively to achieve real-time emergency detection, professional handling, and complete process recovery.

[0030] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for real-time detection and interruption handling of emergencies in a dialogue stream, characterized in that, Includes the following steps: S1: A pre-defined emergency keyword library for the care field is established, comprising six categories of emergency keywords: cardiac, cerebrovascular, consciousness, respiratory, hemorrhage, and postoperative abnormalities. S2: After receiving a natural language message input by the user during dialogue interaction, before model routing, the message is subjected to deterministic substring matching against the emergency keyword library. This matching is performed before intent recognition and model routing logic, and has higher priority than all other routing rules. S3: When a match is found with an emergency keyword, the normal processing path of the current dialogue flow is interrupted, and the message is routed to a medical-specific language model. This interruption is a dialogue flow-level interruption rather than a message-level flag. S4: Based on pre-defined emergency treatment instructions, an emergency reminder message containing specific medical guidance is generated. This medical guidance is differentiated according to the type of emergency, including at least one of calling emergency services, applying pressure to stop bleeding, and contacting a surgeon. S5: After outputting the emergency alert message, send a safety confirmation question to the user. Do not resume the normal dialogue process until the user confirms safety. The safety confirmation is a blocking wait rather than a non-blocking prompt. S6: After receiving the user's security confirmation feedback, resume the previous dialogue flow, retain the dialogue context before the interruption, and let the dialogue continue from the state before the emergency treatment.

2. The method according to claim 1, characterized in that, In step S1, cardiac keywords include chest pain, chest tightness, and radiating pain in the left arm; cerebrovascular keywords include stroke, cerebral infarction, cerebral hemorrhage, hemiplegia, and slurred speech; consciousness keywords include coma, confusion, drowsiness, and unresponsiveness; respiratory keywords include difficulty breathing; bleeding keywords include massive hemorrhage; and postoperative abnormal keywords include wound dehiscence, oozing, and persistent high fever.

3. The method according to claim 1, characterized in that, In step S2, the priority of emergency keyword matching is higher than all routing rules for image recognition, assessment initiation, medication consultation, and daily consultation. It is executed first before the message enters the model routing logic. The detection is preprocessing before routing rather than post-routing analysis or secondary judgment after triage.

4. The method according to claim 1, characterized in that, In step S3, when the keyword "emergency" is hit, the route is routed to a medical-specific language model instead of a general dialogue model, so that the emergency response is generated by a model with medical expertise. The route is a rerouting after the dialogue process is interrupted, rather than adding a mark to the original route path.

5. The method according to claim 1, characterized in that, In step S4, the emergency alert message generates corresponding differentiated medical guidance based on the type of emergency: cardiac and cerebrovascular emergencies correspond to guidance on calling emergency services; bleeding corresponds to guidance on calling emergency services and applying pressure to stop the bleeding; loss of consciousness corresponds to guidance on calling emergency services; and postoperative abnormalities correspond to guidance on contacting the surgeon or calling emergency services.

6. The method according to claim 1, characterized in that, In step S5, the security confirmation inquiry includes asking the user whether they are currently safe and whether they need further assistance. The normal dialogue process is not resumed until the user confirms that they are safe. The security confirmation is a blocking waiting mechanism that suspends the dialogue process until the user provides feedback.

7. The method according to claim 1, characterized in that, In step S6, when the dialogue flow is restored, the dialogue context before the interruption is retained, so that the dialogue can continue from the state before the emergency treatment. The restoration is a context-level restoration rather than restarting a new session.

8. The method according to claim 1, characterized in that, It also includes a model routing priority mechanism, where the priority follows a fixed sorting rule: emergency keyword hits take priority over image input, image input takes priority over evaluation start words, evaluation start words take priority over medication consultation keywords, and other messages are routed to the general dialogue model.

9. The method according to claim 1, characterized in that, It also includes a model degradation mechanism: when the main model fails to be called, it automatically switches to the backup model to generate the response. The backup model is a general text generation model, and the dialogue context is not lost during degradation.

10. A real-time emergency detection and interruption handling system in a dialogue stream, characterized in that, include: The Emergency Keyword Library module is used to store and manage emergency keywords in six categories of care areas; The emergency detection module is used to perform deterministic matching of emergency keywords in user messages before model routing. The detection is a preprocessing step before routing. The process interruption module is used to interrupt the regular dialogue processing path when an emergency is detected. The interruption is a dialogue process-level interruption. The model routing module routes messages to a medical-specific language model based on emergency detection results; the emergency alert generation module generates emergency alert messages containing specific medical guidance based on the different types of emergencies; and the safety confirmation module sends a safety confirmation query to the user after outputting the emergency alert and waits for feedback in a blocking manner. The process recovery module is used to restore the dialogue context before the interruption after the user confirms that it is safe.