Pre-inquiry method based on long-term and short-term memory management large model

Through long and short-term memory management methods, dynamic screening and integration of long and short-term memory updates, the problem of memory loss in large models in pre-diagnosis is solved, and the efficiency and accuracy of pre-diagnosis are improved.

CN120388713APending Publication Date: 2025-07-29SHANGHAI HUIHAO YISHENG INFORMATION TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510442103.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

During the pre-diagnosis process, existing large models are prone to memory loss as the number of conversations increases.

Method used

Long-term memory management method is adopted, long-term memory is updated through dynamic domain control mechanisms, short-term memory is maintained in combination with forgetting mechanisms, and multiple rounds of pre-diagnosis dialogues are constructed to obtain patient condition information.

Benefits of technology

It effectively avoids memory loss in multiple rounds of dialogue between large models, improves the efficiency and accuracy of pre-diagnosis, and reduces the dependence on memory ability of large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120388713A_ABST
    Figure CN120388713A_ABST
Patent Text Reader

Abstract

The invention discloses a pre-inquiry method based on a long and short term memory management large model. The pre-inquiry method comprises the following steps: S100, acquiring identity information and complaint symptom information of a patient; s200, establishing long-term memory and short-term memory corresponding to the patient; all information generated in the pre-inquiry dialogue process is stored in the short-term memory; the long-term memory and the short-term memory are updated and maintained based on a memory storage mechanism; s300, based on the long-term memory and the short-term memory, using a large model to construct multiple rounds of pre-inquiry dialogues, and obtaining patient condition information; and S400, summarizing the patient identity information, the complaint symptom information, the long-term memory and the short-term memory to generate a pre-inquiry report. According to the pre-inquiry method based on the long-short-term memory management large model, the long-short-term memory management is separated from the large model to carry out multiple rounds of pre-inquiry dialogues, the method does not need to depend on the memory ability of the large model, and the memory loss phenomenon in multiple rounds of dialogues commonly seen in an existing large model can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application provides a pre-consultation method based on a long short-term memory management large model, which relates to the technical field of medical large models. Background Art

[0002] AI pre-consultation is one of the important achievements in the development of modern medical informatization. It realizes the preliminary consultation of patients' conditions through artificial intelligence technology. It can obtain patients' information according to patients' inputs, and use the Agent system combined with large model technology to quickly generate a preliminary pre-consultation report. This not only improves the efficiency of medical services, reduces the workload of doctors, but also helps patients understand their health conditions earlier and improves the medical experience. With the continuous progress of technology and the expansion of the application scope, AI pre-consultation will play an increasingly important role in improving public health levels. With the strong support of national policies, the application scope of AI pre-consultation is constantly expanding and has become an important part of the construction of the intelligent medical system.

[0003] For example, in the prior art, "CN119400392A Intelligent Medical Pre-consultation Method, System and Medium Based on Multimodal Large Model", "CN118866219A Pre-consultation Form Generation System, Method, Device and Medium Based on Large Model", and "CN118039138A Controllable Path Pre-consultation Method and Device Based on Large Model" all disclose or partially disclose how to use large models to conduct pre-consultation conversations to obtain patients' condition information and generate pre-consultation reports.

[0004] However, during the pre-consultation process, users may not be able to provide all the necessary information at once, or their expressions may not be clear enough, resulting in difficulty for AI to accurately understand their intentions, thus increasing the number of pre-consultation dialogue rounds. When the number of dialogue rounds is too large, the existing large models will experience memory loss. Summary of the Invention

[0005] The technical problem to be solved by the present application is the problem of memory loss that easily occurs during the pre-consultation process using a large model as the number of pre-consultation dialogue rounds increases.

[0006] To solve the above technical problem, the technical solution of the present application provides a pre-consultation method based on a long short-term memory management large model, including the following steps:

[0007] S100. Obtain the patient's identity information and the main complaint symptom information;

[0008] S200. Establish long-term memory and short-term memory corresponding to the patient;

[0009] All the information generated during the pre-consultation dialogue is stored in the short-term memory; the long-term memory and the short-term memory are updated and maintained based on the memory storage mechanism;

[0010] S300. Based on the long-term memory and the short-term memory, use a large model to construct a multi-round pre-consultation dialogue to obtain the patient's condition information;

[0011] S400. Summarize the patient's identity information, chief complaint symptom information, long-term memory, and short-term memory to generate a pre-consultation report.

