A model calling method, a medical consultation task processing method and device

CN122658710APending Publication Date: 2026-08-28BEIJING JINGDONG TUOXIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510186037.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2026-08-28

AI Technical Summary

Technical Problem

[0004]没有在调用大模型的环节进行降本的策略干预,导致巨大的模型调用成本

Benefits of technology

[0040]One embodiment of the above invention has the following advantages or beneficial effects: By translating the user-inputted prompt words in the original language type into prompt words in the target language type, wherein the number of tokens for the original language type prompt words is greater than the number of tokens for the target language type prompt words; by performing data compression processing on the target language type prompt words to obtain compressed prompt words; by performing intent recognition and complexity recognition on the compressed prompt words, and by calling the target task model based on the intent recognition results and complexity recognition results, the target task model can be used to process the task corresponding to the prompt words; thereby reducing the number of tokens input to the large model, and reducing the memory and inference time occupied by the large model, reducing the calling cost while ensuring normal task processing. By determining the medical consultation information corresponding to the task; calling a pre-trained medical and health large model based on the medical consultation information; wherein the medical and health large model is obtained by calling any of the methods in the first aspect of the present invention; generating response information corresponding to the medical consultation information using the medical and health large model, and using the response information as the task processing result; thereby reducing task processing cost and improving task processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122658710A_ABST
    Figure CN122658710A_ABST
Patent Text Reader

Abstract

The application discloses a model calling method, a medical consultation task processing method and device, and relates to the technical field of internet medical treatment and artificial intelligence. A specific embodiment of the model calling method comprises: translating a prompt word of an original language type input by a user into a prompt word of a target language type; the token number of the prompt word of the original language type is greater than the token number of the prompt word of the target language type; performing data compression processing on the prompt word of the target language type; performing intention and complexity recognition on the processed prompt word, and calling a target task model based on the recognition result to process a task corresponding to the prompt word; the token number input to the model can be reduced, and the model calling cost can be reduced. A specific embodiment of the medical consultation task processing method comprises: determining medical consultation information corresponding to a task; calling a medical health large model based on the medical consultation information to generate response information, and taking the response information as a processing result; the task processing cost can be reduced, and the efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of internet healthcare and artificial intelligence technology, and in particular to a model invocation method, a medical consultation task processing method, and an apparatus. Background Technology

[0002] In the current internet healthcare scenario, there are many health-related user-facing applications. These applications require users to frequently call large models, submitting user-written prompts and questions to the large models to generate responses.

