Function interface calling method and device, equipment and medium

By obtaining and converting the path information of the target software, using preset formats and calling protocols, the problem of low efficiency of functional interface calls in the existing technology is solved, efficient and accurate cross-software interface calls are achieved, and the interaction efficiency between large language models and enterprise software systems is improved.

CN120407049APending Publication Date: 2025-08-01BEIJING YOUTEJIE INFORMATION TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510509167.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing functional interface calling methods have problems such as low efficiency in encapsulation and calling, low response speed and accuracy. Especially in the interaction between large language models (LLMs) and enterprise software systems, existing tools are scattered and computationally large, resulting in inefficiency and compatibility problems.

Method used

By obtaining the path information set of the target software, converting the module interface list into a module function list according to the preset format conversion rules, and finding and calling the target interface according to the user's call commands, using the preconfigured calling protocol for interface calls.

Benefits of technology

Cross-software calls of functional interfaces are realized, the efficiency of encapsulation and call is improved, the response speed and call accuracy are improved, and the interaction efficiency and accuracy of large language models for enterprise software systems are significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407049A_ABST
    Figure CN120407049A_ABST
Patent Text Reader

Abstract

The invention discloses a function interface calling method and device, equipment and a medium. The method comprises the steps of obtaining a path information set of target software, and obtaining a module interface list of at least one module matched with the target software according to each piece of path information; converting the module interface lists into module function lists matched with the module interface lists according to a preset format conversion rule; and obtaining a calling command of a user, searching a target interface matched with the target calling command according to the calling command and each module function list, and calling the target interface according to a pre-configured calling protocol. By means of the technical scheme, calling of the function interface by the large language model can be achieved, the packaging and calling efficiency of the function interface is improved, and meanwhile the response speed and the calling accuracy of the function interface calling operation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software, and in particular, to a method, apparatus, device, and medium for invoking function interfaces. Background Art

[0002] At present, with the booming development of large language models (LLMs), enabling LLMs to effectively invoke the function interfaces of existing enterprise software systems has become a key problem in promoting industry progress. Although the interface invocation function introduced by OpenAPI provides a way to invoke external functions, it requires LLM developers to not only be familiar with the various functions of existing software but also deeply master the details of function interfaces, and then carry out adaptation and development work by themselves. This process is not only time-consuming and laborious but also places high demands on the technical capabilities of developers, undoubtedly increasing the complexity and cost of development.

[0003] On this basis, invoking function interfaces through the model control protocol (MCP) of Anthropic has become a new industry trend. However, currently, MCP server tools are relatively scattered, mainly concentrated in limited fields such as online search and desktop operations, and only some databases provide query tools for software function interfaces. Due to the complex system functions of a large number of traditional software, the number of function interfaces is huge, and the amount of calculation required for conversion and search through existing MCP servers is enormous. At the same time, the existing solution of encapsulating software function interfaces as MCP services for function interface invocation has obvious shortcomings. On the one hand, R & D personnel write MCPServer code separately, with low efficiency and high maintenance costs; on the other hand, after converting the specification file with the help of an adaptation conversion tool and loading it in full, problems such as compatibility and data loss are likely to occur.

[0004] In summary, the existing function interface invocation methods have problems of low efficiency in encapsulating and invoking function interfaces, as well as low response speed and low invocation accuracy in function interface invocation operations. Summary of the Invention

[0005] The present invention provides a method, apparatus, device, and medium for invoking function interfaces, which can solve the problems of low efficiency in encapsulating and invoking function interfaces in the existing function interface invocation methods, as well as low response speed and low invocation accuracy in function interface invocation operations.

[0006] In a first aspect, an embodiment of the present invention provides a method for invoking a function interface, the method comprising:

[0007] Obtain a path information set of a target software, and obtain a module interface list of at least one module matching the target software according to each path information;

[0008] Convert each module interface list into a module function list that respectively matches each module interface list according to the preset format conversion rules;

[0009] Obtain the user's call command, and according to the call command and each module function list, find the target interface that matches the target call command, and call the target interface according to the pre-configured call protocol.

