Method and apparatus for interface processing, device, storage medium and program product
By using machine learning models to assist in generating interface definitions, the problem of developers manually creating API definitions in existing technologies has been solved, enabling interface development with lower cost and higher accuracy.
Patent Information
- Application Number
- PCT/CN2025/103435
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-30
- Filing Date
- 2025-06-25
- Publication Date
- 2026-01-08
AI Technical Summary
In existing technologies, developers need to manually create API definitions for machine learning models to understand, which increases the difficulty and cost of interface development. Furthermore, manually defined APIs have poor performance and are difficult to call accurately.
The machine learning model is used to generate a second definition of the interface definition, which helps to update the interface definition, reduces the development difficulty and improves the accuracy of model understanding and calling.
It reduces the difficulty and cost of interface development, and improves the accuracy of the interface definition being understood by the machine learning model and the success rate of the call.
Smart Images

Figure CN2025103435_08012026_PF_FP_ABST
Abstract
Description
Method, device, apparatus, storage medium and program product for interface processing
[0001] The present application claims priority to the Chinese patent application No. 202410870566.3, filed on June 30, 2024, entitled “Method, device, apparatus, storage medium and program product for interface processing”, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] Example embodiments of the present disclosure generally relate to the field of computer, and in particular, to a method, device, electronic device, computer readable storage medium and computer program product for interface processing. BACKGROUND
[0003] In the development process of an application, a developer usually needs to define an interface, such as an application programming interface (API), on a server side, and provide a description file of the API definition to a client. The client can call a corresponding API based on the API definition. Via the API, one or more functions of a corresponding application or service can be accessed. In a scenario of a dialogue with a digital assistant, a developer usually needs to develop an API that can be understood by the digital assistant, so that the digital assistant can be triggered to call the API to perform a corresponding function in the dialogue process. SUMMARY
[0004] In a first aspect of the present disclosure, a method for interface processing is provided. The method comprises: in response to a creation request for an interface, obtaining an interface definition of the interface; providing first definition content in the interface definition and a prompt word to a machine learning model to obtain second definition content for the interface generated by the machine learning model; updating the interface definition of the interface based on the second definition content; and creating the interface by using the updated interface definition.
[0005] In a second aspect of the present disclosure, a device for interface processing is provided. The device comprises: an obtaining module configured to, in response to a creation request for an interface, obtain an interface definition of the interface; a providing module configured to provide first definition content in the interface definition and a prompt word to a machine learning model to obtain second definition content for the interface generated by the machine learning model; an updating module configured to update the interface definition of the interface based on the second definition content; and a creating module configured to create the interface by using the updated interface definition.
[0006] In a third aspect of the present disclosure, an electronic device is provided. The device comprises at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. The instructions, when executed by the at least one processing unit, cause the electronic device to perform the method of the first aspect.
[0007] In a fourth aspect of the present disclosure, a computer readable storage medium is provided. The medium has stored thereon a computer program which, when executed by a processor, implements the method of the first aspect.
[0008] In a fifth aspect of the present disclosure, a computer program product is provided. The product includes a computer program, wherein the computer program, when executed by a processor, implements the method according to the first aspect of the present disclosure.
[0009] It should be understood that all statements herein made regarding the exemplary embodiments of the present disclosure are intended to encompass both structural and functional equivalents thereof. Additionally, it should be understood that although the exemplary embodiments of the present disclosure have been specifically illustrated, various alternatives, modifications and equivalents can be used. It is therefore, intended that the present disclosure be construed as including all such alternatives, modifications and equivalents within the scope of the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0010] The above and other features, aspects and advantages of certain embodiments of the present disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings, in which like reference numbers represent like elements throughout. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of certain embodiments of the present disclosure.
[0011] FIG. 1 illustrates a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented;
[0012] FIGS. 2A and 2B illustrate flow diagrams of signaling flows for interface processing according to some embodiments of the present disclosure;
[0013] FIG. 3 illustrates an architecture diagram of an example of a classification architecture for interfaces according to some embodiments of the present disclosure;
[0014] FIG. 4 illustrates a schematic diagram of signaling flows for interface processing according to some embodiments of the present disclosure;
[0015] FIG. 5 illustrates a flow diagram of a process for interface processing according to some embodiments of the present disclosure;
[0016] FIG. 6 illustrates an exemplary block diagram of an apparatus for interface processing according to some embodiments of the present disclosure; and
[0017] FIG. 7 illustrates a block diagram of an electronic device that can implement one or more embodiments of the present disclosure. DETAILED DESCRIPTION
[0018] Embodiments of the present disclosure will be described herein below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so as to more completely and thoroughly understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of the present disclosure.
[0019] In the description of embodiments of the present disclosure, the term "comprising" and its similar terms shall be understood as open inclusion, i.e., "including but not limited to". The term "based on" shall be understood as "at least partially based on". The term "one embodiment" or "the embodiment" shall be understood as "at least one embodiment". The term "some embodiments" shall be understood as "at least some embodiments". Other explicit and implicit definitions can also be included below.
[0020] In this article, unless expressly stated, performing a step "in response to A" does not mean performing the step immediately after "A", but can include one or more intermediate steps.
[0021] It can be understood that the data involved in the technical solutions of the present disclosure (including but not limited to the data itself, the obtaining, use, storage or deletion of the data) shall comply with the requirements of the corresponding laws and regulations and relevant provisions.
[0022] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type of information involved in the present disclosure, the use range, the use scenario and the like shall be informed to the relevant user and the authorization of the relevant user shall be obtained by appropriate means according to the relevant laws and regulations, wherein the relevant user can include any type of right subject, such as individual, enterprise and group.
[0023] For example, in response to receiving the active request of the user, the prompt information is sent to the relevant user to explicitly prompt the relevant user that the operation requested to be performed will need to obtain and use the information of the relevant user, so that the relevant user can voluntarily choose whether to provide the information to the software or hardware such as electronic device, application program, server or storage medium performing the operation of the technical solutions of the present disclosure according to the prompt information.
[0024] As an optional but not limited implementation manner, in response to receiving the active request of the relevant user, the prompt information is sent to the relevant user in the manner of pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry selection controls for the user to select "agree" or "disagree" to provide information to the electronic device.
[0025] It can be understood that the above notification and user authorization process is only illustrative, and does not limit the implementation manner of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0026] As used herein, the term “model” can learn the relationship between the corresponding input and output from the training data, so that after the training is completed, the corresponding output can be generated for a given input. The generation of the model can be based on machine learning techniques. Deep learning is a machine learning algorithm that processes input and provides a corresponding output by using multiple layers of processing units. The neural network model is an example of a model based on deep learning. In this document, “model” can also be referred to as “machine learning model”, “learning model”, “machine learning network” or “learning network”, which are used interchangeably herein.
[0027] FIG. 1 shows a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. The environment 100 involves an interface management platform 111, an interface application platform 151, a service end 110, 150, a terminal device 120, 160, and a machine learning model 130, 170.
[0028] As shown in FIG. 1, the interface management platform 111 can provide a user 140 with an environment for creating, publishing and managing interfaces. In some embodiments, the interface management platform 111 can be a low-code platform that provides a collection of tools for interface creation. The interface management platform 111 can support visual development of interfaces. The interface management platform 111 can support any suitable platform for users to develop interfaces.
[0029] The interface management platform 111 can be deployed on the service end 110, can be deployed locally on the terminal device 120 of the user 140, and / or can be supported by a remote server. For example, the terminal device 120 of the user 140 can run a client of the interface management platform 111, which can support the interaction of the user 140 with the interface management platform 111. In the case where the interface management platform is run locally on the terminal device 120 of the user 140, the user 140 can directly interact with the local interface management platform using the client. In the case where the interface management platform 111 is run on the service end 110, the service end 110 can implement the provision of services to the client running on the terminal device 120 based on the communication connection between the terminal device 120.
[0030] The terminal device 160 can be deployed with a digital assistant 161, and the user 180 can interact with the digital assistant 161 through the terminal device 160 or an attached device of the terminal device 160. The terminal device 160 and the terminal device 120 can be implemented as the same device, or can be implemented as different devices. The digital assistant 161 is provided to assist the user 180 in various task processing needs in different applications and scenarios. The digital assistant 161 generally has intelligent conversation and task processing capabilities. In the interaction with the digital assistant 161, the user 180 inputs interaction messages (for example, text, voice, image, video, or other modal conversation contents), and the digital assistant 161 provides reply messages in response to the user input. Generally, the digital assistant 161 can support the user 180 to input questions in a natural language manner, and perform tasks and provide replies based on the understanding of the natural language input and logical reasoning capabilities. The digital assistant 161 can also be configured to call a matched interface according to the user input to provide a reply message, thereby improving the processing capability of the digital assistant 161.
[0031] In embodiments of the present disclosure, the user 140 can create and publish interfaces as needed on the interface management platform 111. The interfaces can be published to any appropriate interface application platform 151 as long as the interface application platform 151 can support the calling of the interfaces by the digital assistant 161. The interface application platform 151 can be deployed on the server 150, or can be deployed on the terminal device 160 of the user 180. The server 150 and the server 110 can be implemented as the same device, or can be implemented as different devices. After the interface is published, the user 180 can input conversation messages in the conversation window of the digital assistant 161, and the digital assistant 161 can call the interface to assist the calling of the interface based on the interface definition of the interface, and obtain feedback information from the interface, determine a reply message based on the feedback information, and present the reply message to the user in the conversation window.
[0032] In some embodiments, the interface management platform 111 can utilize a machine learning model 130 to support the creation, publication, and management of the interfaces. The digital assistant 161 can utilize a machine learning model 170 to support the interaction with the user 180. For example, the digital assistant 161 can utilize one or more machine learning models 170 to provide a question and answer service to the user 180. The machine learning model 130 and the machine learning model 170 can be implemented as the same machine learning model, or can be implemented as different machine learning models. The machine learning models 130, 170 can be different types of models.
[0033] In some embodiments, one or more machine learning models 130, 170 can be built based on a language model (LM). The machine learning model used is a content generative model, which is capable of generating a corresponding output based on a model input. In some embodiments, the machine learning model based on a language model is capable of generating a desired output according to a model input in a text modality (e.g., natural language and / or machine language) and / or a model input in a non-text modality (e.g., image, voice, video, etc.), and according to the model input and a prompt word. The prompt word here is used to guide the machine learning model to generate an output that is capable of addressing a user demand indicated by the model input. In an application scenario for supporting user conversation, a user input can be provided as at least a part of the model input (other parts can include the prompt word) to the machine learning model 170. The user input is considered as a question. Based on the model output, a corresponding answer can be generated to be provided to the user 180.
[0034] The interface management platform 111 and / or the interface application platform 151 can be run on a suitable electronic device. The electronic device here can be any type of device with computing capability, including a terminal device or a server device. The terminal device can be any type of mobile terminal, fixed terminal, or portable terminal including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a game device, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server 110, 150 can include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, etc. In some embodiments, the interface management platform 111 and / or the interface application platform 151 can be implemented based on a cloud service.
[0035] It should be understood that the structure and function of the various elements in the environment 100 are described for illustrative purposes only, without implying any limitation on the scope of the present disclosure.
[0036] As mentioned before, the digital assistant can utilize a machine learning model to provide a question and answer service to a user. The machine learning model can directly generate a corresponding answer for a user input, or determine a required interface, e.g., an API, to be invoked. The digital assistant can invoke the API determined by the machine learning model to generate an answer for the user input. Such an API is to be understood by the machine learning model, so that in the process of the digital assistant utilizing the machine learning model to provide a question and answer service to a user, the machine learning model can determine a required API to be invoked based on a user input.
[0037] Conventionally, a developer usually needs to create an API definition for a client of a regular application, provide the API definition to the client of the application, so that the client can call a corresponding API based on the API definition. The developer also needs to create another API definition for a machine learning model, so that the machine learning model can understand a corresponding API according to the other API definition. This not only increases the development difficulty and development cost of the interface, but also the performance of the artificially developed API definition that can be understood by the machine learning model and accurately call the corresponding API still needs to be improved.
[0038] Therefore, according to an embodiment of the present disclosure, an improved solution for interface processing is provided. According to the solution of the present disclosure, in response to a creation request for an interface, an interface definition of the interface is obtained; a first definition content in the interface definition and a prompt word are provided to a machine learning model to obtain a second definition content for the interface generated by the machine learning model; the interface definition of the interface is updated based on the second definition content; and the interface is created by using the updated interface definition.
[0039] In this way, in the interface creation process, the machine learning model is used to assist in generating or optimizing at least part of the definition content in the interface definition, which can reduce the interface development difficulty and development cost of the developer, and such an interface definition is easier to be understood by the machine learning model, which is beneficial to improve the accuracy and success rate of the interface call.
[0040] Some example embodiments of the present disclosure will be described below with reference to the accompanying drawings.
[0041] FIG. 2A shows a flowchart of a signaling flow 200A for interface processing according to some embodiments of the present disclosure. The signaling flow 200A involves the server 110, the terminal device 120, and the machine learning model 130. For ease of discussion, the signaling flow 200A will be described with reference to the environment of FIG. 1.
[0042] In an embodiment of the present disclosure, as shown in the signaling flow 200A, the terminal device 120 sends (202) a creation request for an interface to the server 110, the server 110 receives (204) the creation request for the interface from the terminal device 120, and the server 110 obtains (206) an interface definition of the interface.
[0043] The interface definition here can be included in the creation request for the interface, or the server 110 can interact with the terminal device 120 to receive the interface definition of the interface from the terminal device 120 in response to receiving the creation request for the interface. In some embodiments, the interface definition can be input by a user corresponding to the terminal device 120.
[0044] The interface definition herein can include all or part of the fields required to create the interface. For example, the all or part of the fields can include a classification field, an identification field, a description field, an address field, an input field, an output field, and the like of the interface.
[0045] Alternatively or additionally, the all or part of the fields herein can include a field name of the all or part of the fields and field information of at least part of the fields in the all or part of the fields. Specifically, the interface definition can include a field name of each field in the all or part of the fields, each field name in the interface definition can have corresponding field information, or only part of the field names in the interface definition can have corresponding field information, and the rest of the field names can not have corresponding field information. For example, the interface definition can only include a field name (e.g., api_desc) of a description field for describing the interface, and not include corresponding field information of the description field.
[0046] It can be understood that the above-mentioned fields are only exemplary, and the interface definition can include all or part of the above-mentioned fields, and can also include other fields, such as a “method” field for defining an HTTP method used when submitting a form of the interface or making a network request, a “package” field for defining a classification to which the interface belongs, an “api_name” field for defining an interface name when the interface is provided to a machine learning model, an “api_show_name” field for defining an interface name when the interface is displayed to a user, a “request_params” field for defining input parameters of the interface and a “response_params” field for defining output parameters of the interface, and a “double_check” field for defining whether a secondary confirmation is required when the interface is called by a machine learning model, and the like, which are not listed one by one here. In actual applications, the number of fields included in the interface definition can be determined according to specific needs, and the name and requirements of each field can also be adjusted as needed. Embodiments of the present disclosure do not limit this.
[0047] In some embodiments, the classification architecture of the interface can include one or more tree structures, and the tree structure can include a root node, a child node, and a leaf node, and each interface can be recorded in the leaf node. The classification field of the interface can be used to record the classification path of the interface in the tree structure. It can be understood that in specific implementations, the classification types corresponding to the root node, the child node, and the leaf node can be flexibly selected according to various classification manners, and the specific classification types corresponding to the root node, the child node, and the leaf node are not limited herein.
[0048] Exemplarily, as shown in FIG. 3, FIG. 3 shows an architecture diagram of an example 300 of a classification architecture of an interface according to some embodiments of the present disclosure. The example 300 includes a tree structure 300A, 300B, 300C. The tree structure 300A includes a root node 311, a plurality of first-level child nodes, a plurality of second-level child nodes, and a plurality of leaf nodes. The interface 341 belongs to the tree structure 300A, and a classification path of the interface 341 in the tree structure 300A can include the root node 311, the first-level child node 321, and the second-level child node 331. On this basis, the field information of the “package” field can include, for example, the root node 311 / the first-level child node 321 / the second-level child node 331.
[0049] In embodiments of the present disclosure, as shown in the signaling flow 200A, the server 110 constructs a model input 210 of the machine learning model 130 based on the first definition content in the interface definition and the prompt, provides (208) the model input 210 to the machine learning model 130, and the machine learning model generates (214) the second definition content (also referred to as a model response) for the interface after receiving (212) the model input 210.
[0050] The first definition content herein can include one or more fields in the interface definition. In some embodiments, the first definition content includes the field name of each of the one or more fields and the field information of at least part of the one or more fields. Alternatively or additionally, the one or more fields can include fields that help the machine learning model understand the interface, and the one or more fields can also include fields that require the machine learning model to generate field information and fields that require the machine learning model to optimize field information. Regarding the fields that help the machine learning model understand the interface, the field name and the field information of such fields can be provided to the machine learning model. Regarding the fields that require the machine learning model to optimize the field information, the field name and the field information that need to be optimized of such fields can be provided to the machine learning model. Regarding the fields that require the machine learning model to generate the field information, the field name of such fields can be provided to the machine learning model.
[0051] The prompt herein can be used to guide the machine learning model to generate the second definition content for the interface based on the first definition content. In some embodiments, the prompt at least includes a generation requirement for the definition content of the interface. Specifically, the prompt can include a generation requirement for the second definition content of the interface. Alternatively or additionally, the prompt can include the field name of the second definition content and the generation standard of the field information corresponding to the field name.
[0052] The second definition content can include field information generated by the machine learning model for at least some of the one or more fields. Alternatively or additionally, the second definition content can also include field names corresponding to the generated field information, so that the server 110 can correctly determine the correspondence between the field information and the field names. Illustratively, the second definition content can include optimized field information and corresponding field names, as well as generated field information and corresponding field names.
[0053] In some embodiments, the second definition content can be used to be provided to the machine learning model or another machine learning model for determining a call to an interface. On this basis, the second definition content can include fields required by the machine learning model or another machine learning model for determining the interface for the call. For example, the second definition content can include fields required by the machine learning model 130 or the machine learning model 170 for determining a call to an interface.
[0054] In some embodiments, the second definition content includes at least one of an identifier corresponding to an identification field of the interface, description information corresponding to a description field of the interface, input parameters corresponding to one or more input fields of the interface, or output parameters corresponding to one or more output fields of the interface.
[0055] Illustratively, the first definition content can include field names of the following fields: “package”, “api_name”, “api_show_name”, “api_desc”, “api_show_desc”, “url”, “method”, “double_check”, “request_params”, “response_params”, and “function_id”. The first definition content also includes field information of the following fields: “package”, “api_show_name”, “api_show_desc”, “url”, “method”, “double_check”, and “function_id”.
[0056] On this basis, the second definition content can include field information and field names of the following fields: “api_name”, “api_show_desc”, “request_params”, “response_params”. The field information of the “request_params” field can include input parameters corresponding to input fields such as “name”, “description”, “required”, “type”, “SubParameters”, and “enum”, and so on.
[0057] In embodiments of the disclosure, as shown in signaling flow 200A, the machine learning model 130 feeds back (216) the second definition content to the server 110, and after the server 110 receives (218) the second definition content, the server 110 updates (222) the interface definition of the interface based on the second definition content. The server 110 creates (224) the interface using the updated interface definition.
[0058] The second definition content here can include field information generated by the machine learning model 130 for at least some of the one or more fields in the first definition content. If one of the fields in the second definition content already has field information in the interface definition before the update, the server 110 can replace the existing field information of the field in the interface definition before the update with the field information of the field generated by the machine learning model 130. If one of the fields in the second definition content is not filled with field information in the interface definition before the update, the server 110 can fill the field information of the field generated by the machine learning model 130 into the interface definition to update the interface definition of the interface.
[0059] In embodiments of the disclosure, as shown in signaling flow 200A, the server 110 constructs the model input 220 of the machine learning model 130 based on the test question for the interface and the updated interface definition of the interface, and provides (226) the model input 220 to the machine learning model 130. After the machine learning model 130 receives (228) the model input 220, the machine learning model 130 generates (232) the model response 230, and the machine learning model 130 feeds back (234) the model response 230 to the server 110. The server 110 determines the test result for the interface based on the received (264) model response 230.
[0060] Alternatively or additionally, the server 110 can construct the model input 220 of the machine learning model 130 based on all or part of the fields in the test question and the updated interface definition. For example, the server 110 can construct the model input 220 of the machine learning model based on the test question and at least the fields in the second definition content.
[0061] In some embodiments, the server 110 can receive the model response 230 for the test question from the machine learning model 130. If the model response 230 does not indicate a call to the interface, it is determined that the test of the interface fails. For example, if the model response 230 does not contain a call parameter for the interface, it can be determined that the test of the interface fails. This situation can be due to inaccurate description information in the interface definition, which causes the machine learning model 130 to fail to correctly understand the function of the interface being tested, so that the machine learning model 130 cannot determine that the interface being tested should be called to respond to the test question.
[0062] If the model response 230 indicates at least a call parameter for the interface, the server 110 can send a call request to the interface based on the call parameter and the call address indicated in the interface definition. If the server 110 receives target feedback information for the test question from the interface, the test of the interface is determined to pass. That is, if the machine learning model 130 determines that the tested interface needs to be called to respond to the test question, and sends a call request to the interface based on the call parameter provided by the machine learning model 130, correct target feedback information for the test question can be received from the interface, the test of the interface is determined to pass. As shown in the signaling flow 200A, if the server 110 determines that the test of the interface passes, the server 110 can feed back (242) notification information to the terminal device 120. The terminal device 120 receives (244) the notification information and can determine that the interface is created.
[0063] If the target feedback information for the test question cannot be received from the interface, the test of the interface is determined to fail. An example case where the target feedback information for the test question cannot be received from the interface is that the machine learning model 130 determines, based on the test question, that the interface to be called is not the tested interface. This case can be caused by inaccurate description information in the interface definition, which makes the machine learning model 130 unable to correctly understand the function of the tested interface, so that the machine learning model 130 cannot determine that the tested interface should be called to respond to the test question.
[0064] Another example case where the target feedback information for the test question cannot be received from the interface is that the machine learning model 130 determines, based on the test question, that the tested interface needs to be called, but cannot obtain correct target feedback information after sending a call request to the interface based on the call parameter. This case can be caused by an error in the call parameter provided by the machine learning model 130 based on the interface definition, which makes the server 110 unable to correctly call the tested interface, or unable to obtain correct target feedback information from the tested interface.
[0065] Alternatively or additionally, the error in the call parameter can include one or more input parameter errors and / or one or more output parameter errors of the interface. In the case of one or more input parameter errors, the server 110 cannot correctly call the tested interface. In the case of one or more output parameter errors, the interface cannot feed back correct target feedback information.
[0066] The process after determining that the test result indicates that the test of the interface fails is described below in connection with FIG. 2B. FIG. 2B shows a flowchart of a signaling flow 200B for interface processing involving the server 110, the terminal device 120, and the machine learning model 130, according to some embodiments of the present disclosure. It can be understood that the signaling flow 200B can be performed after the signaling flow 200A. For ease of discussion, the signaling flow 200B will be described with reference to the environment of FIG. 1.
[0067] In embodiments of the present disclosure, as shown in the signaling flow 200B, the server 130 can obtain (246) an updated prompt word if it is determined that the test result indicates that the test of the interface fails. The server 130 can construct a model input 240 of the machine learning model 130 based on the first definition content and the updated prompt word, and provide (248) the model input 240 to the machine learning model 130. After the machine learning model 130 obtains (252) the model input 240, the machine learning model 130 generates (254) a third definition content.
[0068] As can be known from the foregoing analysis, the test of the interface failing can be caused by the description information of the interface being inaccurate, or the calling parameters fed back by the machine learning model 130 being incorrect. These problems can be caused by the generation requirement of the second definition content in the prompt word being inaccurate, and the prompt word used to instruct the machine learning model 130 to generate the second definition content can be updated. On this basis, the prompt word can be updated, and the machine learning model 130 is triggered to generate a third definition content based on the updated prompt word. The third definition content here can contain all or part of the fields in the second definition content. For example, the updated prompt word can instruct the machine learning model 130 to regenerate all the fields in the second definition content. For another example, if it is detected that the description information is inaccurate, the input parameters are incorrect, or the output parameters are incorrect, the machine learning model 130 is instructed to regenerate the description information of the interface, one or more input parameters, one or more output parameters, and the like through the updated prompt word.
[0069] In embodiments of the present disclosure, as shown in the signaling flow 200B, the machine learning model 130 feeds back (256) the third definition content to the server 110. After the server 110 receives (258) the third definition content, the server 110 updates (262) the interface definition of the interface based on the third definition content.
[0070] In embodiments of the present disclosure, as shown in signaling flow 200B, the server 110 constructs a model input 250 of the machine learning model 130 based on the test question for the interface and the updated interface definition of the interface, provides (264) the model input 250 to the machine learning model 130. The machine learning model 130 receives (266) the model input 220 and generates (268) a model response 260, and the machine learning model 130 feeds back (272) the model response 260 to the server 110. The server 110 determines the test result of the interface based on the received (274) model response 260.
[0071] It can be understood that in the actual interface creation process, if the interface passes the test once, the process shown in signaling flow 200B will not occur. If the interface fails one or more tests, the process shown in signaling flow 200B can be performed once or repeatedly.
[0072] In embodiments of the present disclosure, as shown in signaling flow 200, the server 110 can feed back (278) notification information to the terminal device 120 if it is determined that the test result indicates that the test of the interface passes. The terminal device 120 can determine that the interface creation is completed in response to receiving (282) the notification information.
[0073] The process after the interface creation is completed is described below in combination with FIG. 4. FIG. 4 shows a flowchart of a signaling flow 400 for interface processing, which involves the server 150, the terminal device 160, and the machine learning model 170, according to some embodiments of the present disclosure. For ease of discussion, the signaling flow 400 will be described with reference to the environment of FIG. 1.
[0074] In embodiments of the present disclosure, as shown in signaling flow 400, the terminal device 160 can send (402) a calling parameter 410 to the server 150 in response to the triggering operation of the digital assistant 161 by the user 180. The server 150 can receive (404) the calling parameter 410 from the terminal device 160, send (406) a calling request to a corresponding interface based on the calling parameter 410, and receive feedback information 420 from the corresponding interface.
[0075] In embodiments of the present disclosure, as shown in signaling flow 400, the server 150 can send (408) the feedback information 420 to the terminal device 160. The terminal device 160 can receive (412) the feedback information 420 from the server 160.
[0076] The above process shows that the user 180 can operate the digital assistant 161 through the terminal device 160 or an attached device of the terminal device 160 to trigger the digital assistant to directly send the calling parameter to the server 150, thereby triggering the process of calling the interface. In the above process, the server 150 does not need to request the machine learning model 170 to determine the interface to be called, nor does it need to request the machine learning model 170 to determine the calling parameter of the interface.
[0077] The following will continue to combine the signaling flow 400 to exemplarily illustrate the interaction process of the terminal device 160, the server 150 and the machine learning model 170 in the scenario of the user 180 having a conversation with the digital assistant 161.
[0078] In an embodiment of the present disclosure, as shown in the signaling flow 400, the terminal device 160 can send (414) the question of the user 180 to the server 150 in response to receiving the question. The server 150 receives (416) the question and can send (418) the question to the machine learning model 170. The machine learning model 170 can generate (424) a model response 430 in response to receiving (422) the question. The model response 430 here can include the calling parameter of the interface.
[0079] In an embodiment of the present disclosure, as shown in the signaling flow 400, the terminal device 160 can send (426) the model response 430 to the server 150, and the server 150 receives (428) the model response 430 and can call (432) the corresponding interface based on the calling parameter in the model response 430 to obtain the feedback information 440 of the interface feedback. Then, the server 150 can send the feedback information 440 to the terminal device 160. The terminal device 160 receives (436) the feedback information 440 and can present the feedback information 440 by using the digital assistant.
[0080] To sum up, according to the embodiments of the present disclosure, in the interface creation process, the difficulty and cost of interface development of the developer can be reduced, and such interface definition is easier to be understood by the machine learning model, which is conducive to improving the accuracy and success rate of interface calling.
[0081] FIG. 5 shows a flowchart of a process 500 for interface processing according to some embodiments of the present disclosure. The process 500 can be implemented at the server 110.
[0082] In block 510, the server 110 obtains the interface definition of the interface in response to the creation request of the interface.
[0083] In block 520, the server 110 provides the first definition content and the prompt word in the interface definition to the machine learning model to obtain the second definition content generated by the machine learning model for the interface.
[0084] In block 530, the service end 110 updates the interface definition of the interface based on the second definition content.
[0085] In block 540, the service end 110 creates the interface by using the updated interface definition.
[0086] In some embodiments, the prompt words include at least a generation requirement on the definition content of the interface.
[0087] In some embodiments, the first definition content includes one or more fields in the interface definition.
[0088] In some embodiments, the first definition content includes a field name of each of the one or more fields and field information of at least part of the one or more fields.
[0089] In some embodiments, the second definition content includes field information generated by the machine learning model for at least part of the one or more fields.
[0090] In some embodiments, the second definition content includes at least one of the following: an identifier corresponding to an identification field of the interface, description information corresponding to a description field of the interface, an input parameter corresponding to one or more input fields of the interface, or an output parameter corresponding to one or more output fields of the interface.
[0091] In some embodiments, at least the second definition content is provided to the machine learning model or another machine learning model for determining the call to the interface.
[0092] In some embodiments, the process 500 is further configured to determine a test result of the interface by providing a test question for the interface and the updated interface definition of the interface to the machine learning model.
[0093] In some embodiments, the process 500 is further configured to receive a model response for the test question from the machine learning model; determine that the test result indicates that the test of the interface fails if the model response does not indicate the call to the interface; and
[0094] if the model response at least indicates a call parameter of the call to the interface, send a call request to the interface based on the call parameter and a call address indicated in the interface definition, determine that the test of the interface passes if target feedback information for the test question is received from the interface, and determine that the test of the interface fails if the target feedback information for the test question fails to be received from the interface.
[0095] In some embodiments, the process 500 is further configured to: obtain an updated prompt word if the test result indicates that the test of the interface fails; provide the first definition content and the updated prompt word to the machine learning model to obtain third definition content regenerated by the machine learning model; and update the interface definition of the interface based on the third definition content.
[0096] Embodiments of the present disclosure also provide a corresponding apparatus for implementing the above method or process. FIG. 6 shows an exemplary structural block diagram of an apparatus 600 for interface processing according to some embodiments of the present disclosure. The apparatus 600 can be implemented as or included in the service end 110. Various modules / components in the apparatus 600 can be implemented by hardware, software, firmware, or any combination thereof.
[0097] As shown in FIG. 6, the apparatus 600 includes an obtaining module 610, a providing module 620, an updating module 630, and a creating module 640. The obtaining module 610 is configured to obtain an interface definition of an interface in response to a creation request of the interface. The providing module 620 is configured to provide first definition content in the interface definition and a prompt word to a machine learning model to obtain second definition content of the interface generated by the machine learning model. The updating module 630 is configured to update the interface definition of the interface based on the second definition content. The creating module 640 is configured to create the interface by using the updated interface definition.
[0098] In some embodiments, the prompt word at least includes a generation requirement for the definition content of the interface.
[0099] In some embodiments, the first definition content includes one or more fields in the interface definition.
[0100] In some embodiments, the first definition content includes a field name of each of the one or more fields and field information of at least part of the one or more fields.
[0101] In some embodiments, the second definition content includes field information generated by the machine learning model for at least part of the one or more fields.
[0102] In some embodiments, the second definition content includes at least one of the following: an identifier corresponding to an identification field of the interface, description information corresponding to a description field of the interface, an input parameter corresponding to one or more input fields of the interface, or an output parameter corresponding to one or more output fields of the interface.
[0103] In some embodiments, at least the second definition content is provided to the machine learning model or another machine learning model for determining a call to the interface.
[0104] In some embodiments, the apparatus 600 further includes a testing module configured to determine a test result for the interface by providing the test question for the interface and the updated interface definition of the interface to the machine learning model.
[0105] In some embodiments, the testing module is further configured to: receive a model response for the test question from the machine learning model; determine that the test result indicates that the test for the interface fails if the model response does not indicate a call to the interface; and determine that the test for the interface passes if the model response indicates at least a call parameter to the interface, send a call request to the interface based on the call parameter and the call address indicated in the interface definition, determine that the test for the interface passes if target feedback information for the test question is received from the interface, and determine that the test for the interface fails if the target feedback information for the test question fails to be received from the interface.
[0106] In some embodiments, the testing module is further configured to: obtain an updated prompt word if the test result indicates that the test for the interface fails; provide the first definition content and the updated prompt word to the machine learning model to obtain third definition content regenerated by the machine learning model; and update the interface definition of the interface based on the third definition content.
[0107] The units and / or modules included in the apparatus 600 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, e.g., machine executable instructions stored on a storage medium. In addition to or alternatively, some or all of the units and / or modules in the apparatus 600 can be implemented at least partially by one or more hardware logic components. As an example and not by way of limitation, example types of hardware logic components that can be used include Field-Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Products (ASSPs), System-on-a-Chip (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0108] It should be understood that one or more steps in the above methods can be performed by an appropriate electronic device or combination of electronic devices. Such an electronic device or combination of electronic devices may, for example, include the server 110 in FIG. 1.
[0109] FIG. 7 shows a block diagram of an electronic device 700 in which one or more embodiments of the present disclosure can be implemented. It should be understood that the electronic device 700 shown in FIG. 7 is merely an example and should not be construed to limit the functionality and scope of the embodiments described herein. The electronic device 700 shown in FIG. 7 can be used to implement the server 110 in FIG. 1, and the electronic device 700 can also be used to implement the apparatus 600 in FIG. 6.
[0110] As shown in FIG. 7, electronic device 700 is in the form of a general electronic device. Components of electronic device 700 can include, but are not limited to, one or more processors or processing units 710, memory 720, storage 730, one or more communication units 740, one or more input devices 750, and one or more output devices 760. Processing unit(s) 710 can be actual or virtual processors and capable of executing various processing in accordance with programs stored in memory 720. In a multiprocessor system, multiple processing units execute computer-executable instructions in parallel to improve the parallel processing capability of electronic device 700.
[0111] Electronic device 700 typically includes a plurality of computer storage media. Such media can be removable and / or non-removable, and can include volatile and / or nonvolatile media. Memory 720 can be volatile (such as, for example, registers, cache, random access memory (RAM)), non-volatile (such as, for example, read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage 730 can be removable or non-removable and can include machine-readable media, such as, for example, flash drives, disks, or any other media capable of storing information and / or data and accessible by electronic device 700.
[0112] Electronic device 700 can further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG. 7, a disk drive or other computer-readable media drive can be provided for reading from or writing to a removable, non- volatile magnetic disk (e.g., a "hard drive"), and a disk drive or other computer-readable media drive can be provided for reading from or writing to a removable, non-volatile optical disk (such as a CD-ROM or other optical medium). In these instances, each drive can be connected to the bus (not shown) by one or more data media interfaces. Memory 720 can include a computer program product 725 having one or more program modules configured to carry out the various methods or actions of the various embodiments of the present disclosure.
[0113] Communication unit(s) 740 enable communication with other electronic devices via communication media. Additionally, functionality of components of electronic device 700 can be implemented in a single computing cluster or a plurality of computer machines capable of communication through a communication connection. Accordingly, electronic device 700 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network nodes.
[0114] Input device 750 can be one or more input devices, such as a mouse, a keyboard, a trackball, etc. Output device 760 can be one or more output devices, such as a display, a speaker, a printer, etc. Electronic device 700 can also communicate with one or more external devices (not shown) such as a storage device, a display device, etc. through communication unit 740, as desired, in order to communicate with one or more devices that enable a user to interact with electronic device 700, or to communicate with any device (e.g., a network card, a modem, etc.) that enables electronic device 700 to communicate with one or more other electronic devices. Such communication can be carried out via an input / output (I / O) interface (not shown).
[0115] According to an example implementation of the present disclosure, a computer readable storage medium is provided having computer executable instructions stored thereon, where the computer executable instructions are executed by a processor to implement the method described above. According to an example implementation of the present disclosure, a computer program product is also provided that is tangibly stored on a non-transitory computer readable medium and includes computer executable instructions, where the computer executable instructions are executed by a processor to implement the method described above.
[0116] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0117] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0118] The computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some, as newer, implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0120] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. A method for interface processing, comprising: obtaining an interface definition of an interface in response to a creation request of the interface; providing first definition content in the interface definition and a prompt to a machine learning model to obtain second definition content generated by the machine learning model for the interface; updating the interface definition of the interface based on the second definition content; and creating the interface with the updated interface definition. 2.The method of claim 1, wherein the prompt comprises at least a generation requirement for definition content of the interface. 3.The method of claim 1, wherein the first definition content comprises one or more fields in the interface definition. 4.The method of claim 3, wherein the first definition content comprises a field name of each of the one or more fields and field information of at least part of the one or more fields. 5.The method of claim 3, wherein the second definition content comprises field information generated by the machine learning model for at least part of the one or more fields. 6.The method of claim 1, wherein the second definition content comprises at least one of: an identifier corresponding to an identification field of the interface, description information corresponding to a description field of the interface, input parameters corresponding to one or more input fields of the interface, or output parameters corresponding to one or more output fields of the interface. 7.The method of claim 1, wherein at least the second definition content is provided to the machine learning model or another machine learning model for determining a call to the interface. 8.The method of claim 1, further comprising: determining a test result for the interface by providing a test question for the interface and the updated interface definition of the interface to the machine learning model. 9.The method of claim 8, wherein determining the test result for the interface comprises: receiving a model response for the test question from the machine learning model; determining that the test result indicates that a test of the interface fails if the model response does not indicate a call to the interface; and if the model response indicates at least a call parameter to the interface, sending a call request to the interface based on the call parameter and a call address indicated in the interface definition, determining that the test of the interface passes if target feedback information for the test question is received from the interface, and determining that the test of the interface fails if the target feedback information for the test question fails to be received from the interface. 10.The method of claim 8, further comprising: if the test result indicates that the test of the interface fails, obtaining an updated prompt; providing the first definition content and the updated prompt to the machine learning model to obtain third definition content regenerated by the machine learning model; and updating the interface definition of the interface based on the third definition content. 11. An apparatus for interface processing, comprising: an obtaining module configured to obtain an interface definition of an interface in response to a creation request of the interface; a providing module configured to provide first definition content and a prompt word in the interface definition to a machine learning model to obtain second definition content generated by the machine learning model for the interface; an updating module configured to update the interface definition of the interface based on the second definition content; and a creating module configured to create the interface with the updated interface definition.
12. An electronic device, comprising: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions, when executed by the at least one processing unit, cause the electronic device to perform the method according to any one of claims 1-10.
13. A computer-readable storage medium having stored thereon a computer program, the computer program being executable by a processor to implement the method according to any one of claims 1-10.
14. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1-10.
Citation Information
Patent Citations
API case generation method and device, electronic equipment, storage medium and product
CN117609063A
Method and system for automatically generating reusable API based on code snippets
CN117892031A
Code completion method and device, electronic equipment and medium
CN118227106A
Automated API code generation
US20210279115A1
System and method of automated processing for dynamic API generation
US20230267018A1