[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the related technology:

[0004] The lack of cost-reduction strategies during the large model invocation process resulted in enormous model invocation costs. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a model invocation method, a medical consultation task processing method and apparatus, which can reduce the number of tokens input to large models, as well as reduce the memory and inference time occupied by large models, thereby reducing invocation costs while ensuring normal task processing.

[0006] To achieve the above objectives, according to one aspect of the present invention, a model invocation method is provided, comprising:

[0007] Translate the prompts in the original language type input by the user into prompts in the target language type; wherein the number of tokens for the prompts in the original language type is greater than the number of tokens for the prompts in the target language type.

[0008] The prompt words in the target language type are compressed to obtain compressed prompt words;

[0009] The compressed prompts are subjected to intent recognition and complexity recognition. Based on the intent recognition and complexity recognition results, the target task model is invoked to process the task corresponding to the prompts.

[0010] Optionally, before translating the prompt words in the original language type entered by the user into prompt words in the target language type, the method further includes:

[0011] Detect the number of tokens corresponding to the prompt words of the original language type, and determine the target language type based on the detection results;

[0012] Translate the prompts in the user's original language type into prompts in the target language type, including:

[0013] The target translation service interface is called based on the original language type and the target language type, and the prompt words in the original language type are translated into prompt words in the target language type using the target translation service interface.

[0014] Optionally, the prompt words for the target language type are compressed to obtain compressed prompt words, including:

[0015] Redundant information in the prompts of the target language type is identified, and the redundant information is removed to obtain the compressed prompts; or, the prompts of the target language type are input into a pre-trained compression model, and the compressed prompts are obtained using the compression model.

[0016] Optionally, the compressed prompt words are subjected to intent recognition, including:

[0017] Extract intent information from compressed prompts;

[0018] The intent information is matched with predefined intent categories to obtain intent recognition results; or the intent information is input into a pre-trained intent recognition model to generate intent recognition results.

[0019] Optionally, the complexity of the compressed prompt words is assessed, including:

[0020] The complexity index is determined based on the compressed prompt words; the complexity index includes the number of tokens and the task type.

[0021] The complexity index is matched with pre-established complexity evaluation rules to obtain complexity identification results.

[0022] Optionally, the method further includes:

[0023] The processing results of the target task model are recorded based on a pre-configured feedback mechanism, and the compression parameters corresponding to data compression are adjusted according to the processing results, so as to perform data compression based on the adjusted compression parameters.

[0024] According to another aspect of the present invention, a method for processing medical consultation tasks is provided, comprising:

[0025] Determine the medical consultation information corresponding to the task;

[0026] A pre-trained medical and health model is invoked based on medical consultation information; wherein the medical and health model is obtained by invoking any of the methods in the first aspect of the present invention.

[0027] The system utilizes a large-scale medical and health model to generate response information corresponding to medical consultation information, and uses the response information as the result of the task.

[0028] According to another aspect of the present invention, a model invocation apparatus is provided, comprising:

[0029] The translation module is used to translate the prompts in the original language type into prompts in the target language type; wherein the number of tokens for the prompts in the original language type is greater than the number of tokens for the prompts in the target language type.

[0030] The compression module is used to compress the prompt words in the target language type to obtain compressed prompt words.

[0031] The calling module is used to perform intent recognition and complexity recognition on the compressed prompt words, and call the target task model based on the intent recognition results and complexity recognition results, so as to use the target task model to process the task corresponding to the prompt words.

[0032] According to another aspect of the present invention, a medical consultation task processing device is provided, comprising:

[0033] The determination module is used to determine the medical consultation information corresponding to the task;

[0034] The retrieval module is used to invoke a pre-trained medical and health big model based on medical consultation information; wherein the medical and health big model is obtained by invoking any of the methods in the first aspect of the present invention.

[0035] The generation module is used to generate response information corresponding to medical consultation information using a large medical and health model, and to use the response information as the result of the task processing.

[0036] According to another aspect of the present invention, an electronic device is provided, comprising:

[0037] One or more processors;

[0038] Memory, used to store one or more programs.

[0039] When one or more programs are executed by one or more processors, the one or more processors implement the methods of any of the above embodiments.

[0040] One embodiment of the above invention has the following advantages or beneficial effects: By translating the user-inputted prompt words in the original language type into prompt words in the target language type, wherein the number of tokens for the original language type prompt words is greater than the number of tokens for the target language type prompt words; by performing data compression processing on the target language type prompt words to obtain compressed prompt words; by performing intent recognition and complexity recognition on the compressed prompt words, and by calling the target task model based on the intent recognition results and complexity recognition results, the target task model can be used to process the task corresponding to the prompt words; thereby reducing the number of tokens input to the large model, and reducing the memory and inference time occupied by the large model, reducing the calling cost while ensuring normal task processing. By determining the medical consultation information corresponding to the task; calling a pre-trained medical and health large model based on the medical consultation information; wherein the medical and health large model is obtained by calling any of the methods in the first aspect of the present invention; generating response information corresponding to the medical consultation information using the medical and health large model, and using the response information as the task processing result; thereby reducing task processing cost and improving task processing efficiency.

[0041] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0042] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0043] Figure 1 This is a schematic diagram of the main flow of the model invocation method according to an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of the main flow of a model invocation method according to a preferred embodiment of the present invention;

[0045] Figure 3 This is a schematic diagram of the main flow of a medical consultation task processing method according to an embodiment of the present invention;

[0046] Figure 4 This is a schematic diagram of the main modules of the model calling device according to an embodiment of the present invention;

[0047] Figure 5 This is a schematic diagram of the main modules of a medical consultation task processing device according to an embodiment of the present invention;

[0048] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0049] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0050] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0051] It should be noted that the acquisition, storage, and application of personal information involved in the embodiments of the present invention comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0052] In the current internet healthcare scenario, there are many health-related user-facing applications. These applications frequently call large models when users use them, submitting user-written prompts and questions to the large model for response generation. However, no cost-reduction strategies have been implemented in the process of calling the large model, resulting in huge model call costs.

[0053] In view of this, according to one embodiment of the present invention, a model invocation method is provided.

[0054] Figure 1 This is a schematic diagram illustrating the main flow of the model invocation method according to an embodiment of the present invention. Figure 1 As shown, the model invocation method according to an embodiment of the present invention includes the following steps S101 to S103.

[0055] Step S101: Translate the prompt words in the original language type input by the user into prompt words in the target language type; wherein the number of tokens for the prompt words in the original language type is greater than the number of tokens for the prompt words in the target language type.

[0056] The original language type refers to the language used when the user inputs the prompt, such as Chinese, French, German, etc. The target language type is the language the user wants to translate the prompt into; depending on the use case, it could be English, Spanish, or another language supported by the system. The prompt is the user-input instruction text used to express task requirements to the model, such as "Generate a summary about climate change" or "Translate the following text into English." After translating the user-input prompt from the original language type (e.g., Chinese) to the target language type (e.g., English), due to differences in language structure, the target language prompt requires fewer tokens.

