A medical service interface calling method based on large language model

By using large language models in the medical business system to determine and call the target medical service interface, the problem of unable to efficiently call the medical service interface in existing technology, and realize the efficient compatibility and stability of the medical business system service interface. Reduced maintenance costs and improved the degree of automation and efficiency.

CN119149137BActive Publication Date: 2025-01-24SICHUAN WEINING SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411640450.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-01-24
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

The prior art cannot directly call medical service-related interfaces, resulting in users being unable to process medical data interactions in real time when using large language models to conduct medical Q&A, and being unable to achieve efficient calls to multiple medical service interfaces.

Method used

By obtaining the natural language processing text input from the interface of the preset medical business system, using the preset large language model to determine the target service interface from the service interface database, obtaining the parameter definition information of the interface, performing parameter conversion, generating target request parameters, and calling Target service interface to get results.

Benefits of technology

The efficient calling of the service interface in the preset medical business system has been realized, the compatibility and stability of the medical service interface is improved, the system maintenance costs are reduced, and the degree of automation and call efficiency of the medical business system are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149137B_ABST
    Figure CN119149137B_ABST
Patent Text Reader

Abstract

The present invention provides a medical service interface calling method based on a large language model, which relates to the field of medical information technology, wherein the method comprises: obtaining a natural language processing text inputted in an interface of a preset medical business system, and using a preset large language model to determine a target service interface matching the natural language processing text from a service interface database in the preset medical business system. Obtain parameter definition information of the target service interface from a definition file of the target service interface, and perform parameter conversion on the natural language processing text according to the parameter definition information to obtain a target request parameter of the target service interface. According to the target request parameter, call the target service interface to obtain a call result of the target service interface, and generate a target processing result corresponding to the natural language processing text according to the call result. The present invention determines the call target service interface according to the input natural language processing text, thereby improving the calling efficiency of the service interface in the service interface database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical information technology, and in particular to a medical service interface calling method based on a large language model. Background Art

[0002] With the continuous development of artificial intelligence and natural language processing technology, large language models have demonstrated powerful capabilities in many fields, especially in corpus-based question answering, where large language models can understand and generate natural language processing text. Therefore, large language models have been widely used in tasks such as chatbots, text generation, and language translation.

[0003] At present, by collecting and organizing a large number of question-answer pairs or related text data as training corpus, the large language model is fine-tuned through the training results of the training corpus to improve the large language model's question-answering ability in specific fields. Then the trained large language model is integrated into the question-answering system through an interface. When asking questions, the questions are converted into a format that the model can understand and input into the model to obtain answers.

[0004] However, when using large language models to conduct question-and-answer sessions in the medical field, it is impossible to directly call medical service-related interfaces, which makes it impossible for users to handle medical data interaction tasks in real time when using large language models, and it is impossible to call multiple medical service interfaces, resulting in low efficiency in users' calls to medical service interfaces. Summary of the invention

[0005] The purpose of the present invention is to provide a medical service interface calling method based on a large language model to address the deficiencies in the above-mentioned prior art, determine the target service interface to be called according to the input natural language processing text, and improve the efficiency of calling the service interface in the preset medical business system.

[0006] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0007] In a first aspect, an embodiment of the present invention provides a medical service interface calling method based on a large language model, the method comprising:

[0008] Obtaining natural language processing text input from an interface of a preset medical business system;

[0009] According to the natural language processing text, a preset large language model is used to determine a target service interface matching the natural language processing text from a service interface database in the preset medical service system; the service interface database includes: interfaces of each service in the preset medical service system;

[0010] Acquire parameter definition information of the target service interface from a definition file of the target service interface;

[0011] According to the parameter definition information, the natural language processing text is parameterized to obtain target request parameters of the target service interface;

[0012] Calling the target service interface according to the target request parameters to obtain a calling result of the target service interface;

[0013] According to the calling result, a target processing result corresponding to the natural language processing text is generated.

[0014] Optionally, the step of using a preset large language model according to the natural language processing text to determine a target service interface matching the natural language processing text from a service interface database in the preset medical service system includes:

[0015] Using the preset large language model, performing word segmentation processing on the natural language processing text to obtain target variable parameters;

[0016] The target service interface is determined from the service interface database according to the target variable parameter.

[0017] Optionally, determining the target service interface from the service interface database according to the target variable parameter includes:

[0018] Obtaining a definition file of an interface of each service in the service interface database, wherein the definition file of the interface of each service includes: interface title information of each service, interface function description information of each service, and interface application information of each service;

[0019] Determine the first matching parameter of each service according to the target variable parameter and the interface title information of each service;

[0020] Determining second matching parameters of each service according to the target variable parameter and the interface function description information of each service;

[0021] Determine a third matching parameter of each service according to the target variable parameter and the interface application information of each service;

[0022] Weighting the first matching parameter, the second matching parameter, and the third matching parameter to obtain target matching parameters for each service;

[0023] According to the target matching parameters of each service, an interface with the highest matching parameter is determined as the target service interface.

[0024] Optionally, the determining, according to the target matching parameters of the respective services, an interface with the highest matching parameter as the target service interface includes:

[0025] If the highest matching parameter is greater than or equal to a preset matching threshold, determining the interface with the highest matching parameter as the target service interface;

[0026] If the highest matching parameter is less than a preset matching threshold, generating a matching prompt word according to the natural language processing text, the interface title information of each service, the interface function description information of each service, and the interface application information of each service;

[0027] According to the matching prompt word, the preset large language model is adopted to determine the target service interface from the interfaces of the various services.

[0028] Optionally, the parameter definition information of the target service interface includes: information of request parameters and parameter format examples of the request parameters; and performing parameter conversion on the natural language processing text according to the parameter definition information to obtain target request parameters of the target service interface includes:

[0029] Extracting parameters from the natural language processing text according to the information of the request parameters to obtain a first parameter;

[0030] Determine whether the request parameter is extracted according to the first parameter and information of the request parameter;

[0031] If the request parameter has been extracted, the parameter format example is used to perform format conversion on the first parameter to obtain the target request parameter.

[0032] Optionally, performing parameter conversion on the natural language processing text according to the parameter definition information to obtain the target request parameter of the target service interface further includes:

[0033] If the request parameters have not been extracted, obtain the business context information of the interface;

[0034] According to the information of the request parameter, continue to extract parameters from the business context information to obtain a second parameter;

[0035] The parameter format example is adopted to perform format conversion on the first parameter and the second parameter to obtain the target request parameter.

[0036] Optionally, calling the target service interface according to the target request parameter to obtain a calling result of the target service interface includes:

[0037] Generate a call prompt word according to the target request parameter, the information of the target service interface and the historical service execution result of the business service;

[0038] According to the call prompt word, the preset large language model is adopted to call the target service interface to obtain the execution result of the business service corresponding to the target service interface.

[0039] Optionally, generating a target processing result corresponding to the natural language processing text according to the calling result includes:

[0040] Parsing the call result to determine the execution result of the business service corresponding to the target service interface and content description information of the execution result;

[0041] Generate a return prompt word according to the execution result and the content description information of the execution result;

[0042] According to the returned prompt word, the preset large language model is adopted to generate the target processing result.

[0043] Optionally, the parsing of the call result to determine the execution result of the business service corresponding to the target service interface and content description information of the execution result includes:

[0044] Acquire a target parsing rule for the target service interface from a preset interface parsing rule base, wherein the preset interface parsing rule base stores parsing rules for the interfaces of the respective services;

[0045] The target parsing rule is used to parse the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0046] Optionally, the adopting the target parsing rule to parse the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result includes:

[0047] If the target parsing rule is a list parsing rule, the target parsing rule is adopted to parse the list data in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result;

[0048] Alternatively, if the target parsing rule is a card parsing rule, the target parsing rule is used to parse multiple data objects in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result;

[0049] Alternatively, if the target parsing rule is a business parsing rule, the business parsing rule is used to parse the medical business terms in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0050] In a second aspect, another embodiment of the present invention provides a medical service interface calling device based on a large language model, the device comprising:

[0051] A first acquisition module is used to acquire a natural language processing text inputted into an interface of a preset medical service system;

[0052] A selection module is used to determine a target service interface matching the natural language processing text from a service interface database in the preset medical service system according to the natural language processing text and using a preset large language model; the service interface database includes: interfaces of various services in the preset medical service system;

[0053] A second acquisition module, used to acquire parameter definition information of the target service interface from a definition file of the target service interface;

[0054] An input parameter conversion module, used to perform parameter conversion on the natural language processing text according to the parameter definition information to obtain the target request parameters of the target service interface;

[0055] A calling module, used to call the target service interface according to the target request parameters, and obtain a calling result of the target service interface;

[0056] The parsing module is used to generate a target processing result corresponding to the natural language processing text according to the calling result.

[0057] In the third aspect, another embodiment of the present invention provides a computer device, comprising: a processor and a memory, the memory storing machine-readable instructions executable by the processor, and when the computer device is running, the processor communicates with the memory, and the processor executes the machine-readable instructions to perform the steps of the medical service interface calling method based on a large language model as described in any of the first aspects above.

[0058] In a fourth aspect, another embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the medical service interface calling method based on a large language model as described in any of the first aspects above are executed.

[0059] The beneficial effects of the present invention are:

[0060] The present invention provides a medical service interface calling method based on a large language model, which obtains a natural language processing text inputted in an interface of a preset medical business system, and according to the natural language processing text, uses a preset large language model to determine a target service interface matching the natural language processing text from a service interface database in the preset medical business system, obtains parameter definition information of the target interface from a definition file of the target service interface, performs parameter conversion on the natural language processing text according to the parameter definition information, obtains a target request parameter of the target service interface, and calls the target service interface according to the target request parameter to obtain a calling result. The method enables any input natural language processing text to call the target service interface, improves the compatibility of the service interface in the service interface database of the preset medical business system, and can also realize the calling of the target service interface without modifying the target service interface, thereby improving the stability of calling the target service interface and reducing the maintenance cost of the system. According to the calling result, the target processing result of the natural language processing text is generated, and the effective information in the calling result is extracted, thereby ensuring the accuracy of the obtained target processing result, reducing the difficulty of operation, and improving the automation degree of the medical business system and the efficiency of calling the service interface in the preset medical business system. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0062] Figure 1 A medical service interface calling method based on a large language model provided in an embodiment of the present invention;

[0063] Figure 2 A schematic diagram of a process for determining a target service interface in a first large language model-based medical service interface calling method provided in an embodiment of the present invention;

[0064] Figure 3 A schematic diagram of a process for determining a target service interface in a second method for calling a medical service interface based on a large language model provided in an embodiment of the present invention;

[0065] Figure 4 A schematic diagram of a process for determining a target service interface in a fourth method for calling a medical service interface based on a large language model provided in an embodiment of the present invention;

[0066] Figure 5A schematic diagram of a process for determining target request parameters in a medical service interface calling method based on a large language model provided in an embodiment of the present invention;

[0067] Figure 6 A schematic diagram of a process for determining target request parameters in another medical service interface calling method based on a large language model provided in an embodiment of the present invention;

[0068] Figure 7 A schematic diagram of a process of calling a target service interface in a medical service interface calling method based on a large language model provided in an embodiment of the present invention;

[0069] Figure 8 A process for determining an execution result in a medical service interface calling method based on a large language model provided in an embodiment of the present invention;

[0070] Fig. 9 A process for determining an execution result in another medical service interface calling method based on a large language model provided in an embodiment of the present invention;

[0071] Fig.10 A schematic diagram of the structure of a medical service interface calling device based on a large language model provided by an embodiment of the present invention;

[0072] Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0073] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described in conjunction with the drawings in the embodiment of the present invention. It should be understood that the drawings in the present invention only serve the purpose of illustration and description and are not used to limit the scope of protection of the present invention. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowcharts used in the present invention illustrate the operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, under the guidance of the content of the present invention, those skilled in the art can add one or more other operations to the flowchart, or remove one or more operations from the flowchart.

[0074] In addition, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.

[0075] It should be noted that the term “comprising” will be used in the embodiments of the present invention to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.

[0076] With the continuous development of artificial intelligence and natural language processing technology, in today's technological environment, large language models have demonstrated powerful capabilities in many fields, especially in question-answering based on pre-trained corpus. Large language models can understand and generate natural language processing text. Therefore, large language models have been widely used in tasks such as chatbots, text generation, and language translation. However, in calling medical service interfaces, the potential of large language models has not been fully explored and utilized. Medical service interfaces cannot be directly called based on the input natural language processing text, resulting in relatively limited integration of large language models with actual business systems, making it more difficult to call medical service interfaces in complex business scenarios.

[0077] To this end, the present invention provides a medical service interface calling method based on a large language model. The medical service interface in the present invention communicates through the Hyper Text Transfer Protocol (HTTP) protocol, supports multiple request methods such as obtaining resources (GET), creating resources (POST), updating resources (PUT), and deleting resources (DELETE). Through the above-mentioned request methods and processing medical service interface communications, the code status can be checked and the error status can be processed during the communication process.