[0010] In a second aspect, an embodiment of the present invention provides a device for calling a functional interface. The device includes:

[0011] A path information acquisition module, configured to acquire a path information set of a target software, and obtain a module interface list of at least one module that matches the target software according to each path information;

[0012] A format conversion module, configured to convert each module interface list into a module function list that respectively matches each module interface list according to the preset format conversion rules;

[0013] An interface call module, configured to obtain the user's call command, and according to the call command and each module function list, find the target interface that matches the target call command, and call the target interface according to the pre-configured call protocol.

[0014] In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for calling a functional interface according to any embodiment of the present invention.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement a method for calling a functional interface according to any embodiment of the present invention when executed by a processor.

[0019] The technical solution of the embodiment of the present invention first obtains a path information set of a target software, and obtains a module interface list of at least one module that matches the target software according to each path information. Then, according to a preset format conversion rule, each module interface list is converted into a module function list that respectively matches each module interface list. Finally, a call command of a user is obtained, and according to the call command and each module function list, a target interface that matches the target call command is found, and the target interface is called according to a pre-configured call protocol, which solves the problems existing in the existing call method of functional interfaces, such as low efficiency of encapsulation and call of functional interfaces, and low response speed and call accuracy of functional interface call operations. It realizes the cross-software call of functional interfaces, improves the efficiency of encapsulation and call of functional interfaces, and at the same time improves the response speed and call accuracy of functional interface call operations.

[0020] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0022] Figure 1 is a flowchart of a method for calling a functional interface according to Embodiment 1 of the present invention;

[0023] Figure 2 is a flowchart of a method for calling a functional interface according to Embodiment 2 of the present invention;

[0024] Figure 3 is a schematic structural diagram of a device for calling a functional interface according to Embodiment 3 of the present invention;

[0025] Figure 4 is a schematic structural diagram of an electronic device for implementing the method for calling a functional interface of the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0026] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" any variations are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that comprises a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0028] To enable those skilled in the art to better understand the solution of the present invention, the situation of large language models calling software function interfaces in the prior art will be briefly introduced first. Specifically, with the rapid development of large language models (LLMs), enabling LLMs to effectively call the function interfaces of existing enterprise software systems has become an important issue. Currently, there are mainly two main methods: the function call function launched by OpenAPI and the model control protocol (MCP) protocol launched by Anthropic.

[0029] The function call feature of OpenAPI requires LLM developers to be familiar with the functional interfaces of existing software and then adapt and develop on their own. Anthropic's MCP protocol, on the other hand, requires external vendors and developers to adapt to the LLM in reverse for its invocation, which has recently become the new mainstream. Currently, popular MCP Servers focus on tool levels such as network search and desktop operations; popular MCP Clients mainly include common large model applications such as ClaudeDesktop and Cursor. The available tools on the MCP server side are relatively scattered, and only some databases provide query tools. Many enterprise software systems use the OpenAPI specification to describe functional interfaces. There are two existing solutions for encapsulating software functional interfaces as MCP services: one is that software R & D personnel write MCP Server code separately for each functional interface, and product managers can trim requirements and write some code; the other is to convert the OpenAPI Spec specification file into the tools specification file of MCP Server through an adaptation conversion tool (such as openapi2mcptools), and then fully load it in a single MCP Server.

[0030] In summary, the existing technologies for converting OpenAPI into services available to large models have the following disadvantages: First, the human input is large and the cost performance is low. The solution of writing code separately requires a large amount of human input, and the business value as the interface layer is not obvious, so the cost performance is low. Second, the expansion of the functional interface list affects the response of the large model. The full conversion and loading solution will cause the list of available functional interfaces on the MCP Client side to expand rapidly. When the number of functional interfaces is around 30, the length of the converted and loaded list content may exceed the 128k context window size of mainstream large models, resulting in the large model being unable to respond correctly. Third, the token response time becomes slower. Even when the number of functional interfaces is within 30, full loading will also result in a larger context, causing the token response time of the large model to slow down significantly.

[0031] Embodiment 1

