Medical intelligent agent distribution method and device, electronic equipment and storage medium

By fine-tuning and training a large model and constructing structured rules for agents, combined with NLP technology to identify patient medical record data, the problem of insufficient GPU resources in agent distribution was solved, and efficient agent distribution was achieved.

CN121029224BActive Publication Date: 2026-06-19BEIJING HUIMEI CLOUD TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511528728.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-06-19
Estimated Expiration
2045-10-24

Smart Images

  • Figure CN121029224B_ABST
    Figure CN121029224B_ABST
Patent Text Reader

Abstract

This invention relates to a method, apparatus, electronic device, and storage medium for distributing medical intelligent agents. The method includes: acquiring agent prompts; obtaining labeled medical data from an open-source large model and a local knowledge base based on the agent prompts; fine-tuning the large model based on the labeled medical data; extracting key information maintained under the agent prompts from the trained large model; determining agent labels and execution conditions triggered by the agent based on the key information to construct structured rules for the agent to be executed; using NLP technology to identify information in preprocessed patient medical record data to obtain standardized medical information from the patient medical record data; and recalling candidate agents associated with the standardized medical information based on the agent labels; and controlling the candidate agents to execute the structured rules to recall target agents that conform to the preset rules, thereby improving the efficiency of agent distribution and reducing the dependence on GPU resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical assistance and artificial intelligence technology, and in particular to a method, apparatus, electronic device and storage medium for distributing medical intelligent agents. Background Technology

[0002] Agent distribution and orchestration are crucial for developing robust, intelligent, and human-like free-conversation systems capable of handling complex real-world challenges. Free-conversation systems, often referred to as open-domain conversational AI, aim to engage in natural, uninhibited dialogue with users, covering a wide range of topics and moving beyond rigid, task-specific interactions. These systems strive for human-like fluency, coherence, and contextual understanding. A major shift is underway in the field of artificial intelligence, moving AI from single, large language models (LLMs) to more distributed, collaborative, and dynamic multi-agent systems.

[0003] Currently, existing agent distribution methods aim to achieve better and more natural interactions between multiple agents, while also improving agent performance, assuming sufficient GPU resources. For example, existing methods that achieve higher-quality agent distribution by constructing generative heterogeneous graph models involve: acquiring user-related information of the target user; inputting this information into a pre-trained generative heterogeneous graph model to obtain the target agent output by the generative heterogeneous graph model, which is constructed according to the method described in the first aspect; and then distributing the target agent to the target user. This method requires a pre-trained generative heterogeneous graph model and sufficient GPU resources to achieve good agent distribution results. However, in most hospital scenarios, GPU resources are insufficient, barely enough to maintain the system's normal operation. If agent distribution also requires GPU resources, it could easily lead to system failure.

[0004] Therefore, existing agent distribution methods struggle to ensure smooth agent distribution when GPU resources are scarce, resulting in a high degree of dependence on GPU resources and consequently reduced agent distribution efficiency. Summary of the Invention

[0005] Therefore, it is necessary to provide a medical agent distribution method, device, electronic device, and storage medium that can reduce the dependence of agent distribution on GPU resources and improve agent distribution efficiency in order to address the above-mentioned technical problems.

[0006] This invention provides a method for distributing medical intelligent agents, the method comprising:

[0007] The system obtains agent prompts and retrieves labeled medical data from an open-source large model and a local knowledge base based on the agent prompts, so as to fine-tune the large model based on the labeled medical data.

[0008] The trained large model is invoked to extract key information maintained under the agent prompts, and the agent labels and execution conditions triggered by the agent are determined based on the key information to construct the agent structured rules to be executed.

[0009] The preprocessed patient medical record data is identified using NLP technology to obtain standardized medical information from the patient medical record data, and candidate intelligent agents associated with the standardized medical information are recalled based on intelligent agent tags.

[0010] The candidate agents are controlled to execute the agent structured rules in order to recall target agents that conform to preset rules.

[0011] The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

[0012] In one embodiment, the step of obtaining agent prompts and acquiring labeled medical data from an open-source large model and a local knowledge base based on the agent prompts, and then fine-tuning the large model based on the labeled medical data, includes:

[0013] The labeled medical data is cleaned and divided to remove abnormal data, resulting in a training set, a validation set, and a test set divided according to a preset ratio.

[0014] The model parameters of the large model are configured based on the AdamW optimizer, learning rate scheduler, cross-entropy loss function, and PPO loss function to determine the model configuration parameters.

[0015] In one embodiment, the step of obtaining agent prompts and acquiring labeled medical data from an open-source large model and a local knowledge base based on the agent prompts, and then fine-tuning the large model based on the labeled medical data, further includes:

[0016] Based on the model configuration parameters, the large model is fine-tuned and trained using the training set, evaluated and optimized using the validation set, and its performance is tested using the test set.