[0057] The process of translating prompts from the original language type to the target language type can be achieved using a dedicated translation API (Application Programming Interface). When calling the translation API, the prompts are input, along with the original and target language types. The API returns the translated prompts. Alternatively, pre-trained multilingual models, such as large-scale natural language generation models or multilingual machine translation models, can be utilized. By directly inputting the prompts and translation requirements into the model, the model can generate translations in the target language type during inference. This approach can flexibly handle complex contexts and even eliminates the need to explicitly specify the original and target language types; the model can automatically detect and convert the language type based on the prompts. Translation reduces the overall token count of the prompts, thereby lowering the computational cost of the natural language processing model. Fewer tokens improve task processing efficiency, reduce model call costs, and accelerate the model inference process, achieving both resource conservation and performance improvement while maintaining the semantic integrity of the prompts.

[0058] Step S102: Perform data compression processing on the prompt words of the target language type to obtain compressed prompt words.

[0059] Data compression of prompts in the target language can be achieved through various methods, such as removing redundant information or semantic reconstruction techniques, to further reduce the number of tokens while preserving the core semantics of the prompts. Specifically, removing redundant information includes deleting repeated phrases, removing irrelevant qualifiers or conjunctions, and replacing complex sentences with more concise expressions. For example, simplifying "Please summarize the following text in a concise and clear manner" to "Summarize the text concisely" significantly shortens the prompt length without affecting the completeness of the instruction. Applying semantic reconstruction techniques involves adjusting the sentence structure of prompts using language models or dedicated algorithms, enabling them to use more refined vocabulary and structures while maintaining the original semantics. For example, compressing "Explain how the following code works step by step" to "Explain the code stepwise" not only reduces the number of words but also enhances the model's efficiency in parsing instructions. The compressed prompts are optimized instruction texts with fewer tokens while maintaining semantic clarity. This data compression operation can further improve the processing efficiency of the language model and reduce resource consumption.

[0060] Step S103: Perform intent recognition and complexity recognition on the compressed prompt words, and call the target task model based on the intent recognition results and complexity recognition results to process the task corresponding to the prompt words.

[0061] Intent recognition refers to analyzing the core meaning of prompts to determine the user's intent. For example, it involves using natural language processing models to extract key verbs and target objects from prompts, thereby clarifying the type of operation corresponding to the prompt. Complexity recognition assesses the difficulty of the prompt task, for example, based on the input length, logical hierarchy, and the capabilities of the models required.

[0062] Specifically, intent recognition can be achieved using rule-based natural language processing techniques, matching verbs or key phrases in compressed prompts using predefined keywords, sentence templates, and classification rules. For example, the prompt "Summarize the following text" can be identified by recognizing the verb "summarize" to determine its intent as "generate a summary." Intent recognition can also be based on machine learning-based intent classification models, training a text classifier to map prompts to different intent categories. This intent classification model, by learning intent features from large amounts of labeled data, can more flexibly handle diverse prompt expressions. For example, for the prompt "Explain how this algorithm works," "explain" can be identified as the core intent. Complexity recognition can be implemented based on heuristic rules, such as statistically analyzing the word count or nesting structure of compressed prompts to assess task complexity. Alternatively, a complexity evaluation model can be trained to output a complexity score or level after inputting a prompt.

[0063] The intent recognition result indicates the task's operation type, such as "generate summary" or "sentiment analysis." The complexity recognition result indicates the task's processing difficulty or priority and required computational resources; for example, a lightweight model is chosen for simple tasks, while a deep model is chosen for complex tasks. Calling the target task model can be done by directly mapping the intent and complexity recognition results to a specific model based on predefined rules; alternatively, it can be dynamically adjusted using feedback mechanisms or online optimization to select the most suitable model in real time based on the intent and complexity recognition results. For example, a simple level-one sentiment analysis task can directly call a basic sentiment analysis model, while a level-ten complex sentiment analysis task may require calling multiple highly trained sentiment analysis models. When using the target task model to process tasks corresponding to prompt words, the model will execute the task according to the recognized intent and provide an appropriate output format or result granularity based on the complexity, thereby efficiently meeting user needs.

[0064] This invention translates user-input prompts in the original language type into prompts in the target language type, wherein the number of tokens for the original language type prompts is greater than the number of tokens for the target language type prompts. The target language type prompts are then compressed to obtain compressed prompts. Intent recognition and complexity recognition are performed on the compressed prompts, and the target task model is invoked based on the intent recognition and complexity recognition results to process the task corresponding to the prompts. This reduces the number of tokens input to the large model, as well as the memory and inference time consumed by the large model, thus reducing the invocation cost while ensuring normal task processing.

[0065] Optionally, before translating the user-input prompt in the original language type into the prompt in the target language type, the method further includes: detecting the token count corresponding to the prompt in the original language type, and determining the target language type based on the detection result. Translating the user-input prompt in the original language type into the prompt in the target language type includes: calling the target translation service interface based on the original language type and the target language type, and using the target translation service interface to translate the prompt in the original language type into the prompt in the target language type.