[0012] Preferably, the memory storage mechanism includes:

[0013] Every N rounds of the pre-consultation dialogue are expanded, where N is a preset parameter, and a long-term memory update is performed once. The short-term memory at this time is screened through a dynamic domain control mechanism, and the screened information is integrated and updated with the long-term memory through an information integration and update mechanism to obtain a new long-term memory.

[0014] Preferably, the process of screening the short-term memory through the dynamic domain control mechanism includes:

[0015] First, an importance assessment is performed on all the information contained in the short-term memory, and the importance of the information at time t is evaluated through an importance scoring function I(t);

[0016] The factors considered by the importance scoring function I(t): the frequency of repeated occurrence of the information, the context relevance of the information, and the user feedback;

[0017] The importance scoring function I(t) is set as: I(t) = α·f(t) + β·c(t) + γ·u(t)

[0018] Among them, α, β, γ are weight coefficients, satisfying α + β + γ = 1, f(t) is the occurrence frequency of the information at time t, c(t) is the context relevance score of the information at time t, and u(t) is the user feedback score for the information;

[0019] Then, it is determined whether to transfer the information from the short-term memory to the long-term memory through a dynamic threshold control function D(t), and the dynamic threshold control function D(t) is implemented based on the importance scoring function I(t) and a distribution threshold θ:

[0020]

[0021] When D(t) = 1, the information is transferred to the long-term memory; otherwise, the information remains in the short-term memory or is forgotten.

[0022] Preferably, the process that the screened information is integrated and updated with the long-term memory through the information integration and update mechanism to obtain a new long-term memory includes:

[0023] Update long-term memory through an integration function; the long-term memory is stored in the database in the form of a weaviate vector library, and the new information V that needs to be transferred to the long-term memory new Integrate with the existing long-term memory V through weighted average old to obtain the new long-term memory as: V updated = η·V new +(1 - η)·V old ; where η is the integration weight, which controls the influence degree of new information on long-term memory.

[0024] Preferably, the short-term memory maintains information based on a forgetting mechanism:

[0025] For the information in the short-term memory, if it is not transferred to the long-term memory, define a forgetting mechanism to determine when to forget the information, set the forgetting rate of the information to be proportional to time, and define the forgetting function F(t) as: F(t) = e -λt ; where λ is the forgetting rate constant, and when F(t) is lower than the threshold φ, the information is forgotten.

[0026] Preferably, step S300 includes:

[0027] S310. Construct an instruction for inputting into the first large model to obtain the next question for pre-consultation according to the known information of the patient including patient identity information, chief complaint symptom information, long-term memory, and short-term memory; S320. Input the instruction into the large model, and the large model outputs the next question for asking the patient;

[0028] S330. Ask the patient this question on the pre-consultation dialogue interface to obtain the patient's response information;

[0029] S340. Update the short-term memory and long-term memory through a memory storage mechanism; the condition information is stored in the short-term memory and long-term memory;

[0030] S350. Repeat S310 - S340 until the large model outputs "The acquisition of condition information is completed";

[0031] S360. Prompt the patient on the pre-consultation dialogue interface that the pre-consultation is over.

[0032] Preferably, the pre-consultation instruction template is set as:

[0033]

Instruction

[0034] Your role is a consulting doctor, and your task is to analyze the known information of the patient based on the chief complaint symptom information of the patient to determine whether there is missing condition information;

[0035] If there is missing condition information, please ask the patient questions to obtain the missing condition information;

[0036] If there is no missing medical condition information, output "Medical condition information obtained".

[0037] Please determine the questions you will ask next based on the following known patient information;

[0038] Known patient information:

[0039] "Patient identity information, chief complaint symptom information, long-term memory, short-term memory".

[0040] Preferably, step S310 includes:

[0041] S311. Filter the long-term memory and short-term memory based on the memory retrieval and distribution mechanism, and the filtered long-term memory and short-term memory are used as inputs to the first large model;

[0042] S312. Effectiveness evaluation based on user feedback: Prompt the user to confirm the distributed memory content in the pre-consultation dialogue interface. When the user confirms the correctness of the memory content, dynamically update the importance score I(t) of the memory.

[0043] Preferably, the memory retrieval and distribution mechanism includes:

[0044] Perform text vectorization processing on the patient's chief complaint symptom information as the query vector, and perform memory retrieval in the long-term memory and short-term memory. During the memory retrieval process, use a vector matching method based on cosine similarity to extract memory content related to the query vector from the short-term memory and long-term memory; to improve the relevance and effectiveness of the retrieval results, use a comprehensive sorting mechanism to evaluate the priority score by combining the importance score of the memory and the similarity metric: P(t)=w1·I(t)+w2sim(q,v); where, w1 and w2 are weight coefficients, satisfying w1 + w2 = 1, I(t) represents the importance scoring function of the memory content, and sim(q,v) represents the cosine similarity value between the query vector and the retrieved vector; according to the priority score P(t) and the preset threshold τ, filter out the low-priority memories, and only retain the memories with P(t)≥τ for distribution to the first large model.

[0045] Preferably, the effectiveness evaluation based on user feedback includes:

[0046] Update the importance score I(t) of the memory using the update formula, and the update formula is: I(t) updated =I(t)+δ·U(t); where, U(t) represents the user feedback score, and the feedback score U(t) is the score for quantitatively evaluating the user's approval degree obtained through the evaluation of the second large model.

[0047] The pre-consultation method based on the long short-term memory management large model provided by this application separates the multi-round pre-consultation dialogue between the long short-term memory management and the large model, does not need to rely on the memory ability of the large model, and can effectively avoid the memory loss phenomenon in the common multi-round dialogue of the existing large model. Description of the Drawings

[0048] Figure 1 It is a schematic flow chart of the pre-consultation method based on the long short-term memory management large model provided by the embodiment of this application;

[0049] Figure 2 It is a schematic flow chart of obtaining patient's condition information through multi-round pre-consultation dialogue provided by the embodiment of this application;

[0050] Figure 3 It is a schematic diagram of providing multi-line services for multiple locally deployed large models provided by the embodiment of this application;

[0051] Figure 4 It is a schematic diagram of the pre-consultation system framework based on long short-term memory management provided by the embodiment of this application. Detailed Description of the Invention

[0052] To make this application more obvious and understandable, various example embodiments will be introduced below. These examples are non-limiting, and it should be known that they are used to illustrate the more general application aspects of devices, systems, and methods. Without departing from the essence and scope of this application, these embodiments can be changed in various ways and can be replaced by equivalents. In addition, various changes can be made to adapt to special situations, materials, substance components, processing types, processing actions, or steps to adapt to the purpose, content, or scope of this application. All these changes will be within the protection scope of this application.

[0053] Regarding any materials, sizes, and quantities introduced in the overview or detailed description, they are only examples and do not limit the subject matter of this application. Moreover, the various embodiments of the embodiments described herein will complement each other rather than being purely alternative, unless stated otherwise. In other words, the embodiments from one embodiment can be freely combined with the embodiments from other embodiments, as is easily understood by those of ordinary skill in the art, unless it is stated that these embodiments are only for replacement.

[0054] In the description of the present application, it should be noted that the orientation or positional relationship indicated by terms such as "inner" and "outer" is based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of this application is usually placed during use. It is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be construed as a limitation to the present application. In addition, terms such as "first" and "second" are only used for distinguishing descriptions and cannot be construed as indicating or implying relative importance.

[0055] In the description of the present application, it should also be noted that unless otherwise clearly specified and limited, the terms "set" and "connect" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected, or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to specific situations.

[0056] Embodiment

[0057] The embodiment of the present application provides a pre-consultation method based on a long short-term memory management large model. A pre-consultation Agent system is established based on an open-source large language model to conduct a pre-consultation dialogue with patients, aiming to obtain a pre-consultation report on patients' relevant symptom information; see Figure 1 , including the following steps:

[0058] Step S100, obtaining the patient's identity information and the main complaint symptom information; Exemplarily, guiding the user to swipe the patient's medical insurance card through a preset interaction interface to obtain the medical insurance number, or guiding the user to input the patient's identity information, such as ID number, age, gender, etc.; asking the user the first fixed question through a preset pre-consultation dialogue interface, such as "Pre-consultation Agent: Hello, may I ask where the patient is uncomfortable?", so as to obtain the patient's main complaint symptom information;

[0059] Step S200, searching for the long-term memory and short-term memory corresponding to the patient in the database; if not, establishing an initially empty long-term memory and short-term memory corresponding to the patient; storing all the information generated during the pre-consultation dialogue in the short-term memory; the long-term memory and short-term memory are updated and maintained based on the memory storage mechanism provided in this embodiment;