[0017] Based on the performance test results of the trained large model, the performance indicators of the trained large model are divided by BLEU score in order to obtain the trained large model that meets the set BLEU score indicators.

[0018] In one embodiment, the call to the trained large model extracts key information maintained under the agent's prompts, and determines the agent's label and the execution conditions triggered by the agent based on the key information, in order to construct the agent's structured rules to be executed, including:

[0019] The trained large model is invoked to extract the agent functions, agent execution goals, and agent execution logic maintained under the agent prompt words, so as to generate the agent label and the execution condition information triggered by the agent.

[0020] An agent search engine is constructed based on the agent tags, and an inverted index is built in the agent search engine between the agent tags and the agent names.

[0021] In one embodiment, the step of calling the trained large model to extract key information maintained under the agent's prompts, and determining the agent's label and the execution condition information triggered by the agent based on the key information to construct the agent's structured rules to be executed, further includes:

[0022] Based on the execution condition information, the trigger condition information and recall condition information of the agent are determined, and the trigger condition information and recall condition information are transformed into the agent structured rules to be executed through the GoRules specification.

[0023] When executing the structured rules of the intelligent agent, the GoRules engine is invoked to execute the structured rules.

[0024] In one embodiment, the step of using NLP technology to identify information from preprocessed patient medical record data to obtain standardized medical information from the patient medical record data, and recalling candidate agents associated with the standardized medical information based on agent tags, includes:

[0025] The patient's medical record data is obtained, and NLP technology is used to perform field parsing and medical entity recognition on the patient's medical record data to obtain information recognition results;

[0026] The information identification results are standardized and preprocessed according to preset clinical standards to obtain standardized medical information, so as to recall candidate agents associated with the standardized medical information through the index information corresponding to the agent tag.

[0027] In one embodiment, controlling the candidate agent to execute the agent structured rules to recall target agents that conform to preset rules includes:

[0028] Obtain the agent structure rules corresponding to the candidate agents, and call the GoRules engine to execute the agent structure rules to remove agent structure rules that do not match the standardized medical information, thereby obtaining the target agent structure rules;

[0029] Based on the structured rules of the target agent, target agents that match the standardized medical information are recalled in reverse, and the target agents are orchestrated to trigger and execute the target agents.

[0030] The present invention also provides a medical agent distribution device for implementing the medical agent distribution method described in any of the above claims, the device comprising:

[0031] The large model fine-tuning module is used to obtain agent prompt words and obtain labeled medical data from the open-source large model and the local knowledge base based on the agent prompt words, so as to fine-tune the large model based on the labeled medical data.

[0032] The structured rule construction module is used to call the trained large model to extract key information maintained under the agent prompt words, and determine the agent label and the execution condition information triggered by the agent based on the key information, so as to construct the agent structured rule to be executed.

[0033] The intelligent agent recall module is used to identify information from preprocessed patient medical record data using NLP technology to obtain standardized medical information from the patient medical record data, and recall candidate intelligent agents associated with the standardized medical information based on intelligent agent tags.

[0034] The agent filtering module is used to control the candidate agents to execute the agent structured rules in order to recall target agents that meet the preset rules.

[0035] The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

[0036] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the medical intelligent agent distribution method as described above.

[0037] The present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the medical intelligent agent distribution method as described above.

[0038] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the medical agent distribution method as described above.

[0039] The aforementioned medical agent distribution method, device, electronic device, and storage medium acquire agent prompts and obtain labeled medical data from an open-source large model and a local knowledge base based on these prompts. The large model is then fine-tuned based on this labeled medical data. The trained large model is then used to extract key information maintained under the agent prompts and to determine agent labels and execution conditions based on this key information, thus constructing structured rules for the agent to be executed. Next, NLP technology is used to identify information in the preprocessed patient medical record data to obtain standardized medical information. Candidate agents associated with this standardized medical information are then recalled based on the agent labels. Finally, the candidate agents are controlled to execute the structured rules to recall target agents that conform to the preset rules. This invention improves agent distribution efficiency by integrating search engine and rule engine technologies. Furthermore, the use of a high-performing large model offline to provide high-quality labeled data for engine execution not only effectively guarantees the distribution effect of the agent but also minimizes the dependence of agent distribution on GPU resources. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0041] Figure 1 This is one of the flowcharts illustrating the medical intelligent agent distribution method provided by the present invention;

[0042] Figure 2 This is a flowchart illustrating the index construction and structured rule generation process of the medical intelligent agent distribution method in a specific embodiment of the present invention.

[0043] Figure 3 A flowchart illustrating the agent recall process of the medical agent distribution method in a specific embodiment of the present invention;

[0044] Figure 4 The second flowchart illustrates the medical intelligent agent distribution method provided by this invention.

[0045] Figure 5 The third flowchart illustrating the medical intelligent agent distribution method provided by this invention;

[0046] Figure 6 The fourth flowchart illustrating the medical intelligent agent distribution method provided by this invention;

