Interface calling method, computer equipment and computer readable storage medium
Through the interface call method between the client and the server, the implementation of custom voice interaction logic and interface security call is realized, solving the problem that the existing vehicle voice interaction system cannot meet the user's personal preferences.
Patent Information
- Application Number
- CN202411087650.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-03
AI Technical Summary
The existing in-vehicle voice interaction system is difficult to meet the personal preferences and usage needs of different users, resulting in poor interactive experience.
Through the interface call method between the client and the server, the client receives the application service identification information sent by the server and the call key of the target application program interface, and sends a call request based on this information to complete the call of the target application program interface. This implements customized voice interaction logic.
Users can satisfy their personal preferences through customized voice interaction logic, improve voice interaction experience, and ensure secure calls to the interface through verification mechanisms.
Smart Images

Figure CN119065870A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an interface calling method, a computer device, and a computer-readable storage medium. Background Art
[0002] With the development and widespread application of in-vehicle voice interaction systems, more and more users tend to control vehicles by voice. However, in related technologies, in-vehicle voice interaction systems can support several voice interaction logics for users to control vehicles by voice. However, due to the differences in usage needs and usage methods among different users, some users may be dissatisfied with the native voice interaction logic and have a poor interaction experience. Summary of the invention
[0003] The present application provides an interface calling method, a computer device and a computer-readable storage medium.
[0004] The embodiment of the present application provides an interface calling method for a client, wherein the client is connected to a server for communication, and includes:
[0005] Receive the application service identification information and the calling key of the target application program interface sent by the server;
[0006] Sending a first request to call the target application program interface to the server according to the application service identification information and the calling key;
[0007] Receive the return result output by the server according to the calling request and the target application program interface, and complete the calling of the target application program interface.
[0008] In the interface calling method provided in the implementation mode of the present application, the client can receive the application service identification information and the calling key of the target application interface sent by the server, and send a first request to call the target application interface to the server based on the application service identification information and the calling key, and receive the return result output by the server based on the calling request and the target application interface, thereby completing the calling of the target application interface.
[0009] In this way, in the implementation mode of the present application, the client can send a call request for the target application interface to the server based on the application service identification information sent by the server and the calling key of the target application interface, so as to obtain the return result output by the server when calling the target application interface, thereby completing the call of the target application interface. Therefore, the user can implement the control logic designed by himself, such as voice interaction logic, through the call of the target application interface, thereby satisfying the user's personal preferences and voice interaction experience to a certain extent.
[0010] In certain embodiments of the present application, the method further comprises:
[0011] Sending a second request for creating an application service to the server, wherein the server can send the application service identification information to the client according to the second request; and / or
[0012] Sending a third request for reading description information of the callable interface to the server, wherein the server can send the description information of the callable interface to the client according to the third request; and / or
[0013] Sending a fourth request for using the target application program interface to the server, wherein the server can send the call key to the client according to the fourth request; and / or
[0014] sending a fifth request for registering a target account to the server, wherein the server is capable of registering the target account according to the fifth request; and / or
[0015] A sixth request for publishing the interface to be called is sent to the server, wherein the server can set the interface to be called to a published state according to the sixth request.
[0016] Thus, in the implementation mode of the present application, the client may send a request to the server for creating an application service to request and receive the application service identification information assigned to the client by the server. And / or, the client may send a request to the server for reading the description information of the callable interface, so that the server sends the description information of the callable interface to the client, and the client may subsequently determine the target application interface according to the description information of the callable interface. And / or, the client may send a request to the server for using the target application interface, so that the server sends the call key of the target application interface to the client, and the client may subsequently call the target application interface according to the call key of the target application interface. And / or, the client may send a request to the server for registering the target account, so that the server registers the target account. And / or, the client may send a request to the server for publishing the interface to be called, so that the server sets the interface to be called to the published state.
[0017] In certain embodiments of the present application, the sending, to the server, a first request for invoking the target application program interface according to the application service identification information and the invocation key includes:
[0018] According to the target account, the application service identification information and the calling key, the first request for calling the target application program interface is sent to the server, wherein the server can verify the target account, the application service identification information and the calling key in the first request, and can output the return result if the verification passes.
[0019] In this way, in the implementation mode of the present application, the client can send a request for calling the target application program interface to the server through the target account, application service identification information and calling key, so that the server can verify the account, application service identification information and calling key in the request, and call the target application program interface if the verification is passed, so that the secure calling of the target application program interface can be guaranteed.
[0020] The embodiment of the present application provides an interface calling method, which is used for a server, wherein the server is connected to a client for communication, and includes:
[0021] Sending application service identification information and a calling key of a target application program interface to the client;
[0022] Upon receiving a seventh request sent by the client for calling the target application program interface, outputting a return result according to the seventh request and the target application program interface, wherein the client can generate the seventh request according to the application service identification information and the calling key;
[0023] The returned result is sent to the client to complete the call of the target application program interface.
[0024] In this way, in the implementation mode of the present application, the client can send a call request for the target application interface to the server based on the application service identification information sent by the server and the calling key of the target application interface, so as to obtain the return result output by the server when calling the target application interface, thereby completing the call of the target application interface. Therefore, the user can implement the control logic designed by himself, such as voice interaction logic, through the call of the target application interface, thereby satisfying the user's personal preferences and voice interaction experience to a certain extent.
[0025] In certain embodiments of the present application, the method further comprises:
[0026] Sending the application service identification information to the client according to an eighth request for creating an application service sent by the client; and / or
[0027] According to a ninth request sent by the client for reading description information of a callable interface, sending the description information to the client; and / or
[0028] Sending the call key to the client according to a tenth request sent by the client for using the target application program interface; and / or
[0029] Registering the target account according to the eleventh request for registering the target account sent by the client; and / or
[0030] According to the twelfth request for publishing the interface to be called sent by the client, the interface to be called is set to a publishing state.
[0031] Thus, in the implementation mode of the present application, the client may send a request to the server for creating an application service to request and receive the application service identification information assigned to the client by the server. And / or, the client may send a request to the server for reading the description information of the callable interface, so that the server sends the description information of the callable interface to the client, and the client may subsequently determine the target application interface according to the description information of the callable interface. And / or, the client may send a request to the server for using the target application interface, so that the server sends the call key of the target application interface to the client, and the client may subsequently call the target application interface according to the call key of the target application interface. And / or, the client may send a request to the server for registering the target account, so that the server registers the target account. And / or, the client may send a request to the server for publishing the interface to be called, so that the server sets the interface to be called to the published state.
[0032] In certain embodiments of the present application, the client can generate the seventh request according to the target account, the application service identification information and the calling key, and upon receiving the seventh request sent by the client for calling the target application program interface, outputting a return result according to the seventh request and the target application program interface includes:
[0033] When receiving the seventh request, verifying the application service identification information, the calling key and the account number of the seventh request;
[0034] When the verification is passed, the return result is output according to the seventh request and the target application program interface.
[0035] In this way, in the implementation mode of the present application, the client can send a request for calling the target application program interface to the server through the target account, application service identification information and calling key, so that the server can verify the account, application service identification information and calling key in the request, and call the target application program interface if the verification is passed, so that the secure calling of the target application program interface can be guaranteed.
[0036] The embodiment of the present application provides an interface calling device, which is used for a client, and the client is connected to a server for communication, including:
[0037] A first receiving module, used to receive application service identification information and a calling key of a target application program interface sent by a server;
[0038] A first request sending module, used for sending a first request for calling the target application program interface to the server according to the application service identification information and the calling key;
[0039] The second receiving module is used to receive the return result output by the server according to the calling request and the target application program interface, and complete the calling of the target application program interface.
[0040] In this way, in the implementation mode of the present application, the client can send a call request for the target application interface to the server based on the application service identification information sent by the server and the calling key of the target application interface, so as to obtain the return result output by the server when calling the target application interface, thereby completing the call of the target application interface. Therefore, the user can implement the control logic designed by himself, such as voice interaction logic, through the call of the target application interface, thereby satisfying the user's personal preferences and voice interaction experience to a certain extent.
[0041] The embodiment of the present application provides an interface calling device, which is used for a server, and the server is connected to a client for communication, including:
[0042] A first sending module, used to send application service identification information and a calling key of a target application program interface to the client;
[0043] an output module, configured to, upon receiving a seventh request sent by the client for calling the target application program interface, output a return result according to the seventh request and the target application program interface, wherein the client can generate the seventh request according to the application service identification information and the calling key;
[0044] The second sending module is used to send the return result to the client to complete the call of the target application program interface.
[0045] In this way, in the implementation mode of the present application, the client can send a call request for the target application interface to the server based on the application service identification information sent by the server and the calling key of the target application interface, so as to obtain the return result output by the server when calling the target application interface, thereby completing the call of the target application interface. Therefore, the user can implement the control logic designed by himself, such as voice interaction logic, through the call of the target application interface, thereby satisfying the user's personal preferences and voice interaction experience to a certain extent.
[0046] An embodiment of the present application provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned interface calling method is implemented.
[0047] In this way, in the implementation mode of the present application, the client can send a call request for the target application interface to the server based on the application service identification information sent by the server and the calling key of the target application interface, so as to obtain the return result output by the server when calling the target application interface, thereby completing the call of the target application interface. Therefore, the user can implement the control logic designed by himself, such as voice interaction logic, through the call of the target application interface, thereby satisfying the user's personal preferences and voice interaction experience to a certain extent.
[0048] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by one or more processors, the above-mentioned interface calling method is implemented.
[0049] In this way, in the implementation mode of the present application, the client can send a call request for the target application interface to the server based on the application service identification information sent by the server and the calling key of the target application interface, so as to obtain the return result output by the server when calling the target application interface, thereby completing the call of the target application interface. Therefore, the user can implement the control logic designed by himself, such as voice interaction logic, through the call of the target application interface, thereby satisfying the user's personal preferences and voice interaction experience to a certain extent.
[0050] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0052] Figure 1This is a flowchart of an interface calling method in certain implementation modes of the present application;
[0053] Figure 2 This is a flowchart of an interface calling method in certain implementation modes of the present application;
[0054] Figure 3 A schematic diagram of an application scenario of an interface calling method in certain implementation modes of the present application;
[0055] Figure 4 This is a flowchart of the interface calling method in certain implementation modes of the present application. DETAILED DESCRIPTION
[0056] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0057] With the continuous development and widespread application of natural language processing (NLP) technology, the capabilities of in-vehicle intelligent voice systems have gradually become richer, and they can provide users with sufficiently rich voice interaction methods. However, due to the differences in preferences of different users, the native voice interaction methods supported by in-vehicle intelligent voice systems are difficult to meet the needs of all users. Therefore, some users with certain development capabilities expect to design and use unique voice interaction methods to meet their own preferences.
[0058] Based on the above problems you may encounter, please refer to Figure 1 The embodiment of the present application provides an interface calling method for a client, wherein the client communicates with the server, including:
[0059] 01: Receive the application service identification information and the calling key of the target application program interface sent by the server;
[0060] 02: Send a first request for calling the target application program interface to the server according to the application service identification information and the calling key;
[0061] 03: The receiving server completes the call of the target application program interface according to the call request and the return result output by the target application program interface.
[0062] The embodiment of the present application also provides an interface calling device for a client. The interface calling method for a client in the embodiment of the present application can be implemented by the interface calling device for a client in the embodiment of the present application. Specifically, the interface calling device includes an acquisition module, a first sending module and a calling module. Among them, the acquisition module is used to receive the application service identification information and the calling key of the target application interface sent by the server. The first sending module is used to send a first request to call the target application interface to the server according to the application service identification information and the calling key. The first calling module is used to receive the return result output by the server according to the calling request and the target application interface, and complete the calling of the target application interface.
[0063] The embodiment of the present application also provides a computer device, which includes a memory and a processor. The interface calling method for the client in the embodiment of the present application can be implemented by the computer device of the embodiment of the present application. Specifically, a computer program is stored in the memory, and the processor is used to receive the application service identification information and the calling key of the target application interface sent by the server, and is used to send a first request to call the target application interface to the server according to the application service identification information and the calling key, and is used to receive the return result output by the server according to the calling request and the target application interface to complete the calling of the target application interface.
[0064] For the corresponding interface calling method for the client, see Figure 2 The embodiment of the present application also provides an interface calling method for a server, wherein the server is connected to a client for communication, including:
[0065] 11: Send the application service identification information and the calling key of the target application program interface to the client;
[0066] 12: upon receiving a seventh request sent by the client for invoking the target application program interface, outputting a return result according to the seventh request and the target application program interface, wherein the client can generate the seventh request according to the application service identification information and the invoking key;
[0067] 13: Send the return result to the client to complete the call of the target application interface.
[0068] The embodiment of the present application also provides an interface calling device for a server. The interface calling method for a server in the embodiment of the present application can be implemented by the interface calling device for a server in the embodiment of the present application. Specifically, the interface calling device includes an information sending module, an output module and a result sending module. Among them, the information sending module is used to send application service identification information and a calling key of a target application interface to the client. The output module is used to output a return result according to the seventh request and the target application interface when receiving a seventh request sent by the client to call the target application interface, and the client can generate the seventh request according to the application service identification information and the calling key. The result sending module is used to send a return result to the client to complete the call of the target application interface.
[0069] The embodiment of the present application also provides a computer device, which includes a memory and a processor. The interface calling method for the server in the embodiment of the present application can be implemented by the computer device of the embodiment of the present application. Specifically, a computer program is stored in the memory, and the processor is used to send application service identification information and a calling key of the target application interface to the client, and is used to output a return result according to the seventh request and the target application interface when receiving a seventh request sent by the client to call the target application interface. The client can generate the seventh request according to the application service identification information and the calling key, and is used to send the return result to the client to complete the call of the target application interface.
[0070] Specifically, in the implementation mode of the present application, the server may send the application service identification information and the call key of the target application program interface to the client. Upon receiving the application service identification information and the call key of the target application program interface, the client may generate a call request for calling the target application program interface according to the application service identification information and the call key of the target application program interface, and send the call request to the server.
[0071] When the server receives a call request sent by the client, it can parse the call request to obtain the application service identification information and call key therein, and call the target application interface based on the service identification information and call key obtained by the parsed information to output the corresponding return result, and send the return result to the client, thereby completing the client's call to the target application interface.
[0072] In summary, in the implementation mode of the present application, the client can send a call request for the target application interface to the server based on the application service identification information sent by the server and the calling key of the target application interface, so as to obtain the return result output by the server when calling the target application interface, thereby completing the call of the target application interface. Therefore, the user can implement the control logic designed by himself, such as voice interaction logic, through the call of the target application interface, thereby satisfying the user's personal preferences and voice interaction experience to a certain extent.
[0073] Furthermore, when the client user is aware of an application program interface required for an interaction logic such as voice interaction logic, the corresponding service identification information and call key can be obtained through the server, thereby calling the application program interface to implement the voice interaction logic, which to a certain extent satisfies the client user's personal usage preferences.
[0074] Among them, the application service identification information refers to the information used to identify the application service applied by the client. In the implementation mode of this application, the application service can be understood as a kind of account authority. Each client needs to apply for an application service from the server before calling an application programming interface (Application Programming Interface, API), and the server will assign an identification information (Identity document, ID) to the client. When the client interacts with the server, it can send the identification information to the server so that the server can verify the client's authority.
[0075] Furthermore, in the embodiments of the present application, an application program interface may be used to implement a natural language processing operation or a voice interaction function. For example, in one example, an application program interface may be used to call a pre-trained speech recognition model (Automatic Speech Recognition, ASR) to perform speech recognition on a voice message. In another example, an application program interface may be used to call a pre-trained named entity recognition (Named Entity Recognition, NER) model to perform named entity recognition on a text message.
[0076] Further, in the implementation mode of the present application, when the client calls an application program interface in the server, it is necessary to provide the server with the calling key of the application program interface so that the server can verify whether the calling key is correct. If it is correct, the server can call the application program interface and feedback the corresponding result to the client. If it is wrong, the server can reject the call of the client and send a key verification failure prompt message to the client.
[0077] It can also be understood that in the implementation mode of the present application, the client can generate a request for calling the target application interface according to the application service identification information and the calling key of the target application interface when receiving the application service identification information and the calling key sent by the server, or in other words, encapsulate the application service identification information and the calling key to generate the request. Accordingly, when the client sends the request to the server, the server can verify the service identification information and the calling key in the request, and call the target application interface when the service identification information and the calling key in the request are both verified.
[0078] Furthermore, in certain embodiments of the present application, the client may encapsulate the application service identification information, the call key, and the input parameters required by the target application program interface to generate a call request.
[0079] Exemplarily, when the target application interface is used to call a pre-trained speech recognition model to perform speech recognition on a voice data, and the input parameters of the target application interface include the voice data to be recognized, the client can encapsulate the application service identification information, the call key and the voice data to be recognized to generate a call request, and send the call request to the server.
[0080] Correspondingly, the server can parse the received call request to obtain the application service identification information, the call key and the voice data to be recognized, and when the service identification information and the call key are verified, call the target application program interface to perform voice recognition on the parsed voice data to be recognized, and send the result of the voice recognition (i.e., the return result) to the client.
[0081] In addition, it can also be understood that in the implementation manner of the present application, the first request sent by the client can be understood as the seventh request received by the server.
[0082] In some embodiments of the present application, the interface calling method for the client further includes:
[0083] A second request for creating an application service is sent to the server, wherein the server can send application service identification information to the client according to the second request.
[0084] The interface calling device for the client of the embodiment of the present application further includes a second request sending module. The second request sending module is used to send a second request for creating an application service to the server, and the server can send application service identification information to the client according to the application service creation request.
[0085] The processor of the implementation manner of the present application is also used to send a second request for creating an application service to the server, wherein the server can send application service identification information to the client according to the second request.
[0086] Corresponding to the above-mentioned interface calling method for the client, in some embodiments of the present application, the interface calling method for the server further includes:
[0087] According to an eighth request for creating an application service sent by the client, application service identification information is sent to the client.
[0088] The interface calling device for the server in the embodiment of the present application further includes a third sending module. The third sending module is used to send application service identification information to the client according to the eighth request for creating an application service sent by the client.
[0089] The processor in the implementation manner of the present application is further configured to send application service identification information to the client according to an eighth request for creating an application service sent by the client.
[0090] Specifically, in the implementation mode of the present application, the client may send a request (i.e., the second request) to the server for creating an application service, so that the server allocates or generates an application service identification information for the client. The server may allocate or generate an application service identification information for the client according to the received request (i.e., the eighth request) for creating an application service, and send the application service identification information to the client.
[0091] To more clearly illustrate the implementation of this application, please refer to Figure 3 , Figure 3 This is a schematic diagram of an application scenario of the interface calling method in certain embodiments of the present application. Figure 3 As shown in step c in , the client 1 may send an application service creation request for creating an application service to the server. And, Figure 3 As shown in step d in the example, the application service in the server side can feedback an application service identification information to the client side 1 after receiving the application service identification information.
[0092] Thus, in the implementation manner of the present application, the client may send a request for creating an application service to the server to request and receive the application service identification information assigned to the client by the server.
[0093] In addition, it should be noted that in Figure 3In the illustrated implementation, the "application service creation request for creating an 'application service'" sent by the client 1 can be understood as a request for creating an application service instance (or application service node), and the "application service" in the server can be understood as a service, a program module dedicated to responding to the "application service creation request for creating an 'application service'". Figure 3 In the illustrated implementation, the server may run account services, application services, solution services, security services, and interface services, and these five services may be understood as services.
[0094] In addition, it can also be understood that in the implementation manner of the present application, the second request sent by the client can be understood as the eighth request received by the server.
[0095] In some embodiments of the present application, the interface calling method for the client further includes:
[0096] A third request for reading description information of the callable interface is sent to the server, wherein the server can send the description information of the callable interface to the client according to the third request.
[0097] The interface calling device for the client of the embodiment of the present application further includes a third request sending module. The third request sending module is used to send a third request for reading the description information of the callable interface to the server, wherein the server can send the description information of the callable interface to the client according to the third request.
[0098] The processor of the implementation mode of the present application is also used to send a third request for reading the description information of the callable interface to the server, wherein the server can send the description information of the callable interface to the client according to the third request.
[0099] Corresponding to the above-mentioned interface calling method for the client, in some embodiments of the present application, the interface calling method for the server further includes:
[0100] According to a ninth request sent by the client for reading description information of the callable interface, description information is sent to the client.
[0101] The interface calling device for the server in the embodiment of the present application further includes a fourth sending module. The fourth sending module is used to send application service identification information to the client according to the eighth request for creating an application service sent by the client.
[0102] The processor in the implementation manner of the present application is further configured to send application service identification information to the client according to an eighth request for creating an application service sent by the client.
[0103] Specifically, in order to reduce the difficulty for client users to call an application program interface, in an embodiment of the present application, the client may send a request to the server for reading the description information of the callable interface, so that the server sends the description information of the callable interface to the client.
[0104] To more clearly illustrate the implementation method of this application, please refer to Figure 3 That is, Figure 3 As shown in step e in , the client 1 may send a request to the server to request the server to provide description information of all currently available callable interfaces. Figure 3 As shown in step f in , the server can send the description information of all currently publicly available callable interfaces to client 1 based on the request, so that the user of client 1 can view the description information of each callable interface and determine the target application interface from all callable interfaces according to actual needs.
[0105] Among them, it is understandable that in Figure 3 In the illustrated embodiment, the solution may be understood as an application program interface.
[0106] It is also understood that in the implementation manner of the present application, the specific content of the description information can be set according to the actual situation. For example, in some implementation manners of the present application, the description information includes the name of the application program interface, the type of the input parameter of the application program interface, etc.
[0107] In this way, in an implementation of the present application, the client can send a request to the server for reading the description information of the callable interface, so that the server sends the description information of the callable interface to the client, and the client can subsequently determine the target application interface based on the description information of the callable interface.
[0108] In addition, it can also be understood that in the implementation manner of the present application, the third request sent by the client can be understood as the ninth request received by the server.
[0109] In some embodiments of the present application, the interface calling method for the client further includes:
[0110] A fourth request for using the target application program interface is sent to the server, wherein the server can send a call key to the client according to the fourth request.
[0111] The interface calling device for the client of the embodiment of the present application further includes using a fourth request sending module. The fourth request sending module is used to send a fourth request for using the target application program interface to the server, wherein the server can send a calling key to the client according to the fourth request.
[0112] The processor of the implementation mode of the present application is also used to send a fourth request for using the target application program interface to the server, wherein the server can send a call key to the client according to the fourth request.
[0113] Corresponding to the above-mentioned interface calling method for the client, in some embodiments of the present application, the interface calling method for the server further includes:
[0114] According to a tenth request sent by the client for using the target application program interface, a call key is sent to the client.
[0115] The interface calling device for the server of the embodiment of the present application further includes a fifth sending module. The fifth sending module is used to send a calling key to the client according to a tenth request for using the target application program interface sent by the client.
[0116] The processor of the implementation mode of the present application is also used to send a call key to the client according to the tenth request sent by the client for using the target application program interface.
[0117] Specifically, in the implementation mode of the present application, the client may send a request to the server to apply for the use of the target application program interface. When the server receives the request for the target application program interface sent by the client, it may verify the request, and when the verification is successful, it may feedback the call key of the target application program interface to the client.
[0118] To more clearly illustrate the implementation method of this application, please refer to Figure 3 That is, Figure 3 As shown in step g in , the client 1 may send a request to use the target application program interface to the solution service on the server side.
[0119] like Figure 3 As shown in step h in , the solution service may forward the usage request to the security service.
[0120] After receiving the request, the security service may parse the use request to obtain the application service identification information in the use request. At the same time, if the application service identification information obtained by parsing is the same as the application service identification information pre-assigned (or specified) to a client, such as Figure 3 As shown in step i in , the security service can forward the call key of the target application interface to the solution service.
[0121] like Figure 3 As shown in step j in , the solution service can forward the call key to the client 1, so that when the client 1 subsequently wants to call the target application interface, the call key of the target application interface can be sent to the server.
[0122] In this way, in an embodiment of the present application, the client can send a request to the server for using the target application interface, so that the server sends the calling key of the target application interface to the client, and the client can subsequently call the target application interface according to the calling key of the target application interface.
[0123] In addition, it can also be understood that in the implementation manner of the present application, the fourth request sent by the client can be understood as the tenth request received by the server.
[0124] In some embodiments of the present application, the interface calling method for the client further includes:
[0125] Sending a fifth request for registering the target account to the server, wherein the server can register the target account according to the fifth request;
[0126] The interface calling device for the client of the embodiment of the present application further includes a registration module. The registration module is used to send a fifth request for registering a target account to the server, wherein the server can register the target account according to the fifth request.
[0127] The processor of the implementation mode of the present application is also used to send a fifth request for registering a target account to the server, wherein the server can register the target account according to the fifth request.
[0128] Corresponding to the above-mentioned interface calling method for the client, in some embodiments of the present application, the interface calling method for the server further includes:
[0129] According to the eleventh request sent by the client for registering the target account, the target account is registered.
[0130] The interface calling device for the server of the embodiment of the present application further includes a sixth sending module. The sixth sending module is used to register the target account according to the eleventh request for registering the target account sent by the client.
[0131] The processor of the implementation manner of the present application is also used to register the target account according to the eleventh request for registering the target account sent by the client.
[0132] Specifically, in the implementation mode of the present application, the client may send a request for registering an account to the server, and the server may respond to the request to register and record an account specified by the user.
[0133] Therefore, in the implementation mode of the present application, when the client sends any request to the server except for registering an account, the request can be generated through the account registered by itself. Correspondingly, when the server receives any request sent by the client except for registering an account, it can verify whether the account in the request has been registered.
[0134] To more clearly illustrate the implementation method of this application, please refer to Figure 3 , that is, if Figure 3 As shown in step a of , the client sends a request to the server to register the target account. Figure 3 As shown in step b in , the server can verify the target account, such as whether the character length of the target account is appropriate, whether it includes non-compliant characters, etc., and after the verification is passed, register and store the target account.
[0135] Thus, in the implementation mode of the present application, the client can send a request for registering a target account to the server, so that the server can register the target account.
[0136] In addition, it can also be understood that in the implementation manner of the present application, the fifth request sent by the client can be understood as the eleventh request received by the server.
[0137] In some embodiments of the present application, the interface calling method for the client further includes:
[0138] Sending a sixth request for publishing the interface to be called to the server, wherein the server can set the interface to be called to a published state according to the sixth request;
[0139] The interface calling device for the client of the embodiment of the present application further includes a fifth request sending module. The fifth request sending module is used to send a sixth request for publishing the interface to be called to the server, wherein the server can set the interface to be called to a published state according to the sixth request.
[0140] The processor of the implementation mode of the present application is also used to send a sixth request for publishing the interface to be called to the server, wherein the server can set the interface to be called to a published state according to the sixth request.
[0141] Corresponding to the above-mentioned interface calling method for the client, in some embodiments of the present application, the interface calling method for the server further includes:
[0142] According to the twelfth request for publishing the interface to be called sent by the client, the interface to be called is set to a publishing state.
[0143] The interface calling device for the server in the embodiment of the present application further comprises a state setting module. The state setting module is used to set the interface to be called to a publishing state according to the twelfth request for publishing the interface to be called sent by the client.
[0144] The processor of the implementation manner of the present application is also used to set the interface to be called to a publishing state according to a twelfth request sent by the client for publishing the interface to be called.
[0145] Specifically, in order to realize the opening and communication of interfaces, the server and the client in the implementation mode of the present application also jointly provide the ability to publish interfaces, so that the client can publish the interface edited by itself for use by others.
[0146] To more clearly illustrate the implementation method of this application, please refer to Figure 3 That is, Figure 3 As shown in step o in FIG. 1 , the client 2 may encapsulate the interface data to be published into a request and send the request to the interface service of the client. Figure 3 As shown in step p in , the interface service can publish the interface data in the request for other users to view, use and call.
[0147] It is understandable that in Figure 3 In the illustrated implementation, the request sent by the client 2 to the interface service may include the source code of the interface to be released, usage documentation (corresponding description information), and a call key, etc.
[0148] Thus, in the implementation mode of the present application, the client can send a request for publishing the interface to be called to the server, so that the server sets the interface to be called to a published state.
[0149] In addition, it can also be understood that in the implementation manner of the present application, the sixth request sent by the client can be understood as the twelfth request received by the server.
[0150] In addition, it can also be understood that the embodiments of the present application are based on the following Figure 3 The methods shown can enrich the ecosystem, enhance the value of application programming interfaces, stimulate innovation, incubate more applications, increase user stickiness, and expand the business boundaries and commercial value of application programming interfaces.
[0151] In certain embodiments of the present application, in the interface calling method for the client, step 02 includes:
[0152] According to the target account, application service identification information and calling key, a first request for calling the target application program interface is sent to the server, wherein the server can verify the target account, application service identification information and calling key in the first request, and can output the return result if the verification passes.
[0153] The first request sending module of the implementation mode of the present application is also used to send a first request for calling the target application program interface to the server according to the target account, application service identification information and calling key, wherein the server can verify the target account, application service identification information and calling key in the first request, and can output the return result if the verification passes.
[0154] The processor of the implementation mode of the present application is also used to send a first request to call the target application program interface to the server based on the target account, application service identification information and calling key, wherein the server can verify the target account, application service identification information and calling key in the first request, and can output the return result if the verification is successful.
[0155] For the corresponding interface calling method for the client, see Figure 4 In some implementations of the present application, the client can generate a seventh request based on the target account, application service identification information and the call key, and step 12 includes:
[0156] 120: when receiving the seventh request, verify the application service identification information, the calling key and the account number of the seventh request;
[0157] 121: When the verification is passed, the result is returned according to the seventh request and the target application program interface output.
[0158] In the interface calling device for the server side of the implementation mode of the present application, the output module is also used to verify the application service identification information, calling key and account of the seventh request when the seventh request is received, and to return the result according to the seventh request and the target application program interface output when the verification is passed.
[0159] The processor of the implementation mode of the present application is also used to verify the application service identification information, calling key and account of the seventh request when the seventh request is received, and to return the result according to the seventh request and the target application program interface output when the verification is passed.
[0160] Specifically, in order to further ensure the security and robustness of interface calls, in the implementation mode of the present application, when a client calls an application interface in a server, it can provide the server with its own registered account, its own assigned application service identification information, and the calling key of the application interface.
[0161] Accordingly, when the server receives a request from a client to call an application interface, it can verify the account, application service identification information and the calling key of the application interface provided by the client, and when the account, application service identification information and the calling key of the application interface are all verified, call the application interface to obtain the corresponding output result and feed back the output result to the client.
[0162] Specifically, in an implementation manner of the present application, a user may send a request to register an account to a server through a client, and send a request to create an application service to obtain application service identification information through a client to a server, and send a request to use a target application program interface to obtain a calling key of the target application program interface through a client to a server. Thus, the server of an implementation manner of the present application may record the correspondence between the account-application service identification information-calling key.
[0163] In an example, please refer again to Figure 3 That is, Figure 3 As shown in step c in , the client can encapsulate its previously registered account to obtain a request for creating an application service, and send the request to the server. Figure 3 As shown in step d in , when the server feeds back the application service identification information to the client according to the request, the application service identification information can be bound to the account in the request, thereby forming a corresponding relationship between the account and the application service identification information.
[0164] Similar, such as Figure 3 As shown in step e in , the client can encapsulate its previously registered account and the previously received application service identification information together to obtain a request to use the target application interface. Then, when the server feeds back the call key of the target application interface to the client according to the request, it can verify whether the application service identification information in the request matches the account according to the previously formed correspondence between the account and the application service identification information.
[0165] If so, then Figure 3 As shown in step f in , the server can feedback the call key to the client 1, and can bind the call key, the application service identification information in the request, and the account in the request, thereby forming a corresponding relationship between the account number-application service identification information-call key. If not, the server can feedback to the client 1 a prompt that the target application interface cannot be used.
[0166] Furthermore, when the client obtains the call key, such as Figure 3 As shown in step k in , the client 1 can encapsulate the calling key, account number and application service identification information to obtain a request for calling the target application, and send the request to the server. Figure 3 As shown in step 1, when the security service on the server receives a request from the client to call the target application program interface, it can verify whether the calling key, account number and application service identification information in the request satisfy the previously formed correspondence relationship between account number-application service identification information-calling key.
[0167] If satisfied, then Figure 3 As shown in step m in , the security service can send corresponding instructions to the interface service so that the interface service calls the target application program interface. Figure 3 As shown in step n in , the interface service sends the call result (ie, the return result) of the target application interface to the client 1.
[0168] If it is not met, the server can provide feedback to the client indicating that the target application interface call failed.
[0169] In this way, in the implementation mode of the present application, the client can send a request for calling the target application program interface to the server through the target account, application service identification information and calling key, so that the server can verify the account, application service identification information and calling key in the request, and call the target application program interface if the verification is passed, so that the secure calling of the target application program interface can be guaranteed.
[0170] The embodiment of the present application also provides a computer-readable storage medium storing a computer program, which implements the above-mentioned interface calling method when the computer program is executed by one or more processors.
[0171] In the description of this specification, the descriptions with reference to the terms "specifically", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0172] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0173] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. An interface calling method, used for a client, characterized in that: The client and the server are connected in communication, including: Receive the application service identification information and the calling key of the target application program interface sent by the server; Sending a first request to call the target application program interface to the server according to the application service identification information and the calling key; Receive the return result output by the server according to the calling request and the target application program interface, and complete the calling of the target application program interface.
2. The method according to claim 1, characterized in that The method further comprises: Sending a second request for creating an application service to the server, wherein the server can send the application service identification information to the client according to the second request; and / or Sending a third request for reading description information of the callable interface to the server, wherein the server can send the description information of the callable interface to the client according to the third request; and / or Sending a fourth request for using the target application program interface to the server, wherein the server can send the call key to the client according to the fourth request; and / or sending a fifth request for registering a target account to the server, wherein the server is capable of registering the target account according to the fifth request; and / or A sixth request for publishing the interface to be called is sent to the server, wherein the server can set the interface to be called to a published state according to the sixth request.
3. The method according to claim 2, characterized in that The step of sending a first request for calling the target application program interface to the server according to the application service identification information and the calling key comprises: According to the target account, the application service identification information and the calling key, the first request for calling the target application program interface is sent to the server, wherein the server can verify the target account, the application service identification information and the calling key in the first request, and can output the return result if the verification passes.
4. An interface calling method, used on a server, characterized in that: The server is connected to the client via communication, including: Sending application service identification information and a calling key of a target application program interface to the client; Upon receiving a seventh request sent by the client for calling the target application program interface, outputting a return result according to the seventh request and the target application program interface, wherein the client can generate the seventh request according to the application service identification information and the calling key; The returned result is sent to the client to complete the call of the target application program interface.
5. The method according to claim 4, characterized in that The method further comprises: Sending the application service identification information to the client according to an eighth request for creating an application service sent by the client; and / or According to a ninth request sent by the client for reading description information of a callable interface, sending the description information to the client; and / or sending the call key to the client according to a tenth request sent by the client for using the target application program interface; and / or Registering the target account according to the eleventh request for registering the target account sent by the client; and / or According to the twelfth request for publishing the interface to be called sent by the client, the interface to be called is set to a publishing state.
6. The method according to claim 5, characterized in that The client can generate the seventh request according to the target account, the application service identification information and the calling key, and upon receiving the seventh request sent by the client for calling the target application program interface, outputting a return result according to the seventh request and the target application program interface, including: When receiving the seventh request, verifying the application service identification information, the calling key and the account number of the seventh request; When the verification is passed, the return result is output according to the seventh request and the target application program interface.
7. An interface calling device, used for a client, characterized in that: The client and the server are connected in communication, including: A first receiving module, used to receive application service identification information and a calling key of a target application program interface sent by a server; A first request sending module, used for sending a first request for calling the target application program interface to the server according to the application service identification information and the calling key; The second receiving module is used to receive the return result output by the server according to the calling request and the target application program interface, and complete the calling of the target application program interface.
8. An interface calling device, used at a server, characterized in that: The server is connected to the client via communication, including: A first sending module, used to send application service identification information and a calling key of a target application program interface to the client; an output module, configured to, upon receiving a seventh request sent by the client for calling the target application program interface, output a return result according to the seventh request and the target application program interface, wherein the client can generate the seventh request according to the application service identification information and the calling key; The second sending module is used to send the return result to the client to complete the call of the target application program interface.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method according to any one of claims 1 to 8 is implemented.