[0060] The memory storage mechanism is responsible for managing the long-term memory and short-term memory, including screening the short-term memory through a dynamic domain control mechanism, and the screened information is integrated and updated with the long-term memory through an information integration and update mechanism to obtain a new long-term memory; the short-term memory is maintained based on a forgetting mechanism.

[0061] Exemplarily, if the patient uses the pre-consultation Agent system for pre-consultation for the first time, a short-term memory belonging to the patient is established. The short-term memory is initially empty and is updated with the information generated from the pre-consultation conversation. The short-term memory contains all the information from the pre-consultation conversation content. A long-term memory belonging to the patient is established. The long-term memory is initially empty. The short-term memory is screened through a dynamic domain control mechanism, and the screened information is integrated and updated with the long-term memory through an information integration and update mechanism to obtain a new long-term memory. The short-term memory is maintained based on a forgetting mechanism.

[0062] If the patient uses the pre-consultation Agent system for pre-consultation for the second or multiple times, there are corresponding long-term and short-term memories of the patient in the database. The short-term memory is updated with the information generated from the pre-consultation conversation. The short-term memory contains all the information from the pre-consultation conversation content. The short-term memory is screened through a dynamic domain control mechanism, and the screened information is integrated and updated with the long-term memory through an information integration and update mechanism to obtain a new long-term memory. The short-term memory is maintained based on a forgetting mechanism.

[0063] In an implementation, every N (N is a preset parameter, greater than or equal to 1) rounds of the pre-consultation conversation are expanded, and a long-term memory update is performed. The short-term memory at this time is screened through a dynamic domain control mechanism, and the screened information is integrated and updated with the long-term memory through an information integration and update mechanism to obtain a new long-term memory.

[0064] In a further implementation, the process of screening the short-term memory through a dynamic domain control mechanism includes:

[0065] First, it is the importance assessment of all the information contained in the short-term memory. The importance of the information at time t is evaluated through an importance scoring function I(t). In a possible implementation, the importance scoring function I(t) considers but is not limited to the following factors:

[0066] 1. The frequency of repeated occurrence of the information: The information that appears frequently is more important.

[0067] 2. The context relevance of the information: The information that is highly relevant to the current conversation or the patient's condition is more important.

[0068] 3. User feedback: The confirmation or emphasis of the information by the user can increase its importance.

[0069] The importance scoring function I(t) is as follows:

[0070] I(t) = α·f(t) + β·c(t) + γ·u(t)

[0071] Among them, α, β, and γ are weight coefficients, satisfying α + β + γ = 1, f(t) is the occurrence frequency of information at time t, c(t) is the context relevance score of information at time t, and u(t) is the user's feedback score for the information;

[0072] Then, it is determined whether to transfer the information from short-term memory to long-term memory through dynamic domain control, and the dynamic threshold control function D(t) is used to implement this process; in a possible implementation manner, the dynamic threshold control function D(t) can be implemented based on the importance scoring function I(t) and a distribution threshold θ.

[0073]

[0074] When D(t) = 1, the information is transferred to long-term memory; otherwise, the information remains in short-term memory or is forgotten.

[0075] In a further implementation manner, the information screened by the dynamic domain control mechanism in short-term memory is integrated and updated with long-term memory through the information integration and update mechanism. The information integration and update mechanism includes:

[0076] When the information is transferred to long-term memory, it needs to be integrated and updated with the existing long-term memory to avoid redundancy; the long-term memory is updated through an integration function; the long-term memory is stored in the database in the form of a weaviate vector library, and the new information V that needs to be transferred to long-term memory new is integrated with the existing long-term memory V old through weighted average to obtain the new long-term memory as:

[0077] V updated = η·V new +(1 - η)·V old

[0078] Among them, η is the integration weight, which controls the influence degree of new information on long-term memory.

[0079] In a further implementation manner, short-term memory maintains information based on a forgetting mechanism:

[0080] For the information in short-term memory, if it is not transferred to long-term memory, a forgetting mechanism is defined to determine when to forget the information. The forgetting rate of the information is set to be proportional to time, and the forgetting function F(t) is defined as:

[0081] F(t) = e -λt

[0082] Among them, λ is the forgetting rate constant. When F(t) is lower than the threshold φ, the information is forgotten.