[0047] Figure 7 Fifth flowchart illustrating the medical intelligent agent distribution method provided by the present invention;

[0048] Figure 8 The sixth flowchart illustrating the medical intelligent agent distribution method provided by this invention;

[0049] Figure 9 The seventh flowchart illustrating the medical intelligent agent distribution method provided by this invention;

[0050] Figure 10 A schematic diagram of the medical intelligent agent distribution device provided by the present invention;

[0051] Figure 11 This is a diagram of the internal structure of the electronic device provided by the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0053] The following is combined Figures 1 to 11 The present invention describes a medical intelligent agent distribution method, apparatus, electronic device, and storage medium.

[0054] like Figure 1 As shown, in one embodiment, a medical intelligent agent distribution method includes the following steps:

[0055] Step S110: Obtain agent prompt words, and obtain labeled medical data from the open-source large model and local knowledge base based on the agent prompt words, so as to fine-tune the large model based on the labeled medical data.

[0056] Specifically, the server obtains agent prompts to determine the target task type for fine-tuning the large model, and retrieves labeled high-quality medical data from the open-source large model and the local knowledge base based on the agent prompts, so as to fine-tune and train the large model based on the labeled high-quality medical data.

[0057] Combination Figure 2 and Figure 3As shown in the specific embodiment, the medical agent distribution method provided by the present invention includes an offline part and an online part. The offline part includes large model fine-tuning, agent prompt word extraction based on the large model, generating agent tags and necessary / passing conditions based on the content extracted from the large model prompt words, constructing an agent search inverted index based on the agent tags, and converting agent recall conditions into executable structured rules based on the large model. The online part includes retrieving patient medical records, natural language recognition and standardization, performing agent coarse recall based on the recognized standardized information, executing the structured execution rules of the coarsely recalled agents and filtering out agents that do not meet the requirements, and determining all agent IDs that meet the coarse recall and structured rules and triggering execution according to the orchestration logic.

[0058] In this embodiment, before fine-tuning the large model, it is necessary to select high-quality medical data based on an industry-leading base model for fine-tuning. First, a pre-trained large model suitable for the target task needs to be selected. Open-source models with good performance include DeepSeek-R1 and Qwen3, which possess rich knowledge and generalization capabilities. After evaluation, DeepSeek-R1 was selected as the base large model. Then, fine-tuning training of the large model is performed based on publicly available medical data and locally stored high-quality data.

[0059] During model training, the target task type for fine-tuning needs to be determined as "labeling the agent based on prompts and task descriptions, and extracting task objectives." High-quality labeled data relevant to this task is collected from publicly available online data and labeled data with high task matching from locally stored knowledge bases. The collected high-quality labeled data is then preprocessed: data cleaning: removing noise, duplicates, and useless information to ensure data cleanliness; data partitioning: dividing the dataset into training, validation, and test sets, typically in a ratio of 80:10:10 or 70:15:15. When configuring model parameters, the AdamW optimizer is used; the initial learning rate is set to 3e-5 during fine-tuning, and a learning rate scheduler (linear decay) is used to dynamically adjust the learning rate; the loss functions include the cross-entropy loss function used to calculate the difference between the generated and target texts, and the PPO loss function used for performing classification tasks.

[0060] In this embodiment, during large model training, the model is fine-tuned on the training set by adjusting hyperparameters (such as learning rate and batch size) to optimize it. Model performance is then evaluated on the validation set, and overfitting is prevented by monitoring metrics such as loss, accuracy, and F1 score on the validation set. Furthermore, an early stopping strategy is used to stop training prematurely when validation set performance no longer improves, thus avoiding overfitting. Finally, the performance of the fine-tuned model is evaluated on the test set to ensure its performance on untrained data. The BLEU score is then used to evaluate the performance of the trained large model, according to the following criteria:

[0061] BLEU > 0.40 (40%) - Excellent

[0062] BLEU 0.30-0.40 - Excellent

[0063] BLEU 0.20-0.30 - Good

[0064] BLEU 0.10-0.20 - General

[0065] BLEU < 0.10 (10%) - Poor

[0066] The large model trained in this example needs to meet excellent standards.

[0067] Step S120: The trained large model is called to extract the key information maintained under the agent prompts, and the agent label and the execution condition information triggered by the agent are determined based on the key information to construct the agent structured rules to be executed.

[0068] The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

[0069] Specifically, the server calls the fine-tuned large model to extract key information about the agent's functions, execution goals, and execution logic maintained under the agent's prompts. Based on this key information, the server determines the agent's label and the execution conditions triggered by the agent, and then constructs the structured rules of the agent to be executed based on the condition information.

[0070] Combination Figure 2 and Figure 3 As shown in the specific embodiment, the medical agent distribution method provided by the present invention, in the process of extracting agent prompt word information based on a large model,

[0071] Based on the large model, key information for agent maintenance is extracted, including the agent's main functions, goals, and execution logic. For example, the extracted content for the "CABG postoperative care plan agent" is as follows:

[0072] (1) Main functions: Provide personalized nursing care plans after CABG surgery, including risk stratification, basic and individualized nursing care content, and make dynamic adjustments and optimizations based on the specific patient conditions;

[0073] (2) The goal of the intelligent agent: to provide decision support for the postoperative care plan of CABG surgery based on the patient's basic information and detailed information on the condition, and based on the latest guidelines of authoritative associations;

[0074] (3) Execution logic after extraction (based on the conditions extracted from the above prompts): First, the CABG surgery is risk-stratified and determined, then the postoperative care plan is refined according to the risk level, and finally, it is determined whether the patient has any special circumstances that require the development of a personalized care plan; the following steps will extract tags and trigger conditions according to the extracted execution logic.

[0075] Next, agent tags and triggering conditions are generated based on the large model's prompts, function descriptions, and objectives. This process mainly relies on the previously extracted key agent information, allowing the large model to extract agent tags and relevant triggering conditions, for example:

[0076] The aforementioned intelligent agent, "CABG Postoperative Nursing Plan Intelligent Agent," can obtain its first tag based on key information: CABG surgery {surgery}. Simultaneously, based on CABG surgery, a large model can acquire diagnostic tags strongly associated with the surgery: "multivessel disease," "acute myocardial infarction (AMI) with mechanical complications," "acute coronary syndrome," and "ischemic cardiomyopathy." The large model then converts these tags into standardized terms, based on a group standard that integrates ICD10, ICD11, and National Clinical 2.0 standards.

[0077] The agent trigger conditions extracted from the agent's prompts / functional descriptions are as follows:

[0078] 1) The patient has a history of CABG surgery (i.e., has already completed CABG surgery).

[0079] 2) The system has obtained the patient's basic information (gender, age, etc.).

[0080] 3) The system has obtained detailed information about the patient's condition (medical records).

[0081] The large model prompts used for extraction are:

[0082] You are a clinician with extensive medical knowledge. Please follow the general steps below to complete the Agent Trigger Condition Content Extraction Prompt:

[0083] ```

[0084] Step 1. Understanding the functional description of the intelligent agent

[0085] Carefully read the functional description of the intelligent agent to clarify its core tasks and service targets.

[0086] Extract key actions, objectives, applicable scenarios, and triggering conditions from the description.

[0087] Step 2. Identify key medical or business events.

[0088] Determine whether the description involves core medical events, business events, or specific scenarios (such as a certain type of disease, surgery, examination, or specific population).

[0089] Determine whether these events or scenarios are prerequisites for the action of the intelligent agent.

[0090] Step 3. Clarify the required input information

[0091] Extract the requirements for input information from the description, such as basic patient information, detailed medical information, examination results, and past medical history.

[0092] Determine whether this information is a necessary condition for the agent to execute.

[0093] Step 4. Extract the judgment conditions for distribution and execution.

[0094] Based on the above information, the conditions that the system must meet before distributing and executing the agent can be summarized.

[0095] The conditions should include:

[0096] Does the key event or scenario exist (such as a surgical history, a disease diagnosis, etc.)?

[0097] Are all necessary input information complete (such as basic information, medical condition information, etc.)?

[0098] Step 5. Structured expression of conditional content

[0099] Expressing the conditions in a structured and definable manner facilitates automatic identification and distribution by the system.

[0100] It can be implemented in natural language, pseudocode, JSON, or other formats to ensure that the conditions are clear and operable.

[0101] Step 6. Inspection and Verification

[0102] Check that the conditions and contents correspond exactly to the function description to ensure there are no omissions or misunderstandings.

[0103] The conditions must be valid and applicable.

[0104] General output example:

[0105] There exists a {core event / scenario} (e.g., a disease, a surgery, an examination, etc.).

[0106] {Necessary input information} has been obtained (e.g., basic information, medical condition information, test results, etc.).

[0107] Other specific conditions (such as time range, age group, gender, etc.)

[0108] ```

[0109] Finally, a search engine is built based on agent tags to generate tags for all agents and an index is constructed based on these tags. Simultaneously, an inverted index based on the relationship between tags and agent IDs is also built. Then, based on the large model, the agent triggering / recall conditions are transformed into executable structured rules. In this process, the executable structured rules for agent triggering conditions are represented using the GoRules specification, and rule execution also occurs on the GoRules engine.

[0110] It should be noted that this example builds an index based on agent tags. These tags (medical concept entities) need to be standardized first before being used to build the index, which will then be used to retrieve the required agents later. Furthermore, based on the large model, the content describing the agent's role / function maintained in the agent description is transformed into executable structured rules. Each rule has an ID, which is bound to the agent. A mapping from agent IDs to rule IDs is generated, and a mapping from rule IDs to agent IDs is also generated.

