Function integration method and related device
Automatically generate interface call code through the software development platform and use agents to achieve automated integration of functions and applications, solving the problems of large workload and poor portability of third-party application integration APIs, and achieving flexible function combinations and business requirements.
Patent Information
- Application Number
- PCT/CN2024/117220
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-24
- Filing Date
- 2024-09-05
- Publication Date
- 2025-08-14
AI Technical Summary
In the prior art, third-party application integrated application programming interface (API) has a large workload, is difficult to meet business needs, and is poor in portability.
Receive interface documents through the software development platform, extract functional attribute information, generate interface call code, and establish connections with applications through agents to achieve automated function integration.
It greatly reduces the difficulty and workload of API integration, and the function combination is more flexible and can meet business needs.
Smart Images

Figure CN2024117220_14082025_PF_FP_ABST
Abstract
Description
Function integration method and related equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on February 5, 2024, with application number 202410166723.2, and with the invention name “A Function Integration Method and Related System”, and claims priority to the Chinese patent application filed with the State Intellectual Property Office on April 24, 2024, with application number 202410512977.5, and with the invention name “A Function Integration Method and Related Equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of software development technology, and in particular to a function integration method, a software development platform, a computing device cluster, a computer-readable storage medium, and a computer program product. Background Art
[0003] With the continuous advancement of software development technology, developers have developed a large number of applications (APPs), including but not limited to gaming applications, audio and video applications, and image processing applications. These applications can provide a variety of functions for users to use. At the same time, to meet specific needs, these applications also open application programming interfaces (APIs) for third-party applications to call, allowing for customization or enhanced functionality.
[0004] To customize or enhance functionality within third-party applications, third-party application developers can develop code based on the current application's functionality and open interfaces (such as open APIs). However, each application can expose dozens to hundreds of APIs for functionality. The workload of integrating these APIs can outweigh the benefits, resulting in poor portability and difficulty meeting business needs.
[0005] Summary of the Invention
[0006] This application provides a function integration method that supports the automatic generation of interface call code. Applications can execute the functions supported by the agent by executing the interface call code, thereby achieving automated integration of functions and applications, significantly reducing the difficulty and workload of API integration, and providing more flexible and rich function combinations to meet business needs. This application also provides a software development platform, computing device cluster, computer-readable storage medium, and computer program product corresponding to the above method.
[0007] In the first aspect, the present application provides a function integration method. The method is applied to a software development platform. The software development platform is used to implement function integration or function combination, specifically to integrate functions into applications, and therefore, it can also be referred to as a function integration system or a function combination system. Among them, the software development platform can be a software system, for example, an integrated development environment (IDE), or a plug-in or functional module of an integrated development environment. The software system can be deployed in a computing device cluster, and the computing device cluster executes the program code of the software system, thereby executing the function integration method of the present application. In some examples, the software development platform can also be a hardware system, for example, a computing device cluster with function integration capabilities, which executes the function integration method of the present application when the computing device cluster is running.
[0008] Specifically, the software development platform receives an interface document of a first function, extracts attribute information of the first function from the interface document, the attribute information of the first function includes at least one of a function identifier, a function description, an input parameter, or an output parameter of the first function, and then the software development platform calls a code generator based on the attribute information of the first function to generate an interface call code for the first function, and then the software development platform receives attribute information of a user-configured agent, the attribute information of the agent includes a function list, the function list includes a second function, and the second function is a subset of the first function, and the agent is used to drive the application to execute the second function through the interface call code, and then the software development platform establishes a connection between the agent and the application.
[0009] This method is based on the attribute information of the function extracted from the interface document, calling the code generator to automatically generate the interface call code of the function, and by configuring the function list supported by the proxy and connecting the proxy with the application, the application can execute the functions supported by the proxy by executing the interface call code, thereby realizing the automatic integration of functions and applications, greatly reducing the difficulty and workload of API integration, and making the function combination more flexible and rich to meet business needs.
[0010] In some possible implementations, when the interface of the first function includes a standard interface, the software development platform may, based on the type of the standard interface, invoke a code generator corresponding to the type of the standard interface to generate interface call code for the standard interface. When the interface of the first function includes a non-standard interface, the software development platform may, based on the type of the non-standard interface, invoke a programming language model through a code generator to generate interface call code for the non-standard interface.
[0011] This method supports generating interface call codes for standard interfaces and non-standard interfaces using methods that are adapted to the interfaces, thus ensuring the quality of code generation.
[0012] In some possible implementations, the software development platform can also display the interface call code. The software development platform can receive feedback on the interface call code. This feedback can include acceptance, revision, or rejection. This method supports manual intervention in interface call code generation, such as revising the generated code or rejecting the current generated code if it fails to meet requirements and regenerating the code. This can further improve code generation quality.
[0013] In some possible implementations, the software development platform may receive a function list configured by the user through an agent configuration interface, where the function list includes a function identifier and a function description of the second function. Alternatively, the software development platform may receive agent attribute information configured by the user through an application programming interface (API), where the function identifier of the second function is configured in the request body of the API.
[0014] This method supports multiple ways to configure the agent's attribute information. Users can choose to configure the agent's attribute information through the agent configuration interface or through the API according to their needs. It has high availability and can meet personalized needs.
[0015] In some possible implementations, the software development platform registers the first function in the language model through a registration interface, and the interface parameters of the registration interface include a function identifier of the first function.
[0016] In this method, the software development platform can provide assistance for the subsequent configuration of the function list supported by the agent by registering the first function in a language model such as a large language model, and lay the foundation for subsequent function calls based on the language model-driven application execution interface call code.
[0017] In some possible implementations, the software development platform receives instructions sent by the application through an agent, and according to the instructions, the software development platform drives the application to execute the interface call code of the second function through a language model to execute the second function.
[0018] This method not only supports the automatic generation of interface call code, but also supports the automatic execution of interface call code based on the connection relationship between the agent and the application, realizes automatic function calling, and meets higher-level business needs.
[0019] In some possible implementations, the software development platform can obtain a function list from an agent associated with the application. The software development platform inputs the instructions and function list into a language model, which then generates an action sequence. The software development platform then uses the agent to parse the action sequence, obtain a function bound to at least one action in the action sequence, populate the function with input parameters, obtain an interface call request, and send the interface call request to the application.
[0020] In this way, the natural language processing capability based on the language model can be realized, the instructions in natural language form and the function list supported by the agent can be analyzed, the action sequence that implements the corresponding function of the instruction can be obtained, the action sequence can be parsed to obtain the function bound to at least one action in the action sequence, the parameters of the function can be filled in based on the language model, the interface call request can be obtained, and the automatic call function can be realized.
[0021] In some possible implementations, the application is a game application whose execution environment includes controllable objects, such as non-player characters (NPCs). Accordingly, the software development platform can establish connections between agents and controllable objects running in the game engine of the game application. This enables automated batch integration of game features, significantly reducing integration workload and costs.
[0022] In some possible implementations, the application is a robot-assisted application, which is deployed on a robot body. The interface document includes an interface document for a first function supported by the robot body. The agent is used to drive the robot-assisted application to call code through the interface to instruct the robot body to perform a second function.
[0023] This enables intelligent robot linkage, improving the level of intelligence, such as in smart homes and smart manufacturing, and enhancing user experience. It also enables integrated application development, supporting automatic combination and invocation based on user input, improving efficiency.
[0024] In some possible implementations, the first function includes an information query function, and the application is an application for implementing the information query function.
[0025] In a second aspect, the present application provides a software development platform. The software development platform is used to integrate functions into applications, and the software development platform includes:
[0026] a function analysis subsystem configured to receive an interface document of a first function, extract attribute information of the first function from the interface document, the attribute information of the first function including at least one of a function identifier, a function description, an input parameter, or an output parameter of the first function, and, based on the attribute information of the first function, call a code generator to generate an interface call code for the first function;
[0027] a function configuration subsystem, configured to receive attribute information of an agent configured by a user, the attribute information of the agent including a function list, the function list including a second function, the second function being a subset of the first function, the agent being configured to drive the application to call code through the interface to execute the second function;
[0028] The association subsystem is used to establish a connection between the agent and the application.
[0029] In some possible implementations, the function analysis subsystem is specifically configured to:
[0030] When the interface of the first function includes a standard interface, according to the type of the standard interface, calling a code generator corresponding to the type of the standard interface to generate an interface calling code for the standard interface;
[0031] When the interface of the first function includes a non-standard interface, according to the type of the non-standard interface, the interface calling code of the non-standard interface is generated by calling a programming language model through a code generator.
[0032] In some possible implementations, the function analysis subsystem is further configured to:
[0033] Display the interface calling code;
[0034] Feedback on the interface calling code is received, the feedback including acceptance, revision or rejection.
[0035] In some possible implementations, the function configuration subsystem is specifically configured to:
[0036] receiving the function list configured by the user through the agent configuration interface, wherein the function list includes a function identifier and a function description of the second function; or
[0037] Receive attribute information of the agent configured by a user through an application programming interface (API), wherein a function identifier of the second function is configured in a request body of the API.
[0038] In some possible implementations, the function analysis subsystem is further configured to:
[0039] The first function is registered in the language model through a registration interface, where an interface parameter of the registration interface includes a function identifier of the first function.
[0040] In some possible implementations, the association subsystem is further configured to:
[0041] receiving, through the agent, instructions sent by the application;
[0042] According to the instruction, the application is driven by a language model to execute an interface calling code of the second function to execute the second function.
[0043] In some possible implementations, the association subsystem is specifically configured to:
[0044] Obtaining a list of capabilities of the agent associated with the application;
[0045] Inputting the instruction and the function list into a language model, and generating an action sequence through the language model;
[0046] The action sequence is parsed by the agent to obtain a function bound to at least one action in the action sequence, input parameters are filled in the function, an interface call request is obtained, and the interface call request is sent to the application.
[0047] In a third aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, each of which includes at least one processor and at least one memory. The at least one processor and the at least one memory communicate with each other. The at least one processor is configured to execute instructions stored in the at least one memory, causing the computing device or computing device cluster to perform the function integration method described in the first aspect or any implementation of the first aspect.
[0048] In a fourth aspect, the present application provides a computer-readable storage medium storing instructions that instruct a computing device or a computing device cluster to execute the function integration method described in the first aspect or any implementation of the first aspect.
[0049] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device or a computing device cluster, enables the computing device or computing device cluster to execute the functional integration method described in the first aspect or any one of the implementations of the first aspect.
[0050] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical method of this application, the following is a brief introduction to the drawings required.
[0052] FIG1 is a schematic diagram of a process for implementing a specific function in a gaming environment provided by the present application;
[0053] FIG2 is a schematic diagram of the architecture of a software development platform provided by this application;
[0054] FIG3 is a flow chart of a function integration method provided by the present application;
[0055] FIG4 is a schematic diagram of a function configuration interface provided by this application;
[0056] FIG5 is a schematic diagram of a process for extracting attribute information from an interface document during a function analysis phase provided by the present application;
[0057] FIG6 is a schematic diagram of a process for extracting attribute information from an interface document during the function analysis phase provided by this application;
[0058] FIG7 is a flow chart of a function integration method provided by the present application;
[0059] 8A to 8G are schematic diagrams of the relevant processes and interfaces of a method for integrating functions in a game application scenario provided by this application;
[0060] FIG9 is a flow chart of a method for integrating functions in a game application scenario provided by this application;
[0061] 10A to 10B are schematic diagrams of the relevant processes and interfaces of a method for integrating functions in a smart home scenario provided by this application;
[0062] FIG11 is a flow chart of a method for integrating functions in an integrated application development scenario provided by this application;
[0063] FIG12 is a schematic diagram of the structure of a computing device provided by the present application;
[0064] FIG13 is a schematic diagram of the structure of a computing device cluster provided by the present application;
[0065] FIG14 is a schematic diagram of the structure of another computing device cluster provided by the present application;
[0066] FIG15 is a schematic diagram of the structure of another computing device cluster provided in this application. DETAILED DESCRIPTION
[0067] The terms "first" and "second" in the embodiments of this application are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, features specified as "first" or "second" may explicitly or implicitly include one or more of the features.
[0068] First, some technical terms involved in the embodiments of this application are introduced.
[0069] Application software, also known as application programs or apps, refers to programs written for specific user purposes, such as word processors, spreadsheets, accounting applications, browsers, media players, flight simulators, command-line games, image editors, etc. Applications can provide a variety of functions for users to use.
[0070] In computer programming, a function is typically defined as a function used to perform a specific task or achieve a specific function. Therefore, it is also called a function. Functions are typically designed as reusable blocks of code. When an application needs to perform a specific task, it can directly call the function to implement it without having to rewrite the same code. Application functions can also be exposed to third-party applications through interfaces for customization or enhanced functionality. These interfaces can be application programming interfaces (APIs).
[0071] To implement customized or enhanced features based on existing applications (such as those with open interfaces for third-party invocation), third-party application developers typically need to develop code based on the current application's functionality and open APIs. For example, game applications often feature non-player characters (NPCs). Some game applications currently have AI NPCs that can enable intelligent dialogue, drive storylines, and set NPC backgrounds, personalities, memories, and emotions. However, these features fall short of user needs. For example, AI NPCs struggle to schedule treasure hunts, necessitating the addition of third-party application interface calls to enhance NPCs' ability to perform specific functions within the game environment.
[0072] As shown in Figure 1, developers can first implement the game's function call code and save it to a database and language model (LM). The language model can be a large language model, such as a generative pre-trained transformer (GPT) based on a transformer. The function call code can be the code that drives the NPC's movement logic and display when calling a game's open move API, including move APIs for forward, backward, left, right, up, and down movements, when the NPC performs a function such as move. When the user drives the function call through language (such as natural language), the LLM interface can be called to input the language and function list. Accordingly, the LLM can generate an action sequence based on the language and function list. Based on the action sequence, the AI agent calls the function call code corresponding to each action in the action sequence from the database and executes the function call code in the game environment, thereby calling the corresponding function, obtaining a response, and determining whether to continue execution or exit.
[0073] In this example, when calling LLM, the user can enter natural language, such as "I'm flying from Shenzhen to Beijing tomorrow. What's the weather like?" In addition, the user can enter a function list, such as a function list provided by other applications. The function list can include the function name (name), description (description), and parameters (parameters). Parameters can include input parameters and / or output parameters.
[0074] In some examples, a function list may include a function named get_current_weather with a description of "querying weather information for a specific location." Users can enter input and output parameters for a function in a scheme file. It should be noted that the input and output parameters in a scheme file are formal parameters. A formal parameter is a virtual parameter used when defining a function. A formal parameter is a variable that receives actual parameters (referred to as actual parameters or actual parameter values) when a method is called.
[0075] Based on the aforementioned language and supported functions, LLM can output a sequence of actions to implement user needs. This sequence of actions can be represented by a series of function calls suggested by LLM. For example, LLM suggests calling the function get_current_weather, given the input location of Beijing. After the application receives the LLM's suggestion, it can parse the LLM's suggestion, call the function get_current_weather to obtain the weather, and return it to the user. In this method, LLM completes the conversion from natural language to API, but does not implement the calling and execution of third-party functions.
[0076] The above method still requires developers to spend a lot of time and energy on function integration. Each application can expose APIs for dozens to hundreds of functions. The workload of integrating these APIs may exceed the benefits of integrating the APIs, and the portability is poor. For example, when integrating a game API, the functions that can be controlled by each NPC, such as moving, shooting, digging, jumping, picking up, etc., as well as the tools that each NPC can use are all independent APIs. Developers need to develop calling code for the above APIs separately to achieve function integration or combination. This increases the complexity of application access or function integration, and the cost is high, making it difficult to meet business needs.
[0077] In view of this, the present application provides a function integration method. The method can be applied to a software development platform. The software development platform is used to implement function integration or function combination, specifically to integrate functions into applications. Therefore, it can also be called a function integration system or a function combination system. Among them, the software development platform can be a software system, for example, it can be an integrated development environment (IDE), or a plug-in or functional module of an integrated development environment. The software system can be deployed in a computing device cluster, and the computing device cluster executes the program code of the software system, thereby executing the function integration method of the present application. Among them, the software system can be provided to the user in the form of a software package, and the user deploys the software package to a local computing device or a private cloud. Alternatively, the software system can also be provided to the user in the form of a cloud service, for example, the software system can be deployed in a public cloud, and the cloud platform opens the cloud service API for user use. In some possible implementations, the software development platform can also be a hardware system, for example, a computing device cluster with function integration capabilities, which executes the function integration method of the present application when the computing device cluster is running.
[0078] Specifically, the software development platform receives an interface document (such as an API document) of the first function, for example, receives the interface document of the first function submitted by the developer, and the software development platform extracts the attribute information of the first function from the interface document. The attribute information of the first function includes at least one of the function identifier (identifier, ID), function description (description, desc), input parameters or output parameters of the first function. Based on the attribute information of the first function, the software development platform can call the code generator to generate the interface call code of the first function. Then the software development platform receives the attribute information of the agent configured by the user (such as the developer). The attribute information of the agent includes a function list, and the function list includes the second function. The second function can be a function that the user selects from the first function and needs to be integrated. The second function is a subset of the first function. The agent is used to drive the application to execute the second function through the interface call code. The software development platform can establish a connection between the agent and the application so that the agent drives the application to execute the interface call code to execute the second function.
[0079] This method is based on the attribute information of the function extracted from the interface document, calling the code generator to automatically generate the interface call code of the function, and by configuring the function list supported by the proxy and connecting the proxy with the application, the application can execute the functions supported by the proxy by executing the interface call code, thereby realizing the automatic integration of functions and applications, greatly reducing the difficulty and workload of API integration, and making the function combination more flexible and rich to meet business needs.
[0080] In order to make the technical solution of the present application clearer and easier to understand, the architecture of the software development platform of the present application is first introduced with reference to the accompanying drawings.
[0081] 2 shows an architectural diagram of a software development platform. Software development platform 200 includes a function analysis subsystem 202, a function configuration subsystem 204, and an association subsystem 206. Similar to software development platform 200, function analysis subsystem 202, function configuration subsystem 204, and association subsystem 206 can be software or hardware. For ease of description, this application uses the above subsystems as software examples.
[0082] The function analysis subsystem 202 is used to receive an interface document for a first function, for example, an interface document for a first function submitted by a developer. The first function may be an interface document for a function opened by a software or hardware manufacturer. For example, in a gaming scenario, the interface document for the first function may be an interface document for a function opened by a gaming manufacturer. The interface for function X opened by game manufacturer A may be integrated into the game of game manufacturer B, so that game manufacturer B's game also has function X. For another example, in a smart home scenario, the interface document for the first function may be an interface document for a function opened by a sweeping robot manufacturer. The interface for function Y opened by the sweeping robot manufacturer may be integrated into a robot assistant service (or robot assistant, robot assistant).
[0083] The function analysis subsystem 202 is also used to extract the attribute information of the first function from the interface document, and based on the attribute information of the first function, call the code generator to generate the interface call code of the first function. The attribute information of the first function includes at least one of the function identifier, function description, input parameters or output parameters of the first function. The function identifier can be a function name (such as the name of a function function). For example, in a game scene, the function identifier can be move. Taking into account that in some cases, the function name is not unique, the function identifier can also be a sequence number (SN) generated for the function. The function description is used to describe the tasks that can be completed or the effects achieved by the first function.
[0084] It should be noted that when generating interface call code, the function analysis subsystem 202 can generate interface call code in a manner that is suitable for the interface type in combination with the interface type. When the interface of the first function includes a standard interface, such as a standard Representational State Transfer (REST) API or a standard SDK of each language, the function analysis subsystem 202 can call the code generator corresponding to the type (or code type) of the standard interface according to the type of the standard interface to generate the interface call code of the standard interface. When the interface of the first function includes a non-standard interface, the function analysis subsystem 202 calls the programming language model through the code generator according to the type of the non-standard interface to generate the interface call code of the non-standard interface.
[0085] Function configuration subsystem 204 is used to receive agent attribute information configured by a user (e.g., a developer). The agent attribute information includes a function list. The function list may include a second function, which is a subset of the first function. The agent is used to drive the application to call code through the interface to execute the second function. Furthermore, the agent attribute information may also include an agent ID, which is unique and can be, for example, the agent name. By configuring an agent (e.g., an AI agent) in software development platform 200, the developer assigns the agent a specific combination of functions, forming a specific function set.
[0086] The association subsystem 206 is used to establish a connection between the agent and the application, for example, by establishing a connection between the agent and the application based on the agent identifier. In the application's runtime environment, the developer can pair or associate the application with the agent to form an automated code driver, thereby driving the application to execute the interface call code of the second function to invoke the second function.
[0087] Based on the software development platform 200 provided by the present application, the present application further provides a function integration method, which is described in detail below in conjunction with embodiments.
[0088] Referring to the flowchart of a function integration method shown in FIG3 , the method includes the following steps:
[0089] S302: The software development platform 200 receives an interface document of a first function.
[0090] The first function refers to an open interface for developers to enhance functions based on the interface. In the game scenario, the first function may be a function opened by a game manufacturer or game developer, such as move. In the smart home scenario, the first function may also be a function opened by a robot (such as a sweeping robot) manufacturer. Among them, robots and other devices such as air conditioners can form an artificial intelligence network (artificial intelligence of things, AIoT), and devices including robots and air conditioners are also called AIoT devices. Based on this, the first function may also be a function opened by an AIoT device manufacturer. It should be noted that this application can also be used in other scenarios, such as office scenarios and travel scenarios. In the above scenarios, each application manufacturer can open functions to facilitate functional integration of other applications. For example, weather query application manufacturers and geographic information query manufacturers can open weather query functions and geographic query functions to facilitate functional integration of current applications.
[0091] An interface document is a description document used to describe interface information. For the first function, the interface document can be a description document for various development interfaces, such as Postman. Postman is a widely used interface testing tool that tracks network requests when developing and debugging network programs, effectively helping backend developers independently test interfaces.
[0092] Specifically, the software development platform 200 may provide a function configuration interface. This function configuration interface is used to support user configuration of functions accessed through the software development platform 200, thereby facilitating the subsequent integration of these functions into other applications. Taking a first application and a second application as examples, each application may expose interface documents for multiple functions, and the second application may execute the corresponding API call code in the interface documents to implement the functions of the first application.
[0093] The above-mentioned function configuration interface can be a graphical user interface (GUI) or a command user interface (CUI). For ease of description, the function configuration interface is used as an example GUI for explanation below. Referring to the interface schematic diagram of a function configuration interface shown in Figure 4, the function configuration interface 400 may include a document configuration component 402, wherein the document configuration component 402 may include a path configuration control 4022, a browse control 4024, and an upload control 4026. A user (such as a developer) can enter the path of the interface document of the first function in the path configuration control 4022, and then click the upload control 4026 to submit the interface document of the first function to the software development platform 200. Alternatively, the user can browse the uploadable interface documents through the browse control 4024, select the interface document of at least one function, and then click the upload control 4026 to submit the interface document of the first function to the software development platform 100.
[0094] In some possible implementations, the software development platform 200 may also proactively obtain the open interface documentation for the first function. For example, the software development platform 200 may be connected to a software repository or open source platform. When a new application is detected, the software development platform 200 may obtain the interface documentation for the first function from the software repository or open source platform. For example, the software development platform 200 may obtain the interface documentation for the first function from the software repository or open source platform using a crawler.
[0095] S304: The software development platform 200 extracts attribute information of the first function from the interface document.
[0096] The attribute information of the first function includes at least one of the function identifier, function description, input parameters or output parameters of the first function. The function identifier is unique. For example, the function identifier can be the name of the function function, or the code of the function function. The function description is used to describe the function implemented by the interface. The input parameter is also called the request parameter, which is specifically the parameter required to be input when executing the function function. The output parameter is also called the return parameter, which is specifically the parameter output by the execution function. The output parameter can be the execution status, such as execution success or execution failure, or the execution result, such as the calculation result of the function function.
[0097] Considering that function definition tools typically abstract the name field to describe the function name and the description field to describe the function function, and parameter definitions follow standard parameter description formats such as REST, JavaScript Object Notation (JSON), Extensible Markup Language (XML), and YAML, the software development platform 200 can support different methods for extracting attribute information of the first function.
[0098] In some possible implementations, referring to FIG5 , the software development platform 200 may extract the name field content and description field content of the first function from the interface document, identify the format of the interface document based on the suffix of the interface document, parse the parameter field according to the format, and obtain the parameter field content. The software development platform 200 may organize the name field content, description field content, and parameter field content into a prompt. The prompt may include the name field content, description field content, parameter field content, and an output template. The format of the output template is as follows:
[0099] {
[0100] type: function
[0101] name:xxx
[0102] description:xxx
[0103] parameters: {a:xxx}
[0104] }
[0105] The prompt can be used as an input parameter of the large language model (LLM). The software development platform can input the prompt into the LLM to obtain attribute information of the first function. The attribute information of the first function can be represented by structured data. The format of the structured data can refer to the format of the output template in the prompt.
[0106] In some other possible implementations, the software development platform 200 can also use LLM to learn and summarize the functions of the functional functions, and then extract the attribute information of the first function. Referring to Figure 6, the software development platform 200 can use LLM to extract the name field content and description field content of the first function, and then identify the format of the interface document according to the suffix of the interface document, parse the parameter field according to the format, and obtain the parameter field content. The software development platform 200 organizes the name field content, description field content, and parameter field content into a prompt, for example, by splicing the name field content, description field content, parameter field content and the output template to obtain a prompt. Among them, the name field content, description field content, and parameter field content can be explicitly marked in the prompt, so that the LLM can extract the name field value, description field value, and parameter value therefrom. The software development platform 200 inputs the prompt into the LLM, thereby extracting the attribute information of the first function through the LLM.
[0107] S306 : The software development platform 200 calls a code generator to generate an interface calling code for the first function based on the attribute information of the first function.
[0108] The interface of the first function may include a standard interface or a non-standard interface, such as a standard API or a non-standard API. Among them, the standard API may be an API that complies with the interface standard. The interface standard is a series of rules and specifications formulated to ensure that different programs can communicate and interact with each other, including but not limited to Hypertext Transfer Protocol (HTTP) and Simple Object Access Protocol (SOAP). Standard interfaces may include standard REST APIs and standard SDKs in various languages. A non-standard API is an API that does not comply with the interface standard, and may usually be a custom API.
[0109] A standard interface usually provides a unified standardized way to access and utilize external resources (such as data resources). Based on this, when generating the interface call code of the standard interface, the interface call code can be generated based on the above-mentioned standardized method. Specifically, when the interface of the first function includes a standard interface, the software development platform 200 can call the code generator corresponding to the type of the standard interface according to the type of the standard interface, such as REST API or Java Database Connectivity (Java DataBase Connectivity) API, to generate the interface call code of the standard interface. Among them, the code generator may include a calling code template corresponding to the type of the standard interface. The code generator matches the attribute information of the first function with the calling code template and fills the attribute information into the corresponding position of the calling code template, thereby generating the interface call code of the standard interface.
[0110] The non-standard interface does not provide a unified standardized way to access and utilize external resources. Based on this, when generating the interface call code of the non-standard interface, it can be implemented in combination with a language model with code generation capabilities. Specifically, when the interface of the first function includes a non-standard interface, the software development platform 200 can generate the interface call code of the non-standard interface by calling the programming language model through the code generator according to the type of the non-standard interface. Among them, the programming language model can be a large language model for programming or a large language model with programming capabilities. It should be noted that the programming language model used to generate the interface call code of the non-standard interface and the language model used to extract attribute information can be the same model. Taking Figure 6 as an example, the programming language model used to generate the interface call code of the non-standard interface and the language model used to extract attribute information can be a general large language model LLM, which has code generation capabilities and attribute information extraction capabilities. In some examples, the programming language model used to generate the interface call code of the non-standard interface and the language model used to extract attribute information can also be different models.
[0111] Furthermore, in order to ensure code quality, the present application also supports manual intervention to confirm or modify the interface call code to ensure availability and reliability. Specifically, the software development platform 200 can also display the interface call code. The user can view the interface call code and edit the interface call code. When the user confirms that the interface call code is correct, the user can accept the interface call code. When the user confirms that there are errors in the interface call code, the user can revise the interface call code or reject the interface call code. For example, when the number of errors in the interface call code is small, the user can directly revise the interface call code. When the number of errors in the interface call code is large, the user can reject the interface call code and instruct the software development platform 200 to regenerate the interface call code. Accordingly, the software development platform can receive feedback on the interface call code, which includes the user's editing behavior on the displayed interface call code, such as acceptance, revision or rejection.
[0112] The software development platform 200 may also store the interface call code in a database so that subsequent calls or executions of corresponding functions can be implemented by executing the interface call code. It should be noted that the interface call code stored in the database by the software development platform 200 may be the interface call code generated by the software development platform 200 through a code generator, or the interface call code updated based on feedback on the interface call code.
[0113] In some possible implementations, the software development platform 200 also supports registering the first function in a language model such as LLM, so that the first function can be subsequently called by the LLM-driven application. Specifically, the software development platform 200 can register the first function in the language model through a registration interface, and the interface parameters of the registration interface include the function identifier of the first function, such as the name of the function. Furthermore, the interface parameters of the registration interface can also include a function description and a classification tag. Among them, the classification tag supports the classification of functions from different dimensions. For example, the software development platform 200 can classify functions by their source. In one example, the tag can be Game 1 or Game 2. For another example, the software development platform 200 can classify functions by the degree of necessity of the function. In another example, the tag can be basic, specific, or advanced. It should be noted that for parameters such as function description and classification tag, if the user does not fill in the above parameters during registration, they can be automatically generated and filled in by the software development platform 200.
[0114] By registering the first function with a language model such as an LLM, the method can query the function identifiers (function IDs, such as names), function descriptions, and interface information of all functions supported and integrated by the software development platform 200. The user can also modify the relevant information (such as function descriptions) of the functions supported and integrated by the software development platform 200, thereby improving accuracy.
[0115] S308: The software development platform 200 receives the attribute information of the agent configured by the user.
[0116] The attribute information of the agent includes a function list. Among them, the agent refers to the intermediary that implements function integration or function combination in the software development platform 200. The agent is used to drive the application to execute the second function through the interface call code. The function list is a list of functions supported by the agent, usually including the second function, and the second function can be a subset of the first function. For example, the second function can be the first function configured by the user from the first function to be integrated into the application. Considering that the function is an independent configurable object, each agent can be configured with a different function list. Furthermore, the attribute information of the agent can also include an agent identifier. In some examples, the agent identifier can be the agent name.
[0117] The software development platform 200 supports multiple ways to configure the attribute information of the agent, which are described below.
[0118] In some possible implementations, the software development platform 200 may receive a function list configured by the user through the agent configuration interface, the function list including the function identifier and function description of the second function. The software development platform 200 may display the function identifiers and function descriptions of all functions that can be integrated to the user, such as the function identifier and function description of the first function, and then select at least one function from the first function to integrate into the application. The function selected from the first function is the second function.
[0119] In other possible implementations, the software development platform 200 can receive attribute information of a proxy configured by a user through an API. The API request body includes a function identifier for the second function. Furthermore, the API request body can also include a function description and a classification tag for the second function. This allows for binding the proxy to the second function.
[0120] In some possible implementations, the software development platform 200 also supports configuring a proxy identifier, for example, through a proxy configuration interface, or by receiving a proxy identifier configured by a user through an API. The user can configure the proxy identifier in the API request header. This allows for configuring different function lists for different proxies to meet individual needs.
[0121] S310: The software development platform 200 establishes a connection between the agent and the application.
[0122] Specifically, the user can also configure the association relationship between the agent and the application, such as configuring the application identifier or the association relationship between the object identifier of the controllable object in the application (such as the NPC in the game application, the robot assistant in the smart home scene) and the agent identifier. Accordingly, the software development platform 200 can establish a connection between the agent and the application based on the agent identifier, so that the application automatically obtains the function configuration supported by the agent and can execute the functions supported by the agent.
[0123] Based on the above description, the function integration method of the present application is based on the attribute information extracted from the interface document, and calls the code generator according to the attribute information to automatically generate the interface call code, and by configuring the function list supported by the agent, and connecting the agent with the application, the application automatically obtains the function configuration supported by the agent. The application can execute the functions supported by the agent by executing the interface call code, thereby realizing the automated integration of functions and applications, greatly reducing the difficulty and workload of API integration, and the function combination is more flexible and rich, which can meet business needs.
[0124] The embodiment shown in FIG3 provides a detailed description of automatic creation or configuration of functions in the function integration process, and then introduces function calls in the function integration process.
[0125] Referring to the flowchart of another function integration method shown in FIG7 , the method includes the following steps:
[0126] S702: The software development platform 200 receives instructions sent by the application through an agent.
[0127] Specifically, a user (e.g., a game player or a family member in a smart home scenario) can issue commands via voice or text, which can be natural language commands. For example, in a smart home scenario, if a user accidentally spills milk on the floor while retrieving it, they can issue a voice command like: "Xiao X, go to the kitchen and clean the floor." Upon receiving the command, the application can send it to the software development platform 200, for example, to an agent within the software development platform 200. Accordingly, the software development platform 200 can receive the command sent by the application through the agent.
[0128] S704 : The software development platform 200 drives the application to execute the interface calling code of the second function through the language model according to the instruction, so as to execute the second function.
[0129] Specifically, the software development platform 200 can obtain a function list of an agent associated with an application. The function list of an agent associated with an application can be a function list supported by the agent bound to the application or an operable object in the application. The software development platform 200 can determine the agent identifier of the agent bound to the application or the operable object in the application based on the application identifier or the object identifier of the operable object in the application (e.g., an NPC, a robot assistant). The software development platform 200 can query the agent's configuration information based on the agent identifier to obtain the function list supported by the agent.
[0130] The software development platform 200 can then input the instruction and function list into the language model and generate an action sequence using the language model. The software development platform 200 uses the proxy to parse the action sequence, obtain a function bound to at least one action in the action sequence, populate the function with input parameters, obtain an interface call request, and send the interface call request to the application. Based on the interface call request, the application can execute the interface call code for the second function to perform the second function.
[0131] In this method, the agent is configured with a function list, which includes a second function determined from the first function and integrated into the application. Moreover, a connection relationship is established between the agent and the application. When the application receives an instruction, the agent can perceive the instruction and drive the application to execute the interface call code of the second function through a language model, thereby realizing flexible calling of the function. Moreover, the calling process can be automated, reducing the difficulty of calling, reducing the calling workload, and being able to meet business needs.
[0132] Next, the functional integration method of this application is described in detail in combination with different application scenarios.
[0133] First, let's take a game application as an example, where the controllable objects in the game application's execution environment are NPCs. In this example, the software development platform can serve as an AI NPC, and the agent can be an AI NPC. Game developers can provide open interface documentation for functions, and the AI NPC service can automatically generate interface call code based on the interface documentation. This interface call code can be used to implement function integration and enable diversified language-driven functionality.
[0134] Traditional NPC functions are typically predefined by game developers, resulting in fixed dialogues and interactions between each NPC and the player. This results in NPC responses becoming stereotyped, lacking a sense of freshness and immersion for players. The AI NPC service in this application can integrate traditional NPCs into language models, such as large AI models like LLM, through AI NPC configuration. This allows NPCs to have specific story backgrounds and emotions, and achieve natural conversational capabilities through AI-driven NPCs.
[0135] In this embodiment, the AI NPC service can be a cloud service that supports the configuration of the NPC's background and emotions. The game engine is the execution environment of the NPC in the game application and is responsible for the execution and display of the NPC's functions. Among them, the game engine can be deployed on the player's terminal (such as a smartphone, laptop, desktop), server, or in a cloud environment. In order to associate the NPC in the game application with an AI NPC, an NPC agent can be configured in the game engine, for example, an NPC agent can be configured in the NPC that needs to be associated with the AI NPC. When the NPC needs to respond to the conversation, for example, when responding to the natural language input by the player, the NPC can feed the conversation back to the AI NPC service. After the AI NPC service calls the large language model on the cloud to complete the conversation, it returns the response result to the game engine, and the game engine displays the response result to the player.
[0136] The above describes the AI functions of the AI NPC (such as intelligent question and answer). The AI NPC can also add game functions in addition to the AI functions.
[0137] As shown in FIG8A , adding game functions to an AI NPC generally requires executing the following phases of steps: function analysis, function configuration, and agent association.
[0138] In the functional analysis phase, as shown in 1.1 in Figure 8A, users (such as game developers) can submit interface documents for open functions, where functions can be skills in the game, such as move and dig. Figure 8B shows an interface diagram of an interface document for an open function of a game application. The interface document may include the interface type, interface address, interface parameters (denoted as params), interface request header (denoted as headers), and interface request body (denoted as body). Furthermore, the interface document may also include authentication information, pre-request scripts, test information (such as test cases, denoted as tests), and setting information (denoted as settings).
[0139] In this example, the interface type can be POST, and the interface address can be {{AI_NPC_AGENTS_ENDPOINT}} / skills. The request body includes attribute information of at least one skill. For example, the request body can record the skill name, description, and tag in raw format.
[0140] As shown in step 1.2 of Figure 8A , the AI NPC service can extract skill attribute information based on the interface document, such as the skill's name, description, and params, where params can include at least one of input and output parameters. The AI NPC service can construct the extracted attribute information into a prompt and then input it into the Large Language Model (LLM) to obtain the LLM's analysis results for the interface. Based on the skill's attribute information, the AI NPC service can invoke a code generator to generate interface call code. In some possible implementations, the AI NPC service can also generate interface call code in conjunction with the LLM's analysis results. For example, if the skill's interface is non-standard, the AI NPC service can generate the interface call code with the assistance of the LLM. When generating the interface call code with the assistance of the LLM, the analysis results can be input as a prompt into the programming-capable LLM for code generation, thereby improving the quality of the generated code.
[0141] As shown in Figure 8C, the AI NPC service extracts the attribute information of the skill and registers the skill to the LLM through the registration interface. For example, the AI NPC service can register the skill name, skill description, input parameters and description, and output parameters and description in the LLM. Figure 8D shows a schematic diagram of an interface for registering a skill based on attribute information. In this example, the AI NPC service can create a skill through the POST method to register the skill. The AI NPC service can register the skill in the LLM based on the extracted attribute information of the skill. Taking into account that different skills may have the same name, the AI NPC service can also generate a unique skill ID (or function ID). The AI NPC service can register the skill ID in the LLM to facilitate subsequent skill calls based on the skill ID.
[0142] The skill attribute information extracted by the AI NPC service may include:
[0143] The AI NPC service is registered in the LLM based on the extracted skill attribute information. The registration results are as follows:
[0144] In addition, the AI NPC service can generate the skill interface call code based on the extracted skill attribute information. For example, for the move skill, the AI NPC service can generate the following interface call code:
[0145] positionX=10, positionY=20, positionZ=30;
[0146] run(positionX,positionY,positionZ).
[0147] Furthermore, referring to FIG8C , the AI NPC service can also support users in viewing and editing interface call codes. Specifically, the AI NPC service can display the interface call code to the user, and the user can provide feedback on the interface call code, such as accepting the interface call code, revising the interface call code, or rejecting the interface call code. The AI NPC service can receive the user's feedback on the interface call code and store the final interface call code.
[0148] In the function configuration stage, as shown in 2.1 in Figure 8A, users can configure skills for AI NPCs through the AI NPC service, thereby adding game functions other than AI.
[0149] As shown in Figure 8E , the AI NPC service provides an agent configuration interface for configuring skills for the AI NPC. The agent configuration interface can include a skill classification, an optional parameter used to distinguish different skill types. For example, all skills supported in Game 1 can be included in the Game 1 classification, allowing users to select the corresponding skills from the Game 1 classification when configuring skills for the AI NPC. It should be noted that in this embodiment, the user-submitted interface documentation for the function can also be extended to interface documentation for other game applications. Accordingly, the classification can also take other values, such as Game 2.
[0150] It's important to note that an AI NPC can be configured with one or more functions, bound to a specific function name or function ID. For example, a user might select the game1 classification and then a skill named move. This skill could include multiple movement skills in six directions (front, back, left, right, up, and down), as well as the dance skill in game1.
[0151] In some possible implementations, the AI NPC service also supports the use of an API to bind functions to AI NPCs. Each AI NPC can include an agent name and agent ID, also referred to as the AI NPC name or AI NPC. The AI NPC service associates AI NPCs (AGENTs in game applications) with skills via a POST interface. As shown in FIG8F , the request header of the POST interface includes the AI NPC ID, for example, 11b594ca-7a30-4056-986f-4975d92e6f95, and the request body of the POST interface includes the skill ID, denoted as skill_ids. In the example of FIG8F , the skill_ids of the skills associated with the AI NPC can be afad1786-7a4a-42db-8dc9-66d17998fcec.
[0152] After configuring an AI NPC's skills through the API, you can query the corresponding function list based on the AI NPC's ID. As shown in Figure 8G, the AI NPC service can retrieve the AI NPC's skill list through the GET interface. The GET interface address includes the AI NPC ID, specifically 11b594ca-7a30-4056-986f-4975d92e6f95. The AI NPC service uses this AI NPC ID to query multiple skills associated or bound to the AI NPC, including but not limited to skills moved up and down in game1 and basic skills.
[0153] During the agent association phase, as shown in 3.1 of Figure 8A , users can bind an AI NPC ID to a specific NPC in the game engine. Accordingly, the AI NPC service can establish a connection between the AI NPC and the NPC running in the game engine based on the AI NPC ID. The NPC is an example of a controllable object in this embodiment; in actual applications, the NPC can be replaced with other controllable objects.
[0154] It's important to note that in-game NPC development is independent of AI NPC development. Typically, an NPC requires professional 2D / 3D modeling tools to create its face, body, clothing, and accessories. Furthermore, a specialized engine is often required to create the NPC's motion and visual effects, such as its walking posture and the size of a gunshot. Based on this, this embodiment allows for the customization or enhancement of existing NPC functionality within the game.
[0155] Game developers primarily associate in-game NPCs with AI NPCs in the cloud through various methods, such as integrating AI NPC agent plug-ins, engine plug-ins, configuration interfaces, and SDKs. In some examples, game developers can associate in-game NPCs with AI NPCs using the following relationship:
[0156] Association: Steve(NPC name or ID) = abcdf(AI NPC name or ID).
[0157] 8A to 8G illustrate in detail the process of automatically creating functions in a game application, and the following describes in detail the process of calling functions in a game application.
[0158] Referring to FIG9 , a schematic diagram of a function call process of a game application is shown, which specifically includes the following steps:
[0159] 1) The player speaks specific commands to the NPC or enters specific commands through text, and the game application sends the voice or text commands to the AI NPC service.
[0160] In the example of FIG9 , the specific instruction issued by the player may be a natural language instruction, specifically “Steve, go to the woods to mine.” This specific instruction is used to instruct an NPC named Steve to perform a mining task.
[0161] 2) The AI NPC service queries the configuration information of the AI NPC bound to the current NPC through the agent's configuration information.
[0162] 3) The AI NPC service obtains the function list and detailed description information of the AI NPC through the skill list in the configuration information and the database.
[0163] For example, an AI NPC's function list may include three functions: move, get, and dig. The AI NPC can obtain function descriptions for these functions. For example, the function description for move can be "move to a specific coordinate," the function description for get can be "pick up a tool," and the function description for dig can be "dig a specific object."
[0164] 4) The AI NPC service inputs the text and function list from 1) into a large language model and generates an action sequence through the large language model.
[0165] For example, the action sequence corresponding to mining can be: 1. move 12, 5, 6 (coordinates); 2. get shovel; 3. dig clod; 4. move 12, 5, 7; 5. dig clod...
[0166] 5) The AI NPC service parses the action sequence, obtains the function bound to the action, and fills in the input parameters.
[0167] 6) The AI NPC service sends the function call request to the game / game engine, and the game / game engine executes the interface call code and calls the game interface to execute the function.
[0168] 7) / 8) The AI NPC service obtains the function execution results, analyzes the results, and determines whether to continue or terminate the execution.
[0169] It's important to note that the above process can change based on player input. It's also important to note that if the AI NPC's configured (bound) functions are modified, such as removing the move function, the AI NPC's executable functions will be modified accordingly. For example, the action sequence generated in 4) may not include move, and the AI NPC service can implement function execution through get and dig.
[0170] Figures 8A to 9 illustrate the example of a game application scenario. The function integration method of the present application can also be applied to a smart home scenario. In this scenario, the software development platform can develop services for a robot assistant, and the application can be a robot-assisted application, such as a robot assistant service, or simply a robot assistant. The robot-assisted application can be deployed on the robot body. The robot body refers to the mechanical part of the robot, which can generally include: transmission components, a body and a walking mechanism, and an arm. Furthermore, the robot body can also include a wrist and a hand. Depending on the function of the robot, the robot body can also include other components. For example, a sweeping robot can also include a cleaning component. In this scenario, the interface document includes an interface document for the first function supported by the robot body, and the interface document can be opened by the robot equipment manufacturer. The agent is used to drive the robot-assisted application to call the code through the interface to instruct the robot body to perform the second function.
[0171] The following example illustrates the development of a home robot assistant service, using a smart home scenario. The home robot assistant service manages AIoT devices such as robots. Specifically, it notifies robots or other AIoT devices to respond to daily tasks or emergencies, enabling them to handle various daily tasks or emergencies. For example, if the owner notices water spilling on the kitchen floor, they can issue a cleaning command. The home robot assistant service will then instruct the robot vacuum to clean the water from the kitchen floor. If the user hears a knock on the door, they can issue a projection command. The home robot assistant service can then instruct the camera outside the door to project the image outside to the owner. The owner can then issue an open the door command, which the home robot assistant service will then automatically open.
[0172] The Robot Assistant Development Service is similar to the AI NPC service used in gaming scenarios, but it operates in non-gaming scenarios such as home care, cleaning, restaurant cleaning, and industrial cleaning. Users can configure a list of available functions for the Robot Assistant within the service.
[0173] As shown in Figure 10A, developing a robot assistant typically involves the following stages: function analysis, function configuration, and agent association. The specific implementation of the function analysis and function configuration stages can be found in the description of game application scenarios.
[0174] It should be noted that the functional analysis phase mainly analyzes the interface documents of the functions opened by the robot manufacturer, rather than the interface documents of the functions opened by the game manufacturer or developer. Figure 10B also shows a schematic diagram of the interface documents of the functions opened by the robot manufacturer. The robot assistant development service can extract the attribute information of the function from the interface documents. In this example, the attribute information extracted by the robot assistant development service may include:
[0175] name: ObjectModelManagement, description: Model management, models include robots, sofas, and tables.
[0176] Similarly, the function configuration phase is mainly about configuring the functions of the robot assistant Agent, rather than configuring the AI NPC. The robot assistant Agent (or simply Agent) is an application software that supports embodied intelligence. Among them, embodied intelligence (Embodied AI), also known as figurative intelligence, refers to an intelligent entity with a physical body that supports sensation and movement and supports physical interaction, such as household service robots and unmanned vehicles. The robot assistant Agent can drive the robot's behavior mode based on AI. In this example, the user configures the functions supported by the robot assistant B's Agent in the agent configuration interface of the robot assistant development service, such as driving robot A to sweep the floor. The robot assistant development service can save the Agent ID or Agent name.
[0177] During the agent association phase, users can configure an association between Robot Assistant B and an Agent. The Robot Assistant's running entity, such as the robot itself, can download the Robot Agent plug-in, which is then bound to the ID or name of Robot Assistant B. The Robot Assistant development service can then establish a connection between the Agent and Robot Assistant B based on this association.
[0178] As shown in Figure 10A, when a robot (such as a vacuum cleaner) is running and detects a user command (text or voice), it can send the command to the robot assistant development service in the cloud. The robot assistant development service can obtain the function list bound to the current robot assistant's agent, input the command and function list into the large language model for analysis to obtain an action sequence. The agent can then drive the robot assistant based on the action sequence to call code through the interface, instructing the robot to perform the function.
[0179] The functional integration method of this application can also be used in integrated application development scenarios. In this scenario, the software development platform can provide integrated application development services, and each application vendor can provide the integrated application development service with interface documentation for their own publicly available functions. The integrated application development service can bind the APIs of the functions publicly available to the application vendor and automatically integrate them. For example, when customizing an information query function for application C, after binding or integrating the information query function with the application, it can be automatically combined and triggered based on user input.
[0180] As shown in Figure 11, developing an integrated application typically involves the following phases: functional analysis, functional configuration, and agent association. The specific implementation of the functional analysis and configuration phases can be found in the description of the gaming application scenario. The difference between the integrated application development scenario and the gaming application scenario is that users configure neither an AI NPC nor a robotic assistant agent; rather, they configure an application software that implements a specific function.
[0181] Specifically, a user defines Application C in the integrated application development service, binds external call functions to Application C, such as skills for querying location and weather, and generates an Agent ID. Application C is bound to its Agent ID at runtime. When a user uses natural language in Application C, the Agent plug-in sends the natural language to the integrated application development service. The integrated application development service then decomposes the sequence of interfaces to be called, and Application C calls different interfaces based on the sequence to execute functions. In this scenario, Application C can use natural language to call functions in Application A and Application N.
[0182] Based on the aforementioned function integration method, the present application further provides a software development platform 200. The software development platform 200 is used to integrate functions into applications. As shown in FIG2 , the software development platform 200 includes:
[0183] The function analysis subsystem 202 is configured to receive an interface document of a first function, extract attribute information of the first function from the interface document, the attribute information of the first function including at least one of a function identifier, a function description, an input parameter, or an output parameter of the first function, and, based on the attribute information of the first function, call a code generator to generate an interface call code for the first function;
[0184] The function configuration subsystem 204 is configured to receive attribute information of an agent configured by a user, wherein the attribute information of the agent includes a function list, wherein the function list includes a second function, which is a subset of the first function, and the agent is configured to drive the application to execute the second function by calling code through the interface;
[0185] The association subsystem 206 is configured to establish a connection between the agent and the application.
[0186] For example, the function analysis subsystem 202 , the function configuration subsystem 204 , and the association subsystem 206 may be implemented through hardware or software.
[0187] When implemented by software, the function analysis subsystem 202, the function configuration subsystem 204, and the association subsystem 206 can be applications running on a computer device, such as a computing engine. The above-mentioned applications can also be virtualized and provided to users in the form of virtualized services. Virtualization services may include virtual machine (VM) services, bare metal server (BMS) services, or container services. Among them, VM services can be services that use virtualization technology to virtualize a virtual machine (VM) resource pool on multiple physical hosts to provide users with VMs for use on demand. BMS services are services that virtualize a BMS resource pool on multiple physical hosts to provide users with BMSs for use on demand. Container services are services that virtualize a container resource pool on multiple physical hosts to provide users with containers for use on demand. VM is a simulated virtual computer, that is, a logical computer. BMS is a high-performance computing service that can be elastically scalable. Its computing performance is no different from that of a traditional physical machine and has the characteristics of secure physical isolation. Containers are a kernel virtualization technology that provides lightweight virtualization to isolate user spaces, processes, and resources. It should be understood that the VM service, BMS service, and container service mentioned above are merely specific examples. In actual applications, virtualization services can also include other lightweight or heavyweight virtualization services, which are not specifically limited here.
[0188] When implemented through hardware, the function analysis subsystem 202, the function configuration subsystem 204, and the association subsystem 206 may include at least one computing device, such as a server. Alternatively, the function analysis subsystem 202, the function configuration subsystem 204, and the association subsystem 206 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0189] In some possible implementations, the function analysis subsystem 202 is specifically configured to:
[0190] When the interface of the first function includes a standard interface, according to the type of the standard interface, calling a code generator corresponding to the type of the standard interface to generate an interface calling code for the standard interface;
[0191] When the interface of the first function includes a non-standard interface, according to the type of the non-standard interface, the interface calling code of the non-standard interface is generated by calling a programming language model through a code generator.
[0192] In some possible implementations, the function analysis subsystem 202 is further configured to:
[0193] Display the interface calling code;
[0194] Feedback on the interface calling code is received, the feedback including acceptance, revision or rejection.
[0195] In some possible implementations, the function configuration subsystem 204 is specifically configured to:
[0196] receiving the function list configured by the user through the agent configuration interface, wherein the function list includes a function identifier and a function description of the second function; or
[0197] Receive attribute information of the agent configured by a user through an application programming interface (API), wherein a function identifier of the second function is configured in a request body of the API.
[0198] In some possible implementations, the function analysis subsystem 202 is further configured to:
[0199] The first function is registered in the language model through a registration interface, where an interface parameter of the registration interface includes a function identifier of the first function.
[0200] In some possible implementations, the association subsystem 206 is further configured to:
[0201] receiving, through the agent, instructions sent by the application;
[0202] According to the instruction, the application is driven by a language model to execute an interface calling code of the second function to execute the second function.
[0203] In some possible implementations, the association subsystem 206 is specifically configured to:
[0204] Obtaining a list of capabilities of the agent associated with the application;
[0205] Inputting the instruction and the function list into a language model, and generating an action sequence through the language model;
[0206] The action sequence is parsed by the agent to obtain a function bound to at least one action in the action sequence, input parameters are filled in the function, an interface call request is obtained, and the interface call request is sent to the application.
[0207] This application also provides a computing device 1200. As shown in Figure 12, computing device 1200 includes a bus 1202, a processor 1204, a memory 1206, and a communication interface 1208. Processor 1204, memory 1206, and communication interface 1208 communicate with each other via bus 1202. Computing device 1200 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1200.
[0208] Bus 1202 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG12 shows a single bus line, but this does not imply a single bus or type of bus. Bus 1202 may include a path for transmitting information between various components of computing device 1200 (e.g., memory 1206, processor 1204, and communication interface 1208).
[0209] The processor 1204 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0210] The memory 1206 may include a volatile memory, such as a random access memory (RAM). The memory 1206 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD). The memory 1206 stores executable program code, and the processor 1204 executes the executable program code to implement the aforementioned function integration method. Specifically, the memory 1206 stores instructions for the software development platform 200 to execute the function integration method.
[0211] The communication interface 1208 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1200 and other devices or a communication network.
[0212] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0213] As shown in Figure 13, the computing device cluster includes at least one computing device 1200. The memory 1206 of one or more computing devices 1200 in the computing device cluster may store instructions of the same software development platform 200 for executing the function integration method.
[0214] In some possible implementations, one or more computing devices 1200 in the computing device cluster may also be used to execute some of the instructions for executing the function integration method on the software development platform 200. In other words, a combination of one or more computing devices 1200 may jointly execute the instructions for executing the function integration method on the software development platform 200.
[0215] It should be noted that the memory 1206 in different computing devices 1200 in the computing device cluster may store different instructions for executing part of the functions of the software development platform 200 .
[0216] FIG14 illustrates a possible implementation. As shown in FIG14 , two computing devices 1200A and 1200B are connected via a communication interface 1208. The memory of computing device 1200A stores instructions for executing the functions of function analysis subsystem 202. The memory of computing device 1200B stores instructions for executing the functions of function configuration subsystem 204 and association subsystem 206. In other words, the memories 1206 of computing devices 1200A and 1200B jointly store instructions for software development platform 200 to execute the function integration method.
[0217] The connection method between the computing device clusters shown in Figure 14 can be based on the fact that the function integration method provided by this application requires more resources to analyze the interface document, extract the attribute information of the first function from the interface document, and call the code generator based on the attribute information to generate the interface call code for the first function. Therefore, it is considered that the functions implemented by the function analysis subsystem 202 are executed by an independent computing device, such as computing device 1200A, and the functions implemented by the remaining subsystems, such as the function configuration subsystem 204 and the association subsystem 206, are executed by computing device 1200B.
[0218] It should be understood that the functionality of the computing device 1200A shown in FIG14 may also be implemented by multiple computing devices 1200. Similarly, the functionality of the computing device 1200B may also be implemented by multiple computing devices 1200.
[0219] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), etc. FIG. 15 illustrates a possible implementation. As shown in FIG. 15 , two computing devices 1200C and 1200D are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 1206 in the computing device 1200C stores instructions for executing the functions of the functional analysis subsystem 202. Simultaneously, the memory 1206 in the computing device 1200D stores instructions for executing the functions of the functional configuration subsystem 204 and the association subsystem 206.
[0220] The connection method between the computing device clusters shown in Figure 15 can be based on the consideration that the function integration method provided in this application requires a large amount of resources for interface document analysis and interface call code generation. Therefore, it is considered to entrust the functions implemented by the function analysis subsystem 202 to an independent computing device for execution, such as computing device 1200C, and entrust the functions implemented by the remaining subsystems such as the function configuration subsystem 204 and the association subsystem 206 to computing device 1200D for execution.
[0221] It should be understood that the functionality of the computing device 1200C shown in FIG15 may also be implemented by multiple computing devices 1200. Similarly, the functionality of the computing device 1200D may also be implemented by multiple computing devices 1200.
[0222] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned method for executing the function integration method applied to the software development platform 200.
[0223] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored on any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the aforementioned function integration method.
[0224] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A function integration method, characterized in that: Applied to a software development platform for integrating functions into applications, the method comprises: The software development platform receives an interface document of a first function; The software development platform extracts attribute information of the first function from the interface document, where the attribute information of the first function includes at least one of a function identifier, a function description, an input parameter, or an output parameter of the first function; The software development platform calls a code generator to generate an interface calling code for the first function based on the attribute information of the first function; The software development platform receives attribute information of an agent configured by a user, the attribute information of the agent including a function list, the function list including a second function, the second function being a subset of the first function, and the agent being used to drive the application to call code through the interface to execute the second function; The software development platform establishes a connection between the agent and the application.
2. The method according to claim 1, characterized in that The software development platform calls a code generator to generate an interface calling code for the first function based on the attribute information of the first function, including: When the interface of the first function includes a standard interface, the software development platform calls a code generator corresponding to the type of the standard interface to generate an interface call code for the standard interface according to the type of the standard interface; When the interface of the first function includes a non-standard interface, the software development platform generates an interface calling code of the non-standard interface by calling a programming language model through a code generator according to the type of the non-standard interface.
3. The method according to claim 1 or 2, characterized in that The method further comprises: The software development platform displays the interface calling code; The software development platform receives feedback on the interface calling code, wherein the feedback includes acceptance, revision or rejection.
4. The method according to any one of claims 1 to 3, characterized in that The software development platform receives attribute information of the agent configured by the user, including: The software development platform receives the function list configured by the user through the agent configuration interface, wherein the function list includes a function identifier and a function description of the second function; or The software development platform receives attribute information of the agent configured by the user through an application programming interface (API), wherein a function identifier of the second function is configured in a request body of the API.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The software development platform registers the first function in the language model through a registration interface, and the interface parameters of the registration interface include a function identifier of the first function.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The software development platform receives instructions sent by the application through the agent; The software development platform drives the application to execute the interface calling code of the second function through the language model according to the instruction, so as to execute the second function.
7. The method according to claim 6, characterized in that The software development platform drives the application to execute the interface calling code of the second function through the language model according to the instruction, so as to execute the second function, including: The software development platform obtains a function list of an agent associated with the application; The software development platform inputs the instructions and the function list into a language model, and generates an action sequence through the language model; The software development platform parses the action sequence through the agent, obtains a function bound to at least one action in the action sequence, fills input parameters in the function, obtains an interface call request, and sends the interface call request to the application.
8. The method according to any one of claims 1 to 7, characterized in that The application is a game application, and the execution environment of the game application includes a controllable object. The software development platform establishes a connection between the agent and the application, including: The software development platform establishes a connection between the agent and the controllable object running in the game engine of the game application.
9. The method according to any one of claims 1 to 7, characterized in that The application is a robot-assisted application, which is deployed on a robot body. The interface document includes an interface document of a first function supported by the robot body. The agent is used to drive the robot-assisted application to call code through the interface to instruct the robot body to execute the second function.
10. The method according to any one of claims 1 to 7, characterized in that The first function includes an information query function, and the application is an application for implementing the information query function.
11. A software development platform, characterized in that: The software development platform is used to integrate functions into applications, and the software development platform includes: a function analysis subsystem configured to receive an interface document of a first function, extract attribute information of the first function from the interface document, the attribute information of the first function including at least one of a function identifier, a function description, an input parameter, or an output parameter of the first function, and, based on the attribute information of the first function, call a code generator to generate an interface call code for the first function; a function configuration subsystem, configured to receive attribute information of an agent configured by a user, the attribute information of the agent including a function list, the function list including a second function, the second function being a subset of the first function, the agent being configured to drive the application to call code through the interface to execute the second function; The association subsystem is used to establish a connection between the agent and the application.
12. The software development platform according to claim 11, characterized in that: The functional analysis subsystem is specifically used for: When the interface of the first function includes a standard interface, according to the type of the standard interface, calling a code generator corresponding to the type of the standard interface to generate an interface calling code for the standard interface; When the interface of the first function includes a non-standard interface, according to the type of the non-standard interface, the interface calling code of the non-standard interface is generated by calling a programming language model through a code generator.
13. The software development platform according to claim 11 or 12, characterized in that: The functional analysis subsystem is also used to: Display the interface calling code; Feedback on the interface calling code is received, the feedback including acceptance, revision or rejection.
14. The software development platform according to any one of claims 11 to 13, characterized in that: The function configuration subsystem is specifically used for: receiving the function list configured by the user through the agent configuration interface, wherein the function list includes a function identifier and a function description of the second function; or Receive attribute information of the agent configured by a user through an application programming interface (API), wherein a function identifier of the second function is configured in a request body of the API.
15. The software development platform according to any one of claims 11 to 14, characterized in that: The functional analysis subsystem is also used for: The first function is registered in the language model through a registration interface, where an interface parameter of the registration interface includes a function identifier of the first function.
16. The software development platform according to any one of claims 11 to 15, characterized in that: The association subsystem is further configured to: receiving, through the agent, instructions sent by the application; According to the instruction, the application is driven by a language model to execute an interface calling code of the second function to execute the second function.
17. The software development platform according to claim 16, wherein: The association subsystem is specifically used for: Obtaining a list of capabilities of the agent associated with the application; Inputting the instruction and the function list into a language model, and generating an action sequence through the language model; The action sequence is parsed by the agent to obtain a function bound to at least one action in the action sequence, input parameters are filled in the function, an interface call request is obtained, and the interface call request is sent to the application.
18. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster performs the function integration method according to any one of claims 1 to 10.
19. A computer-readable storage medium, characterized in that Comprising computer-readable instructions; the computer-readable instructions are used to implement the function integration method described in any one of claims 1 to 10.
20. A computer program product, characterized in that Comprising computer-readable instructions; the computer-readable instructions are used to implement the function integration method described in any one of claims 1 to 10.
Citation Information
Patent Citations
Application building method and device, equipment and storage medium
CN117193738A
Code generation method and device and electronic equipment
CN117193790A
Code auxiliary system, code auxiliary processing method and device and electronic equipment
CN117311683A
Natural language interface to interactive, operating-system shell and techniques for creating training data for the same
US20180373998A1