[0083] Step S300, construct a multi-round pre-consultation dialogue to obtain the patient's condition information, seeFigure 2 , including:

[0084] S310. Construct an instruction for inputting into the first large model (the large model for generating pre-consultation questions) to obtain the next pre-consultation question according to the known information of the patient, such as patient identity information, chief complaint symptom information, long-term memory, short-term memory, etc., in accordance with the pre-consultation instruction template:

[0085]

[0086] S320. Input the instruction into the large model, and the large model outputs the next question for asking the patient;

[0087] S330. Ask the patient this question in the pre-consultation dialogue interface to obtain the patient's response information;

[0088] S340. Update the short-term memory and long-term memory through the memory storage mechanism; the condition information is stored in the short-term memory and long-term memory;

[0089] S350. Repeat S310 - S340 until the large model outputs "All condition information has been obtained";

[0090] S360. Prompt the patient in the pre-consultation dialogue interface that the pre-consultation is over.

[0091] Exemplarily, the execution logic of the multi-round pre-consultation dialogue is as shown in the following table of the multi-round pre-consultation dialogue example:

[0092] Multi-round pre-consultation dialogue

[0093]

[0094] Among them, each round of questions is generated by the large model, and the user's response contains the condition information. All dialogue contents are stored in the short-term memory until the large model determines that all condition information has been obtained completely and then ends the dialogue; for the user, the user can only see the Q&A content.

[0095] In a further embodiment, corresponding to the patient's long-term memory, it also includes the patient's historical medical record information, such as obtaining the patient's historical disease information, diagnosis information, treatment information, admission and discharge information, etc. from databases such as hospital servers, electronic medical record systems, and LIS systems. Such historical information is stored in a standard unified format and can be directly incorporated into the patient's corresponding long-term memory. Of course, the large model can also be used to strengthen the information and extract the core information from the above historical information and then incorporate it into the patient's corresponding long-term memory.

[0096] In a further embodiment, for the case where the amount of information in long-term memory and short-term memory is too large, if all the known information of the patient is input into the first large model in step S310, it will lead to an increase in the analysis time of the large model and a decrease in the efficiency of the pre-consultation dialogue. In order to reduce the amount of information, all the contents of long-term memory and short-term memory should not be distributed to the large model for processing. The amount of information can be reduced based on the memory retrieval and distribution mechanism provided in the embodiments of the present application;

[0097] Therefore, step S310 further includes:

[0098] S311. Filter the long-term memory and short-term memory based on the memory retrieval and distribution mechanism, and the filtered long-term memory and short-term memory are used for input into the first large model;

[0099] Specifically, the memory retrieval and distribution mechanism dynamically utilizes historical information during the dialogue process to improve the efficiency and accuracy of the consultation, including:

[0100] Memory retrieval and distribution. The main complaint symptom information of the patient is processed into a text vector as a query vector, and memory retrieval is performed in the long-term memory and short-term memory. During the memory retrieval process, a vector matching method based on cosine similarity is adopted to extract memory content related to the query vector from the short-term memory (STM) and long-term memory (LTM). In order to improve the relevance and effectiveness of the retrieval results, the embodiments of the present application provide a comprehensive sorting mechanism to achieve optimized sorting by combining the importance score of the memory and the similarity metric. Specifically as follows:

[0101] P(t) = w1·I(t) + w2sim(q,v)

[0102] where w1 and w2 are weight coefficients, satisfying w1 + w2 = 1, I(t) represents the importance scoring function of the memory content, and sim(q,v) represents the cosine similarity value between the query vector and the retrieval vector; according to the priority score P(t) and the preset threshold τ, the memories with low priority are filtered out, and only the memories with P(t) ≥ τ are retained for distribution to the first large model;

[0103] S312. Effectiveness evaluation based on user feedback: Prompt the user to confirm the distributed memory content on the pre-consultation dialogue interface. When the user confirms the correctness of the memory content, the importance score I(t) of the memory is dynamically updated. The specific update formula is:

[0104] I(t) updated = I(t) + δ·U(t)

[0105] Among them, U(t) represents the user feedback score. The feedback score U(t) can be obtained through the evaluation of the second largest model and is used to quantify the degree of user recognition of the memorized content. Specifically, the user's reply information (the reply information for prompting the user to confirm the distributed memorized content on the pre-consultation dialogue interface) can be input into the second largest model, and a score (range 0-100) for quantifying the degree of user recognition is required to be given; δ is the feedback weight coefficient, which is used to adjust the influence degree of the feedback on the importance score.