[0111] In this embodiment, the patient's actual medical record data is input, and NLP-based identification and standardization of medical entities are performed to output structured medical entities. Then, based on the identified standardized medical concept entities, a related agent set A1 is recalled using a constructed index. Next, related rule IDs are recalled using the IDs of agent set A1, generating a rule set R. Based on the identified medical entity content as input, the entire rule set R is executed, yielding results for all rules in R, with all hit rules RH retained. Finally, all agents related to rules RH are recalled, generating an agent set A2. All agents in agent set A2 are the final distributed agents, all of which need to be executed. Due to the two layers of filtering—tag-based recall and initial rule-hitting results—the number of remaining agents to be executed is relatively small compared to the existing agent distribution, significantly improving the execution efficiency of agent distribution and effectively avoiding the waste of GPU resources.

[0112] Step S130: Information identification is performed on the preprocessed patient medical record data using NLP technology to obtain standardized medical information in the patient medical record data, and candidate intelligent agents associated with the standardized medical information are recalled based on the intelligent agent label.

[0113] Specifically, the server uses NLP technology to identify information in the preprocessed patient medical record data to determine the medical entities and entity relationships in the patient medical record data, obtain the standardized medical information corresponding to the patient medical record data, and then recall the candidate intelligent agents associated with the standardized medical information based on the intelligent agent label index.

[0114] Combination Figure 2 and Figure 3 As shown in the specific embodiment, the medical intelligent agent distribution method provided by the present invention, in its online portion, first acquires the patient's medical records by connecting to the hospital's electronic medical record system to obtain patient medical record information, including: medical record document information (admission record, initial progress note, ward round record, daily progress note, discharge record), examination reports, laboratory reports, and pathology reports, etc. Then, NLP technology is used to identify the patient's complete in-hospital medical record information, including: parsing text medical record information fields, identifying medical entities and entity relationships, and standardizing the identification results according to clinical standards. In this example, NLP technology is used to preprocess the medical record information in real time, including: current medical record information and historical medical record information of the same patient. By comprehensively identifying the patient's in-hospital medical record information, a more complete and accurate data foundation is provided for subsequent recall of relevant intelligent agents.

[0115] Step S140: Control the candidate agent to execute the agent structured rules in order to recall the target agent that conforms to the preset rules.

[0116] Specifically, the server controls candidate agents to execute their corresponding agent structured rules, then filters out rules that do not match the patient's medical record information based on the execution results, thereby determining the remaining agent structured rules that meet the set rules, and finally recalls the corresponding agents based on the remaining agent structured rules after filtering, which are the target agents.

[0117] Combination Figure 2 and Figure 3As shown in the specific embodiment, the medical agent distribution method provided by this invention, during the coarse agent recall process based on identified standardized information, uses standardized information such as diagnosis, symptoms, medications, examinations, tests, gender, and age, and employs agent tag indexing to quickly recall relevant agents. Then, based on the coarsely recalled agents, the corresponding structured rules are obtained, and the corresponding structured rules are quickly executed through a structured rule engine. Rules that do not match patient information are filtered out, and the remaining rules are used to recall agents that meet the rule requirements, i.e., target agents. Finally, a refined list of target agent IDs is obtained. The target agents are then triggered and executed according to the arrangement requirements using their IDs to obtain the agent results.

[0118] For example, if the function of an agent is to assess nutritional risks after coronary stent surgery, then the agent is associated with the tag "coronary stent surgery". If the medical record describes coronary stent surgery, the agent whose function is to assess nutritional risks after coronary stent surgery can be recalled through the coronary stent surgery. At the same time, the agent also has corresponding structured rules. Only after executing the corresponding rules and hitting the target can the agent be considered successfully distributed and the agent execution process be triggered.

[0119] When a target agent is triggered to execute according to the orchestration requirements via an ID, such as the agent for "acute ischemic stroke reperfusion treatment decision", the agent needs to first determine whether the patient has a diagnosis related to "acute ischemic stroke". If there is no relevant diagnosis, the agent will directly remind the user that the condition does not meet the requirements. If the diagnosis condition is met, the agent will continue to determine whether the patient has received reperfusion treatment. If the patient has received reperfusion treatment, the agent will not remind the user again. If the patient has not received reperfusion treatment, the agent will remind the user.

[0120] The aforementioned medical agent distribution method acquires agent prompts and, based on these prompts, retrieves labeled medical data from an open-source large model and a local knowledge base. This labeled medical data is then used to fine-tune the large model's training. The trained large model is then used to extract key information maintained under the agent prompts, and based on this key information, agent labels and execution conditions are determined to construct structured rules for the agents to be executed. Next, NLP technology is used to identify information in the preprocessed patient medical record data to obtain standardized medical information. Candidate agents associated with this standardized medical information are then recalled based on the agent labels. Finally, the candidate agents are controlled to execute the structured rules to recall target agents that conform to the preset rules. This method improves agent distribution efficiency by integrating search engine and rule engine technologies. Furthermore, the offline use of a high-performing large model provides high-quality labeled data for the engine execution, effectively ensuring the distribution effect of agents and minimizing the dependence of agent distribution on GPU resources.