[0078] Figure 1 A medical service interface calling method based on a large language model is provided in an embodiment of the present invention, such as Figure 1 As shown, the method includes:

[0079] Step 101: Obtain natural language processing text input into an interface of a preset medical service system.

[0080] Among them, the preset medical business system can be a medical business system such as a hospital medical business system, a rehabilitation center medical business system, a clinic medical business system, etc., and the embodiment of the present invention does not limit this. The interface of the preset medical business system refers to the information system interface used interactively by participants such as patients, doctors, and medical institutions during the medical and health service process. For example, when the preset medical business system is a hospital medical business system, the interface of the preset medical business system can be an inpatient interface, an outpatient interface, and other medical business-related interfaces, and the embodiment of the present invention does not limit this. The natural language processing text can be a natural language processing text related to medical business manually input by medical staff, patients, or patients' families, or it can be a natural language processing text obtained by voice input and input voice recognition, such as medical information query, medical business appointment, medical business system access, etc. The present invention does not limit the content and input method of the natural language processing text.

[0081] Optionally, after obtaining the natural language processing text input in the interface of the preset medical business system, the natural language processing text is standardized to obtain the processed natural language processing text. Specifically, the standardization process may include: removing redundant spaces, converting to lowercase, processing synonyms, etc., which are not limited in the embodiment of the present invention. The consistency of the natural language processing text can be ensured by preprocessing the natural language processing text.

[0082] Step 102: Based on the natural language processing text, a preset large language model is used to determine a target service interface that matches the natural language processing text from a service interface database in a preset medical business system.

[0083] Among them, the service interface database includes: interfaces of various services in the preset medical business system. The number of services in the service interface database is determined according to the preset medical business system, and the service interface database includes all services in the preset medical business system. The input and output of all service interfaces in the preset medical business system can be in any format, and the embodiment of the present invention does not limit this. The various service interfaces in the preset medical business system can be any medical service interface such as a query service interface, an appointment service interface, and an access service interface. The preset large language model is a large language model that has been pre-trained through a large amount of natural language processing text and target service interface.

[0084] Optionally, the natural language processing text is recognized through a preset large language model to obtain the intent of the natural language processing text, and based on the intent of the natural language processing text, the service interface that best matches the intent of the natural language processing text is determined from the service interface database of the preset medical business system as the target service interface.

[0085] Step 103: Obtain parameter definition information of the target service interface from the definition file of the target service interface.