[0066] Before translating the user-input prompts in the original language type into prompts in the target language type, a translation strategy can be determined by detecting the token count of the prompts in the original language type. Based on the detection results, the optimal target language type is selected; for example, if the token count of the prompts in the original language type is high and the token count decreases significantly after translation into a certain language, that language is chosen as the target language type. Specifically, based on rule-based and statistical analysis methods, a built-in token detector counts the token count of the prompts in the original language type and combines this with the compression rate of the same content in different languages ​​to determine suitable target language types (such as English or Spanish) as translation targets. Then, a predefined translation service interface is called to translate the original prompts into the target language. In addition, a multilingual evaluation strategy based on a machine learning model is employed. By training a multilingual token optimization model, the token distribution in different target languages ​​is predicted after inputting prompts in the original language type, and the target language type with the optimal token count is selected for translation. The translation conversion of the prompts is completed using a high-performance translation interface.

[0067] Optionally, the prompt words in the target language type are subjected to data compression processing to obtain compressed prompt words, including: identifying redundant information in the prompt words in the target language type, deleting redundant information, and obtaining compressed prompt words; or, the prompt words in the target language type are input into a pre-trained compression model, and the compressed prompt words are obtained using the compression model.

[0068] By employing grammatical parsing and keyword extraction algorithms, repetitive phrases, meaningless filler words, and redundant descriptive content in prompt words are identified. For example, the sentence "Please provide a detailed summary of the textbelow in a concise manner" can be compressed to "Summarize the text below" by removing "Please" and lengthy modifiers. This method is simple and efficient, suitable for structured or templated prompt word scenarios, directly reducing the number of tokens while maintaining semantic clarity. Prompt words of the target language type are input into a neural network compression model (such as a text summarization model based on the Transformer architecture). This model automatically generates more compact compressed prompt words through semantic understanding and importance ranking. For example, "Explain in detail the working principles of this algorithm" can be compressed to "Explain algorithm principles." This method is suitable for compressing complex prompt words, achieving high conciseness while maintaining semantic integrity. This invention reduces the number of tokens for prompt words, optimizes downstream task processing efficiency, reduces context analysis costs, and decreases model inference memory usage and inference time.

[0069] Optionally, the compressed prompt words are subjected to intent recognition, including: extracting intent information from the compressed prompt words; matching the intent information with predefined intent categories to obtain intent recognition results; or inputting the intent information into a pre-trained intent recognition model to generate intent recognition results using the intent recognition model.

[0070] Compression-processed prompts can be used for intent recognition through keyword extraction and pattern matching techniques to identify core verbs or semantic phrases. For example, for the prompt "Summarize the following text concisely," "Summarize" and "text" can be extracted as intent information and matched with predefined intent categories (such as "summarization generation") to obtain a clear intent category. This method is simpler and more efficient, suitable for scenarios with clear prompt structures and limited categories. Alternatively, a pre-trained intent recognition model can be used. The prompts are input into the model, which, trained on large amounts of multi-domain data, can automatically understand semantic relationships and generate intent categories. For example, the prompt "Provide a detailed analysis of this dataset" can be identified as a "data analysis" intent after model processing. This method has higher recognition accuracy for complex prompts and is suitable for open scenarios and diverse tasks. Another approach is to utilize a context-based self-attention mechanism for intent recognition. The prompts are input into a deep learning model with an attention mechanism, and key information is extracted and matched with intent categories through weighted analysis of the importance of different parts of the prompts. By extracting explicit intent information, this invention can efficiently match the optimal subsequent processing model, thereby improving the accuracy and efficiency of task processing.

[0071] Optionally, complexity identification is performed on the compressed prompt words, including: determining a complexity index based on the compressed prompt words; wherein the complexity index includes the number of tokens and the task type; and matching the complexity index with a pre-established complexity evaluation rule to obtain a complexity identification result.

[0072] Complexity identification of compressed prompts can be performed based on metrics such as token count and task type. By counting tokens on the compressed prompts and considering the task type (e.g., text generation, translation, question answering), their complexity can be determined. Prompts with higher token counts typically involve more information and more complex processing logic, while certain task types, such as natural language understanding, may require more computational resources for model processing. By matching these complexity metrics with predefined complexity evaluation rules, the processing difficulty of a task can be quickly determined, and appropriate computational resources or models can be allocated accordingly. Alternatively, a pre-trained complexity evaluation model can be used, taking the compressed prompts as input. The model comprehensively analyzes their syntactic structure, semantic complexity, and task requirements, outputting a complexity score. This score reflects the multi-layered information complexity of the prompts, helping the system dynamically select suitable processing paths and models. Furthermore, complexity can be identified through a domain-knowledge-based rule system. By combining a domain knowledge base and semantic graph, prompt words are compared with relevant domain knowledge to identify the included technical terms, contextual relationships, and expected processing difficulty, thereby assessing the task's complexity. This method allows for customized complexity assessments based on domain-specific needs. By effectively identifying task complexity, this invention provides precise guidance for system resource allocation, model selection, and task processing strategies, improving model invocation efficiency and reducing computational resource waste.