[0106] Exemplarily, according to the user's reply information, an instruction for inputting into the second largest model to obtain the user feedback score (a score for quantifying the degree of user recognition) is constructed according to the user feedback evaluation instruction template:

[0107]

[0108] The instruction is input into the second largest model to obtain the user feedback score. Through this feedback mechanism, the pre-consultation method provided by the embodiments of the present application can continuously optimize the importance score of the memory, thereby improving the accuracy and practicality of subsequent memory retrieval.

[0109] In a further implementation manner, the foregoing weight coefficients w1 and w2 and thresholds (such as the filtering threshold τ and the distribution threshold θ) can also be analyzed, dynamically adjusted and optimized in real time according to the user feedback and the pre-consultation effect, so as to optimize the priority ranking of memory distribution and balance the accuracy and efficiency of distribution; at the same time, for the important memories confirmed by the user, through multiple distributions or emphasis, the retention time in the long-term memory is strengthened, thereby improving the adaptive ability and user experience of the pre-consultation method provided by the embodiments of the present application.

[0110] The pre-consultation method provided by the embodiments of the present application further includes:

[0111] Step S400, generating a pre-consultation report: Summarize the final patient identity information, chief complaint symptom information, long-term memory, and short-term memory, construct an instruction for inputting into the third largest model to generate a pre-consultation report according to the pre-consultation report generation instruction template, and instruct the third largest model to generate a pre-consultation report according to the pre-consultation report format template provided by the hospital:

[0112]

[0113]

[0114] The pre-consultation ends. The pre-consultation report is used to provide reference information for the doctor's diagnosis, which is convenient for saving the doctor's consultation procedure and improving the doctor's consultation efficiency.

[0115] Based on the foregoing pre-consultation method, it can be found that the pre-consultation method based on the long short-term memory management large model provided by the embodiments of the present application separates the long short-term memory management from the multi-round pre-consultation dialogue carried out by the large model, does not need to rely on the memory ability of the large model, and can effectively avoid the memory loss phenomenon commonly seen in the multi-round dialogue of existing large models. The common memory loss phenomenon in the multi-round dialogue of large models is because existing large models generally use the context window size or the cumulative number of output tokens to limit the number of multi-round dialogues. After multiple rounds of dialogue, the large model no longer retains the past dialogue information. The embodiments of the present application provide long-term memory storage and short-term memory storage for patients, and the long-term memory and short-term memory are managed based on the memory storage mechanism provided by the embodiments of the present application, and the relevant information corresponding to the patient is retained for a long time through the long-term memory.

[0116] It can be understood that: on the one hand, the first large model, the second large model, and the third large model involved in the embodiments of the present application are only used to distinguish the instruction tasks executed by the large model, and do not limit that the corresponding instruction tasks must be executed by three independent large models. All three types of instruction tasks can be submitted to a single large model for processing; on the other hand, the large model involved in the embodiments of the present application can be, but is not limited to, online large model APIs such as ChatGPT, Wenxin Yiyan, and DeepSeek, or a local large model deployed on a local server based on large model open source technology.

[0117] In one embodiment, the large model involved in the embodiments of the present application uses a locally deployed large model. The pre-consultation Agent system includes a first server, a second server... an Mth server set locally, where M≥3; a local large model is deployed in each server, and there are a total of M local large models for pre-consultation, see Figure 3 , when executing the pre-consultation method based on the long short-term memory management large model provided by the embodiments of the present application, the instruction can be input into any idle large model. The advantage of multiple local large models is that when there are multiple patients for pre-consultation at the same time, multi-line services are provided by multiple local large models, and the instructions generated by the pre-consultation are uniformly allocated and processed, which can shorten the waiting time of patients and improve the pre-consultation efficiency.

[0118] Based on the pre-consultation method based on the long short-term memory management large model provided by the embodiments of the present application, to execute this method, the embodiments of the present application also provide a pre-consultation system based on long short-term memory management, see Figure 4 , including a human-computer interaction module 100, a memory storage module 200, and a large model module 300.

[0119] The human-computer interaction module provides an interactive interface for guiding the user to input patient identity information and conduct a pre-consultation dialogue. The input of the interactive interface has a text input mode and a voice input mode. When the user selects the voice input mode, speech recognition technology is used to convert speech into text information.