[0086] Among them, the content in the definition file of the target service interface can be defined in a lightweight data exchange format (JavaScript Object Notation, JSON for short) or a format used to express data serialization (YAML Ain't Markup Language, YAML for short). The definition file of the target service interface includes: interface name, interface description, interface request method, interface parameter definition information, request header, request body, return protocol content, return content rendering type and other information, which is not limited in the embodiment of the present invention. The parameter definition information of the target service interface includes: parameter name, parameter type, parameter default value and other information required by the target interface, which is not limited in the embodiment of the present invention.

[0087] Optionally, the definition file of the target service interface is determined according to the name of the target service interface, and the parameter definition information of the target service interface is determined from the definition file of the target interface. The parameter definition information of the target service interface includes: parameter name, parameter type, parameter default value and other information.

[0088] Step 104: Perform parameter conversion on the natural language processing text according to the parameter definition information to obtain target request parameters of the target service interface.

[0089] Optionally, based on information such as parameter name, parameter type and parameter default value in the parameter definition information of the target service interface, the parameters corresponding to the target service interface are determined from the natural language processing text, and then the parameters corresponding to the target service interface in the natural language processing text are converted according to the parameter type and parameter default value of the target service interface to obtain the target request parameters of the target service interface.

[0090] Step 105: Call the target service interface according to the target request parameters to obtain the calling result of the target service interface.

[0091] Optionally, a service interface request is sent using a hypertext transfer protocol library according to target request parameters, a request header and a request body of the target service interface are called, and the call content of the target service interface is obtained.

[0092] Step 106: Generate a target processing result corresponding to the natural language processing text according to the calling result.

[0093] Optionally, the target service interface is not an interface dedicated to the natural language processing text input into the interface of the medical business system. Therefore, the calling result of the target service interface includes some content that is not related to the natural language processing text. It is necessary to determine the content related to the natural language processing text from the calling result based on the natural language processing text, and use the content related to the natural language processing text as the target processing result corresponding to the natural language processing text.

[0094] Optionally, the definition file of the target service interface also includes a return result rendering type, in which a rendering module or a custom rendering template is preset, and the rendering types include lists, tables, cards, and charts. Before generating the target processing corresponding to the natural language processing text, the result corresponding to the generated natural language processing text can also be rendered according to the return result rendering type in the definition file of the target service interface, and a hypertext markup language or lightweight data exchange format string is generated to obtain the target processing result of the list, table, card, or chart type.

[0095] The present invention provides a medical service interface calling method based on a large language model, which obtains a natural language processing text inputted into an interface of a preset medical service system, and according to the natural language processing text, uses a preset large language model to determine a target service interface matching the natural language processing text from a service interface database in the preset medical service system, obtains parameter definition information of the target interface from a definition file of the target service interface, performs parameter conversion on the natural language processing text according to the parameter definition information, obtains a target request parameter of the target service interface, and calls the target service interface according to the target request parameter to obtain a calling result. The target service interface can be called by inputting any natural language processing text, which improves the compatibility of the service interface in the service interface database of the preset medical service system, and can also realize the calling of the target service interface without modifying the parameters of the target service interface, thereby improving the stability of calling the target service interface and reducing the maintenance cost of the system. According to the calling result, a target processing result of the natural language processing text is generated, and effective information in the calling result is extracted, thereby ensuring the accuracy of the obtained target processing result, reducing the difficulty of operation, and improving the automation degree of the medical service system and the efficiency of calling the service interface in the preset medical service system.

[0096] On the basis of the above embodiments, the present invention also provides a process for determining a target service interface in a first medical service interface calling method based on a large language model. Figure 2 A schematic diagram of a process for determining a target service interface in a first medical service interface calling method based on a large language model provided in an embodiment of the present invention, such as Figure 2 As shown above Figure 1In step 102, according to the natural language processing text, a preset large language model is used to determine a target service interface matching the natural language processing text from a service interface database in a preset medical business system, including:

[0097] Step 201: Use a preset large language model to perform word segmentation on the natural language processing text to obtain target variable parameters.

[0098] Optionally, the example is first input into a preset large language model, the output and output content of the preset large language model are determined from the example, and based on the output and output content of the preset large language model in the example, the preset large language model is used to perform word segmentation on the natural language processing text to obtain the target variable parameters.

[0099] For example, the content of the example is "Query: 'View the urine pH value of Zhang San in the last three days'; User target: 'View the patient's urine routine information'; Variable parameters: 'Patient name description: Zhang San', 'Patient bed number description: None', 'Business type description: Urinalysis, urine pH', 'Time description: the last three times'". The request is the natural language processing text entered by the user. The variable parameters include patient name description, patient bed number description, business type description, time description, etc.

[0100] Step 202: Determine the target service interface from the service interface database according to the target variable parameters.

[0101] Optionally, according to the target variable parameter, a service interface matching the target variable parameter is determined from definition files of multiple service interfaces in the service interface data as the target service interface.

[0102] In an embodiment of the present invention, a preset large language model is used to perform word segmentation processing on the natural language processing text to obtain target variable parameters, and the target service interface is determined from the service interface database based on the target variable parameters, thereby improving the speed and accuracy of determining the target service interface, which can be applied to different scenarios and business needs.

[0103] On the basis of the above-mentioned embodiment, the present invention also provides a process of determining a target service interface in a second medical service interface calling method based on a large language model, Figure 3 A schematic diagram of a process for determining a target service interface in a second method for calling a medical service interface based on a large language model provided in an embodiment of the present invention, such as Figure 3 As shown above Figure 2 In step 202, according to the target variable parameter, a target service interface is determined from a service interface database, including:

[0104] Step 301: Obtain the definition file of the interface of each service in the service interface database.

[0105] Among them, the definition file of each service interface includes: interface title information of each service, interface function description information of each service, and interface application information of each service. The title information of each service interface is the unique identifier of each service interface, which is used to quickly locate and identify the interface. The function description information of each service interface is used to describe the function of each service interface. The application information of each service interface describes the application scenario of each service interface in detail. The definition file is a pre-written file used to design and manage service interfaces, and supports the selection of each service interface, parameter conversion, service interface call, result parsing and customized data display. The definition files of different service interfaces are different, and the content of the definition file is determined according to the function and purpose of the service interface.

[0106] Step 302: Determine the first matching parameter of each service according to the target variable parameter and the interface title information of each service.

[0107] Optionally, the target variable parameter is matched with the interface title information of each service by similarity matching algorithm to obtain the first matching parameter of each service. The similarity matching algorithm may be a word frequency-inverse document frequency algorithm, and the matching parameter is determined by calculating the product of the word frequency and the inverse document frequency. The word frequency refers to the number of times the target variable parameter appears in the current document, and the inverse document frequency refers to the rarity of the target variable parameter.

[0108] Step 303: Determine the second matching parameter of each service according to the target variable parameter and the interface function description information of each service.

[0109] Optionally, similarity matching is performed between the target variable parameters and the interface function description information of each service through a similarity matching algorithm to obtain second matching parameters of each service.

[0110] Step 304: Determine the third matching parameter of each service according to the target variable parameter and the interface application information of each service.

[0111] Optionally, similarity matching is performed between the target variable parameters and the interface application information of each service through a similarity matching algorithm to obtain third matching parameters of each service.

[0112] Step 305: Weight the first matching parameter, the second matching parameter, and the third matching parameter to obtain target matching parameters for each service.

[0113] Optionally, the weights of the interface title information of each service, the interface function description information of each service, and the interface application information of each service are different, and the specific weight parameters are determined according to the preset medical business system. The first matching parameter, the second matching parameter, and the third matching parameter are weighted according to the weights of the interface title information of each service, the interface function description information of each service, and the interface application information of each service, respectively, and the weighted first matching parameter, the weighted second matching parameter, and the weighted third matching parameter are summed to obtain the target matching parameter of each service.

[0114] Step 306: According to the target matching parameters of each service, determine the interface with the highest matching parameter as the target service interface.

[0115] Optionally, the target matching parameters of each service are sorted, and the interface with the highest matching parameter is used as the target interface.

[0116] In another possible implementation, the target variable parameters are weighted to obtain weight information of the target variable parameters, and the weight information of the target variable parameters is matched with the interface title information of each service, the interface function description information of each service, and the interface application information of each service to obtain the target matching parameters, and the interface corresponding to the highest target matching parameter is used as the target interface. Specifically, the target variable parameters can be weighted to process the business type description in the target variable parameters, and to reduce the weight of the patient description or the time description to obtain the target matching parameters.

[0117] In the embodiment of the present invention, multiple matching parameters are obtained by matching the target variable parameters with the definition files of the interfaces of each service, and the target matching parameters are weighted to obtain the target matching parameters, thereby obtaining the target service interface according to the target matching parameters. The accuracy of determining the target service interface is improved, thereby providing a more stable and reliable matching result.

[0118] Based on the above embodiment, the present invention also provides a process for determining the target service interface in a third method for calling a medical service interface based on a large language model, as described above. Figure 3 In step 306, according to the target matching parameters of each service, determining the interface with the highest matching parameter as the target service interface includes:

[0119] If the highest matching parameter is greater than or equal to the preset matching threshold, the interface with the highest matching parameter is determined as the target service interface.

[0120] The preset matching threshold is determined according to the matching requirements of the target service interface, or according to the requirements of the preset medical business system, and the embodiment of the present invention does not limit this.

[0121] Optionally, when the highest matching parameter is greater than or equal to a preset matching threshold, that is, the target variable parameter successfully matches the definition file of the target service interface, the interface with the highest matching parameter is determined as the target service interface.

[0122] On the basis of the above-mentioned embodiment, the present invention also provides a fourth process of determining a target service interface in a medical service interface calling method based on a large language model, Figure 4 A schematic diagram of a process for determining a target service interface in a fourth method for calling a medical service interface based on a large language model provided in an embodiment of the present invention, such as Figure 4 As shown above Figure 3 In step 306, according to the target matching parameters of each service, determining the interface with the highest matching parameter as the target service interface includes:

[0123] Step 401: If the highest matching parameter is less than a preset matching threshold, a matching prompt word is generated according to the natural language processing text, the interface title information of each service, the interface function description information of each service, and the interface application information of each service.

[0124] Optionally, when the highest matching parameter is less than a preset matching threshold, that is, the target variable parameter fails to match the definition file of the interface of each service, it is necessary to redefine the target service interface.

[0125] For example, taking three service interfaces as an example, when the natural language processing text is "Please help me query Li Si's blood routine test", the interface function description information of the three service interfaces are "1", "2", "Please help me query Zhang San's medical record" respectively. At this time, the matching prompt words are: My question is 'Please help me query Li Si's blood routine test', and the interface function description information of the service interfaces are "1", "2", "Please help me query Zhang San's medical record" respectively. Please help me choose the most appropriate service interface. The present invention only takes the interface function description information as an example, and the specific generated matching prompt words also need to consider the interface title information and the interface application function information.

[0126] Step 402: According to the matching prompt words, a preset large language model is used to determine the target service interface from the interfaces of various services.

[0127] Optionally, a preset large language model is used to match the natural language processing text with the interface title information of each service, the interface function description information of each service and the interface application information of each service according to the matching prompt word to obtain a target service interface that matches the natural language processing text.

[0128] In the embodiment of the present invention, when the highest matching parameter is less than the preset matching threshold, matching prompt words are generated according to the interface title information of each service in the natural language processing text, the interface function description information of each service, and the interface application information of each service, and the preset large language model is used according to the matching prompt words to determine the target service interface from the interface of each service. The natural language processing text is better understood to ensure that the appropriate target service interface can be matched in different scenarios, and the efficiency and accuracy of matching the target service interface are improved.

[0129] Based on the above embodiment, the parameter definition information of the target service interface includes: information of request parameters and parameter format examples of request parameters. To this end, the present invention provides a process for determining target request parameters in a medical service interface calling method based on a large language model. Figure 5 A flowchart of determining target request parameters in a medical service interface calling method based on a large language model provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown above Figure 1 In step 104, the natural language processing text is converted into parameters according to the parameter definition information to obtain the target request parameters of the target service interface, including:

[0130] Step 501: Extract parameters from the natural language processing text according to the request parameter information to obtain a first parameter.

[0131] The request parameter information specifies the parameters required to call the target service interface, including the request parameter name, request parameter type, parameter default value, parameter format example and other information.

[0132] Optionally, before processing the natural language processing text, it is determined whether it is necessary to perform parameter extraction on the natural language processing text based on the information of the request parameters. If it is necessary to perform variable extraction on the natural language processing text, a first extraction prompt word is generated based on the parameter name in the request parameters of the target service interface and the natural language processing text, and a large language model is used to extract variables from the natural language processing text to obtain the first parameter.

[0133] For example, when the natural language processing text is "Check the urine pH value in Zhang San's urine routine report for the past three days", and the request parameter information indicates that parameter extraction of the natural language processing text is required, the first extraction prompt word generated according to the parameter name in the request parameter of the target service interface and the natural language processing text is "Please provide the patient name, time, report type and report item you need to query", and the first parameter is obtained.

[0134] Step 502: Determine whether the request parameter extraction is complete based on the first parameter and the request parameter information.

[0135] Optionally, when multiple parameters in the first parameter are consistent with parameters in the request parameter information, the request parameter extraction is completed.

[0136] For example, when the variable names in the request parameter information are "name, date, report number, item number", and the first parameter is "Zhang San, last three days, urine routine, urine pH", then the request parameter extraction is completed.

[0137] Step 503: If the request parameters have been extracted, the parameter format example is used to convert the format of the first parameter to obtain the target request parameters.

[0138] The parameter format examples include format conversion and function conversion in the name request parameter.

[0139] For example, the parameter format example is used to convert the format of "Zhang San, recent three days, urine routine, urine pH" in the first parameter. Zhang San is converted into a name, and recent three days, urine routine and urine pH are converted into functions to obtain the target request parameters.

[0140] In an embodiment of the present invention, according to the request parameter information, the natural language processing text is subjected to parameter extraction to obtain the first parameter, and it is determined whether the request parameter extraction is completed according to the information of the first parameter and the request parameter. When the request parameter extraction is completed, the first parameter is formatted using the parameter format example to obtain the target request parameter. It is ensured that the target request parameter is determined according to the first parameter and the parameter format example, and when the input parameter of the target service interface changes, the correct input parameter can also be obtained according to the parameter format example, thereby improving the adaptability of the system, ensuring the stability and reliability of the system, and reducing the system maintenance cost.

[0141] On the basis of the above embodiment, the present invention also provides another process for determining target request parameters in a medical service interface calling method based on a large language model. Figure 6 A flow chart of determining target request parameters in another medical service interface calling method based on a large language model provided by an embodiment of the present invention, such as Figure 6 As shown above Figure 1 In step 104, according to the parameter definition information, the natural language processing text is converted into parameters to obtain the target request parameters of the target service interface, which also includes:

[0142] Step 601: If the request parameters have not been extracted, obtain the business context information of the interface.

[0143] Among them, the interfaces of different preset medical business systems correspond to different context information, and the context information stores context data and variable information related to the query. The context information includes: data structure, data source, and data matching. The data structure is used to define the data structure of the context information, such as patient list, doctor information, etc. The embodiment of the present invention does not limit this. The data source is used to indicate the source of the context information, such as an external database, file system, or real-time data interface, etc. The embodiment of the present invention does not limit this. Data matching is used in the subsequent variable extraction process to match through context information.

[0144] Optionally, when multiple parameters in the first parameter are not completely consistent with the parameters in the request parameter information, it means that the request parameter is not completely extracted, and the business context information of the interface is obtained according to the interface of the preset medical business system.

[0145] For example, when the natural language processing text is "Check the urine pH value in Zhang San's urine routine report for the past three days", and the request parameter information indicates that parameter extraction of the natural language processing text is required, the first extraction prompt word generated according to the parameter name in the request parameter of the target service interface and the natural language processing text is "Please provide the patient name, patient identifier, doctor identifier, hospital identifier, time, report type and report item you need to query", and the first parameter "Zhang San, past three days, urine routine, urine pH value" is obtained. At this time, the request parameter extraction is not completed.

[0146] Step 602: Continue to extract parameters from the business context information according to the request parameter information to obtain a second parameter.

[0147] Optionally, when multiple parameters in the first parameter are not completely consistent with the parameters in the request parameter information, the request parameter extraction is not complete, and other variable information needs to be extracted from the business context information of the current interface. At this time, a second extraction prompt is generated based on the remaining variable extraction information in the request parameter information and the business context information of the current interface. According to the second extraction prompt, parameter extraction is continued from the business context information to obtain the second parameter.

[0148] For example, the second extraction prompt is "Please determine the patient identifier, doctor identifier and hospital identifier from the business context information based on the patient's name". According to the second extraction prompt, parameter extraction is continued from the business context information to obtain the second parameter.

[0149] Step 603: Use the parameter format example to convert the first parameter and the second parameter to obtain the target request parameter.

[0150] In the embodiment of the present invention, when the request parameter extraction is not completed, the business context information of the current interface is obtained, and the parameter extraction is continued from the business context information according to the request parameter information to obtain the second parameter, and the first parameter and the second parameter are formatted using the parameter format example to obtain the target request parameter. When the variable parameter extraction is not completed, the variable parameter can be extracted again to obtain the second parameter, and the accuracy, comprehensiveness and extraction efficiency of the variable parameter extraction can be improved through the powerful natural language understanding ability of the large language model.

[0151] Based on the above embodiments, the present invention also provides a process of calling a target service interface in a medical service interface calling method based on a large language model. Figure 7 A schematic diagram of a process of calling a target service interface in a medical service interface calling method based on a large language model provided in an embodiment of the present invention, such as Figure 7 As shown above Figure 1 In step 105, the target service interface is called according to the target request parameter to obtain the calling result of the target service interface, including:

[0152] Step 701: Generate a call prompt word according to target request parameters, target service interface information, and historical service execution results of the business service.

[0153] The historical service execution result may be the last execution result of the target request parameter, or may be an intermediate parameter of the target request parameter calling the target service interface.

[0154] For example, when the name of the target service interface is a, the target request parameter is b, and the historical service execution result is c, the call prompt word generated is: When calling service interface 'a', please make sure to pass in the correct request parameter 'b'. According to the historical service execution result 'c', the result obtained is "xx".

[0155] Step 702: According to the call prompt word, a preset large language model is used to call the target service interface to obtain the execution result of the business service corresponding to the target service interface.

[0156] Optionally, according to the call prompt word, a preset large language model is used to call the target service interface, and based on the historical service execution data, the execution result of the business service corresponding to the target service interface is obtained, and according to the target request parameters, it is determined whether to store the execution result of the business service corresponding to the target service interface in the context information.

[0157] In an embodiment of the present invention, a call prompt word is generated according to the target request parameters, the information of the target service interface and the historical service execution results of the business service, and based on the call prompt word, a preset large language model is used to call the target service interface to obtain the execution result of the business service corresponding to the target service interface. This can reduce the failure of requests to the target service interface due to parameter errors or format problems, and improve the efficiency of determining the execution results and the accuracy of the execution results.

[0158] Based on the above embodiments, the present invention also provides a process for determining the execution result in a medical service interface calling method based on a large language model. Figure 8 A process for determining an execution result in a medical service interface calling method based on a large language model provided in an embodiment of the present invention, such as Figure 8 As shown above Figure 1 In step 106, a target processing result corresponding to the natural language processing text is generated according to the call result, including:

[0159] Step 801: parse the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0160] The execution result is the original return result of the target service interface, such as the target service interface execution success or the target service interface execution failure; the content description information of the execution result is the description information of the original return result of the target service interface.

