Medical service interface file generation method, device and equipment
By extracting keywords and identifying medical semantics of natural language requirements description information, generating medical needs description information, and obtaining structured interface documents for target medical services, the complex problem of medical system interface development is solved and development efficiency is improved.
Patent Information
- Application Number
- CN202410154761.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2025-08-08
AI Technical Summary
The existing technology is difficult to quickly and effectively generate medical service interface files that are suitable for different medical scenarios, resulting in complex and time-consuming integration of medical systems. The lack of digital interface knowledge base cannot be reused, and the interface needs to be redeveloped.
By extracting keywords of natural language requirements description information, identifying it using a preset medical semantic model, generating medical needs description information, and obtaining structured interface documents of target medical services based on medical needs description information, including target interface definition files and target execution scripts.
It reduces the difficulty of obtaining structured interface documents, improves the development efficiency of medical service interfaces, and realizes the rapid development of adapted medical service interface files.
Smart Images

Figure CN120452811A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method, device and equipment for generating a medical service interface file. Background Art
[0002] Currently, medium and large medical institutions generally have multiple systems running simultaneously. Each system needs to rely on processes or its own data for business interaction and data sharing to complete the overall workflow. Therefore, whether the systems can be well integrated and connected has become an important task.
[0003] The interactions between medical systems are very complex, requiring a large number of medical scenario API interfaces to provide services. The current development technology generally requires software manufacturers to analyze and design according to the interface requirements of each system, and then invest a large amount of R&D resources to manually write code for development. Even if there are some low-code interface development auxiliary tools, they cannot be adapted to the more complex scenario requirements of medical models. As a result, both the investment in human resources and the arrangement of project development cycles are generally very time-consuming and labor-intensive, and cannot meet the long-term development and secondary development needs of hospital information.
[0004] Currently, there is a lack of necessary digital interface knowledge bases for different medical scenarios, and a complete solution cannot be formed. Interfaces often need to be redeveloped for different scenarios, and it is difficult or basically impossible to reuse previous interfaces. At the same time, there is no ability to develop medical interface processes. Summary of the Invention
[0005] The purpose of the present invention is to provide a medical service interface file generation method, device and equipment to address the deficiencies in the above-mentioned prior art, so as to obtain medical demand description information by processing natural language demand description information, and obtain the structured interface document of the target medical service, and obtain a medical service interface file that is adapted to the medical demand description information.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:
[0007] In a first aspect, an embodiment of the present application provides a method for generating a medical service interface file, comprising:
[0008] Perform keyword extraction on the input natural language demand description information to obtain multiple keywords;
[0009] Performing medical semantic recognition based on the multiple keywords using a preset medical semantic model to obtain medical semantic labels corresponding to the multiple keywords;
[0010] Generate medical demand description information according to the medical semantic tags corresponding to the multiple keywords;
[0011] According to the medical demand description information, a structured interface document of a target medical service corresponding to the medical demand description information is obtained, wherein the structured interface document includes: a target interface definition file and a target execution script.
[0012] In an optional embodiment, obtaining, based on the medical need description information, a structured interface document of a target medical service corresponding to the medical need description information includes:
[0013] According to the medical need description information, a preset medical interface knowledge base is searched to obtain a medical service that matches the medical need description information as the target medical service; wherein the preset medical interface knowledge base pre-stores: a plurality of medical service interface knowledge files, each medical service interface knowledge file including: interface definition knowledge and script knowledge;
[0014] The structured interface document is generated according to the interface knowledge file of the target medical service in the preset medical interface knowledge base.
[0015] In an optional embodiment, the step of obtaining, based on the medical need description information, a structured interface document of a target medical service corresponding to the medical need description information further includes:
[0016] If there is no medical service matching the medical demand description information in the preset medical interface knowledge base, the preset medical service model is used to process the medical demand description information to obtain information on multiple medical sub-services corresponding to the medical demand description information and the dependency relationships between the multiple medical sub-services;
[0017] The structured interface document is generated using a preset interface generator according to the information of the multiple medical sub-services and the dependencies between the multiple medical sub-services.
[0018] In an optional embodiment, before processing the plurality of keywords using a preset medical semantic model to obtain medical semantic labels corresponding to the plurality of keywords, the method further includes:
[0019] Acquiring sample medical corpus data, wherein the sample medical corpus data has medical semantic tags;
[0020] The sample medical corpus data is used to perform model training to obtain the medical semantic model.
[0021] In an optional embodiment, before searching a preset medical interface knowledge base based on the medical need description information and obtaining a medical service that matches the medical need description information as the target medical service, the method further includes:
[0022] Collect interface definition files and execution scripts for each medical service;
[0023] Performing knowledge extraction on the interface definition file and execution script of each medical service respectively to obtain interface knowledge and script knowledge of each medical service;
[0024] The preset medical interface knowledge base is constructed based on the interface knowledge and script knowledge of the multiple medical services.
[0025] In an optional embodiment, generating the structured interface document using a preset interface generator based on the information of the multiple medical sub-services and the dependencies between the multiple medical sub-services includes:
[0026] Using the first determination module in the preset interface generator, based on information of multiple medical sub-services and dependencies between the multiple medical sub-services, determine information of a target data table, information of a target data field in the target data table, and an action execution condition;
[0027] Using a statement construction module in the preset interface generator, construct a plurality of code statements according to the information of the target data table, the information of the target data field in the target data table, and the action execution condition;
[0028] Using the statement splicing module in the preset interface generator, the plurality of code statements are spliced according to preset code grammar rules to generate a spliced code statement;
[0029] Using the parameterization module in the preset interface generator, the parameter fields in the spliced code statements are replaced with placeholders to obtain the target execution script and the target interface definition file;
[0030] The structured interface document is generated by using a generation module in the preset interface generator according to the target execution script and the target interface definition file.
[0031] In an optional embodiment, the method further comprises:
[0032] The output module in the preset interface generator is used to output the data object of the target medical service in a preset data exchange format according to the target execution script and the target interface definition file.
[0033] In an optional embodiment, before processing the medical need description information using a preset medical service model to obtain information about multiple medical sub-services corresponding to the medical need description information and the dependency relationships between the multiple medical sub-services, the method further includes:
[0034] Obtaining sample medical demand description information, wherein the sample medical demand description information is marked with: information of preset medical sub-services and dependencies between the preset medical sub-services;
[0035] Model training is performed based on the sample medical demand description information to obtain the medical service model.
[0036] In a second aspect, an embodiment of the present application further provides a medical service interface file generation device, comprising:
[0037] The extraction module is used to extract keywords from the input natural language demand description information to obtain multiple keywords;
[0038] an identification module, configured to perform medical semantic identification based on the plurality of keywords using a preset medical semantic model to obtain medical semantic labels corresponding to the plurality of keywords;
[0039] A generating module, configured to generate medical demand description information according to the medical semantic tags corresponding to the plurality of keywords;
[0040] An acquisition module is used to acquire, based on the medical demand description information, a structured interface document of a target medical service corresponding to the medical demand description information, wherein the structured interface document includes: a target interface definition file and a target execution script.
[0041] In the third aspect, an embodiment of the present application also provides a computer device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor. When the computer device is running, the processor and the storage medium communicate through the bus, and the processor executes the program instructions to perform the steps of the medical service interface file generation method as described in any one of the first aspects.
[0042] In a fourth aspect, an embodiment of the present application 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 data processing method as described in any one of the first aspects are executed.
[0043] The beneficial effects of this application are:
[0044] The embodiment of the present application provides a method, device and equipment for generating a medical service interface file, the method comprising: extracting keywords from input natural language demand description information to obtain multiple keywords, then performing medical semantic recognition based on the multiple keywords using a preset medical semantic model to obtain medical semantic tags corresponding to the multiple keywords, and generating medical demand description information based on the medical semantic tags corresponding to the multiple keywords, and finally obtaining a structured interface document of a target medical service corresponding to the medical demand description information based on the medical demand description information, wherein the structured interface document comprises: a target interface definition file and a target execution script. The method of the present application obtains medical demand description information by processing natural language demand description information, thereby reducing the difficulty of obtaining a structured interface document and not relying on other external resource conditions. The structured interface document of the target medical service can be obtained based on the medical demand description information. The medical service interface can be quickly developed through the structured interface document to obtain a medical service interface file that is compatible with the medical demand description information, thereby improving the development efficiency of the medical service interface. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 This is a flow chart of a method for generating a medical service interface file provided in an embodiment of the present application;
[0047] Figure 2 This is a second flow chart of a method for generating a medical service interface file provided in an embodiment of the present application;
[0048] Figure 3 This is a flowchart of a method for generating a medical service interface file according to an embodiment of the present application;
[0049] Figure 4 This is a fourth flow chart of a method for generating a medical service interface file provided in an embodiment of the present application;
[0050] Figure 5 This is a flowchart of a method for generating a medical service interface file provided in an embodiment of the present application;
[0051] Figure 6 Flowchart 6 of a method for generating a medical service interface file provided in an embodiment of the present application;
[0052] Figure 7 Flowchart 7 of a method for generating a medical service interface file provided in an embodiment of the present application;
[0053] Figure 8 A schematic diagram of the functional modules of a medical service interface file generation device provided in an embodiment of the present application;
[0054] Figure 9 A schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0056] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.
[0057] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the product of the application is usually placed when in use. It is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on this application.
[0058] In addition, the terms "first," "second," and the like in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.
[0059] It should be noted that, in the absence of conflict, the features in the embodiments of this application can be combined with each other.
[0060] In order to generate a variety of medical service interface files and reduce the difficulty of medical system integration, an embodiment of the present application provides a medical service interface file generation method, which performs keyword extraction on the input natural language demand description information to obtain multiple keywords, and then uses a preset medical semantic model to perform medical semantic recognition based on the multiple keywords to obtain medical semantic tags corresponding to the multiple keywords, and generates medical demand description information based on the medical semantic tags corresponding to the multiple keywords. Finally, based on the medical demand description information, a structured interface document of the target medical service corresponding to the medical demand description information is obtained, wherein the structured interface document includes: a target interface definition file and a target execution script. The medical service interface can be quickly developed through the structured interface document to obtain a medical service interface file adapted to the medical demand description information.
[0061] The following detailed explanation of the medical service interface file generation method provided in the embodiments of this application is provided below using specific examples with reference to the accompanying drawings. The medical service interface file generation method provided in the embodiments of this application can be implemented by running the algorithm or software on a computer device pre-installed with the medical service interface file generation algorithm. The computer device can be, for example, a server or terminal, and the terminal can be a user's computer. Figure 1 This is one of the flow charts of a method for generating a medical service interface file provided in an embodiment of the present application. Figure 1 As shown, the method includes:
[0062] S101: extract keywords from the input natural language demand description information to obtain multiple keywords.
[0063] In this embodiment, natural language demand description information is input on the front-end page of the medical service system, so that the server can receive the input natural language demand description information and perform keyword extraction to obtain multiple keywords.
[0064] Specifically, the natural language requirement description information can be input via text or voice input, without limitation. After obtaining the natural language requirement description information, a preset keyword extraction model is used to translate and slice the natural language requirement description information to extract multiple keywords. For example, if the natural language requirement description information is "I want to query Zhang San's medical records," the multiple keywords extracted are "query," "Zhang San," and "medical records." The preset keyword extraction model can employ a deep learning model (Transformer) with a self-attention mechanism.
[0065] S102. Based on the multiple keywords, a preset medical semantic model is used to perform medical semantic recognition to obtain medical semantic labels corresponding to the multiple keywords.
[0066] S103. Generate medical demand description information based on the medical semantic tags corresponding to the multiple keywords.
[0067] Specifically, the preset medical semantic model performs medical semantic recognition on multiple keywords and converts the semantics of multiple keywords into medical semantic labels. For example, if the multiple keywords are "query", "Zhang San" and "medical record", the medical semantic label corresponding to "query" is "action", the medical semantic label corresponding to "Zhang San" is "patient name", and the medical semantic label corresponding to "medical record" is "clinical medical record information", among which "Zhang San" represents the patient model field, "medical record" represents the clinical model field, and is simultaneously associated with the medical treatment model.
[0068] Medical demand description information can be generated based on the medical semantic tags corresponding to multiple keywords.
[0069] For example, the medical demand description information is: query the patient's clinical medical record information based on his name and treatment type.
[0070] S104. According to the medical demand description information, obtain a structured interface document of the target medical service corresponding to the medical demand description information.
[0071] The structured interface document includes: target interface definition file and target execution script.
[0072] Specifically, the medical demand description information is processed to determine the structured interface document of the target medical service corresponding to the medical demand description information. The target execution script includes: SQL query script, Groovy script, etc.
[0073] In summary, the embodiment of the present application provides a method for generating a medical service interface file, including: extracting keywords from the input natural language demand description information to obtain multiple keywords, then using a preset medical semantic model to perform medical semantic recognition based on the multiple keywords to obtain medical semantic tags corresponding to the multiple keywords, and generating medical demand description information based on the medical semantic tags corresponding to the multiple keywords, and finally obtaining a structured interface document of the target medical service corresponding to the medical demand description information based on the medical demand description information, wherein the structured interface document includes: a target interface definition file and a target execution script. The method of the present application obtains medical demand description information by processing the natural language demand description information, reduces the difficulty of obtaining a structured interface document, and does not have to rely on other external resource conditions. The structured interface document of the target medical service can be obtained based on the medical demand description information. The medical service interface can be quickly developed through the structured interface document, and a medical service interface file that is compatible with the medical demand description information can be obtained, thereby improving the development efficiency of the medical service interface.
[0074] The embodiment of the present application provides another possible implementation method of a medical service interface file generation method by obtaining a structured interface document. Figure 2 This is a flow chart of a method for generating a medical service interface file provided in an embodiment of the present application, as shown in FIG. Figure 2 As shown, according to the medical demand description information, the structured interface document of the target medical service corresponding to the medical demand description information is obtained, including:
[0075] S201. Search a preset medical interface knowledge base according to the medical demand description information, and obtain a medical service that matches the medical demand description information as a target medical service.
[0076] The preset medical interface knowledge base pre-stores: a plurality of medical service interface knowledge files, and each medical service interface knowledge file includes: interface definition knowledge and script knowledge.
[0077] S202. Generate a structured interface document based on the interface knowledge file of the target medical service in the preset medical interface knowledge base.
[0078] Specifically, first, the preset medical interface knowledge base is searched according to the multiple medical semantic tags in the medical demand description information, and multiple medical services matching the multiple medical semantic tags are retrieved. Then, based on the search results, that is, the similarity of the interface knowledge files corresponding to the multiple medical services, the target medical service is determined, and the interface knowledge file of the target medical service is determined to be a structured interface document.
[0079] In the method provided in the embodiment of the present application, a preset medical interface knowledge base is searched based on the medical need description information, and a medical service that matches the medical need description information is obtained as a target medical service; wherein, the preset medical interface knowledge base pre-stores: interface knowledge files of multiple medical services, and the interface knowledge file of each medical service includes: interface definition knowledge and script knowledge; a structured interface document is generated based on the interface knowledge file of the target medical service in the preset medical interface knowledge base, and the medical need description information is retrieved and matched with the preset medical interface knowledge base. If a medical service is matched, the matched medical service is determined to be the target medical service, and a structured interface document is generated based on the interface knowledge file of the target medical service to obtain a medical service interface file adapted to the medical need description information.
[0080] The embodiment of the present application provides another possible implementation method of the medical service interface file generation method through another way of obtaining a structured interface document. Figure 3 The third flow chart of a method for generating a medical service interface file provided in an embodiment of the present application is as follows: Figure 3As shown, according to the medical demand description information, the structured interface document of the target medical service corresponding to the medical demand description information is obtained, which also includes:
[0081] S301. If there is no medical service matching the medical demand description information in the preset medical interface knowledge base, the preset medical service model is used to process the medical demand description information to obtain information on multiple medical sub-businesses corresponding to the medical demand description information and the dependency relationship between the multiple medical sub-businesses.
[0082] In this embodiment, since the medical need description information includes multiple medical semantic tags, when there is no medical service matching the medical need description information in the preset medical interface knowledge base, the preset medical service model is used to process the medical need description information, and the information of multiple medical sub-services corresponding to the multiple medical semantic tags and the dependency relationships between the multiple medical sub-services can be obtained. For example, the medical need description information is: query the patient's clinical medical record information based on the patient's name and the type of consultation. The multiple medical semantic tags are: "patient name", "query", and "clinical medical record information". The information of the medical sub-service corresponding to "patient name" is the patient information table, and the information of the medical sub-service corresponding to "clinical medical record information" is the patient medical record table. The dependency relationship between the multiple medical sub-services is indicated by the type of consultation corresponding to the patient medical record table, for example, the patient's outpatient medical record table, the patient's inpatient medical record table, etc.
[0083] S302: Generate a structured interface document using a preset interface generator based on information of the multiple medical sub-businesses and dependencies between the multiple medical sub-businesses.
[0084] Specifically, a preset interface generator is used to process information of multiple medical sub-businesses and dependencies between the multiple medical sub-businesses to generate a structured interface document.
[0085] In the method provided in the embodiment of the present application, if there is no medical service matching the medical need description information in the preset medical interface knowledge base, the preset medical service model is used to process the medical need description information to obtain information on multiple medical sub-businesses corresponding to the medical need description information and the dependency relationships between the multiple medical sub-businesses, and then a preset interface generator is used to generate a structured interface document based on the information on the multiple medical sub-businesses and the dependency relationships between the multiple medical sub-businesses. In the event that a medical service cannot be matched from the preset medical interface knowledge base based on the medical need description information, the preset medical service model is used to obtain information on multiple medical sub-businesses corresponding to the medical need description information and the dependency relationships between the multiple medical sub-businesses, and then a preset interface generator is used to generate a structured interface document to obtain a medical service interface file that is compatible with the medical need description information.
[0086] The embodiment of the present application also provides another possible implementation of the medical service interface file generation method. Figure 4 This is a flowchart of a method for generating a medical service interface file provided in an embodiment of the present application, as shown in FIG. Figure 4 As shown, before a preset medical semantic model is used to process multiple keywords and obtain medical semantic labels corresponding to the multiple keywords, the method further includes:
[0087] S401: Obtain sample medical corpus data, where the sample medical corpus data has medical semantic tags.
[0088] In this embodiment, sample medical corpus data are collected, including medical records, medical papers, clinical guidelines, medical product model libraries, terminology, etc., and then the sample medical corpus data are cleaned and preprocessed based on the word embedding model BERT, including removing special characters, punctuation marks, performing word segmentation, etc., and natural language processing tools are used to perform medical semantic annotation, entity recognition, etc. on the sample medical corpus data, so that the sample medical corpus data has medical semantic labels.
[0089] S402: Use sample medical corpus data to perform model training to obtain a medical semantic model.
[0090] Specifically, a bag-of-words model, a word embedding model or a pre-trained medical corpus is constructed to perform model training on sample medical corpus data to obtain a medical semantic model, so that the medical semantic model can be applied to tasks such as medical text classification, entity recognition, information extraction, and natural language generation.
[0091] In the method provided in the embodiments of this application, sample medical corpus data is obtained, which includes medical semantic labels. The sample medical corpus data is used to train a model to obtain a medical semantic model. By training an initial medical semantic model based on the sample medical corpus data to obtain a medical semantic model, medical semantic recognition of keywords can be achieved and medical semantic labels can be obtained.
[0092] The embodiment of the present application also provides another possible implementation of the medical service interface file generation method. Figure 5 The fifth flow chart of a method for generating a medical service interface file provided in an embodiment of the present application is as follows: Figure 5 As shown, before searching the preset medical interface knowledge base according to the medical demand description information and obtaining the medical service matching the medical demand description information as the target medical service, the method further includes:
[0093] S501. Collect interface definition files and execution scripts for each medical service.
[0094] In this embodiment, the interface definition file of each medical service includes information such as the interface function, input parameters, and output results, and then the interface definition file of each medical service is cleaned, deduplicated, and integrated.
[0095] S502: Extract knowledge from the interface definition file and execution script of each medical service to obtain interface knowledge and script knowledge of each medical service.
[0096] S503. Construct a preset medical interface knowledge base based on the interface knowledge and script knowledge of multiple medical services.
[0097] Specifically, key information is extracted from the interface definition file of each medical service, such as interface function description, input parameter description, output result format, etc., and the extracted interface knowledge is represented by a data structure. Finally, based on the interface knowledge and script knowledge of multiple medical services, a preset medical interface knowledge base is constructed, so that the preset medical interface knowledge base can be used in the fields of interface document generation, interface call example display, interface management system, etc.
[0098] In the method provided in the embodiments of this application, the interface definition file and execution script for each medical service are collected, and knowledge extraction is performed on each medical service's interface definition file and execution script to obtain interface knowledge and script knowledge for each medical service. Based on the interface knowledge and script knowledge of multiple medical services, a preset medical interface knowledge base is constructed. This allows the preset medical interface knowledge base to be searched based on the medical need description information to determine the target medical service.
[0099] The embodiment of the present application also provides another possible implementation of the medical service interface file generation method. Figure 6 The sixth flow chart of a method for generating a medical service interface file provided in an embodiment of the present application is as follows: Figure 6 As shown, based on the information of multiple medical sub-businesses and the dependencies between the multiple medical sub-businesses, a preset interface generator is used to generate a structured interface document, including:
[0100] S601. Using the first determination module in the preset interface generator, determine the information of the target data table, the information of the target data field in the target data table, and the action execution conditions based on the information of multiple medical sub-businesses and the dependencies between the multiple medical sub-businesses.
[0101] S602: Using a statement construction module in a preset interface builder, construct multiple code statements according to information of a target data table, information of a target data field in the target data table, and action execution conditions.
[0102] In this embodiment, constructing multiple code statements may include: SELECT clause, FROM clause, JOIN clause, WHERE clause, etc. These statements respectively specify the target data fields to be queried, target data tables, association conditions between target data tables, and filtering conditions.
[0103] S603: Using the statement splicing module in the preset interface generator, according to the preset code grammar rules, multiple code statements are spliced to generate a spliced code statement.
[0104] S604: Using the parameterization module in the preset interface generator, replace the placeholders of the parameter fields in the spliced code statements to obtain the target execution script and the target interface definition file.
[0105] S605: Using a generation module in a preset interface generator, a structured interface document is generated according to the target execution script and the target interface definition file.
[0106] Specifically, when generating the target execution script, the target execution script's grammatical rules must be considered. For example, the order of multiple code statements is fixed, such as the SELECT clause must precede the FROM clause. Syntax-based generation methods, such as the Abstract Syntax Network (ASN) and Syntax Neural Network Model (SNM), are then used. These methods generate grammatical rules from an abstract syntax tree during decoding, generating the target execution script. Based on the target execution script and the target interface definition file, a structured interface document is generated.
[0107] In the method provided in the embodiment of the present application, a first determination module in a preset interface generator is used to determine the information of a target data table, the information of a target data field in the target data table, and the action execution conditions based on the information of multiple medical sub-businesses and the dependency relationships between the multiple medical sub-businesses. A statement construction module in the preset interface generator is used to construct multiple code statements based on the information of the target data table, the information of the target data field in the target data table, and the action execution conditions. A statement splicing module in the preset interface generator is used to splice the multiple code statements according to the preset code grammar rules to generate spliced code statements. A parameterization module in the preset interface generator is used to replace the placeholders of the parameter fields in the spliced code statements to obtain a target execution script and a target interface definition file. A generation module in the preset interface generator is used to generate a structured interface document based on the target execution script and the target interface definition file. The preset interface generator is used to generate a structured interface document based on the information of multiple medical sub-businesses and the dependency relationships between the multiple medical sub-businesses.
[0108] This embodiment of the application also provides another possible implementation of the method for generating a medical service interface file. The method further includes:
[0109] The output module in the preset interface generator is used to execute the script according to the target and the target interface definition file to output the data object of the target medical service in the preset data exchange format.
[0110] Specifically, the data object of the target medical service is, for example, a JSON object. After obtaining the target execution script and the target interface definition file, the target execution script is debugged. If the preset conditions are met, the target execution script and the target interface definition file are added to the preset medical interface knowledge base to complete the optimization of the preset medical interface knowledge base.
[0111] The embodiment of the present application also provides another possible implementation of the medical service interface file generation method. Figure 7 The seventh flow chart of a method for generating a medical service interface file provided in an embodiment of the present application is as follows: Figure 7 As shown, before processing the medical demand description information using a preset medical service model to obtain information of multiple medical sub-services corresponding to the medical demand description information and the dependency relationship between the multiple medical sub-services, the method further includes:
[0112] S701. Obtain sample medical demand description information.
[0113] The sample medical demand description information is marked with: information about preset medical sub-businesses and the dependencies between the preset medical sub-businesses.
[0114] S702: Perform model training based on sample medical demand description information to obtain a medical service model.
[0115] Specifically, the initial medical service model is trained based on the information of the preset medical sub-businesses in the sample medical need description information and the dependency relationship between the preset medical sub-businesses to obtain a medical service model, so that the medical service model can determine the information of multiple medical sub-businesses corresponding to the sample medical need description information and the dependency relationship between the multiple medical sub-businesses based on the sample medical need description information.
[0116] The following continues to explain the medical service interface file generation device and computer equipment provided by any of the above embodiments of this application. Its specific implementation process and the technical effects produced are the same as those of the corresponding method embodiments mentioned above. For the sake of brief description, for the parts not mentioned in this embodiment, please refer to the corresponding content in the method embodiment.
[0117] Figure 8 This is a functional module diagram of a medical service interface file generation device provided in an embodiment of the present application. Figure 8 As shown, the medical service interface file generating device 100 includes:
[0118] The extraction module 110 is used to extract keywords from the input natural language demand description information to obtain multiple keywords;
[0119] The recognition module 120 is used to perform medical semantic recognition based on multiple keywords using a preset medical semantic model to obtain medical semantic labels corresponding to the multiple keywords;
[0120] A generating module 130 is configured to generate medical demand description information based on medical semantic tags corresponding to a plurality of keywords;
[0121] The acquisition module 140 is used to acquire the structured interface document of the target medical service corresponding to the medical demand description information according to the medical demand description information. The structured interface document includes: a target interface definition file and a target execution script.
[0122] Optionally, the acquisition module 140 is also used to search the preset medical interface knowledge base based on the medical need description information, and obtain the medical service that matches the medical need description information as the target medical service; wherein, the preset medical interface knowledge base pre-stores: interface knowledge files of multiple medical services, and the interface knowledge file of each medical service includes: interface definition knowledge and script knowledge; based on the interface knowledge file of the target medical service in the preset medical interface knowledge base, a structured interface document is generated.
[0123] Optionally, the acquisition module 140 is also used to process the medical need description information using a preset medical service model if there is no medical service matching the medical need description information in the preset medical interface knowledge base, to obtain information on multiple medical sub-businesses corresponding to the medical need description information and the dependency relationships between the multiple medical sub-businesses; and to generate a structured interface document using a preset interface generator based on the information on the multiple medical sub-businesses and the dependency relationships between the multiple medical sub-businesses.
[0124] Optionally, the medical service interface file generating device 100 further includes:
[0125] The training module is used to obtain sample medical corpus data, which has medical semantic labels; the sample medical corpus data is used to perform model training to obtain a medical semantic model.
[0126] Optionally, the training module is also used to collect the interface definition files and execution scripts of each medical service; perform knowledge extraction on the interface definition files and execution scripts of each medical service respectively to obtain the interface knowledge and script knowledge of each medical service; and construct a preset medical interface knowledge base based on the interface knowledge and script knowledge of multiple medical services.
[0127] Optionally, the generation module 130 is also used to use the first determination module in the preset interface generator to determine the information of the target data table, the information of the target data field in the target data table, and the action execution conditions based on the information of multiple medical sub-businesses and the dependency relationship between the multiple medical sub-businesses; use the statement construction module in the preset interface generator to construct multiple code statements based on the information of the target data table, the information of the target data field in the target data table, and the action execution conditions; use the statement splicing module in the preset interface generator to splice multiple code statements according to preset code syntax rules to generate spliced code statements; use the parameterization module in the preset interface generator to replace the placeholders of the parameter fields in the spliced code statements to obtain the target execution script and the target interface definition file; use the generation module in the preset interface generator to generate a structured interface document based on the target execution script and the target interface definition file.
[0128] Optionally, the medical service interface file generating device 100 further includes:
[0129] The output module is used to adopt the output module in the preset interface generator, execute the script according to the target, and the target interface definition file, and output the data object of the target medical service in the preset data exchange format.
[0130] Optionally, the training module is also used to obtain sample medical demand description information, which is marked with: information of preset medical sub-businesses and dependencies between preset medical sub-businesses; model training is performed based on the sample medical demand description information to obtain a medical service model.
[0131] The above-mentioned device is used to execute the method provided in the above-mentioned embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0132] The above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented by scheduling program code through a processing element, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0133] Figure 9 This is a schematic diagram of a computer device provided in an embodiment of the present application, which can be used to generate a medical service interface file. Figure 9 As shown, the computer device 200 includes: a processor 210 , a storage medium 220 , and a bus 230 .
[0134] Storage medium 220 stores machine-readable instructions executable by processor 210. When the computer device is running, processor 210 communicates with storage medium 220 via bus 230, and processor 210 executes the machine-readable instructions to perform the steps of the above-described method embodiment. The specific implementation methods and technical effects are similar and will not be repeated here.
[0135] Optionally, the present application further provides a storage medium 220 on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method embodiment are executed. The specific implementation and technical effects are similar and will not be repeated here.
[0136] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0138] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional units.
[0139] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviated: ROM), a random access memory (English: Random Access Memory, abbreviated: RAM), a magnetic disk or an optical disk, and other media that can store program code.
[0140] The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A method for generating a medical service interface file, characterized in that: include: Perform keyword extraction on the input natural language demand description information to obtain multiple keywords; Performing medical semantic recognition based on the multiple keywords using a preset medical semantic model to obtain medical semantic labels corresponding to the multiple keywords; Generate medical demand description information according to the medical semantic tags corresponding to the multiple keywords; According to the medical demand description information, a structured interface document of a target medical service corresponding to the medical demand description information is obtained, wherein the structured interface document includes: a target interface definition file and a target execution script.
2. The method according to claim 1, characterized in that The step of obtaining, based on the medical need description information, a structured interface document of a target medical service corresponding to the medical need description information includes: According to the medical need description information, a preset medical interface knowledge base is searched to obtain a medical service that matches the medical need description information as the target medical service; wherein the preset medical interface knowledge base pre-stores: a plurality of medical service interface knowledge files, each medical service interface knowledge file including: interface definition knowledge and script knowledge; The structured interface document is generated according to the interface knowledge file of the target medical service in the preset medical interface knowledge base.
3. The method according to claim 2, characterized in that The step of obtaining, according to the medical need description information, a structured interface document of a target medical service corresponding to the medical need description information further includes: If there is no medical service matching the medical demand description information in the preset medical interface knowledge base, the preset medical service model is used to process the medical demand description information to obtain information on multiple medical sub-services corresponding to the medical demand description information and the dependency relationships between the multiple medical sub-services; The structured interface document is generated using a preset interface generator according to the information of the multiple medical sub-services and the dependencies between the multiple medical sub-services.
4. The method according to claim 1, wherein Before processing the plurality of keywords using a preset medical semantic model to obtain medical semantic labels corresponding to the plurality of keywords, the method further includes: Acquiring sample medical corpus data, wherein the sample medical corpus data has medical semantic tags; The sample medical corpus data is used to perform model training to obtain the medical semantic model.
5. The method according to claim 2, characterized in that Before searching a preset medical interface knowledge base according to the medical need description information and obtaining a medical service matching the medical need description information as the target medical service, the method further includes: Collect interface definition files and execution scripts for each medical service; Performing knowledge extraction on the interface definition file and execution script of each medical service respectively to obtain interface knowledge and script knowledge of each medical service; The preset medical interface knowledge base is constructed based on the interface knowledge and script knowledge of the multiple medical services.
6. The method according to claim 3, characterized in that Generating the structured interface document using a preset interface generator based on the information of the multiple medical sub-services and the dependencies between the multiple medical sub-services includes: Using the first determination module in the preset interface generator, based on information of multiple medical sub-services and dependencies between the multiple medical sub-services, determine information of a target data table, information of a target data field in the target data table, and an action execution condition; Using a statement construction module in the preset interface generator, construct a plurality of code statements according to the information of the target data table, the information of the target data field in the target data table, and the action execution condition; Using the statement splicing module in the preset interface generator, the plurality of code statements are spliced according to preset code grammar rules to generate a spliced code statement; Using the parameterization module in the preset interface generator, the parameter fields in the spliced code statements are replaced with placeholders to obtain the target execution script and the target interface definition file; The structured interface document is generated by using a generation module in the preset interface generator according to the target execution script and the target interface definition file.
7. The method according to claim 6, characterized in that The method further comprises: The output module in the preset interface generator is used to output the data object of the target medical service in a preset data exchange format according to the target execution script and the target interface definition file.
8. The method according to claim 3, characterized in that Before processing the medical demand description information using a preset medical service model to obtain information about multiple medical sub-services corresponding to the medical demand description information and the dependency relationships between the multiple medical sub-services, the method further includes: Obtaining sample medical demand description information, wherein the sample medical demand description information is marked with: information of preset medical sub-services and dependencies between the preset medical sub-services; Model training is performed based on the sample medical demand description information to obtain the medical service model.
9. A medical service interface file generation device, characterized in that: include: The extraction module is used to extract keywords from the input natural language demand description information to obtain multiple keywords; an identification module, configured to perform medical semantic identification based on the plurality of keywords using a preset medical semantic model to obtain medical semantic labels corresponding to the plurality of keywords; A generating module, configured to generate medical demand description information according to the medical semantic tags corresponding to the plurality of keywords; An acquisition module is used to acquire, based on the medical demand description information, a structured interface document of a target medical service corresponding to the medical demand description information, wherein the structured interface document includes: a target interface definition file and a target execution script.
10. A computer device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor. When the computer device is running, the processor and the storage medium communicate through the bus, and the processor executes the program instructions to perform the steps of the medical service interface file generation method as described in any one of claims 1 to 8.