[0120] The memory storage module is provided with a long-term memory sub-module and a short-term memory sub-module, which are respectively used to store the long-term memory and short-term memory corresponding to the patient. The short-term memory comes from all the information generated during the pre-consultation dialogue. The long-term memory and short-term memory are managed through a memory storage mechanism.

[0121] The large model module includes multiple locally deployed large models. During the execution of the pre-consultation method by the pre-consultation system, the generated instructions are distributed to the idle large models for execution.

[0122] The pre-consultation system conducts multiple rounds of dialogue with the user through the human-computer interaction module, gradually obtains the patient's main complaint symptoms and condition information during the multiple rounds of dialogue, and finally generates a pre-consultation report in a specific format.

[0123] It can be understood that the implementation of the pre-consultation method based on long-term and short-term memory management of large models provided by the embodiments of the present application depends on a computer program to allocate or instruct corresponding hardware such as storage devices, servers, and displays to complete. After a person of ordinary skill in the art reads and understands all or part of the process of the pre-consultation method based on long-term and short-term memory management of large models provided by the embodiments of the present application, it is easy to implement all or part of the process through a computer program, and there is no technical obstacle and no creative labor is required for a person of ordinary skill in the art.

[0124] The embodiments of the present application also provide a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, it implements the pre-consultation method based on long-term and short-term memory management of large models provided by the embodiments of the present application.

[0125] As described above, it is only the preferred embodiment of the present application, and it does not impose any formal or substantial restrictions on the present application. It should be noted that for those of ordinary skill in the art of this technology, several improvements and supplements can still be made without departing from the present application, and these improvements and supplements should also be regarded as the protection scope of the present application. Those skilled in the art, without departing from the content and scope of the present application, when making some changes, modifications and equivalent variations of evolution by using the technical content disclosed above, are all equivalent embodiments of the present application; at the same time, any changes, modifications and equivalent variations of evolution made to the above embodiments according to the substantial technology of the present application still fall within the scope of the technical solution of the present application.

Claims

1. A pre-consultation method based on a large model managed by long short-term memory, characterized in that, It includes the following steps: S100. Obtain the patient's identity information and the information of the chief complaint symptoms; S200. Establish the long-term memory and short-term memory corresponding to the patient; All the information generated during the pre-consultation dialogue process is stored in the short-term memory; The long-term memory and short-term memory are updated and maintained based on the memory storage mechanism; S300. Based on the long-term memory and short-term memory, use a large model to construct a multi-round pre-consultation dialogue to obtain the patient's condition information; S400. Summarize the patient's identity information, the information of the chief complaint symptoms, the long-term memory, and the short-term memory to generate a pre-consultation report.

2. The pre-consultation method based on the long-term and short-term memory management large model according to claim 1, wherein the memory storage mechanism includes: Every N rounds of the pre-consultation dialogue are expanded, where N is a preset parameter, and a long-term memory update is executed once. The short-term memory at this time is screened through a dynamic domain control mechanism, and the screened information is integrated and updated with the long-term memory through an information integration update mechanism to obtain a new long-term memory.

3. The pre-consultation method based on the long-term and short-term memory management large model according to claim 2, wherein the process of screening the short-term memory through the dynamic domain control mechanism includes: First, an importance evaluation is performed on all the information included in the short-term memory, and the importance of the information at time t is evaluated through the importance scoring function I(t); The factors considered by the importance scoring function I(t) are: the frequency of repeated occurrence of the information, the context relevance of the information, and the user feedback; The importance scoring function I(t) is set as: I(t) = α·f(t) + β·c(t) + γ·u(t) where α, β, and γ are weight coefficients that satisfy α + β + γ = 1, f(t) is the occurrence frequency of the information at time t, c(t) is the context relevance score of the information at time t, and u(t) is the user feedback score for the information; Then, it is determined whether to transfer the information from the short-term memory to the long-term memory through the dynamic threshold control function D(t). The dynamic threshold control function D(t) is implemented based on the importance scoring function I(t) and a distribution threshold θ: When D(t) = 1, the information is transferred to the long-term memory; otherwise, the information remains in the short-term memory or is forgotten.