[0161] Optionally, the call result is parsed to determine whether the execution result of the business service corresponding to the target service interface is successful or failed. When the execution of the business service corresponding to the target service interface is successful, content description information of the execution result is determined.

[0162] Step 802: Generate a return prompt word according to the execution result and the content description information of the execution result.

[0163] The return prompt word is used to determine the target processing result from the content description information of the execution result according to the execution result.

[0164] Step 803: Generate a target processing result based on the returned prompt word using a preset large language model.

[0165] Optionally, according to the returned prompt word, a preset large language model is used to generate a target processing result according to a parameter format example of the request parameter.

[0166] For example, when the execution result is "execution successful", the content description information of the execution result is "{:'07 / 02', pH:'4.5'}, {Date:'07 / 01', pH:'5.5'}, {Date:'06 / 30', pH:'6.5'}". The returned prompt is "Please determine the pH value of urine in the urine routine report of the past three days based on the content description information of the execution result". The processing result obtained using the preset large language model is "July 2, 2023: pH value is 4.5; July 1, 2023: pH value is 5.5; June 30, 2023: pH value is 6.5".

[0167] In the embodiment of the present invention, the call result is parsed to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result, generate a return prompt word, and generate the target processing result based on the return prompt word using a preset large language model. Automatic parsing of the execution result is achieved, making the obtained information easier to understand, and improving the automation and use efficiency of the medical business system.