[0073] Optionally, the method further includes: recording the processing results of the target task model based on a pre-configured feedback mechanism, and adjusting the compression parameters corresponding to the data compression based on the processing results, so as to perform data compression based on the adjusted compression parameters.

[0074] In this embodiment, data compression parameters are continuously adjusted based on a feedback mechanism to optimize compression effectiveness and task processing performance, thereby improving overall system efficiency. Specifically, the processing results of the target task model are recorded through manual evaluation and expert feedback mechanisms. After the target task model completes the task, the feedback mechanism records the model's processing results and the corresponding task execution effect, which are then evaluated by humans or experts to determine whether the compressed prompts achieve the expected results. Based on the expert feedback, compression parameters (such as compression ratio, compression method, etc.) are adjusted, and data compression is performed again based on the adjusted compression parameters. Feedback can also be provided through an automated evaluation system and a real-time monitoring mechanism. The output results of the target task model can be automatically compared with preset task success standards, and machine learning algorithms are used to analyze the accuracy, efficiency, and other indicators of the model's output. If the feedback results show that the task processing effect does not meet expectations, compression parameters, such as compression ratio and word replacement strategies, can be automatically adjusted, and data compression processing can be performed again. This enables rapid feedback and automatic adjustment, greatly improving response speed and adaptability.

[0075] The embodiments of the present invention adjust data compression parameters through a continuous feedback mechanism, which can continuously optimize the processing flow and improve data compression efficiency. The automation and real-time feedback mechanism can enhance flexibility and intelligence, and avoid delays and inconsistencies caused by manual intervention.

[0076] Optionally, it also includes: recording the processing results of the target task model based on a pre-configured feedback mechanism, and adjusting the model routing rules corresponding to the target task model according to the processing results, so as to perform task processing based on the adjusted model routing rules.

[0077] Model routing rules are a mechanism that intelligently selects the most suitable model or processing path for the current task from among multiple models or algorithms. Its purpose is to optimize the allocation of computing resources in multi-task processing scenarios and select the optimal model for processing based on the characteristics of the task. Specifically, model routing rules dynamically determine how to allocate tasks to different models by analyzing factors such as input prompts, task type, and data complexity. In the initial stage, manual checking and comparison of effects can help the system identify the advantages and disadvantages of different models and adjust the model routing rules based on experimental results. Human feedback can comprehensively evaluate multiple aspects such as task execution speed, output quality, and computing resource consumption. By continuously adjusting the routing rules, it can ensure that different types of tasks are assigned to the most suitable models, thereby improving the overall system efficiency and accuracy. As the system matures, a complete evaluation system can be built by relying on large model evaluation and automation mechanisms to reduce human intervention. Large model evaluation can automatically learn and optimize model routing rules based on real-time data streams, model output, and feedback. By monitoring and analyzing the performance of tasks (such as model response time and accuracy), the routing rules and model parameters can be autonomously adjusted to adapt to the needs of different tasks. Through the optimization of the above two stages, the model routing rules can continuously adjust themselves to dynamically select the most suitable model and path, enabling tasks to be completed efficiently and accurately, reducing the waste of computing resources and improving processing efficiency.

[0078] Figure 2 This is a schematic diagram illustrating the main flow of a model invocation method according to a preferred embodiment of the present invention. Figure 2 As shown, the embodiments of the present invention mainly include four parts: a translator, a compressor, a model router, and a feedback mechanism. When using large models, prompt words are generally set, such as the prompt words for a certain process in a health assistant, where the total number of tokens for the prompt words in this business process is 1574.

[0079] First, in the translator section, the Chinese prompt or input content is translated into English by calling the translation API. After translation, the number of tokens after translation is 1119, which is 455 tokens less than the original number, a saving of 28.9%. By translating into English, the length of the prompt is reduced, thereby reducing the computing resources and costs required to process this content.

[0080] Then, in the compressor section, the translated prompts are input into the compressor to obtain compressed prompts. The number of tokens in the compressed prompts is 931, a reduction of 40.8%. Data compression can utilize the Hugging Face Model Compression (HCMC) model, which proposes a selective context approach. By identifying and removing redundant information, it makes the content input to the LLM (Large Language Model) more compact. Experimental data shows that it reduces contextual costs by 50%, reduces model inference memory usage by 36%, and reduces inference time by 32%. For example, in a dialogue, A: "Did you go to the hospital today?"; B: "Yes, I went to the hospital today." Here, "I went to the hospital today" is redundant information. Removing information that does not affect contextual transmission is necessary because the LLM model has already learned this knowledge. Even with the removal of this redundant information, the large model can still understand and generate the correct answer in the current text environment.