[0032] Figure 1 The flowchart of a method for calling a functional interface provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where a large language model invokes the functional interface of software based on the MCP protocol. This method can be executed by a device for calling a functional interface, and the device for calling a functional interface can be implemented in the form of hardware and / or software. The device for calling a functional interface can be configured in a terminal or server with the function of calling a functional interface.

[0033] As Figure 1 shown, the method includes:

[0034] S110. Obtain the path information set of the target software, and obtain the module interface list of at least one module matching the target software according to each path information.

[0035] Among them, the target software can be an enterprise-level software system with complex functions. In this embodiment, the function interfaces provided by the target software follow the OpenAPI specification, and the interface functions are described through standardized path information; further, the OpenAPI is an industry standard for defining, describing, and standardizing function interfaces (Application Programming Interface, API), aiming to clearly describe key information such as the endpoints of the API, supported operations, input and output parameters, authentication mechanisms, and response formats through a standardized machine-readable format, so as to achieve visualization, automated invocation, and cross-system integration of the API.

[0036] Among them, the path information set includes at least one path information, and the path information includes the operation object information of at least one operation object. The operation object information includes the path attribute, name information, and parameter information matching the operation object.

[0037] Further, the path information set is a set composed of multiple path information in the target software. Each path information corresponds to the operation object information of at least one operation object included under this path information in the OpenAPI specification, and is used to describe a specific API operation; further, the operation object information is the core component of the path information, and includes the path attribute, name information, and parameter information matching the operation object (i.e., the API operation). Among them, the path attribute mainly refers to the URL path of the API, which is used to uniquely identify the access address of the API; the name information usually corresponds to the Tag attribute of each operation object of the target software in the OpenAPI, and is used to mark each function module to which the API belongs; the parameter information includes input parameters (such as request body, query parameters) and output parameters (such as response body). For example, the input parameter requirements of "GET

[0038] / api / v3 / agent" must include the "group_ids" parameter, and the output parameters may include information such as "agent_id" and "hostname".

[0039] Specifically, obtaining a module interface list of at least one module that matches the target software according to each path information includes: grouping each path information according to the name information of each path information in the path information set to obtain at least one module information set, where the module information set includes at least one path information, and the name information of each path information included in the same module information set is the same; performing a format conversion operation on each path information in the module information set based on a preset format rule to obtain each module interface information that matches each path information; and performing a listing operation on each module interface information that matches the module information set to obtain a module interface list that matches the module information set.

[0040] In a specific implementation manner of this embodiment, in the process of obtaining a module interface list according to each path information, grouping is first performed based on the name information. The name information, as a label of the functional module, can classify path information with the same business function into one category. Exemplarily, all path information with the name information of "agent management", such as "GET / api / v3 / agent" "POST

[0041] " / api / v3 / agent", "DELETE / api / v3 / agent / {agent_id}", etc. are grouped into the same module information set. Then, format conversion operations are performed on the path information in the module information set. In this embodiment, the preset format rules are formulated according to the tool definition specifications of the MCP protocol, aiming to convert the complex descriptions of OpenAPI into structured information recognizable by the large model. During the conversion process, content crucial for the large model to understand, such as Summary (brief function description), Description (detailed function description), Parameters (parameter requirements), Response (response format), etc., will be retained. Taking "GET / api / v3 / agentgroup" as an example, the converted module interface information will include its path attribute " / api / v3 / agentgroup", method type "GET", input parameter requirements (marked as optional if there are no special parameters), the "group_ids" list in the output parameters, etc. These information are presented in JSON or XML format. It should be noted that in this embodiment, the content to be retained during the conversion process can be defined and adjusted according to the actual needs of developers, and this embodiment does not limit this. Finally, list operations are performed on all the module interface information within the same module information set to generate a module interface list. The list operation is to organize the structured interface information in a unified format to form a list containing the module name (determined by the name information) and the specific interface details. For example, the interface list of the "agent management" module will list the paths, methods, parameter descriptions, and function descriptions of all APIs under this module. By reading this list, the large model can quickly identify the functions provided by this module, such as "obtain agent group information", "create agent", "delete agent", etc., and select the appropriate interface for invocation according to the user's needs. Through this process, the complex APIs of the target software are organized into a module interface list in an orderly manner, which not only avoids the problem of context expansion caused by full-scale loading but also provides clear function guidance for the large model. For example, in the Logeasy system, the original 800 scattered APIs are classified into different module interface lists through the above steps, and each list only contains the interfaces related to specific function modules, greatly reducing the amount of information that the large model needs to process, enabling it to more efficiently understand and invoke the functions of the target software, and significantly improving the interaction efficiency and accuracy.