[0168] On the basis of the above-mentioned embodiment, the present invention also provides another process for determining the execution result in the medical service interface calling method based on the large language model. Fig. 9 Another process for determining the execution result in a medical service interface calling method based on a large language model provided by an embodiment of the present invention is as follows: Fig. 9 As shown above Figure 8 In step 801, the call result is parsed to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result, including:

[0169] Step 901: Obtain a target resolution rule for a target service interface from a preset interface resolution rule library.

[0170] The preset interface parsing rule library stores parsing rules for the interfaces of various services. Parsing rules are used to define data extraction, data conversion, and data formatting from call results. The target parsing rule can be one or more of a list parsing rule, a card parsing rule, or a business parsing rule, which is not limited in the embodiment of the present invention.

[0171] Optionally, the definition file of the target service interface also includes a return content protocol, which is used to determine the parsing rule of the target service interface. The target parsing rule of the target service interface is obtained from a preset interface parsing rule library according to the return content protocol in the definition file of the target service interface.

[0172] Step 902: parse the call result using the target parsing rule to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0173] Optionally, the target parsing rule is used to parse the call result, so as to determine the content related to the request parameters in the call result, and the execution result and content description information of the execution result are generated according to the content related to the request parameters in the call result.

[0174] In the embodiment of the present invention, the target parsing rule of the target service interface is obtained from the preset interface parsing rule library, and the target parsing rule is used to parse the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result. The accuracy of the execution result of the business service corresponding to the target service interface and the content description information of the execution result is guaranteed, and the speed of determining the content description information of the execution result is improved.

[0175] On the basis of the above embodiment, the present invention further provides a process for parsing execution results in a medical service interface calling method based on a large language model, such as using a target parsing rule in the above step 901 to parse the calling result, determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result, including:

[0176] If the target parsing rule is a list parsing rule, the target parsing rule is used to parse the list data in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0177] The list parsing rule is used to determine the specified field from the list field set of the call result.

[0178] Optionally, when the target parsing rule in the return content protocol of the definition file of the target service interface is a list parsing rule, multiple list data objects in the call result are parsed according to the list parsing rule to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0179] For example, when the target parsing rule is a list parsing rule, the list parsing rule is "data.list.[date, pH]", which means to determine the date and pH from the list data. Parse the data list {data: {list: [{date:'07 / 02', pH:'4.5', red blood cells:'3.1', white blood cells:'12'}, {date:'07 / 01', pH:'5.5', red blood cells:'3.2', white blood cells:'11'}, {date:'06 / 30', pH:'6.5', red blood cells:'3.3', white blood cells:'12'}]}, status: 1} in the call result. The execution result is successful, and the content description information of the execution result is "{Date: '07 / 02', pH: '4.5'}, {Date: '07 / 01', pH: '5.5'}, {Date: '06 / 30', pH: '6.5'}".

