Medical task making method and system based on large language model

By introducing prefabricated treatment plans customized generation templates and large language models, combining patient information dynamically generate and evaluate treatment plans, the problem of poor applicability of AI models is solved, and the formulation and evaluation of personalized treatment plans are realized.

CN120412964APending Publication Date: 2025-08-01ZHONGDIAN YAOMING DATA TECH (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410133209.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing AI models lack the ability to generalize across diseases in the formulation of treatment plans, and the training methods, prediction plans and evaluation methods are single, resulting in poor applicability and inability to fully consider individual patients.

Method used

A prefabricated treatment plan customized generation template is introduced and packaged based on a large-scale language base model. It combines the patient's requests, treatment goals, current case information and historical diagnosis and treatment records to dynamically generate candidate treatment plans, and determine the best solution through intelligent evaluation.

Benefits of technology

It improves the flexibility and accuracy of treatment plans, reduces the impact of human factors and data selection on the accuracy of treatment plans, and can provide patients with personalized treatment plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120412964A_ABST
    Figure CN120412964A_ABST
Patent Text Reader

Abstract

The invention discloses a medical task making method and system based on a large language model, and the method comprises the steps: obtaining the current case information and historical diagnosis and treatment records of a patient according to the number id of the patient, obtaining the treatment guide group grouping of the patient, determining an expert treatment guide according to the treatment guide group grouping, and carrying out the treatment of the expert treatment guide. Generating scheme customization input data and treatment suggestions according to the current case information and the historical diagnosis and treatment records of the patient on the basis of a treatment scheme customization generation template and a large language model, and generating the treatment suggestions according to the current case information and the historical diagnosis and treatment records of the patient; and generating candidate treatment schemes according to the treatment target, the expert treatment guide and the treatment suggestion, evaluating the candidate treatment schemes by using a treatment scheme customization evaluation model, obtaining a scheme evaluation result, and determining an optimal treatment scheme from the candidate treatment schemes according to the scheme evaluation result. By applying the method and the system, the flexibility, the accuracy and the universality of formulating the treatment scheme according to needs are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of the Internet of Things and intelligent processing of health data, and more specifically, to a medical task formulation method and system based on a large language model. Background Art

[0002] The generation of general disease treatment plans aims to provide a set of treatment plan generation mechanisms applicable to multiple diseases, rather than a single plan for a specific disease. Due to the complexity of the characteristics of each disease type and the differences between individual patients, existing treatment plan formulation methods often focus on a specific disease type. Some are based on expert decision rules, and some are based on AI reinforcement learning. For the plan based on expert decision rules, the decision rule set is usually refined according to expert guidelines, without fully considering the individual differences of patients, and the generated treatment plan is too general. For the plan based on AI reinforcement learning, depending on the diversity, preparedness of its training samples, and the advancement of the model training plan, a more personalized treatment plan can usually be obtained compared with the expert decision rules. However, the training method, prediction plan, evaluation method, etc. of this AI model are all for specific disease types, and its working mode does not have the generalization ability across disease types.

[0003] Based on this, it is necessary to introduce a new method and system. By introducing a prefabricated treatment plan customization generation template and a large language model obtained by encapsulating a large-scale language base model based on the treatment plan customization generation template, it is possible to dynamically formulate a candidate treatment plan for the patient according to the patient's request, treatment goal, current case information, and historical diagnosis and treatment records, and determine the best treatment plan after intelligently evaluating the selected treatment plan, so as to solve the technical problems of the single training method, prediction plan, and evaluation method of the AI model and poor applicability in the existing technology, thereby reducing the influence of human factors, data selection, training methods, and evaluation methods on the accuracy of the treatment plan, and improving the flexibility and accuracy of formulating treatment plans on demand. Summary of the Invention

[0004] In view of the above-mentioned technical problems, the present invention provides a medical task formulation method and system based on a large language model. By introducing a prefabricated treatment plan customization generation template and a large language model obtained by encapsulating a large-scale language base model based on the treatment plan customization generation template, it is possible to dynamically formulate a candidate treatment plan for the patient according to the patient's request, treatment goal, current case information, and historical diagnosis and treatment records, and determine the best treatment plan after intelligently evaluating the selected treatment plan, so as to solve the technical problems of the single training method, prediction plan, and evaluation method of the AI model and poor applicability in the existing technology.

[0005] The present invention provides a medical task formulation method based on a large language model, and the method includes:

[0006] S1, respond to event trigger requests in real time, and determine the patient number ID and treatment goals based on the parsing results of the event trigger request; S2, obtain the patient's current case information and historical medical records, as well as the patient's treatment guideline group grouping based on the patient number ID, and determine the expert treatment guideline based on the treatment guideline group grouping; S3, generate templates and large language models based on treatment plan customization, generate plan customization input data based on the patient's current case information and historical medical records, and generate treatment recommendations based on the plan customization input data, the treatment goals and the expert treatment guidelines; S4, generate candidate treatment plans based on the patient's current case information and historical medical records, as well as the treatment goals, the expert treatment guidelines and the treatment recommendations, use the treatment plan customization evaluation model to evaluate the candidate treatment plans, and obtain plan evaluation results; S5, determine the best treatment plan from the candidate treatment plans based on the plan evaluation results.

[0007] Preferably, in step S1, the step of responding to the event trigger request in real time and determining the patient number ID and treatment goal according to the analysis result of the event trigger request further includes: S11, responding to the event trigger request, and determining the patient number ID of the patient corresponding to the event trigger request according to the analysis result; S12, obtaining the patient's intention information according to the patient number ID, normalizing and threshold segmenting the patient's intention information, determining the patient's intention classification, and generating a tendency value table; S13, determining the treatment goal according to the patient's intention classification and tendency value table.

[0008] Preferably, in step S2, before the step of determining the expert treatment guideline according to the treatment guideline group grouping, it also includes the steps of group grouping and knowledge base construction, specifically: grouping the patient group according to the patient's clinical characteristics and case information to obtain the treatment guideline group grouping; obtaining the clinical guideline data corresponding to the treatment guideline group grouping according to the treatment guideline group grouping, as well as the characteristics, severity of the disease and complication risk of the patient group, and classifying the guideline data to generate and construct an expert treatment guideline knowledge base; wherein, the type of the case information includes: the current case information, historical case information and the historical diagnosis and treatment records; the data structure of the case information includes: patient age, gender, medical history, allergy history, target-related vital signs information, examination results, biochemical test results, medical history data and medication history.

[0009] Preferably, the step of S2 further includes: S21, obtaining the current case information and historical diagnosis and treatment records of the patient according to the patient number id, and preprocessing the current case information and the historical diagnosis and treatment records to generate the current case information and the historical diagnosis and treatment records in a structured format; S22, comparing and judging the current case information and the historical diagnosis and treatment records in a structured format with the treatment guideline population groups to determine the treatment guideline population group corresponding to the patient; S23, determining the expert treatment guideline from the expert treatment guideline knowledge base according to the treatment guideline population group corresponding to the patient.

[0010] Preferably, in S2, after obtaining the current case information and historical diagnosis and treatment records of the patient, it further includes a step of key information extraction and processing: Key information extraction: According to the type and data structure of the case information, extract the patient information data of the patient from the current case information and historical diagnosis and treatment records of the patient, including: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data, medication history, and symptom description; According to the preset data format, perform format reorganization processing on the patient information data of the patient to generate patient information data with a unified format; Among them, the type of the case information includes: the current case information, historical case information, and the historical diagnosis and treatment records; the data structure of the case information includes: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data, medication history, and symptom description.

[0011] Preferably, in step S3, before the step of generating the template and the large language model based on the treatment plan customization and generating the plan customization input data according to the current case information and historical diagnosis and treatment records of the patient, there is also a step of model prefabrication, specifically: Generating the template: generating the treatment plan customization generation template according to the medical task template structure; Generating the model: based on the patient's case information and the expert treatment guideline knowledge base, using the treatment plan customization generation template to encapsulate the large-scale language base model to generate an initialized large language model; Model training: using the medical knowledge corpus to enhance the domain knowledge of the large language model to obtain an enhanced large language model; wherein, the medical task template structure includes: patient medical record information, treatment goals, treatment suggestions, treatment plans, plan evaluation results, and plan optimization goals; the patient medical record information includes: patient age, gender, past history, family history, biochemical examination data, blood glucose level, insulin level, fundus examination data, and current medication data; the treatment plan includes: drug treatment plan, lifestyle adjustment plan, and disease condition monitoring plan; the large-scale language base model is an existing large-scale language model algorithm library selected according to the generation requirements of the large language model; the medical knowledge corpus includes general medical textbooks, medical textbooks, clinical guidelines, expert consensus, and academic papers.

[0012] Preferably, the step of S3 further includes: S31, based on the treatment plan customization generation template, generating the generation plan customization input data according to the uniformly formatted patient information data, and the plan customization input data includes: patient medical record information, treatment goals; S32, based on the large language model, generating the treatment suggestions according to the patient medical record information, the treatment goals, and the expert treatment guidelines.

[0013] Preferably, the step of S4 further includes: S41, inputting the patient medical record information, the treatment goals, the expert treatment guidelines, and the treatment suggestions into the treatment plan customization generation template to generate the candidate treatment plan; S42, evaluating the candidate treatment plan based on the large language model to obtain the plan evaluation result and the plan optimization goal.

[0014] Preferably, in step S5, the step of determining the optimal treatment plan from the candidate treatment plans according to the plan evaluation result further includes: if the evaluation result is satisfied, determining the optimal treatment plan as the candidate treatment plan; if the evaluation result is not satisfied, according to the plan optimization objective, re-inputting the patient's medical record information, the treatment objective, the expert treatment guidelines, and the treatment suggestions into the treatment plan customization generation template to generate an optimized candidate treatment plan, and re-evaluating the candidate treatment plan based on the large language model to obtain an optimized plan evaluation result and a plan optimization objective, and then determining the optimal treatment plan from the optimized candidate treatment plans according to the optimized plan evaluation result.

[0015] Correspondingly, the present invention also provides a medical task formulation system based on a large language model. The system includes a request response module, a patient grouping module, a task preprocessing module, a task generation and evaluation module, and a task determination and output module; wherein, the request response module is used to respond to an event trigger request in real time and determine the patient number id and the treatment objective according to the parsing result of the event trigger request.

[0016] The patient grouping module is used to obtain the current case information and historical diagnosis and treatment records of the patient according to the patient number id, as well as the treatment guideline group grouping of the patient, and determine the expert treatment guidelines according to the treatment guideline group grouping; the task preprocessing module is used to generate plan customization input data based on the treatment plan customization generation template and the large language model according to the current case information and historical diagnosis and treatment records of the patient, and generate treatment suggestions according to the plan customization input data, the treatment objective, and the expert treatment guidelines; the task generation and evaluation module is used to generate candidate treatment plans based on the current case information and historical diagnosis and treatment records of the patient, as well as the treatment objective, the expert treatment guidelines, and the treatment suggestions, and evaluate the candidate treatment plans using a treatment plan customization evaluation model to obtain a plan evaluation result; the task determination and output module is used to determine the optimal treatment plan from the candidate treatment plans according to the plan evaluation result.

[0017] By applying the above technical solutions, the present invention realizes that by introducing a prefabricated treatment plan customization generation template and a large language model obtained by encapsulating a large-scale language base model based on the treatment plan customization generation template, it is possible to dynamically formulate a candidate treatment plan for a patient according to the patient's request, treatment goal, current case information, and historical diagnosis and treatment records, and determine the best treatment plan after intelligently evaluating the selected treatment plan, solving the technical problems of the single training method, prediction plan, and evaluation method of the AI model and poor applicability in the prior art, thereby reducing the influence of human factors, data selection, training method, and evaluation method on the accuracy of the treatment plan, and improving the flexibility and accuracy of formulating treatment plans on demand. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0019] Figure 1 The flowchart showing a method for formulating a medical task based on a large language model proposed in an embodiment of the present invention;

[0020] Figure 2 The task execution flowchart showing a method for formulating a medical task based on a large language model proposed in an embodiment of the present invention;

[0021] Figure 3 The model fine-tuning flowchart showing a method for formulating a medical task based on a large language model proposed in an embodiment of the present invention;

[0022] Figure 4 The solution generation flowchart showing a method for formulating a medical task based on a large language model proposed in an embodiment of the present invention;

[0023] Figure 5 The structural schematic diagram showing a system for formulating a medical task based on a large language model proposed in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, rather than all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present application.

[0025] The present invention provides a method for formulating medical tasks based on large language models, such as Figure 1 shown, the method comprising the following steps:

[0026] S1, in real-time response to an event trigger request, determining the patient ID id and the treatment goal according to the parsing result of the event trigger request.

[0027] In this embodiment, in step S1, the step of in real-time response to an event trigger request and determining the patient ID id and the treatment goal according to the parsing result of the event trigger request further comprises:

[0028] S11, responding to the event trigger request and determining the patient ID id of the patient corresponding to the event trigger request according to the parsing result;

[0029] S12, according to the patient ID id, obtaining the patient's willingness information, performing normalization and threshold segmentation processing on the patient's willingness information, determining the patient's intention classification, and generating a tendency value table;

[0030] S13, determining the treatment goal according to the patient's intention classification and the tendency value table.

[0031] S2, according to the patient ID id, obtaining the patient's current case information, historical diagnosis and treatment records, and the treatment guideline group classification of the patient, and determining the expert treatment guideline according to the treatment guideline group classification.

[0032] In this embodiment, in step S2, before the step of determining the expert treatment guideline according to the treatment guideline group classification, there are also steps of group classification and knowledge base construction, specifically:

[0033] Grouping the patient population according to the clinical characteristics and case information of the patients to obtain the treatment guideline group classification;

[0034] According to the treatment guideline group classification, as well as the characteristics, disease severity and complication risk of the patient population, obtaining the clinical guideline data corresponding to the treatment guideline group classification, and classifying the guideline data to generate and construct an expert treatment guideline knowledge base;

[0035] Wherein,

[0036] The types of the case information include: the current case information, historical case information and the historical diagnosis and treatment records;

[0037] The data structure of the case information includes: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data and medication history.

[0038] In this embodiment, the steps of S2 further include:

[0039] S21. According to the patient number id, obtain the current case information and historical diagnosis and treatment records of the patient, and preprocess the current case information and the historical diagnosis and treatment records to generate the current case information and the historical diagnosis and treatment records in a structured format;

[0040] S22. Compare and judge the structured current case information and the historical diagnosis and treatment records with the treatment guideline population grouping to determine the treatment guideline population grouping corresponding to the patient;

[0041] S23. According to the treatment guideline population grouping corresponding to the patient, determine the expert treatment guideline from the expert treatment guideline knowledge base.

[0042] In this embodiment, in S2, after obtaining the current case information and historical diagnosis and treatment records of the patient, it further includes the step of key information extraction and processing:

[0043] Key information extraction: According to the type and data structure of the case information, extract the patient information data of the patient from the current case information and historical diagnosis and treatment records of the patient, including: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data, medication history, and symptom description;

[0044] According to the preset data format, perform format reorganization processing on the patient information data of the patient to generate patient information data with a unified format;

[0045] Wherein,

[0046] The type of the case information includes: the current case information, historical case information, and the historical diagnosis and treatment records;

[0047] The data structure of the case information includes: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data, medication history, and symptom description.

[0048] S3. Based on the treatment plan customization generation template and the large language model, generate the plan customization input data according to the current case information and historical diagnosis and treatment records of the patient, and generate treatment suggestions according to the plan customization input data, the treatment goal, and the expert treatment guideline.

[0049] In this embodiment, in step S3, before the step of generating the plan customization input data according to the current case information and historical diagnosis and treatment records of the patient based on the treatment plan customization generation template and the large language model, it further includes the step of model prefabrication, specifically:

[0050] Generation template: Generate the customized generation template for the treatment plan according to the medical task template structure;

[0051] Generation model: Based on the patient's case information and the expert treatment guideline knowledge base, encapsulate the large-scale language base model using the customized generation template for the treatment plan to generate an initialized large language model;

[0052] Model training: Use the medical knowledge corpus to enhance the domain knowledge of the large language model to obtain an enhanced large language model;

[0053] Among them,

[0054] The medical task template structure includes: patient medical record information, treatment goals, treatment suggestions, treatment plans, plan evaluation results, and plan optimization goals;

[0055] The patient medical record information includes: patient age, gender, past medical history, family history, biochemical examination data, blood glucose level, insulin level, fundus examination data, and current medication data;

[0056] The treatment plan includes: drug treatment plan, lifestyle adjustment plan, and disease monitoring plan;

[0057] The large-scale language base model is an existing large-scale language model algorithm library selected according to the generation requirements of the large language model;

[0058] The medical knowledge corpus includes general medical textbooks, medical textbooks, clinical guidelines, expert consensus, and academic papers.

[0059] In this embodiment, the steps of S3 further include:

[0060] S31, based on the customized generation template for the treatment plan, generate the customized input data for the generation plan according to the patient information data with unified format. The customized input data for the plan includes: patient medical record information, treatment goals;

[0061] S32, based on the large language model, generate the treatment suggestions according to the patient medical record information, the treatment goals, and the expert treatment guidelines.

[0062] S4, based on the patient's current case information and historical diagnosis and treatment records, as well as the treatment goals, the expert treatment guidelines, and the treatment suggestions, generate candidate treatment plans, and use the treatment plan customization evaluation model to evaluate the candidate treatment plans to obtain plan evaluation results.

[0063] In this embodiment, the steps of S4 further include:

[0064] S41. Input the patient's medical record information, the treatment goal, the expert treatment guidelines, and the treatment suggestions into the treatment plan customization generation template to generate the candidate treatment plan.

[0065] S42. Evaluate the candidate treatment plan based on the large language model to obtain the plan evaluation result and the plan optimization goal.

[0066] S5. Determine the best treatment plan from the candidate treatment plans according to the plan evaluation result.

[0067] In this embodiment, in step S5, the step of determining the best treatment plan from the candidate treatment plans according to the plan evaluation result further includes:

[0068] If the evaluation result is satisfied, determine the best treatment plan as the candidate treatment plan.

[0069] If the evaluation result is not satisfied, according to the plan optimization goal, re-enter the patient's medical record information, the treatment goal, the expert treatment guidelines, and the treatment suggestions into the treatment plan customization generation template to generate an optimized candidate treatment plan, and re-evaluate the candidate treatment plan based on the large language model to obtain the optimized plan evaluation result and the plan optimization goal, and then determine the best treatment plan from the optimized candidate treatment plans according to the optimized plan evaluation result.

[0070] To facilitate those skilled in the art to better understand the medical task formulation method based on the large language model provided by the present invention, taking a scoliosis patient as an example, the above steps are further supplemented and explained below.

[0071] As Figure 2 shown, pre-train the large language model for disease knowledge in a specific field and perform specific task supervised fine-tuning.

[0072] The large-scale language base model can be GPT, BERT, T5, or other self-developed LLM models. The large language model is encapsulated using a prompt template (i.e., the treatment plan customization generation template), with examples of the specifications, details, and input-output formats written in natural language conventions, so that the large-scale language model can more accurately understand the comprehensive information of the patient and the plan generation goal, and generate a personalized treatment plan that conforms to medical logic.

[0073] Among them, the incremental pre-training of the large language model includes: enhancing the domain knowledge of the base large language model by using a medical knowledge corpus. The medical knowledge corpus includes general medical textbooks, medical textbooks in specific fields, clinical guidelines, expert consensus, and academic papers, etc. These data can provide the latest knowledge and guiding principles on treatment plans. This stage aims to enable the model to learn the natural language structure and rules of new domain knowledge, and requires a large amount of data. In order to improve the understanding ability of the large language model in the knowledge of diseases in specific fields, data cleaning, domain knowledge annotation, and data augmentation are performed on medical textbooks, medical textbooks in specific fields, clinical guidelines, expert consensus, academic papers, etc., so as to improve the quality of the medical knowledge corpus.

[0074] The supervised fine-tuning of large language models refers to the process of fine-tuning a pre-trained model on specific tasks after incremental pre-training. In this process, it is usually necessary to collect some labeled datasets for specific tasks. Then, these datasets are used to fine-tune the pre-trained model so that the model can better adapt to the requirements of specific tasks. When fine-tuning the pre-trained model, the processing of these datasets by the model is as follows: The model uses existing pre-trained knowledge and labeled data for supervised learning, and adjusts the model parameters through the backpropagation algorithm to better adapt to the requirements of specific tasks. This process can be achieved by minimizing the loss function of the model on the labeled data. The key lies in balancing the generalization ability of the model and its adaptability to specific tasks. Therefore, regularization processing, learning rate adjustment, etc. are required technically. Regularization processing can help prevent overfitting and improve the generalization ability of the model. Adjusting the learning rate can control the parameter update speed of the model during fine-tuning to balance the retention of pre-trained knowledge and the adaptation to specific tasks. Since the pathogenesis of different diseases, the physiological and biochemical characteristics of patients, disease treatment methods, etc. are all different, the key points for dataset annotation required for model fine-tuning in different disease fields are also different. Therefore, the key points for dataset annotation can be determined through expert knowledge. Taking diabetes as an example, the indicators that need to be focused on when preparing the dataset are: blood glucose levels (including fasting blood glucose, postprandial blood glucose, long-term blood glucose control indicators such as HbA1c level, etc.), insulin levels (including insulin secretion level and insulin resistance degree), weight changes, diet control (the eating habits of patients, including the proportion of carbohydrates, fats, and proteins ingested, etc.), drug treatment (the types, doses, and treatment effects of drugs used by patients), exercise habits (the exercise frequency, intensity, and duration of patients), and complications (whether diabetes-related complications such as cardiovascular diseases and kidney diseases have occurred), etc. Usually, only a small amount of labeled data is required at this stage to achieve good results on specific tasks. In actual usage scenarios, it is only necessary to fine-tune for three specific task scenarios: treatment task generation, treatment task evaluation, and treatment task optimization. The reason is that large language models have learned rich language knowledge and context understanding ability during the pre-training stage. During the fine-tuning stage, only the parameters of the model need to be adjusted through labeled data to make it adapt to the requirements of specific tasks.

[0075] Fine-tuning for the task scenario of treatment plan generation, the technical process is to collect a labeled dataset related to the treatment plan, such as medical record information of diabetic patients and corresponding treatment plans. Then, input these data into a pre-trained large model, and update the model's parameters through a fine-tuning algorithm to make it more accurate and reasonable when generating text related to treatment plans. Fine-tuning for treatment plan evaluation, the technical process is to collect a labeled dataset related to treatment plan evaluation, such as treatment effect evaluation data of diabetic patients. Then input these data into a pre-trained large model, and update the model's parameters through a fine-tuning algorithm to make it more accurate and comprehensive when evaluating treatment plans. Fine-tuning for treatment plan optimization, the technical process is to collect a labeled dataset related to treatment plan optimization, such as treatment optimization suggestions for diabetic patients. Then input these data into a pre-trained large model, and update the model's parameters through a fine-tuning algorithm to make it more targeted and effective when providing treatment plan optimization suggestions.

[0076] The dataset can be collected through the following processing process. First, extract relevant data from professional literature, medical databases, or patient records in related fields; then, clean, label, and organize these data to ensure data quality and consistency. Specific tasks are determined through expert knowledge, task requirements, or the guidance of domain experts. For example, in the medical field, specific tasks can be disease diagnosis, drug recommendation, or treatment plan generation, etc.

[0077] As Figure 3 and Figure 4 shown, generally, the system has already included the current medical record information of patients in a specific disease field, including but not limited to patient age, gender, past medical history, allergy history, vital sign information related to the disease field target, examination results, biochemical test results, etc., as well as factual information such as the medical visit history and medication history related to the disease field.

[0078] For these information, in order to improve the treatment plan generation, evaluation, and optimization effects of the system in a specific disease field, the following technical processing will be carried out on these information: data preprocessing, feature extraction, and data augmentation. Data preprocessing includes operations such as data cleaning, denoising, and standardization to ensure the accuracy and consistency of the data. Feature extraction involves extracting useful features from the original data, such as extracting indicators such as blood glucose level and insulin level from biochemical test results. Data augmentation can increase the diversity and quantity of data by synthesizing new samples or expanding existing samples to improve the generalization ability of the model; at the same time, the system has also constructed a knowledge base for patient group grouping and group treatment suggestions based on knowledge such as clinical guidelines and expert consensus.

[0079] The technical process of constructing patient group grouping is as follows: Based on the patient's clinical characteristics and condition information, such as age, gender, medical history, symptoms, test results, etc., cluster analysis or classification algorithms are used to group patients into the same group (population) in order to better understand and manage different types of patients. Patient group grouping refers to grouping patients with similar condition characteristics into the same group (population); the technical process of constructing a group treatment recommendation knowledge base is as follows: Based on existing clinical guidelines, expert consensus and research literature, treatment recommendations for different patient groups are collected and organized, including recommendations on drug therapy, surgical treatment, diet control, lifestyle intervention, etc. These recommendations can be personalized based on factors such as the characteristics of the patient group, the severity of the disease, and the risk of complications. Group treatment recommendations refer to grouping patients with similar condition characteristics (based on the results of patient group grouping) into the same group (population) and providing corresponding treatment recommendations for this group of patients.

[0080] Step 1: Use a patient ID to query the patient's complete medical record information from the patient information database. The case information has been structured and entered into the database in advance.

[0081] Step 2: Determine the patient's treatment goal characteristics based on their preferences. To this end, the patient's preferences are collected through a system task questionnaire or other means. The answers are then digitally scored to obtain a numerical representation of their preferences. To determine the patient's treatment goal, the preferences are processed as follows: the collected preference data is normalized and thresholded to obtain a treatment preference classification to represent the treatment goal characteristics.

[0082] Step 3: Match the group according to the patient's medical record information and treatment target characteristics, and obtain the general treatment recommendations (expert guidelines) for the group from the knowledge base based on the matched group.

[0083] To match patients to group groups based on their medical records and treatment goal characteristics, the following technical processing steps are required: preprocessing the patient data to convert it into a format suitable for processing; extracting features related to the treatment goals; and using these features to match patients to appropriate groups, thereby matching them to group groups.

[0084] In order to obtain general treatment recommendations for the matched group from the knowledge base, the following technical processing steps need to be performed: calculate the similarity between the group to which the patient belongs and the existing groups in the knowledge base; use this similarity to index relevant information in the knowledge base; and extract treatment recommendations and guidance that match the patient's condition based on the index results, thereby matching the group.

[0085] Step 4, integrate information such as the patient's complete medical record information, treatment goals, and general treatment recommendations into the pre-designed plan generation prompt template (i.e., the treatment plan customization generation template) through key information extraction and format reorganization to complete the question organization of the plan generation prompt. The plan generation prompt template (i.e., the treatment plan customization generation template) is pre-designed according to the characteristics of different diseases and is used to guide the question organization of the plan generation task. When using it, the closer the content characteristics of the questions are to the corpus characteristics during training, the more accurate the generated recommended plan will be.

[0086] To integrate information such as the patient's complete medical record information, treatment goals, and general treatment recommendations into the pre-designed plan generation prompt template (i.e., the treatment plan customization generation template) through key information extraction and format reorganization, the following technical processing procedures need to be executed: Extract key information from the patient's medical record information, and extract important information related to plan generation, such as disease diagnosis, symptom description, past treatment records, etc. Then, reorganize the format of this information to make it meet the requirements of the pre-designed plan generation prompt template (i.e., the treatment plan customization generation template); Determine the patient's treatment goals according to the patient's condition and the doctor's advice, such as disease control, symptom relief, rehabilitation, etc. Associate these treatment goals with the medical record information to ensure that the generated plan can be designed for the patient's specific treatment goals. Then, reorganize the format of this information to make it meet the requirements of the pre-designed plan generation prompt template (i.e., the treatment plan customization generation template); Utilize resources such as knowledge bases or medical literature to obtain general treatment recommendations that match the patient's condition. These treatment recommendations can be conventional treatment methods, drug recommendations, lifestyle suggestions, etc. for specific diseases or symptoms. Screen out the relevant general treatment recommendations according to the patient's medical record information and treatment goals.

[0087] Reorganize the format of this information to make it meet the requirements of the pre-designed plan generation prompt template (i.e., the treatment plan customization generation template). Thus, finally achieve integration into the pre-designed plan generation prompt template (i.e., the treatment plan customization generation template).

[0088] Taking diabetes as an example, the main component elements of its plan generation prompt template (i.e., the treatment plan customization generation template) are shown as follows:

[0089]

[0090] Step 5, send the plan generation prompt data to the fine-tuned large language model service endpoint to obtain the generated candidate treatment plans.

[0091] To send the generated prompt data of the solution to the fine-tuned large language model service endpoint and obtain the generated candidate treatment solutions, the following technical processing procedures are included: sending the preprocessed generated prompt data of the solution to the fine-tuned large language model service endpoint through the RestAPI method; in the fine-tuned large language model, calling the API for generating text, and the model will continue writing the text based on the input information and context to obtain the text of the candidate treatment solution as the candidate treatment solution, and the candidate treatment solution is presented in the form of semi-structured JSON text.

[0092] Step 6: Incorporate the complete medical record information and treatment goals of the patient, as well as the candidate treatment solutions generated in Step 5, etc. into the pre-designed solution evaluation prompt template (i.e., the treatment plan customization and generation template) through key information extraction and format reorganization to complete the problem organization of the solution evaluation prompt. The solution evaluation prompt template (i.e., the treatment plan customization and generation template) is also pre-designed according to the characteristics of different diseases and is used to guide the problem organization of the prompt for the solution evaluation task. When used, the closer the content characteristics of the questions are to the corpus characteristics during training, the more accurate the generated evaluation conclusion will be.

[0093] To incorporate the complete medical record information and treatment goals of the patient, the candidate treatment solutions generated in Step 5, etc. into the pre-designed solution evaluation prompt template (i.e., the treatment plan customization and generation template) through key information extraction and format reorganization to complete the problem organization of the solution evaluation prompt, the following technical processing procedures need to be executed: text analysis, entity recognition, and relationship extraction; text sorting, structuring, and annotation; generating the problem organization of the solution evaluation prompt containing sufficient key information and format. The problem organization of the solution evaluation prompt refers to the problem organization expressed in a certain structure and annotation form after extracting and reorganizing the key information such as the patient's medical record information, treatment goals, and candidate treatment solutions, so as to achieve the purpose of effectively evaluating the treatment plan through this problem organization of the solution evaluation prompt.

[0094] The key information extraction includes the following technical processing procedures: analyzing the texts such as the patient's medical record information, treatment goals, and candidate treatment solutions through text analysis technology to identify key entities such as disease names, treatment goals, and drug names, and extracting the relationships between them, such as the association relationship between the treatment goal and the disease, through relationship extraction technology.

[0095] Format restructuring includes the following technical processing procedures: For medical record information, it is organized according to different parts of the medical record. For example, past medical history, current medical history, physical examination results, laboratory test results, etc. are sorted into different paragraphs respectively; for treatment goals, they are organized according to different aspects or priorities. For example, primary treatment goals and secondary treatment goals are listed separately, and clear descriptions and quantification indicators are provided for each goal; for candidate treatment plans, they are organized according to different treatment strategies or drug categories. For example, drug treatment, diet control, exercise plans, etc. are listed separately, and detailed descriptions and relevant references are provided for each plan.

[0096] Taking diabetes as an example, the main components of its scheme evaluation prompt template (i.e., the treatment plan customization and generation template) are exemplified as follows:

[0097]

[0098]

[0099] Step 7: Send the scheme evaluation prompt data to the fine-tuned large language model service endpoint to obtain the treatment plan evaluation results, including the conclusion (satisfied / not satisfied) and the inference reason for the conclusion.

[0100] Step 8: If the evaluation result generated in Step 7 is not satisfied, then integrate information such as the patient's complete medical record information, treatment goals, candidate treatment plans generated in Step 5, and evaluation results generated in Step 7 into the pre-designed scheme optimization prompt template (i.e., the treatment plan customization and generation template) through key information extraction and format restructuring to complete the problem organization of the scheme optimization prompt. The scheme optimization prompt template (i.e., the treatment plan customization and generation template) is also pre-designed according to the characteristics of different diseases and is used to guide the problem organization of the scheme optimization task. When using it, the closer the content characteristics of the questions are to the corpus characteristics during training, the more accurate the generated optimized plan will be. Taking diabetes as an example, the main components of its scheme optimization prompt template (i.e., the treatment plan customization and generation template) are exemplified as follows:

[0101]

[0102]

[0103]

[0104] Step 9: Send the scheme optimization prompt data to the fine-tuned large language model service endpoint to obtain the candidate optimized treatment plan.

[0105] Repeat steps 6 to 9 until a candidate treatment plan with a satisfactory evaluation result is obtained.

[0106] Step 10: Format the satisfactory candidate treatment plan in JSON format, along with information such as the recommended reasons in the evaluation result, and output it to the downstream system interface.

[0107] By applying the above technical solutions, a general disease treatment plan generation mechanism applicable to various diseases is provided. Through the introduction of a prefabricated treatment plan customization generation template and a large language model obtained by encapsulating a large-scale language base model based on the treatment plan customization generation template, candidate treatment plans can be dynamically formulated for a patient according to the patient's requests, treatment goals, current case information, and historical diagnosis and treatment records. After intelligent evaluation of the selected treatment plans, the best treatment plan is determined. This mechanism can generate personalized treatment plans for patients based on their holographic detection data and treatment goals, solving the technical problems of the single training method, prediction plan, and evaluation method of AI models in the prior art, as well as poor applicability. Thus, the influence of human factors, data selection, training methods, and evaluation methods on the accuracy of treatment plans is reduced, and the flexibility and accuracy of formulating treatment plans on demand are improved.

[0108] In addition, the method provided by the present invention can generate candidate treatment plans by introducing a large language model. It can describe the patient's basic information in natural language with higher flexibility, and by adding the patient's treatment goals, the formulated plan is more in line with the patient's expectations, providing more accurate guidance for physicians to formulate the final treatment plan. By introducing a large language model to evaluate candidate treatment plans, the rigor and completeness of candidate treatment plans can be effectively improved. By using the treatment plan customization generation template to specify the writing norms, details, and example input / output formats of natural language, the large language model can more accurately understand the patient's diagnosis and treatment intentions, thereby generating treatment plans that conform to the patient's characteristics. For different disease fields, different fine-tuning training corpora can be prepared in the same way, and corresponding customized treatment plans can be obtained by fine-tuning the open-source large model.

[0109] Corresponding to a medical task formulation method based on a large language model in an embodiment of the present invention, the present invention also discloses a medical task formulation system based on a large language model, as Figure 5 shown. The system includes a request response module, a patient grouping module, a task preprocessing module, a task generation and evaluation module, and a task determination and output module.

[0110] Among them,

[0111] The request response module is used to respond to event trigger requests in real time, and determine the patient ID and treatment goal according to the parsing result of the event trigger request;

[0112] The patient grouping module is used to obtain the current case information and historical diagnosis and treatment records of the patient according to the patient ID, as well as the group classification of the treatment guidelines for the patient, and determine the expert treatment guidelines according to the group classification of the treatment guidelines;

[0113] The task preprocessing module is used to generate a template and a large language model for treatment plan customization, generate input data for plan customization according to the current case information and historical diagnosis and treatment records of the patient, and generate treatment suggestions according to the input data for plan customization, the treatment goal, and the expert treatment guidelines;

[0114] The task generation and evaluation module is used to generate candidate treatment plans based on the current case information and historical diagnosis and treatment records of the patient, as well as the treatment goal, the expert treatment guidelines, and the treatment suggestions, and evaluate the candidate treatment plans using a treatment plan customization evaluation model to obtain a plan evaluation result;

[0115] The task determination and output module is used to determine the best treatment plan from the candidate treatment plans according to the plan evaluation result.

[0116] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments.

[0117] The above is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A method for formulating medical tasks based on large language models, characterized in that, The method includes: S1. Respond to the event trigger request in real time, and determine the patient number id and treatment goal according to the parsing result of the event trigger request; S2. According to the patient number id, obtain the current case information, historical diagnosis and treatment records of the patient, and the treatment guideline group classification of the patient, and determine the expert treatment guideline according to the treatment guideline group classification; S3. Based on the treatment plan customization generation template and the large language model, generate the plan customization input data according to the current case information and historical diagnosis and treatment records of the patient, and generate treatment suggestions according to the plan customization input data, the treatment goal and the expert treatment guideline; S4. Generate a candidate treatment plan based on the current case information and historical diagnosis and treatment records of the patient, as well as the treatment goal, the expert treatment guideline and the treatment suggestions, and use the treatment plan customization evaluation model to evaluate the candidate treatment plan to obtain the plan evaluation result; S5. Determine the best treatment plan from the candidate treatment plans according to the plan evaluation result.

2. The method according to claim 1, characterized in that, In step S1, the step of responding to the event trigger request in real time and determining the patient number id and treatment goal according to the parsing result of the event trigger request further includes: S11. Respond to the event trigger request, and determine the patient number id of the patient corresponding to the event trigger request according to the parsing result; S12. According to the patient number id, obtain the will information of the patient, perform normalization and threshold segmentation processing on the will information of the patient, determine the intention classification of the patient, and generate a tendency value table; S13. Determine the treatment goal according to the intention classification and tendency value table of the patient.

3. The method according to claim 1, wherein In step S2, before the step of determining the expert treatment guideline according to the treatment guideline group classification, it further includes the steps of group classification and knowledge base construction, specifically: Group the patient groups according to the clinical characteristics and case information of the patients to obtain the treatment guideline group classification; According to the treatment guideline group classification, as well as the characteristics, disease severity and complication risk of the patient group, obtain the clinical guideline data corresponding to the treatment guideline group classification, and classify the guideline data to generate and construct an expert treatment guideline knowledge base; Among them, The types of the case information include: the current case information, historical case information and the historical diagnosis and treatment records; The data structure of the case information includes: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data and medication history.

4. The method according to claim 1, wherein The step of S2 further includes: S21. According to the patient number id, obtain the current case information and historical diagnosis and treatment records of the patient, and preprocess the current case information and the historical diagnosis and treatment records to generate the current case information and the historical diagnosis and treatment records in a structured format; S22. Compare and judge the structured current case information and historical diagnosis and treatment records with the treatment guideline group classification to determine the treatment guideline group classification corresponding to the patient; S23. Group the patients according to the corresponding treatment guideline groups, and determine the expert treatment guidelines from the expert treatment guideline knowledge base.

5. The method according to claim 1, wherein In step S2, after obtaining the current case information and historical diagnosis and treatment records of the patient, it further includes the step of key information extraction and processing: Key information extraction: According to the type and data structure of the case information, extract the patient information data of the patient from the current case information and historical diagnosis and treatment records of the patient, including: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data, medication history, and symptom description; Reorganize the format of the patient information data of the patient according to the preset data format to generate uniformly formatted patient information data; Among them, The types of the case information include: the current case information, historical case information, and the historical diagnosis and treatment records; The data structure of the case information includes: patient age, gender, past history, allergy history, target-related vital sign information, examination results, biochemical test results, medical history data, medication history, and symptom description.

6. The method according to claim 1, wherein In step S3, before the step of generating the template and the large language model based on the treatment plan customization and generating the plan customization input data according to the current case information and historical diagnosis and treatment records of the patient, it further includes the step of model prefabrication, specifically: Generate template: Generate the treatment plan customization generation template according to the medical task template structure; Generate model: Based on the patient's case information and the expert treatment guideline knowledge base, use the treatment plan customization generation template to encapsulate the large-scale language base model to generate an initialized large language model; Model training: Use the medical knowledge corpus to enhance the domain knowledge of the large language model to obtain an enhanced large language model; Among them, The medical task template structure includes: patient medical record information, treatment goals, treatment suggestions, treatment plans, plan evaluation results, and plan optimization goals; The patient medical record information includes: patient age, gender, past history, family history, biochemical examination data, blood glucose level, insulin level, fundus examination data, and current medication data; The treatment plan includes: drug treatment plan, lifestyle adjustment plan, and disease monitoring plan; The large-scale language base model is an existing large-scale language model algorithm library selected according to the generation requirements of the large language model; The medical knowledge corpus includes general medical textbooks, medical textbooks, clinical guidelines, expert consensus, and academic papers.

7. The method according to claim 1, wherein The steps of S3 further include: S31. Based on the treatment plan customization generation template, generate the plan customization input data according to the uniformly formatted patient information data. The plan customization input data includes: patient medical record information, treatment goals; S32. Based on the large language model, generate the treatment suggestions according to the patient medical record information, the treatment goals, and the expert treatment guidelines.

8. The method according to claim 1, characterized in that, The steps of S4 further include: S41. Input the patient's medical record information, the treatment goal, the expert treatment guidelines, and the treatment suggestions into the treatment plan customization generation template to generate the candidate treatment plan. S42. Evaluate the candidate treatment plan based on the large language model to obtain the plan evaluation result and the plan optimization goal.

9. The method according to claim 1, wherein In step S5, the step of determining the optimal treatment plan from the candidate treatment plans according to the plan evaluation result further includes: If the evaluation result is satisfied, determine the optimal treatment plan as the candidate treatment plan. If the evaluation result is not satisfied, according to the plan optimization goal, re-enter the patient's medical record information, the treatment goal, the expert treatment guidelines, and the treatment suggestions into the treatment plan customization generation template to generate an optimized candidate treatment plan, and re-evaluate the candidate treatment plan based on the large language model to obtain the optimized plan evaluation result and the plan optimization goal, and then determine the optimal treatment plan from the optimized candidate treatment plans according to the optimized plan evaluation result.

10. A system for implementing the method for formulating medical tasks based on a large language model according to claim 1, characterized in that, The system includes a request response module, a patient grouping module, a task preprocessing module, a task generation and evaluation module, and a task determination and output module. Among them, The request response module is used to respond to the event trigger request in real time and determine the patient number id and the treatment goal according to the parsing result of the event trigger request. The patient grouping module is used to obtain the patient's current case information and historical diagnosis and treatment records according to the patient number id, and the treatment guideline group classification of the patient, and determine the expert treatment guidelines according to the treatment guideline group classification. The task preprocessing module is used to generate plan customization input data based on the treatment plan customization generation template and the large language model according to the patient's current case information and historical diagnosis and treatment records, and generate treatment suggestions according to the plan customization input data, the treatment goal, and the expert treatment guidelines. The task generation and evaluation module is used to generate a candidate treatment plan based on the patient's current case information and historical diagnosis and treatment records, and the treatment goal, the expert treatment guidelines, and the treatment suggestions, and evaluate the candidate treatment plan using the treatment plan customization evaluation model to obtain the plan evaluation result. The task determination and output module is used to determine the optimal treatment plan from the candidate treatment plans according to the plan evaluation result.