[0042] S120. Convert each module interface list into a module function list that respectively matches each module interface list according to the preset format conversion rules.

[0043] S130. Obtain the user's call command, find the target interface that matches the target call command according to the call command and each module function list, and call the target interface according to the pre-configured call protocol.

[0044] Among them, the call command is a function call requirement proposed by the user based on natural language or structured input, such as "query the IDs of all agent groups in the system" or "call the customer management module to create a new user". Its core includes two parts: a name instruction and a function instruction. The name instruction is used to specify the target function module, such as "agent group", "customer management", etc., corresponding to the function tags defined by name information in the OpenAPI specification; the function instruction specifies the specific operation, such as "query", "create", "delete", etc., corresponding to the HTTP methods (GET / POST / DELETE, etc.) and parameter requirements of the API.

[0045] Among them, finding the target interface that matches the target call command according to the call command and each module function list includes: finding whether there is a target list that matches the name instruction in each module function list according to the name instruction in the call command, where the name information of the target list is the same as the name instruction; if it exists, extract the target interface from the function interface information of the target list according to the function instruction in the call command, where the path attribute and parameter information of the target interface are the same as the function instruction. [[ID=X]]

[0046] Further, after finding whether there is a target list that matches the name instruction in each module function list according to the name instruction in the call command, it also includes: if there is no target list that matches the name instruction, generate an error prompt to prompt the user;

[0047] And, extracting the target interface from the function interface information of the target list according to the function instruction in the call command also includes: if there is no path attribute and parameter information of any function interface information in the target list that is the same as the function instruction, generate an error prompt to prompt the user.

[0048] In a specific implementation scenario of this embodiment, for example, when the system obtains the user's call command, it first parses the name instruction therein and searches for a matching target list in the module function list. Taking the user input "Call the agent group management module to obtain all agent group IDs" as an example, the name instruction "agent group management" corresponds to the module function list with the name information "agent group management" in each module function list. If there is a matching target list, the system further parses the function instruction "Obtain all agent group IDs" and extracts the target interface in the function interface information of this module whose path attribute and parameter information match. At this time, the path attribute of the "GET / api / v3 / agentgroup" interface is consistent with the "Obtain" function instruction, and the parameter information matches the user's requirements, so it can be determined as the target interface. If the name instruction has no matching item in the module function list, for example, the user mistakenly enters "log analysis module" while the actual module name is "log query module", the system will generate an error prompt, such as type information like "Function module named 'log analysis module' not found". Similarly, if there is a module with a matching name in the target list, but the function instruction cannot match the path attribute or parameter information of any interface, for example, the user requests "Delete the agent group through the agent ID" but this module has no "DELETE" interface, the system will prompt "There is no interface with a matching function in the target module. Please confirm the operation instruction". After determining the target interface, the system calls it according to the pre-configured call protocol. The call protocol defines the data interaction format and data interaction method between the large model and the MCP server. For example, if the pre-configured call protocol is the HTTP protocol, after determining the target interface, the system constructs an HTTP GET request through HTTPClient, carries the necessary authentication information (such as JWT token), sends it to the software API system, receives the response result and converts it into the MCP format recognizable by the large model, and finally feeds it back to the user or uses it for subsequent logical processing. Relevant personnel in this field should understand that the operation of calling the function interface of the target module through the pre-configured call protocol is a mature existing technology, and the specific implementation principle of this method will not be elaborated in this embodiment.