[0180] Alternatively, if the target parsing rule is a card parsing rule, the target parsing rule is used to parse multiple data objects in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0181] Among them, the card parsing rule is used to extract specific fields from multiple data objects. When the target service interface needs to extract the card content, some fields in different data objects are needed. At this time, the target parsing rule in the return content protocol of the definition file of the target service interface is the card parsing rule.

[0182] Optionally, when the target parsing rule in the return content protocol of the definition file of the target service interface is a card parsing rule, multiple card data objects in the call result are parsed according to the card parsing rule to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0183] For example, when the target parsing rule is the card parsing rule, the card parsing rule is: card extraction rule = {patient name: 'patient data.name', diagnosis conclusion: 'diagnosis data.conclusion', cost: 'cost data.total cost'}, the interface data of the card data in the call result = {patient data: {number: '1', name: 'Zhang San', age: '30'}, diagnosis data: {conclusion: 'mild cold', suggestion: 'rest more'}, cost data: {registration fee: '20', drug cost: '50', total cost: '70'}} is parsed. The execution result is successful, and the content description information of the execution result is "{name: 'Zhang San'}, {conclusion: 'mild cold'}, {total cost: '70'}".

[0184] Alternatively, if the target parsing rule is a business parsing rule, the business parsing rule is used to parse multiple medical business terminology data objects in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0185] Among them, the business parsing rules are used to parse the call results according to business logic and medical industry terms. For example, when the type is an enumeration value such as 1, 2, 3, etc., it is necessary to map and parse out the actual medical industry terms such as 1 for outpatient, 2 for emergency, and 3 for hospitalization according to the actual business.

[0186] Optionally, when the target parsing rule in the return content protocol of the definition file of the target service interface is a business parsing rule, the medical business terms in the call result are parsed according to the business parsing rule to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0187] For example, when the target parsing rule is a business parsing rule, and the business parsing rule is to extract the patient's name and age, the business data {"patient information": {"name": Zhang San, "age": 45} in the call result is parsed, and the execution result is successful, and the content description information of the execution result is "patient name: Zhang San; age: 45 years old".

[0188] In an embodiment of the present invention, the call result is parsed based on the target parsing rules to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result, thereby ensuring the accuracy of the content description information of the determined execution result, reducing the workload of developers, and improving the degree of automation and utilization efficiency.

[0189] Based on the same inventive concept, the embodiment of the present invention also provides a medical service interface calling device based on a large language model corresponding to the medical service interface calling method based on a large language model. Since the principle of solving the problem by the medical service interface calling device based on a large language model in the embodiment of the present invention is similar to the above-mentioned medical service interface calling method based on a large language model in the embodiment of the present invention, the implementation of the medical service interface calling device based on a large language model can refer to the implementation of the method, and the repeated parts will not be repeated.

[0190] Fig.10 A schematic diagram of a medical service interface calling device based on a large language model provided by an embodiment of the present invention, such as Fig.10 As shown, the device includes: a first acquisition module 1001, a selection module 1002, a second acquisition module 1003, an input parameter conversion module 1004, a calling module 1005 and a parsing module 1006.

[0191] The first acquisition module 1001 is used to acquire a natural language processing text inputted into the interface of a preset medical service system;

[0192] A selection module 1002 is used to determine a target service interface matching the natural language processing text from a service interface database in a preset medical service system according to the natural language processing text and using a preset large language model; the service interface database includes: interfaces of various services in the preset medical service system;

[0193] The second acquisition module 1003 is used to acquire parameter definition information of the target service interface from the definition file of the target service interface;

[0194] An input parameter conversion module 1004 is used to perform parameter conversion on the natural language processing text according to the parameter definition information to obtain the target request parameters of the target service interface;

[0195] The calling module 1005 is used to call the target service interface according to the target request parameters and obtain the calling result of the target service interface;

[0196] The parsing module 1006 is used to generate a target processing result corresponding to the natural language processing text according to the calling result.

[0197] In a possible implementation, the selection module 1002 is specifically configured to: use a preset large language model to perform word segmentation processing on the natural language processing text to obtain a target variable parameter;

[0198] According to the target variable parameters, the target service interface is determined from the service interface database.

[0199] In a possible implementation, the selection module 1002 is specifically used to: obtain a definition file of an interface of each service in a service interface database, wherein the definition file of the interface of each service includes: interface title information of each service, interface function description information of each service, and interface application information of each service;

[0200] Determine the first matching parameter of each service according to the target variable parameter and the interface title information of each service;

[0201] Determine the second matching parameter of each service according to the target variable parameter and the interface function description information of each service;

[0202] Determine the third matching parameter of each service according to the target variable parameter and the interface application information of each service;

[0203] Weighting the first matching parameter, the second matching parameter, and the third matching parameter to obtain target matching parameters for each service;

[0204] According to the target matching parameters of each service, the interface with the highest matching parameter is determined as the target service interface.

[0205] In a possible implementation, the selection module 1002 is specifically configured to: if the highest matching parameter is greater than or equal to a preset matching threshold, determine the interface with the highest matching parameter as the target service interface;

[0206] If the highest matching parameter is less than the preset matching threshold, a matching prompt word is generated according to the natural language processing text, the interface title information of each service, the interface function description information of each service, and the interface application information of each service;

[0207] According to the matching prompt words, the preset large language model is used to determine the target service interface from the interfaces of various services.

[0208] In a possible implementation, the parameter definition information of the target service interface includes: information of the request parameter and an example of the parameter format of the request parameter; the input parameter conversion module 1004 is specifically used to: extract parameters from the natural language processing text according to the information of the request parameter to obtain the first parameter;

[0209] Determine whether the request parameter extraction is complete according to the first parameter and the information of the request parameter;

[0210] If the request parameters have been extracted, the parameter format example is used to convert the format of the first parameter to obtain the target request parameters.

[0211] In a possible implementation, the input parameter conversion module 1004 is specifically used to: if the request parameter extraction is not completed, obtain the business context information of the interface;

[0212] According to the information of the request parameter, continue to extract the parameter from the business context information to obtain the second parameter;

[0213] Using the parameter format example, the first parameter and the second parameter are format converted to obtain the target request parameter.

[0214] In a possible implementation, the calling module 1005 is specifically used to: generate a calling prompt word according to the target request parameters, the information of the target service interface and the historical service execution results of the business service;

[0215] According to the call prompt word, the preset large language model is used to call the target service interface to obtain the execution result of the business service corresponding to the target service interface.

