Application calling method, system and device, computer equipment and medium
By using the general application programming interface name, AI devices are associated with target applications, and the target application programming interface will be automatically determined, and the complex problems of developers in existing technologies need to manually associate API interfaces and action instructions. Application of efficient automatic calls.
Patent Information
- Application Number
- CN202311616967.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2025-01-28
AI Technical Summary
In the prior art, developers need to associate the API interface of new applications with action instructions, which is complex in operation, consumes a lot of manpower and material resources, and has low efficiency.
By providing an application call method, the general application programming interface name is used to associate AI devices with the target application, and the target application programming interface is automatically determined according to the target instruction, so as to achieve the automatic call of the application on the application.
Simplified the application process of the application of AI devices, reduced the consumption of human and material resources, and improved the efficiency of calling.
Smart Images

Figure CN119376870A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, system, device, computer equipment and medium for calling an application program. Background Art
[0002] At present, it has become a trend to introduce large language models in the field of Natural Language Processing (NLP). Large language models perform well in tasks such as semantic understanding, keyword extraction, sentiment analysis, and automatic summarization, making it possible for artificial intelligence (AI) to understand the target task by reading the task text and perform the target operation through operating instructions.
[0003] In the process of AI using applications, currently, the Application Programming Interface (API) interfaces opened for different applications are different. Therefore, each time a new application is connected, developers are required to associate the API interface and action instructions of the new application. The operation is complicated, consumes a lot of manpower and material resources, and has low efficiency. Summary of the invention
[0004] In view of this, the present invention provides a method, system, device, computer equipment and medium for calling an application program to solve the problem that developers need to associate the API interface and action instructions of a new application program, which causes complicated operations.
[0005] In a first aspect, the present invention provides a method for calling an application, which is applied to an AI device, and the method includes: obtaining a target instruction, which is an instruction that a target user needs to execute; determining a target application according to the target instruction, and sending a general application programming interface name to the target application; wherein the target application is used to identify the general application programming interface name, and is used to send an operation set to the AI device according to the identification result; determining a target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface represents an application programming interface corresponding to a target operation in the operation set for implementing the target instruction; calling the target application programming interface to control the target application to execute the target instruction.
[0006] Beneficial effect: The application calling method of the present invention is applied to an AI device, and according to the target instruction, a target application for executing the target instruction is determined, and a pre-set universal application programming interface name is sent to the target application so that the target application can identify the AI device. The target application is used to send an operation set to the AI device according to the recognition result, wherein when the recognition result is successful, the operation set is sent to the AI device, and according to the operation set and the target instruction, the target application programming interface corresponding to the target operation that can execute the target instruction is selected from the operation set, and the target application programming interface is called to control the target application to execute the target instruction. The present invention associates the AI device with the target application through the universal application programming interface name. When the target application needs to be called, as long as the recognition is successful according to the universal application programming interface name, all target application programming interfaces of the target application can be automatically called to execute the target instruction. Compared with the related art in which the developer associates the application programming interfaces of all applications with the action instruction, the present invention automatically determines the target application programming interface according to the target instruction through the universal application programming interface, thereby realizing the calling of the application by the AI device, which is simple to operate, reduces the consumption of manpower and material resources, and is highly efficient.
[0007] In an optional implementation, determining the target application according to the target instruction includes:
[0008] According to the target instruction, a target application that can execute the target instruction is selected from the application set; wherein the application set includes applications that establish a connection relationship with the AI device based on a general application programming interface name.
[0009] Beneficial effect: The present invention establishes an association relationship between AI devices and applications in advance through a general application programming interface to form an application set. The present invention enables the AI device to automatically select a target application that can execute a target instruction in the application set according to the target instruction, thereby improving the efficiency of the AI device in calling the application.
[0010] In an optional embodiment, the operation set includes multiple operations, application programming interfaces corresponding to the multiple operations, and function information corresponding to the multiple operations; based on the operation set and the target instruction, the target application programming interface of the target application is determined, including: based on the target instruction, determining the target function information that matches the target instruction in the function information corresponding to the multiple operations; filtering the target operation corresponding to the target function information; and determining the target application programming interface of the target application based on the target operation.
[0011] Beneficial effects: The present invention determines, in the function information corresponding to multiple operations in the operation set according to the target instruction, the target function information that matches the target instruction, determines the target operation according to the target function information, determines the target application programming interface of the target application according to the target operation, realizes the automation of artificial intelligence calling the target application programming interface of the application, automatically determines the target application programming interface according to the target instruction, does not require the intervention of developers, saves manpower and material resources, and improves efficiency.
[0012] In an optional embodiment, before controlling the target application to execute the target instruction, the method also includes: determining whether there are execution conditions for the target instruction in the target application; the execution conditions represent the basic conditions for executing the target instruction; if the execution conditions for the target instruction exist in the target application, calling the target application programming interface to control the target application to execute the target instruction; if the execution conditions for the target instruction do not exist in the target application, generating a prompt message, which indicates that the target instruction cannot be executed.
[0013] Beneficial effect: Before controlling the target application to execute the target instruction, the present invention determines whether there is an execution condition for the target instruction in the target application. If the execution condition exists, the target application can be controlled to execute the target instruction. If the execution condition does not exist, a prompt message is generated to prompt the developer that the target instruction cannot be executed. The judgment of the execution condition in advance can improve efficiency and prevent execution errors due to the lack of execution conditions when executing the target instruction.
[0014] In an optional embodiment, after calling the target application programming interface and controlling the target application to execute the target instruction, the method also includes: receiving execution result information sent by the target application, the execution result information including a return value; parsing the return value according to the execution result information to determine the target execution result; and sending the target execution result to the client.
[0015] Beneficial effects: The present invention obtains execution result information, parses the return value according to the execution result information, and determines the target execution result; sends the target execution result to the client to realize the sending and display of the target execution result, so that the client can clearly understand the execution result and prevent information errors and omissions.
[0016] In an optional implementation, the return value is parsed according to the execution result information to determine the target execution result, including: if the return value is a first preset value, the target execution result is a successful execution; if the return value is a second preset value, the target execution result is a failed execution.
[0017] In a second aspect, the present invention provides a system for calling an application program, the system comprising:
[0018] The AI device is used to obtain a target instruction; and is used to determine a target application according to the target instruction, and send a general application programming interface name to the target application; wherein the target instruction is an instruction that a target user needs to execute; the target application is used to identify the general application programming interface name, and is used to send an operation set to the AI device according to the identification result; the AI device is used to determine a target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface represents an application programming interface corresponding to a target operation in the operation set for implementing the target instruction; the AI device is used to call the target application programming interface and control the target application to execute the target instruction; the target application is used to execute the target instruction.
[0019] Beneficial effects: The application calling system of the present invention, the AI device, is used to determine the target application for executing the target instruction according to the target instruction, send the pre-set universal application programming interface name to the target application, so that the target application recognizes the AI device, the target application is used to send an operation set to the AI device according to the recognition result, wherein when the recognition result is successful, the operation set is sent to the AI device; the AI device is used to select the target application programming interface corresponding to the target operation that can execute the target instruction in the operation set according to the operation set and the target instruction, call the target application programming interface, and control the target application to execute the target instruction. The present invention associates the AI device with the target application through the universal application programming interface name. When the target application needs to be called, as long as the recognition is successful according to the universal application programming interface name, all target application programming interfaces of the target application can be automatically called to execute the target instruction. Compared with the related art in which the developer associates the application programming interfaces of all applications with the action instruction, the present invention automatically determines the target application programming interface according to the target instruction through the universal application programming interface, thereby realizing the calling of the application by the AI device, which is simple to operate, reduces the consumption of manpower and material resources, and is highly efficient.
[0020] In a third aspect, the present invention provides an application calling device, which is applied to an AI device, and the device includes: an information acquisition module, which is used to obtain a target instruction, which is an instruction that a target user needs to execute; a target application determination module, which is used to determine a target application according to the target instruction, and send a general application programming interface name to the target application; wherein the target application is used to identify the general application programming interface name, and is used to send an operation set to the AI device according to the identification success information; a target application programming interface determination module, which is used to determine a target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface represents an application programming interface corresponding to a target operation in the operation set for implementing the target instruction; a target instruction execution module, which is used to call the target application programming interface and control the target application to execute the target instruction.
[0021] In a fourth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for calling an application of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0022] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute a method for calling an application program of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 is a flowchart of a method for an AI device to call an application program in a related technology according to an embodiment of the present invention;
[0025] Figure 2 is a flowchart of a method for calling an application according to an embodiment of the present invention;
[0026] Figure 3 is a flowchart of a calling method of another application according to an embodiment of the present invention;
[0027] Figure 4 is a flowchart of a method for calling another application according to an embodiment of the present invention;
[0028] Figure 5 is a schematic diagram of the process of calling the system of an application according to an embodiment of the present invention;
[0029] Figure 6 is a schematic diagram of a process of setting an alarm clock on an AI device according to an embodiment of the present invention;
[0030] Figure 7 is a schematic diagram of a process of deleting an alarm clock by an AI device according to an embodiment of the present invention;
[0031] Figure 8 is a structural block diagram of a device for calling an application according to an embodiment of the present invention;
[0032] Fig. 9 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0034] At present, for the method of artificial intelligence (AI) devices calling applications, the applications need to actively open the application programming interface (API) interface and provide documentation. Developers read the documentation and associate the API interface configuration with the action instructions that AI can execute. AI understands and generates corresponding action instructions by reading the task text, calls the target API interface of the target application, and executes the action instructions.
[0035] like Figure 1As shown, it is a flow chart of a method for an AI device to call an application program in a related technology according to an embodiment of the present invention, including: obtaining a task text input by a user; analyzing the user intent in combination with the context, and determining a target application program according to the user intent; analyzing the target instruction according to the user intent, exemplarily, the first instruction, the second instruction, etc. The target instruction is converted into different target API interfaces; wherein the target API interface represents an interface selected according to the user instruction in a mapping set of user instructions and API interfaces established by a developer, and each application contains multiple API interfaces, exemplarily, application A includes API1, API2, API3; application B includes API4, API5, API6; application C includes API7, API8, API9; calling the target API interface of the target application program, controlling the target application program to execute the target instruction, obtaining the task execution result returned by the application program, judging whether the task execution is completed, if the execution is completed, the task is completed, if the execution is not completed, re-analyzing the user intent in combination with the context.
[0036] In the above method, all the applications open different API interfaces. Each time a new application is associated, developers need to intervene to associate all API interfaces with action instructions. The operation is complicated, consumes a lot of manpower and material resources, and has low efficiency.
[0037] The embodiment of the present invention provides a method for calling an application program, which achieves the effect of automatically calling the application program by opening a general API interface.
[0038] According to an embodiment of the present invention, an embodiment of a method for calling an application is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0039] In this embodiment, a method for calling an application program is provided, which can be used for the above-mentioned AI device. Figure 2 is a flow chart of a method for calling an application according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0040] Step S201, obtaining a target instruction, where the target instruction is an instruction that a target user needs to execute.
[0041] The input form of the target instruction may be text input, voice input, etc. For example, the target instruction may be voice input "help me set an alarm for 10 pm".
[0042] Step S202, determine the target application according to the target instruction, and send the universal application programming interface name to the target application; wherein the target application is used to identify the universal application programming interface name and to send an operation set to the AI device according to the identification result.
[0043] Among them, AI devices can be smart phones, AR devices, etc.
[0044] Among them, an application set associated with the AI device is pre-set, and each application in the application set is associated with the AI device through a universal application programming interface. Therefore, the universal application programming interface name is sent to the target application so that the target application can communicate with the AI device through the universal application programming interface name, and the universal application programming interface user queries the operation set of the target application.
[0045] The name of the general application programming interface in the embodiment of the present invention can be customized. Exemplarily, the name of the general application programming interface can be supportAIFunctions().
[0046] In an embodiment of the present invention, according to the target instruction, a target application that can execute the target instruction is selected from the application set. For example, when the target instruction is "help me set an alarm for 10 o'clock in the evening", the target application that can execute the setting alarm instruction is selected: alarm clock.
[0047] Step S203, determining a target application programming interface of a target application according to the operation set and the target instruction; wherein the target application programming interface represents an application programming interface corresponding to a target operation in the operation set for implementing the target instruction.
[0048] Among them, each target application in the application set includes its own operation set, and the operation set represents the set of executable operations of the target application. The operation set includes different operations and the application programming interface corresponding to each operation. For example, for the application, the timer includes different operations, start timing, end timing, timing setting, etc. Each operation corresponds to its own application programming interface, and the different operations of the timer are controlled through the application interface.
[0049] Exemplarily, when the target instruction is "help me set an alarm for 10 pm", in the application alarm clock, the application program interface corresponding to the alarm setting is determined.
[0050] Step S204, calling the target application programming interface to control the target application to execute the target instruction.
[0051] In some optional embodiments, before controlling the target application to execute the target instruction, the method also includes: determining whether there are execution conditions for the target instruction in the target application; the execution conditions represent the basic conditions for executing the target instruction; if the execution conditions for the target instruction exist in the target application, calling the target application programming interface to control the target application to execute the target instruction; if the execution conditions for the target instruction do not exist in the target application, generating a prompt message, which indicates that the target instruction cannot be executed.
[0052] For example, if the target instruction is "help me turn off the current music", the execution condition of the target instruction is that the music player software is playing music; if the target instruction is "help me delete the alarm at 10 pm", the execution condition of the target instruction is that an alarm at 10 pm is set in the alarm software.
[0053] In an embodiment of the present invention, before controlling the target application to execute the target instruction, it is determined whether there are execution conditions for the target instruction in the target application. If the execution conditions exist, the target application can be controlled to execute the target instruction. If the execution conditions do not exist, a prompt message is generated to prompt the developer that the target instruction cannot be executed. Judging the execution conditions in advance can improve efficiency and prevent execution errors due to the lack of execution conditions when executing the target instruction.
[0054] The application calling method provided in this embodiment is applied to an AI device, and according to the target instruction, a target application for executing the target instruction is determined, and a pre-set universal application programming interface name is sent to the target application so that the target application can identify the AI device. The target application is used to send an operation set to the AI device according to the recognition result, wherein when the recognition result is successful, the operation set is sent to the AI device, and according to the operation set and the target instruction, the target application programming interface corresponding to the target operation that can execute the target instruction is selected from the operation set, and the target application programming interface is called to control the target application to execute the target instruction. The embodiment of the present invention associates the AI device with the target application through the universal application programming interface name. When the target application needs to be called, as long as the recognition is successful according to the universal application programming interface name, all target application programming interfaces of the target application can be automatically called to execute the target instruction. Compared with the related art in which the developer associates the application programming interfaces of all applications with the action instruction, the embodiment of the present invention automatically determines the target application programming interface according to the target instruction through the universal application programming interface, thereby realizing the calling of the application by the AI device, which is simple to operate, reduces the consumption of manpower and material resources, and is highly efficient.
[0055] In this embodiment, a method for calling an application program is provided, which can be used for the above-mentioned AI device. Figure 3 is a flowchart of a calling method of another application according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0056] Step S301, obtain the target instruction, which is the instruction that the target user needs to execute. Figure 2 Step S201 of the illustrated embodiment will not be described in detail here.
[0057] Step S302: Determine the target application according to the target instruction, and send the universal application programming interface name to the target application; wherein the target application is used to identify the universal application programming interface name and to send an operation set to the AI device according to the identification result. Figure 2 Step S202 of the illustrated embodiment will not be described in detail here.
[0058] In some optional implementations, the above step S302 includes:
[0059] Step S3021, according to the target instruction, select a target application that can execute the target instruction from the application set; wherein the application set includes an application that establishes a connection relationship with the AI device based on a general application programming interface name.
[0060] In an embodiment of the present invention, an AI device and an application are associated in advance through a general application programming interface to form an application set. The present invention enables the AI device to automatically select a target application that can execute a target instruction in the application set according to the target instruction, thereby improving the efficiency of the AI device in calling the application.
[0061] Step S303: Determine the target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface refers to the application programming interface corresponding to the target operation in the operation set for implementing the target instruction. Figure 2 Step S203 of the illustrated embodiment will not be described in detail here.
[0062] The operation set includes multiple operations, application programming interfaces corresponding to the multiple operations, and function information corresponding to the multiple operations.
[0063] In some optional implementations, the above step S303 includes:
[0064] Step S3031, according to the target instruction, determining the target function information matching the target instruction among the function information corresponding to the multiple operations.
[0065] Step S3032, filtering the target operation corresponding to the target function information.
[0066] Step S3033, determining the target application programming interface of the target application according to the target operation.
[0067] Exemplarily, if the target instruction is "help me set an alarm for 10 p.m.", then determine the target function information that matches the target instruction, that is, the information about functions related to setting an alarm; filter the target operation corresponding to the information about functions related to setting an alarm, that is, setting an alarm; and determine the target application programming interface for setting the alarm based on setting the alarm.
[0068] In an embodiment of the present invention, according to the target instruction, target function information matching the target instruction is determined in the operation set among the function information corresponding to multiple operations, and the target operation is determined according to the target function information. According to the target operation, the target application programming interface of the target application is determined, so as to realize the automation of artificial intelligence calling the target application programming interface of the application, and automatically determine the target application programming interface according to the target instruction without the intervention of developers, thereby saving manpower and material resources and improving efficiency.
[0069] Step S304: call the target application programming interface to control the target application to execute the target instruction. Figure 2 Step S204 of the illustrated embodiment will not be described in detail here.
[0070] Step S305: receiving the execution result information sent by the target application, wherein the execution result information includes a return value.
[0071] Step S306, analyzing the return value according to the execution result information to determine the target execution result.
[0072] In some optional implementations, the return value is parsed based on the execution result information to determine the target execution result, including: if the return value is a first preset value, the target execution result is a successful execution; if the return value is a second preset value, the target execution result is a failed execution.
[0073] The first preset value and the second preset value can be set according to actual conditions. For example, the first preset value is 0 and the second preset value is 1.
[0074] Step S307, sending the target execution result to the client.
[0075] The application calling method provided in this embodiment obtains execution result information, parses the return value according to the execution result information, and determines the target execution result; the target execution result is sent to the client to realize the sending and display of the target execution result, so that the client can clearly understand the execution result and prevent information errors and omissions.
[0076] In this embodiment, a method for calling an application program is provided, which can be used for the above-mentioned AI device. Figure 4 is a flowchart of a method for calling another application according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0077] Obtain the task text input by the user; analyze the user's intention in combination with the context, determine the target application according to the user's intention, and query the operation set of the target application through the general application programming interface. For example, the target application can be application A, application B, and application C; obtain the structured interface description data returned by the target application, wherein the structured interface description data includes the operation combination of the application; determine the target application programming interface of the target application according to the structured interface description data and the task text; obtain the task execution result returned by the target application; determine whether the task execution has been completed. If the execution has been completed, the task is completed. If the execution has not been completed, re-analyze the user's intention in combination with the context.
[0078] In the embodiment of the present invention, the structured interface description data can be customized. For example, a set of operations supported by the target application is sent to the AI device using a certain JSON structure. For the AI device of the embodiment of the present invention, the AI model prompt words can be defined to tell the AI how to process the task text, how to interpret the structured parameters, understand the detailed information therein and perform the corresponding operation.
[0079] In this embodiment, a method for calling an application program is provided, which can be used for the above-mentioned AI device. Figure 5 FIG. 1 is a flowchart of the calling system operation of an application according to an embodiment of the present invention. Figure 5 As shown, the process includes the following steps:
[0080] Step S501, the AI device is used to obtain a target instruction; and is used to determine a target application according to the target instruction, and send a general application programming interface name to the target application; wherein the target instruction is an instruction that the target user needs to execute. For details, please refer to Figure 2 Step S201 and step S202 of the illustrated embodiment are not described in detail here.
[0081] Step S502: The target application is used to identify the name of the general application programming interface and send an operation set to the AI device according to the identification result. Figure 2 Step S202 of the illustrated embodiment will not be described in detail here.
[0082] Step S503: The AI device is used to determine the target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface refers to the application programming interface corresponding to the target operation in the operation set for implementing the target instruction. Figure 3 Step S203 of the illustrated embodiment will not be described in detail here.
[0083] Step S504: The AI device is used to call the target application programming interface to control the target application to execute the target instruction. Figure 3 Step S204 of the illustrated embodiment will not be described in detail here.
[0084] Step S505: target application program, used to execute target instructions.
[0085] For example, Figure 6 As shown, it is a schematic diagram of the process of setting an alarm clock for an AI device according to an embodiment of the present invention, including:
[0086] The client is used to send the target instruction "help me set an alarm for 10 o'clock in the evening"; the AI device is used to determine that the target application is the alarm clock according to the target instruction, and is used to send the general application programming interface name to the alarm clock application; the alarm clock application is used to determine the structured parameters according to the general application programming interface name, and is used to send the structured parameters to the AI device, wherein the structured parameters include an operation set; the AI device is used to parse the structured parameters, determine the target API interface corresponding to the target operation in the operation set in combination with the target instruction, and is used to control the alarm clock application to set the alarm for 10 o'clock in the evening; the alarm clock application is used to set the alarm for 10 o'clock in the evening, and is used to send a return value to the AI device, wherein the return value indicates the execution result of the target instruction; the AI device is used to interpret the return value according to the structured parameters, obtain the execution result, and send the execution result to the client.
[0087] For example, Figure 7 As shown, it is a schematic diagram of a process of deleting an alarm clock by an AI device according to an embodiment of the present invention, including:
[0088] The client is used to send the target instruction "help me delete the alarm at 10 pm"; the AI device is used to determine that the target application is the alarm clock according to the target instruction, and is used to send the general application programming interface name to the alarm clock application; the alarm clock application is used to determine the structured parameters according to the general application programming interface name, and is used to send the structured parameters to the AI device, wherein the structured parameters include an operation set; the AI device is used to parse the structured parameters, determine the target API interface corresponding to the target operation in the operation set in combination with the target instruction, and is used to confirm whether the alarm clock application has an alarm at 10 pm; the alarm clock application is used to send the information of the existence of the alarm at 10 pm to the AI device according to the structured parameters; the AI device is used to confirm the existence of the alarm at 10 pm according to the structured parameters, and is used to control the alarm clock application to delete the alarm at 10 pm; the alarm clock application is used to delete the alarm at 10 pm, and is used to send a return value to the AI device, and the return value indicates the execution result of the target instruction; the AI device is used to interpret the return value according to the structured parameters, obtain the execution result, and send the execution result to the client.
[0089] The application calling system of the embodiment of the present invention, the AI device, is used to determine the target application for executing the target instruction according to the target instruction, send the pre-set universal application programming interface name to the target application, so that the target application recognizes the AI device, the target application is used to send an operation set to the AI device according to the recognition result, wherein when the recognition result is successful, the operation set is sent to the AI device; the AI device is used to select the target application programming interface corresponding to the target operation that can execute the target instruction in the operation set according to the operation set and the target instruction, call the target application programming interface, and control the target application to execute the target instruction. The embodiment of the present invention associates the AI device with the target application through the universal application programming interface name. When the target application needs to be called, as long as the recognition is successful according to the universal application programming interface name, all target application programming interfaces of the target application can be automatically called to execute the target instruction. Compared with the related art in which the developer associates the application programming interfaces of all applications with the action instruction, the embodiment of the present invention automatically determines the target application programming interface according to the target instruction through the universal application programming interface, thereby realizing the calling of the application by the AI device, which is simple to operate, reduces the consumption of manpower and material resources, and is highly efficient.
[0090] In the present embodiment, a device for calling an application is also provided, and the device is used to implement the above-mentioned embodiment and preferred implementation mode, and the descriptions have been made no further. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0091] This embodiment provides a device for calling an application program, which is applied to an AI device, such as Figure 8 As shown, including:
[0092] The information acquisition module 801 is used to acquire a target instruction, where the target instruction is an instruction that a target user needs to execute.
[0093] The target application determination module 802 is used to determine the target application according to the target instruction and send the universal application programming interface name to the target application; wherein the target application is used to identify the universal application programming interface name and to send an operation set to the AI device according to the identification success information.
[0094] The target application programming interface determination module 803 is used to determine the target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface represents the application programming interface corresponding to the target operation in the operation set for implementing the target instruction.
[0095] The target instruction execution module 804 is used to call the target application programming interface and control the target application to execute the target instruction.
[0096] In some optional implementations, the target application determination module 802 includes:
[0097] The target application selection unit is used to select a target application that can execute the target instruction from the application set according to the target instruction; wherein the application set includes applications that establish a connection relationship with the AI device based on a general application programming interface name.
[0098] In some optional implementations, the target application programming interface determination module 803 includes:
[0099] The target function information determination unit is used to determine, according to the target instruction, the target function information matching the target instruction among the function information corresponding to the multiple operations.
[0100] The target operation screening unit is used to screen the target operation corresponding to the target function information.
[0101] The target application programming interface determination unit is used to determine the target application programming interface of the target application according to the target operation.
[0102] In some optional embodiments, the above device further includes:
[0103] The execution condition judgment module is used to judge whether there is an execution condition for the target instruction in the target application; the execution condition represents the basic condition for the execution of the target instruction.
[0104] The instruction execution module is used to call the target application programming interface according to the execution condition of the target instruction in the target application, and control the target application to execute the target instruction.
[0105] The prompt information determination module is used to generate a prompt information according to the execution condition that the target instruction does not exist in the target application program, and the prompt information indicates that the target instruction cannot be executed.
[0106] The execution result return module is used to receive the execution result information sent by the target application, including the return value; and to parse the return value according to the execution result information to determine the target execution result; and to send the target execution result to the client.
[0107] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0108] The calling device of the application in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0109] The embodiment of the present invention also provides a computer device having the above Figure 8 The calling device of the application shown.
[0110] Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0111] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0112] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0113] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0114] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0115] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0116] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0117] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for calling an application, characterized in that: Applied to an AI device, the method includes: Obtaining a target instruction, where the target instruction is an instruction that a target user needs to execute; Determine a target application according to the target instruction, and send a universal application programming interface name to the target application; wherein the target application is used to identify the universal application programming interface name, and is used to send an operation set to the AI device according to the identification result; Determine a target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface represents an application programming interface corresponding to a target operation in the operation set for implementing the target instruction; The target application programming interface is called to control the target application to execute the target instruction.
2. The method according to claim 1, characterized in that Determining the target application according to the target instruction includes: According to the target instruction, a target application that can execute the target instruction is selected from an application set; wherein the application set includes an application that establishes a connection relationship with the AI device based on the universal application programming interface name.
3. The method according to claim 1 or 2, characterized in that: The operation set includes a plurality of operations, application programming interfaces corresponding to the plurality of operations, and function information corresponding to the plurality of operations; and determining the target application programming interface of the target application according to the operation set and the target instruction includes: According to the target instruction, determining target function information matching the target instruction among the function information corresponding to the multiple operations; Filtering a target operation corresponding to the target function information; A target application programming interface of the target application is determined according to the target operation.
4. The method according to claim 1 or 2, characterized in that: Before controlling the target application to execute the target instruction, the method further includes: Determine whether the target application has an execution condition for the target instruction; the execution condition represents a basic condition for executing the target instruction; If the target application has an execution condition for the target instruction, calling the target application programming interface to control the target application to execute the target instruction; If the execution condition of the target instruction does not exist in the target application, a prompt message is generated, and the prompt message indicates that the target instruction cannot be executed.
5. The method according to claim 1 or 2, characterized in that: After calling the target application programming interface and controlling the target application to execute the target instruction, the method further includes: Receiving execution result information sent by the target application, wherein the execution result information includes a return value; According to the execution result information, the return value is parsed to determine the target execution result; The target execution result is sent to the client.
6. The method according to claim 5, characterized in that The step of parsing the return value according to the execution result information to determine the target execution result includes: If the return value is the first preset value, the target execution result is successful execution; If the return value is the second preset value, the target execution result is execution failure.
7. A system for calling an application program, characterized in that: The system comprises: The AI device is used to obtain a target instruction; and is used to determine a target application according to the target instruction, and send a universal application programming interface name to the target application; wherein the target instruction is an instruction that a target user needs to execute; The target application is used to identify the general application programming interface name and to send an operation set to the AI device according to the identification result; The AI device is used to determine a target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface represents an application programming interface corresponding to a target operation in the operation set for implementing the target instruction; The AI device is used to call the target application programming interface to control the target application to execute the target instruction; The target application is used to execute the target instruction.
8. A device for calling an application, characterized in that: Applied to AI equipment, the device comprises: An information acquisition module is used to acquire a target instruction, where the target instruction is an instruction that a target user needs to execute; A target application determination module, used to determine a target application according to the target instruction, and send a universal application programming interface name to the target application; wherein the target application is used to identify the universal application programming interface name, and is used to send an operation set to the AI device according to the identification success information; A target application programming interface determination module, used to determine the target application programming interface of the target application according to the operation set and the target instruction; wherein the target application programming interface represents the application programming interface corresponding to the target operation in the operation set for implementing the target instruction; The target instruction execution module is used to call the target application programming interface and control the target application to execute the target instruction.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for calling the application program according to any one of claims 1 to 6 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for calling the application program according to any one of claims 1 to 6.