[0081] In the model router section, the compressed prompts are input into the model router, which performs intent recognition and complexity recognition on the prompts. Then, based on the intent and complexity recognition results, the model is assigned a task. This embodiment sets dynamically adjustable rules and mappings for intent, complexity, and model price, aiming to use appropriate models to handle the current task and save the cost of using expensive models for simple tasks. For example, if the complexity is divided into 1-10 levels, and the model identifies the current task's complexity as level 10, then the task is assigned to a more sophisticated model (such as GPT) for processing.

[0082] In addition, a feedback mechanism is set in the compressor and model router to report and record the flowing data. In the early stage, the effect is checked and compared manually to adjust the model compression parameters and model routing rules to the optimal state. In the later stage, a complete evaluation mechanism is built to automatically adjust the parameters by relying on large model evaluation.

[0083] Experiments show that the compressed token count was reduced by 931 from the original 1574, a reduction of 40.8%, while maintaining almost the same data quality. This embodiment reduces the calling cost of the large model for the internet medical and health assistant by reducing the number of tokens input to the large model, as well as reducing the memory usage and inference time of the large model's inference, without significantly impacting the accuracy of the generated content. This approach reduces costs while ensuring normal business operations.

[0084] According to another embodiment of the present invention, a method for processing medical consultation tasks is provided.

[0085] Figure 3 This is a schematic diagram of the main flow of a medical consultation task processing method according to an embodiment of the present invention; as shown below. Figure 3 As shown, the medical consultation task processing method according to an embodiment of the present invention mainly includes the following steps S301 to S303.

[0086] Step S301: Determine the medical consultation information corresponding to the task.

[0087] Step S302: Invoke the pre-trained medical and health big data model based on medical consultation information.

[0088] The large-scale medical and health model can be implemented through the embodiments of the present invention. Figure 1 and Figure 2 The method call obtained from the corresponding implementation method.

[0089] Step S303: Use the medical and health big data model to generate response information corresponding to the medical consultation information, and use the response information as the processing result of the task.

[0090] Tasks can be health-related questions or requests from users. In practice, tasks may manifest as users asking about symptoms, requesting medication advice, seeking disease diagnoses, or requesting other medical consultations. For each user's request, the first step is to determine the corresponding medical consultation information based on the user's input. Medical consultation information refers to specific health information related to the user's question or request, which may include the user's described symptoms, medical history, medication usage, lifestyle habits, etc. Specifically, semantic analysis, keyword extraction, and contextual understanding can be performed on the user's input health questions. By matching this information with historical health data and a pre-set health knowledge base, key information within the task can be automatically identified and extracted.

[0091] After obtaining medical consultation information, a pre-trained medical and health big data model is invoked to generate corresponding response information. This model is a deep learning model trained on a large amount of medical data, health information, and clinical practice experience. Trained on a massive medical dataset, it understands the relationship between medical terminology, symptoms, and diseases, and generates personalized medical advice or answers by combining multiple factors. This big data model not only understands the question itself but also provides more accurate health advice based on the input medical consultation information. Invoking the medical and health big data model based on the medical consultation information involves converting the user's input into a format that the model can understand, such as language standardization, prompt word optimization, or data preprocessing. The processed medical consultation information is then passed to the big data model through the model interface. The big data model analyzes this information, combining its internal knowledge base and reasoning capabilities to generate an accurate response. The generated response information can include symptom analysis, disease suggestions, treatment plans, drug recommendations, etc., specifically tailored to the user's input.

[0092] The generated response information is returned to the user as the result of the task. This response information must not only conform to medical standards but also adapt to the personalized needs of different users, taking into account background information such as age, gender, and medical history. Through this overall process, healthcare tasks can be processed efficiently and intelligently, providing users with accurate and real-time medical consultation services, thereby significantly improving the quality and efficiency of healthcare services.

[0093] Furthermore, in the healthcare field, task processing methods are not limited to medical consultation but also include a variety of other task processing applications. For example, in drug recommendation and management tasks, based on a patient's medical history, drug allergy records, and current symptoms, the system can generate personalized drug recommendation plans to ensure medication safety and improve efficacy. It can also automatically check drug interactions and side effects through connections to drug databases, helping doctors or patients make rational drug choices.

[0094] In the smart home field, task processing methods can also involve device control, environmental regulation, and energy efficiency optimization. Users input commands through voice assistants or mobile applications, and the system translates these commands into device control tasks, such as adjusting the temperature, turning on lights, and controlling security systems. Task processing methods not only involve recognizing user needs but also making intelligent decisions based on device status and environmental conditions to achieve optimal operational results.

[0095] According to another embodiment of the present invention, a model invocation device is provided.

[0096] Figure 4 This is a schematic diagram of the main modules of a model invocation device according to an embodiment of the present invention. Figure 4As shown, the model invocation device 400 includes:

[0097] Translation module 401 is used to translate the prompt words in the original language type input by the user into prompt words in the target language type; wherein, the number of tokens of the prompt words in the original language type is greater than the number of tokens of the prompt words in the target language type.

[0098] Compression module 402 is used to perform data compression processing on the prompt words of the target language type to obtain compressed prompt words;

[0099] Module 403 is invoked to perform intent recognition and complexity recognition on the compressed prompt words. Based on the intent recognition results and complexity recognition results, the target task model is invoked to process the task corresponding to the prompt words.

[0100] Optionally, the calling device 400 further includes a detection module, which is used for:

[0101] Detect the number of tokens corresponding to the prompt words of the original language type, and determine the target language type based on the detection results;

[0102] Translation module 401 is also used for:

[0103] The target translation service interface is called based on the original language type and the target language type, and the prompt words in the original language type are translated into prompt words in the target language type using the target translation service interface.

[0104] Optionally, the compression module 402 is also used for:

[0105] Redundant information in the prompts of the target language type is identified, and the redundant information is removed to obtain the compressed prompts; or, the prompts of the target language type are input into a pre-trained compression model, and the compressed prompts are obtained using the compression model.

[0106] Optionally, module 403 is also used to:

[0107] Extract intent information from compressed prompts;

[0108] The intent information is matched with predefined intent categories to obtain intent recognition results; or the intent information is input into a pre-trained intent recognition model to generate intent recognition results.

[0109] Optionally, module 403 is also used to:

[0110] The complexity index is determined based on the compressed prompt words; the complexity index includes the number of tokens and the task type.

[0111] The complexity index is matched with pre-established complexity evaluation rules to obtain complexity identification results.

[0112] Optionally, the calling device 400 further includes a feedback module, which is used for:

[0113] The processing results of the target task model are recorded based on a pre-configured feedback mechanism, and the compression parameters corresponding to data compression are adjusted according to the processing results, so as to perform data compression based on the adjusted compression parameters.

[0114] It should be noted that the specific implementation details of the model invocation device of the present invention have been described in detail in the above model invocation method, so the content will not be repeated here.

[0115] According to another embodiment of the present invention, a medical consultation task processing device is provided.

[0116] Figure 5 This is a schematic diagram of the main modules of a medical consultation task processing device according to an embodiment of the present invention, such as... Figure 5 As shown, a medical consultation task processing device 500 includes:

[0117] Module 501 is used to determine the medical consultation information corresponding to the task.

[0118] The retrieval module 502 is used to retrieve a pre-trained medical and health large-scale model based on medical consultation information; wherein, the medical and health large-scale model is obtained through the embodiments of the present invention. Figure 1 and Figure 2 Obtained by any of the corresponding method calls;

[0119] The generation module 503 is used to generate response information corresponding to medical consultation information using a large medical and health model, and to use the response information as the result of the task processing.

[0120] It should be noted that the specific implementation details of the medical consultation task processing device in this embodiment of the invention have been described in detail in the above medical consultation task processing method, so the details will not be repeated here.

[0121] According to another embodiment of the present invention, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the model invocation method and / or medical consultation task processing method of the present invention.

[0122] Figure 6 An exemplary system architecture 600 is shown that can be applied to the model invocation method or model invocation apparatus of embodiments of the present invention.

[0123] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0124] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0125] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0126] Server 605 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 601, 602, and 603 (for example only). The backend management server can analyze and process data such as received model call requests, and feed back the processing results (such as the target task model - for example only) to the terminal devices.

[0127] It should be noted that the model invocation method provided in this embodiment of the invention is generally run by server 405, and correspondingly, the model invocation device is generally set in server 605.

[0128] It should be noted that the medical consultation task processing method provided in this embodiment of the invention is generally run by server 605, and correspondingly, the medical consultation task processing device is generally set in server 605.

[0129] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0130] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing a terminal device of the present invention. Figure 7 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0131] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0132] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0133] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is run by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.

[0134] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more operable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually operate substantially in parallel, and they may sometimes operate in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0136] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor may include a translation module, a compression module, and a calling module. The names of these modules do not necessarily limit the module itself; for example, a translation module may be described as "a module for translating prompts in the original language type input by the user into prompts in the target language type." Alternatively, a processor may include a determining module, a calling module, and a generating module, where the names of these modules do not necessarily limit the module itself; for example, a determining module may be described as "a module for determining medical consultation information corresponding to a task."

[0137] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: translating prompts of a user-inputted original language type into prompts of a target language type; wherein the token count of the original language type prompts is greater than the token count of the target language type prompts; performing data compression processing on the target language type prompts to obtain compressed prompts; performing intent recognition and complexity recognition on the compressed prompts; and invoking a target task model based on the intent recognition results and complexity recognition results to process the task corresponding to the prompts using the target task model. Alternatively, the device implements the following method: determining medical consultation information corresponding to the task; invoking a pre-trained medical and health big model based on the medical consultation information; wherein the medical and health big model is obtained by invoking any of the methods in the first aspect of the present invention; generating response information corresponding to the medical consultation information using the medical and health big model; and using the response information as the processing result of the task.