[0216] In a possible implementation, the parsing module 1006 is specifically used to: parse the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result;

[0217] Generate a return prompt word according to the execution result and the content description information of the execution result;

[0218] According to the returned prompt words, the preset large language model is used to generate the target processing result.

[0219] In a possible implementation, the parsing module 1006 is specifically configured to: obtain a target parsing rule for a target service interface from a preset interface parsing rule library, wherein the preset interface parsing rule library stores parsing rules for interfaces of various services;

[0220] The target parsing rules are used to parse the call results to determine the execution results of the business services corresponding to the target service interface and the content description information of the execution results.

[0221] In a possible implementation, the parsing module 1006 is specifically configured to: if the target parsing rule is a list parsing rule, parse the list data in the call result using the target parsing rule to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result;

[0222] Alternatively, if the target parsing rule is a card parsing rule, the target parsing rule is used to parse multiple data objects in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result;

[0223] Alternatively, if the target parsing rule is a business parsing rule, the business parsing rule is used to parse the medical business terms in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

[0224] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0225] The embodiment of the present invention further provides a computer device, Fig.11 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention is shown in FIG. Fig.11 As shown, the computer device includes: a processor 1101, a memory 1102, and optionally, a bus 1103. The memory 1102 stores machine-readable instructions executable by the processor 1101. When the computer device is running, the processor 1101 communicates with the memory 1102 via the bus 1103. When the machine-readable instructions are executed by the processor 1101, the steps of the above-mentioned medical service interface calling method based on the large language model are executed.

[0226] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned medical service interface calling method based on a large language model are executed.

[0227] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in the present invention. In the several embodiments provided by the present invention, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0228] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk, etc., which can store program code.

[0229] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A medical service interface calling method based on a large language model, characterized in that: The method comprises: Obtaining natural language processing text input from an interface of a preset medical business system; According to the natural language processing text, a preset large language model is used to determine a target service interface matching the natural language processing text from a service interface database in the preset medical service system; the service interface database includes: interfaces of each service in the preset medical service system; Acquire parameter definition information of the target service interface from a definition file of the target service interface; According to the parameter definition information, the natural language processing text is parameterized to obtain target request parameters of the target service interface; Calling the target service interface according to the target request parameters to obtain a calling result of the target service interface; According to the calling result, generating a target processing result corresponding to the natural language processing text; The step of determining, based on the natural language processing text, a target service interface matching the natural language processing text from a service interface database in the preset medical service system using a preset large language model includes: Using the preset large language model, performing word segmentation processing on the natural language processing text to obtain target variable parameters; Determining the target service interface from the service interface database according to the target variable parameter; The step of determining the target service interface from the service interface database according to the target variable parameter comprises: Obtaining a definition file of an interface of each service in the service interface database, wherein the definition file of the interface of each service includes: interface title information of each service, interface function description information of each service, and interface application information of each service; Determine the first matching parameter of each service according to the target variable parameter and the interface title information of each service; Determining second matching parameters of each service according to the target variable parameter and the interface function description information of each service; Determine a third matching parameter of each service according to the target variable parameter and the interface application information of each service; Weighting the first matching parameter, the second matching parameter, and the third matching parameter to obtain target matching parameters for each service; According to the target matching parameters of each service, an interface with the highest matching parameter is determined as the target service interface.

2. The medical service interface calling method based on a large language model according to claim 1, characterized in that: The step of determining, according to the target matching parameters of each service, an interface with the highest matching parameter as the target service interface includes: If the highest matching parameter is greater than or equal to a preset matching threshold, determining the interface with the highest matching parameter as the target service interface; If the highest matching parameter is less than a preset matching threshold, generating a matching prompt word according to the natural language processing text, the interface title information of each service, the interface function description information of each service, and the interface application information of each service; According to the matching prompt word, the preset large language model is adopted to determine the target service interface from the interfaces of the various services.

3. The medical service interface calling method based on a large language model according to claim 1, characterized in that: The parameter definition information of the target service interface includes: information of request parameters and parameter format examples of the request parameters; the parameter conversion of the natural language processing text according to the parameter definition information to obtain the target request parameters of the target service interface includes: Extracting parameters from the natural language processing text according to the information of the request parameters to obtain a first parameter; Determine whether the request parameter is extracted according to the first parameter and information of the request parameter; If the request parameter has been extracted, the parameter format example is used to perform format conversion on the first parameter to obtain the target request parameter.

4. The medical service interface calling method based on a large language model according to claim 3 is characterized in that: The step of performing parameter conversion on the natural language processing text according to the parameter definition information to obtain the target request parameter of the target service interface further includes: If the request parameters have not been extracted, obtain the business context information of the interface; According to the information of the request parameter, continue to extract parameters from the business context information to obtain a second parameter; The parameter format example is adopted to perform format conversion on the first parameter and the second parameter to obtain the target request parameter.

5. The medical service interface calling method based on a large language model according to claim 1, characterized in that: The step of calling the target service interface according to the target request parameter to obtain a calling result of the target service interface includes: Generate a call prompt word according to the target request parameter, the information of the target service interface and the historical service execution result of the business service; According to the call prompt word, the preset large language model is adopted to call the target service interface to obtain the execution result of the business service corresponding to the target service interface.

6. The medical service interface calling method based on a large language model according to claim 1, characterized in that: Generating a target processing result corresponding to the natural language processing text according to the calling result includes: Parsing the call result to determine the execution result of the business service corresponding to the target service interface and content description information of the execution result; Generate a return prompt word according to the execution result and the content description information of the execution result; According to the returned prompt word, the preset large language model is adopted to generate the target processing result.

7. The medical service interface calling method based on a large language model according to claim 6, characterized in that: The parsing of the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result includes: Acquire a target parsing rule for the target service interface from a preset interface parsing rule base, wherein the preset interface parsing rule base stores parsing rules for the interfaces of the respective services; The target parsing rule is used to parse the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

8. The medical service interface calling method based on a large language model according to claim 7, characterized in that: The adopting the target parsing rule to parse the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result includes: If the target parsing rule is a list parsing rule, the target parsing rule is adopted to parse the list data in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result; Alternatively, if the target parsing rule is a card parsing rule, the target parsing rule is used to parse multiple data objects in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result; Alternatively, if the target parsing rule is a business parsing rule, the business parsing rule is used to parse the medical business terms in the call result to determine the execution result of the business service corresponding to the target service interface and the content description information of the execution result.

Citation Information

Patent Citations

  • Medical big language model training method and device, electronic equipment and storage medium

    CN118098562A

  • Data processing method and device, readable storage medium and electronic equipment

    CN118446334A