[0121] like Figure 4 As shown, in one embodiment, the medical intelligent agent distribution method provided by the present invention includes the following steps in step S110:

[0122] Step S111 involves cleaning and partitioning the labeled medical data to remove abnormal data and obtain training, validation, and test sets partitioned according to a preset ratio.

[0123] Step S112: Based on the AdamW optimizer, learning rate scheduler, cross-entropy loss function, and PPO loss function, configure the model parameters of the large model to determine the model configuration parameters.

[0124] like Figure 5 As shown, in one embodiment, the medical intelligent agent distribution method provided by the present invention further includes the following steps in step S110:

[0125] Step S113: Based on the model configuration parameters, fine-tune the large model using the training set, evaluate and optimize the large model using the validation set, and perform performance testing on the trained large model using the test set.

[0126] Step S114: Based on the performance test results of the trained large model, the trained large model is divided into performance indicators by BLEU score in order to obtain the trained large model that meets the set BLEU score index.

[0127] like Figure 6 As shown, in one embodiment, the medical intelligent agent distribution method provided by the present invention includes the following steps in step S120:

[0128] Step S121: The trained large model is called to extract the agent functions, agent execution goals and agent execution logic maintained under the agent prompt words, so as to generate agent labels and agent-triggered execution condition information.

[0129] Step S122: Construct an agent search engine based on agent tags, and build an inverted index between agent tags and agent names in the agent search engine.

[0130] like Figure 7 As shown, in one embodiment, the medical intelligent agent distribution method provided by the present invention further includes the following steps in step S120:

[0131] Step S123: Determine the trigger condition information and recall condition information of the agent based on the execution condition information, and transform the trigger condition information and recall condition information into the agent structured rules to be executed through the GoRules specification.

[0132] Step S124: When executing the structured rules of the intelligent agent, the GoRules engine is invoked to execute the structured rules.

[0133] like Figure 8 As shown, in one embodiment, the medical intelligent agent distribution method provided by the present invention includes the following steps in step S130:

[0134] Step S131: Obtain patient medical record data and call NLP technology to perform field parsing and medical entity recognition on the patient medical record data to obtain information recognition results.

[0135] Step S132: Perform standardized preprocessing on the information recognition results according to preset clinical standards to obtain standardized medical information, so as to recall candidate intelligent agents associated with the standardized medical information through the index information corresponding to the intelligent agent label.

[0136] like Figure 9 As shown, in one embodiment, the medical intelligent agent distribution method provided by the present invention includes the following steps in step S140:

[0137] Step S141: Obtain the agent structure rules corresponding to the candidate agents, and call the GoRules engine to execute the agent structure rules in order to remove agent structure rules that do not match the standardized medical information, and obtain the target agent structure rules.

[0138] Step S142: Based on the structured rules of the target intelligent agent, the target intelligent agent that matches the standardized medical information is recalled in reverse, and the target intelligent agent is orchestrated to trigger and execute the target intelligent agent.

[0139] The medical intelligent agent distribution device provided by the present invention is described below. The medical intelligent agent distribution device described below can be referred to in correspondence with the medical intelligent agent distribution method described above.

[0140] like Figure 10 As shown, in one embodiment, a medical agent distribution device includes a large model fine-tuning module 1010, a structured rule construction module 1020, an agent recall module 1030, and an agent filtering module 1040.

[0141] The large model fine-tuning module 1010 is used to obtain agent prompt words and obtain labeled medical data from the open-source large model and the local knowledge base based on the agent prompt words, so as to fine-tune the large model based on the labeled medical data.

[0142] The structured rule construction module 1020 is used to call the trained large model to extract key information maintained under the agent prompts, and determine the agent label and the execution condition information triggered by the agent based on the key information, so as to construct the agent structured rules to be executed.

[0143] The agent recall module 1030 is used to identify information from preprocessed patient medical record data using NLP technology, to obtain standardized medical information from the patient medical record data, and to recall candidate agents associated with the standardized medical information based on agent tags.

[0144] The agent filtering module 1040 is used to control candidate agents to execute agent structured rules in order to recall target agents that meet the preset rules.

[0145] The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

[0146] In this embodiment, the large model fine-tuning module 1010 of the medical intelligent agent distribution device provided by the present invention is specifically used for:

[0147] The labeled medical data is cleaned and divided to remove outliers, resulting in training, validation, and test sets divided according to a preset ratio.

[0148] Based on the AdamW optimizer, learning rate scheduler, cross-entropy loss function, and PPO loss function, the model parameters of large models are configured to determine the model configuration parameters.

[0149] In this embodiment, the large model fine-tuning module 1010 of the medical intelligent agent distribution device provided by the present invention is further used for:

[0150] Based on the model configuration parameters, the large model is fine-tuned using the training set, evaluated and optimized using the validation set, and its performance is tested using the test set.

[0151] Based on the performance test results of the trained large model, the performance indicators of the trained large model are divided by BLEU score in order to obtain the trained large model that meets the set BLEU score indicators.

[0152] In this embodiment, the structured rule construction module 1020 of the medical intelligent agent distribution device provided by the present invention is specifically used for:

[0153] The trained large model is invoked to extract the agent functions, agent execution goals, and agent execution logic maintained under the agent prompts, in order to generate agent labels and agent-triggered execution condition information.

[0154] A smart agent search engine is built based on smart agent tags, and an inverted index between smart agent tags and smart agent names is constructed in the smart agent search engine.

[0155] In this embodiment, the structured rule construction module 1020 of the medical intelligent agent distribution device provided by the present invention is further used for:

[0156] Based on the execution condition information, the trigger condition information and recall condition information of the agent are determined, and the trigger condition information and recall condition information are transformed into the agent structured rules to be executed through the GoRules specification.

[0157] When executing the structured rules of the intelligent agent, the GoRules engine is invoked to execute the structured rules.

[0158] In this embodiment, the medical intelligent agent distribution device provided by the present invention, specifically uses the intelligent agent recall module 1030 for:

[0159] The system acquires patient medical record data and uses NLP technology to perform field parsing and medical entity recognition on the patient medical record data to obtain information recognition results.

[0160] The information identification results are standardized and preprocessed according to preset clinical standards to obtain standardized medical information, so as to recall candidate agents associated with the standardized medical information through the index information corresponding to the agent tags.

[0161] In this embodiment, the medical intelligent agent distribution device provided by the present invention, specifically uses the intelligent agent filtering module 1040 for:

[0162] Obtain the agent structure rules corresponding to the candidate agents, and call the GoRules engine to execute the agent structure rules to remove agent structure rules that do not match the standardized medical information, so as to obtain the target agent structure rules.

[0163] The system uses structured rules to back-recall target agents that match standardized medical information, and then orchestrates these target agents to trigger and execute them.

[0164] Figure 11 This example illustrates a schematic diagram of the physical structure of an electronic device, which can be a smart terminal. Its internal structure diagram can be as follows: Figure 11As shown. The electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a medical intelligent agent distribution method, which includes:

[0165] The system acquires agent prompts and retrieves labeled medical data from open-source large models and local knowledge bases based on these prompts, enabling fine-tuning of the large model based on the labeled medical data.

[0166] The trained large model is invoked to extract key information maintained under the agent prompts, and the agent labels and execution conditions triggered by the agent are determined based on the key information in order to construct the agent structured rules to be executed.

[0167] The NLP technology is used to identify information in the preprocessed patient medical record data to obtain standardized medical information in the patient medical record data, and candidate intelligent agents associated with the standardized medical information are recalled based on the intelligent agent label.

[0168] Control candidate agents to execute agent structure rules in order to recall target agents that conform to preset rules;

[0169] The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

[0170] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the electronic device to which the present invention is applied. A specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0171] On the other hand, the present invention also provides a computer storage medium storing a computer program, which, when executed by a processor, implements a medical intelligent agent distribution method, the method comprising:

[0172] The system acquires agent prompts and retrieves labeled medical data from open-source large models and local knowledge bases based on these prompts, enabling fine-tuning of the large model based on the labeled medical data.

[0173] The trained large model is invoked to extract key information maintained under the agent prompts, and the agent labels and execution conditions triggered by the agent are determined based on the key information in order to construct the agent structured rules to be executed.

[0174] The NLP technology is used to identify information in the preprocessed patient medical record data to obtain standardized medical information in the patient medical record data, and candidate intelligent agents associated with the standardized medical information are recalled based on the intelligent agent label.

[0175] Control candidate agents to execute agent structure rules in order to recall target agents that conform to preset rules;

[0176] The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

[0177] In another aspect, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, it implements a medical agent distribution method, the method comprising:

[0178] The system acquires agent prompts and retrieves labeled medical data from open-source large models and local knowledge bases based on these prompts, enabling fine-tuning of the large model based on the labeled medical data.

[0179] The trained large model is invoked to extract key information maintained under the agent prompts, and the agent labels and execution conditions triggered by the agent are determined based on the key information in order to construct the agent structured rules to be executed.

[0180] The NLP technology is used to identify information in the preprocessed patient medical record data to obtain standardized medical information in the patient medical record data, and candidate intelligent agents associated with the standardized medical information are recalled based on the intelligent agent label.

[0181] Control candidate agents to execute agent structure rules in order to recall target agents that conform to preset rules;

[0182] The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

[0183] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory.