[0138] According to the technical solution of the embodiments of the present invention, the following advantages or beneficial effects are achieved: The prompt words in the original language type input by the user are translated into prompt words in the target language type; wherein the number of tokens for the prompt words in the original language type is greater than the number of tokens for the prompt words in the target language type; the prompt words in the target language type are subjected to data compression processing to obtain compressed prompt words; the compressed prompt words are subjected to intent recognition and complexity recognition, and the target task model is called based on the intent recognition results and complexity recognition results to process the task corresponding to the prompt words; thereby reducing the number of tokens input to the large model, as well as reducing the memory and inference time occupied by the large model, and reducing the calling cost while ensuring normal task processing. Furthermore, by determining the medical consultation information corresponding to the task; calling a pre-trained medical and health large model based on the medical consultation information; wherein the medical and health large model is obtained by calling any of the methods in the first aspect of the embodiments of the present invention; generating response information corresponding to the medical consultation information using the medical and health large model, and using the response information as the task processing result; thereby reducing task processing cost and improving task processing efficiency.

[0139] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

[0140] It should be noted that the acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

Claims

1. A model invocation method, characterized in that, include: Translate the prompt words in the original language type input by the user into prompt words in the target language type; wherein the number of tokens for the prompt words in the original language type is greater than the number of tokens for the prompt words in the target language type. The prompt words of the target language type are subjected to data compression processing to obtain compressed prompt words; The compressed prompt words are subjected to intent recognition and complexity recognition. Based on the intent recognition results and complexity recognition results, the target task model is invoked to process the task corresponding to the prompt words.

2. The method according to claim 1, characterized in that, Before translating the user-input prompts in the original language type into prompts in the target language type, the process also includes: The number of tokens corresponding to the prompt words of the original language type is detected, and the target language type is determined based on the detection results; Translate the prompts in the user's original language type into prompts in the target language type, including: Based on the original language type and the target language type, the target translation service interface is invoked, and the prompt words of the original language type are translated into prompt words of the target language type using the target translation service interface.

3. The method according to claim 1, characterized in that, The prompt words of the target language type are subjected to data compression processing to obtain compressed prompt words, including: Redundant information in the prompt words of the target language type is identified, and the redundant information is deleted to obtain compressed prompt words; or, the prompt words of the target language type are input into a pre-trained compression model, and the compressed prompt words are obtained using the compression model.

4. The method according to claim 1, characterized in that, The compressed prompt words are subjected to intent recognition, including: Extract the intent information from the compressed prompts; The intent information is matched with a predefined intent category to obtain an intent recognition result; or the intent information is input into a pre-trained intent recognition model to generate an intent recognition result using the intent recognition model.

5. The method according to claim 1, characterized in that, The complexity of the compressed prompt words is determined, including: The complexity index is determined based on the compressed prompt words; wherein, the complexity index includes the number of tokens and the task type; The complexity index is matched with pre-established complexity evaluation rules to obtain complexity identification results.

6. The method according to claim 1, characterized in that, The method further includes: The processing results of the target task model are recorded based on a pre-configured feedback mechanism, and the compression parameters corresponding to data compression are adjusted according to the processing results, so as to perform data compression based on the adjusted compression parameters.

7. A method for processing medical consultation tasks, characterized in that, include: Determine the medical consultation information corresponding to the task; The medical consultation information is used to invoke a pre-trained medical and health model; wherein the medical and health model is obtained by invoking the method described in any one of claims 1 to 6. The medical and health big data model is used to generate response information corresponding to the medical consultation information, and the response information is used as the processing result of the task.

8. A model recall device, characterized in that, include: A translation module is used to translate prompts in the original language type input by the user into prompts in the target language type; wherein the number of tokens for the prompts in the original language type is greater than the number of tokens for the prompts in the target language type. The compression module is used to perform data compression processing on the prompt words of the target language type to obtain compressed prompt words; The calling module is used to perform intent recognition and complexity recognition on the compressed prompt words, and call the target task model based on the intent recognition results and complexity recognition results, so as to use the target task model to process the task corresponding to the prompt words.

9. A medical consultation task processing device, characterized in that, include: The determination module is used to determine the medical consultation information corresponding to the task; The retrieval module is used to invoke a pre-trained medical and health big data model based on the medical consultation information; wherein the medical and health big data model is obtained by invoking the method described in any one of claims 1 to 6; The generation module is used to generate response information corresponding to the medical consultation information using the medical and health big data model, and to use the response information as the processing result of the task.

10. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.