4. The pre-consultation method based on the long-term and short-term memory management large model according to claim 2, wherein the integration and update of the screened information with the long-term memory through the information integration update mechanism to obtain a new long-term memory includes: Update long-term memory through an integration function; the long-term memory is stored in the database in the form of a weaviate vector library, and the new information V that needs to be transferred to the long-term memory new Integrate with the existing long-term memory V through weighted average old to obtain the new long-term memory as: V updated = η · V new + (1 - η) · V old ; where η is the integration weight, controlling the influence degree of new information on long-term memory.

5. The pre-consultation method based on the long-term and short-term memory management large model according to claim 2, wherein the short-term memory maintains information based on the forgetting mechanism: For the information in short-term memory, if it is not transferred to long-term memory, define a forgetting mechanism to determine when to forget the information. Set the forgetting rate of the information to be proportional to time, and define the forgetting function F(t) as: F(t) = e -λt ; where λ is the forgetting rate constant, and when F(t) is lower than the threshold φ, the information is forgotten.

6. The pre-consultation method based on the long-term and short-term memory management large model according to claim 1, wherein step S300 includes: S310. Construct an instruction for inputting into the first large model to obtain the next pre-consultation question according to the patient's known information including the patient's identity information, the information of the chief complaint symptoms, the long-term memory, and the short-term memory according to the pre-consultation instruction template; S320. Input the instruction into the large model, and the large model outputs the next question for asking the patient. S330. Pose this question to the patient in the pre-consultation dialogue interface and obtain the patient's response information; S340. Update the short-term memory and long-term memory through the memory storage mechanism; the condition information is stored in the short-term memory and long-term memory; S350. Repeat S310 - S340 until the large model outputs "Condition information acquisition completed".

7. A pre-consultation method based on a large model for long-short-term memory management according to claim 6, characterized in that the pre-consultation instruction template is set as: 【Instruction】 Your role is a consulting doctor. Your task is to analyze the patient's known information based on the patient's chief complaint symptoms to determine if there is any missing condition information; If there is missing condition information, ask the patient questions to obtain the missing condition information; If there is no missing condition information, output "Condition information acquisition completed"; Please determine the next question you will ask based on the following patient's known information; Patient's known information: "Patient identification information, chief complaint symptoms information, long-term memory, short-term memory".

8. A pre-consultation method based on a large model for long-short-term memory management according to claim 6, characterized in that Step S310 includes: S311. Filter the long-term memory and short-term memory based on the memory retrieval and distribution mechanism. The filtered long-term memory and short-term memory are used as inputs to the first large model; S312. Effectiveness evaluation based on user feedback: Prompt the user in the pre-consultation dialogue interface to confirm the distributed memory content. When the user confirms the correctness of the memory content, dynamically update the importance score I(t) of this memory.

9. A pre-consultation method based on a large model for long-short-term memory management according to claim 8, characterized in that the memory retrieval and distribution mechanism includes: Perform text vectorization processing on the patient's chief complaint symptoms information as a query vector, and perform memory retrieval in the long-term memory and short-term memory. During the memory retrieval process, use a vector matching method based on cosine similarity to extract memory content related to the query vector from the short-term memory and long-term memory; to improve the relevance and effectiveness of the retrieval results, use a comprehensive sorting mechanism to evaluate the priority score by combining the importance score of the memory and the similarity measure: P(t) = w1·I(t) + w2sim(q, v); where w1 and w2 are weight coefficients satisfying w1 + w2 = 1, I(t) represents the importance scoring function of the memory content, and sim(q, v) represents the cosine similarity value between the query vector and the retrieved vector; according to the priority score P(t) and a preset threshold τ, filter out the low-priority memories and only retain the memories with P(t) ≥ τ for distribution to the first large model.

10. A pre-consultation method based on a large model for long-short-term memory management according to claim 8, characterized in that the effectiveness evaluation based on user feedback includes: Update the importance score I(t) of the memory using the update formula, and the update formula is: I(t) updated = I(t) + δ · U(t); where U(t) represents the user feedback score, and the feedback score U(t) is the score for quantitatively evaluating the degree of user recognition obtained through the evaluation of the second largest model.

Citation Information

Patent Citations

  • Intelligent medical pre-inquiry method and system based on multi-modal large model, and medium

    CN119400392A

Cited By

  • Consultation result generation method and device and electronic equipment

    CN120670582A

  • Consultation result generation method and apparatus, and electronic device

    CN120670582B

  • Multi-mode intelligent health management method and system based on continuous memory

    CN122291041A

  • A multi-modal intelligent health management method and system based on continuous memory

    CN122291041B