[0184] By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0185] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0186] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A method for distributing medical intelligent agents, characterized in that, The method includes: The system obtains agent prompts and retrieves labeled medical data from an open-source large model and a local knowledge base based on the agent prompts, so as to fine-tune the large model based on the labeled medical data. The trained large model is invoked to extract key information maintained under the agent prompts, and the agent labels and execution conditions triggered by the agent are determined based on the key information to construct the agent structured rules to be executed. The preprocessed patient medical record data is identified using NLP technology to obtain standardized medical information from the patient medical record data, and candidate intelligent agents associated with the standardized medical information are recalled based on intelligent agent tags. The candidate agents are controlled to execute the agent structured rules in order to recall target agents that conform to preset rules. The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic. The process involves calling the trained large model to extract key information maintained under the agent's prompts, and determining the agent's label and execution conditions based on this key information to construct structured rules for the agent to be executed, including: The trained large model is invoked to extract the agent functions, agent execution goals, and agent execution logic maintained under the agent prompt words, so as to generate the agent label and the execution condition information triggered by the agent. An agent search engine is constructed based on the agent tags, and an inverted index is built in the agent search engine between the agent tags and the agent names.

2. The medical intelligent agent distribution method according to claim 1, characterized in that, The step of obtaining agent prompts and acquiring labeled medical data from an open-source large model and a local knowledge base based on the agent prompts, and then fine-tuning the large model based on the labeled medical data, includes: The labeled medical data is cleaned and divided to remove abnormal data, resulting in a training set, a validation set, and a test set divided according to a preset ratio. The model parameters of the large model are configured based on the AdamW optimizer, learning rate scheduler, cross-entropy loss function, and PPO loss function to determine the model configuration parameters.

3. The medical intelligent agent distribution method according to claim 2, characterized in that, The step of obtaining agent prompts and acquiring labeled medical data from an open-source large model and a local knowledge base based on the agent prompts, and then fine-tuning the large model based on the labeled medical data, further includes: Based on the model configuration parameters, the large model is fine-tuned and trained using the training set, evaluated and optimized using the validation set, and its performance is tested using the test set. Based on the performance test results of the trained large model, the performance indicators of the trained large model are divided by BLEU score in order to obtain the trained large model that meets the set BLEU score indicators.

4. The medical intelligent agent distribution method according to claim 1, characterized in that, The process of calling the trained large model to extract key information maintained under the agent's prompts, and determining the agent's label and the execution conditions triggered by the agent based on the key information to construct the agent's structured rules to be executed, also includes: Based on the execution condition information, the trigger condition information and recall condition information of the agent are determined, and the trigger condition information and recall condition information are transformed into the agent structured rules to be executed through the GoRules specification. When executing the structured rules of the intelligent agent, the GoRules engine is invoked to execute the structured rules.

5. The medical intelligent agent distribution method according to claim 1, characterized in that, The step of using NLP technology to identify information from preprocessed patient medical record data to obtain standardized medical information from the patient medical record data, and recalling candidate agents associated with the standardized medical information based on agent tags, includes: The patient's medical record data is obtained, and NLP technology is used to perform field parsing and medical entity recognition on the patient's medical record data to obtain information recognition results; The information identification results are standardized and preprocessed according to preset clinical standards to obtain standardized medical information, so as to recall candidate agents associated with the standardized medical information through the index information corresponding to the agent tag.

6. The medical intelligent agent distribution method according to claim 5, characterized in that, The step of controlling the candidate agent to execute the agent structured rules in order to recall target agents that conform to preset rules includes: Obtain the agent structure rules corresponding to the candidate agents, and call the GoRules engine to execute the agent structure rules to remove agent structure rules that do not match the standardized medical information, thereby obtaining the target agent structure rules; Based on the structured rules of the target agent, target agents that match the standardized medical information are recalled in reverse, and the target agents are orchestrated to trigger and execute the target agents.

7. A medical intelligent agent distribution device, characterized in that, The apparatus for implementing the medical intelligent agent distribution method according to any one of claims 1 to 6, the apparatus comprising: The large model fine-tuning module is used to obtain agent prompt words and obtain labeled medical data from the open-source large model and the local knowledge base based on the agent prompt words, so as to fine-tune the large model based on the labeled medical data. The structured rule construction module is used to call the trained large model to extract key information maintained under the agent prompt words, and determine the agent label and the execution condition information triggered by the agent based on the key information, so as to construct the agent structured rule to be executed. The intelligent agent recall module is used to identify information from preprocessed patient medical record data using NLP technology to obtain standardized medical information from the patient medical record data, and recall candidate intelligent agents associated with the standardized medical information based on intelligent agent tags. The agent filtering module is used to control the candidate agents to execute the agent structured rules in order to recall target agents that meet the preset rules. The key information includes the agent's functions, the agent's execution goals, and the agent's execution logic.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the medical agent distribution method according to any one of claims 1 to 6.

9. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the medical agent distribution method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Metro field large language model evaluation method and system

    CN120163142A

  • Task processing method, task platform, computing device and computer readable storage medium

    CN120297322A