[0049] The above operation steps disassemble the natural language instruction into structured information in terms of name and function dimensions, and combine the modular interface list to achieve the efficient call of complex enterprise APIs by the large model, avoiding full-scale retrieval from hundreds of APIs, significantly improving the interaction efficiency and accuracy, and at the same time ensuring the fault tolerance of user operations through the error prompt mechanism.

[0050] Optionally, the pre-configured call protocol includes at least one of the following: HTTP protocol, HTTPS protocol, apikey authentication protocol, token authentication protocol, cookie authentication protocol, and JWT authentication protocol.

[0051] The technical solution of the embodiment of the present invention first obtains a set of path information of the target software, and obtains a module interface list of at least one module that matches the target software according to each path information. Then, according to a preset format conversion rule, each module interface list is converted into a module function list that respectively matches each module interface list. Finally, a call command of the user is obtained, and according to the call command and each module function list, a target interface that matches the target call command is searched, and the target interface is called according to a pre-configured call protocol, realizing cross-software call of function interfaces, improving the efficiency of encapsulation and call of function interfaces, and at the same time improving the response speed and call accuracy of function interface call operations.

[0052] Embodiment 2

[0053] Figure 2 It is a flowchart of a method for calling a function interface provided by the second embodiment of the present invention. This embodiment is refined based on the above embodiment. Specifically, in this embodiment, the method of converting each module interface list into a module function list that respectively matches each module interface list according to a preset format conversion rule is refined.

[0054] As Figure 2 shown, the method includes:

[0055] S210. Obtain a set of path information of the target software, and obtain a module interface list of at least one module that matches the target software according to each path information.

[0056] S220. Obtain software description information that matches the target software based on the user's editing operation, and add the software description information to each module interface list to update each module interface list.

[0057] Among them, the user's editing operation refers to the behavior of the user to supplement, modify or perfect relevant information according to the understanding of the functions of the target software and actual usage requirements. Further, the software description information includes, but is not limited to, detailed descriptions of the target software, usage scenario examples, association relationships with other modules, and special parameter requirements, etc. Relevant personnel in the field should understand that the software description information can improve the accuracy and efficiency of the large model to accurately understand and call the corresponding interface.

[0058] Exemplarily, for example, in the module interface list corresponding to a certain log query software, the original interface information of "GET / api / v3 / logs" may only include basic input and output parameter descriptions. After adding software description information, it will supplement that this interface is suitable for quickly retrieving recent logs. Optionally, if you want to query a large amount of historical logs, it is recommended to use another specific interface, and actual query statement examples will also be attached. Through such updates, the module interface list can better provide comprehensive interface information for the large model, helping the large model more accurately understand the functions and usage methods of each interface.

[0059] S230. Perform a format conversion operation on the updated module interface lists based on preset format conversion rules to obtain module function lists in a preset format that respectively match the module interface lists.

[0060] Among them, the module function list includes at least one function interface information.

[0061] Among them, the preset format conversion rules are a set of specifications formulated in advance according to the understanding ability of the large model and the requirements of the MCP protocol. The rules stipulate how to reorganize and format the information in the updated module interface list so that it conforms to a format that is easy for the large model to recognize and process. For example, convert the interface information originally presented in the OpenAPI specification format into a structured format such as JSON or XML, and adjust the hierarchical structure and field names of the information according to the requirements for tool descriptions in the MCP protocol.

[0062] Based on the above steps, through the above format conversion operation, the large model can more efficiently read and understand the detailed information of each function interface, including the module to which the interface belongs, the interface path, the request method, parameter requirements, and detailed function descriptions, etc. This lays a solid foundation for the large model to accurately select and call the appropriate interface according to user needs in the future, greatly improving the efficiency and accuracy of the interaction between the large model and the target software system.

[0063] S240. Obtain the user's call command, and based on the call command, search for the target interface that matches the target call command in each module function list, and call the target interface according to the pre-configured call protocol.

[0064] The technical solution of the embodiment of the present invention first obtains a set of path information of the target software, and obtains a module interface list of at least one module matching the target software according to each path information. Then, based on the user's editing operation, software description information matching the target software is obtained, and the software description information is added to each module interface list to update each module interface list. After that, each updated module interface list is subjected to a format conversion operation based on a preset format conversion rule to obtain a module function list in a preset format that respectively matches each module interface list. Finally, the user's call command is obtained, and the target interface matching the target call command is found according to the call command and each module function list, and the target interface is called according to a pre-configured call protocol, realizing cross-software call of function interfaces, improving the efficiency of encapsulation and call of function interfaces, and at the same time improving the response speed and call accuracy of function interface call operations.

[0065] Embodiment III

[0066] Figure 3 FIG. is a schematic structural diagram of a function interface call device provided in Embodiment III of the present invention.

[0067] As Figure 3 shown, the device includes:

[0068] A path information acquisition module 310, configured to acquire a set of path information of the target software, and obtain a module interface list of at least one module matching the target software according to each path information;

[0069] A format conversion module 320, configured to convert each module interface list into a module function list respectively matching each module interface list according to a preset format conversion rule;

[0070] An interface call module 330, configured to acquire a user's call command, find a target interface matching the target call command according to the call command and each module function list, and call the target interface according to a pre-configured call protocol.

[0071] The technical solution of the embodiment of the present invention first obtains a path information set of a target software, and obtains a module interface list of at least one module that matches the target software according to each path information. Then, according to a preset format conversion rule, each module interface list is converted into a module function list that respectively matches each module interface list. Finally, a call command of a user is obtained, and according to the call command and each module function list, a target interface that matches the target call command is found, and the target interface is called according to a pre-configured call protocol, realizing cross-software call of function interfaces, improving the efficiency of encapsulation and call of function interfaces, and at the same time improving the response speed and call accuracy of function interface call operations.

[0072] Based on the above embodiment, the path information acquisition module 310 includes:

[0073] An information grouping unit, configured to group each path information in the path information set according to the name information of each path information in the path information set, to obtain at least one module information set, where the module information set includes at least one path information, and the name information of each path information included in the same module information set is the same;

[0074] A first format conversion unit, configured to perform a format conversion operation on each path information in the module information set based on a preset format rule, to obtain each module interface information that matches each path information;

[0075] A list unit, configured to perform a list operation on each module interface information that matches the module information set, to obtain a module interface list that matches the module information set.

[0076] Based on the above embodiment, the format conversion module 320 includes:

[0077] An information update unit, configured to obtain software description information that matches the target software based on an editing operation of a user, and add the software description information to each module interface list to update each module interface list;

[0078] A second format conversion unit, configured to perform a format conversion operation on each updated module interface list based on a preset format conversion rule, to obtain a module function list in a preset format that respectively matches each module interface list, where the module function list includes at least one function interface information.

[0079] Based on the above embodiment, the interface call module 330 includes:

[0080] A name lookup unit for looking up in each module function list whether there is a target list that matches the name instruction in the call command, where the name information of the target list is consistent with the name instruction;

[0081] An interface extraction unit for, if there is, extracting a target interface from the function interface information of the target list according to the function instruction in the call command, where the path attribute and parameter information of the target interface are consistent with the function instruction.

[0082] Based on the above embodiment, the name lookup unit is further configured to: after looking up in each module function list whether there is a target list that matches the name instruction in the call command, if there is no target list that matches the name instruction, generate an error prompt to prompt the user;

[0083] Based on the above embodiment, the interface extraction unit is further configured to: if there is no path attribute and parameter information of any function interface information in the target list that is consistent with the function instruction, generate an error prompt to prompt the user.

[0084] The function interface calling device provided by the embodiment of the present invention can execute the function interface calling method provided by any embodiment of the present invention, and has function modules and beneficial effects corresponding to the execution of the method.

[0085] Embodiment 4

[0086] Figure 4 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smart phone, a wearable device (such as a helmet, glasses, a watch, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described herein and / or claimed.

[0087] As Figure 4As shown in the figure, the electronic device 10 includes at least one processor 11 and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0088] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0089] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for invoking a function interface.

[0090] Correspondingly, the method includes:

[0091] Obtain a set of path information of the target software, and obtain a module interface list of at least one module matching the target software according to each path information;

[0092] Convert each module interface list into a module function list respectively matching each module interface list according to a preset format conversion rule;

[0093] Obtain a user's call command, and find a target interface matching the target call command according to the call command and each module function list, and call the target interface according to a pre-configured call protocol.

[0094] In some embodiments, a method for invoking a functional interface may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for invoking a functional interface described above may be executed. Alternatively, in other embodiments, the processor 11 may be configured to execute a method for invoking a functional interface by any other suitable means (e.g., by means of firmware).

[0095] The various embodiments of the systems and techniques described above in this document may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), systems on a chip (SOC), complex programmable logic devices (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from a storage system, at least one input device, and at least one output device, and transmits the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0096] The computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs may be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.

[0097] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0098] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0099] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.

[0100] A computing system may include a client and a server. The client and the server are generally far from each other and usually interact via a communication network. The relationship between the client and the server is created by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.

[0101] It should be understood that various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.

Claims

1. A method for invoking a functional interface, characterized in that, Including: Obtain a set of path information of the target software, and obtain a module interface list of at least one module matching the target software according to each path information; Convert each module interface list into a module function list respectively matching each module interface list according to a preset format conversion rule; Obtain a user's call command, and find a target interface matching the target call command according to the call command and each module function list, and call the target interface according to a pre-configured call protocol.

2. The method according to claim 1, characterized in that, The set of path information includes at least one path information, and the path information includes operation object information of at least one operation object. The operation object information includes path attributes, name information, and parameter information matching the operation object.

3. The method according to claims 1-2, characterized in that, Obtaining a module interface list of at least one module matching the target software according to each path information includes: Group each path information according to the name information of each path information in the set of path information to obtain at least one module information set. The module information set includes at least one path information, and the name information of each path information included in the same module information set is the same; Perform a format conversion operation on each path information in the module information set based on a preset format rule to obtain each module interface information matching each path information; Perform a listing operation on each module interface information matching the module information set to obtain a module interface list matching the module information set.

4. The method according to claim 1, wherein Converting each module interface list into a module function list respectively matching each module interface list according to a preset format conversion rule includes: Obtain software description information matching the target software based on the user's editing operation, and add the software description information to each module interface list to update each module interface list; Perform a format conversion operation on the updated each module interface list based on a preset format conversion rule to obtain a module function list in a preset format respectively matching each module interface list, where the module function list includes at least one function interface information.

5. The method according to claim 1, characterized in that, Finding a target interface matching the target call command according to the call command and each module function list includes: Find whether there is a target list matching the name instruction in each module function list according to the name instruction in the call command, where the name information of the target list is the same as the name instruction; If it exists, extract the target interface from each function interface information of the target list according to the function instruction in the call command, where the path attribute and parameter information of the target interface are the same as the function instruction.

6. The method according to claim 5, characterized in that After finding whether there is a target list matching the name instruction in each module function list according to the name instruction in the call command, it further includes: If there is no target list matching the name instruction, generate an error prompt to prompt the user; And, extracting the target interface from each function interface information of the target list according to the function instruction in the call command further includes: If there is no path attribute and parameter information of any functional interface information in the target list that is consistent with the functional instruction, an error prompt is generated to prompt the user.

7. The method according to claim 1, characterized in that, The pre-configured call protocol includes at least one of the following: HTTP protocol, HTTPS protocol, functional interface key authentication protocol, token authentication protocol, cookie authentication protocol, and JWT authentication protocol.

8. An invocation device for a functional interface, characterized in that It includes: A path information acquisition module, configured to acquire a path information set of a target software, and obtain a module interface list of at least one module that matches the target software according to each path information; A format conversion module, configured to convert each module interface list into a module function list that respectively matches each module interface list according to a preset format conversion rule; An interface call module, configured to acquire a user's call command, search for a target interface that matches the target call command according to the call command and each module function list, and call the target interface according to the pre-configured call protocol.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor, so that the at least one processor can execute a method for calling a functional interface according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and the computer instructions are used to implement a method for calling a functional interface according to any one of claims 1-7 when executed by a processor.

Citation Information

Cited By

  • Large model data report generation tool and method based on MCP

    CN120687467A