Detailed Description
In the embodiment of the application, a server receives a web service request sent by a terminal (i.e., a web service request initiated by a browser or an application having a browser kernel), through a web page returned to the terminal, a specified application in the terminal is invoked, and the application sends a service execution request corresponding to the web service request (i.e., the service execution request sent by the specified application replaces the web service request), and finally the server executes a service according to the service execution request. Therefore, when the method executes the service through the webpage, the designated application program can be simply and effectively awakened, and the application program and the server complete the execution of the service together, so that the user operation is more convenient, and the service execution efficiency is higher.
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a service execution process provided in an embodiment of the present application, which specifically includes the following steps:
s101: and the server receives a webpage service request sent by the terminal.
In the embodiment of the application, since the service request received by the server is not all from the web service, but the application is for solving the problem of low execution efficiency of the web service in the terminal, when the server receives the service request, it may be determined that the service request is the web service request, and then the subsequent steps are continuously executed. The web page service request refers to a web page service request sent by a browser or an application with a browser kernel to a server in a web page form, and the web page service request is used for calling a web page for executing a corresponding service to the server.
In addition, because the web page service request is usually a service request initiated by the terminal through the third-party platform, that is, when the user logs in the account of the third-party platform on the terminal and initiates the web page service request to the server through the account, the terminal sends the web page service request to the server through the third-party platform. Therefore, the server can specifically receive the webpage service request sent by the terminal through the third-party platform.
It should be noted that the web page service request described in the present application may be a web page order payment request, and the following description only describes the web page service request as the web page order payment request. The terminal in the present application may be a mobile terminal, such as a mobile phone, a tablet computer, and the like, and the server may be a single device or a system composed of multiple devices.
For example, mr. wang logs in an account i of an e-commerce platform a (i.e., a third party platform) in a browser of a mobile phone, and initiates an order transaction on the e-commerce platform a through the account i in the browser. Assuming that the transaction services of the e-commerce platform a need to be completed through a certain payment server a, when mr. wang initiates an order transaction through an account i, the payment server may receive a request (i.e., a web service request) for calling a web order payment page sent by a browser in the mobile phone of mr. wang through an interface with the e-commerce platform a.
S102: and returning a webpage to the terminal according to the webpage service request, so that the terminal invokes a specified application program through the webpage.
In the embodiment of the application, after the server receives the web page service request, the server may determine the service parameter by analyzing the web page service request, and the service parameter includes the service identifier, and then return the web page carrying the service identifier to the terminal. Wherein, the service parameter may include, in addition to the service identifier: type of service, service attributes, etc. Of course, besides carrying the service identifier in the web page, other service parameters, such as service type, may also be carried.
The web pages described in this application may be written in hypertext Markup Language fifth edition (HTML 5), or may be written in other types of web page codes.
Further, when the server receives a web page service request through a third-party platform, the server may also return a web page carrying a service identifier to the terminal through the third-party platform.
Still taking the web page service request as the web page order payment request for example for explanation, the server may determine each order payment parameter required for executing the order payment service, such as an order number, an order type, a transaction amount, a payment channel, information of both parties of the transaction, a service type, a terminal operating system, a terminal mac address, a terminal network type, and the like, by analyzing the web page order payment request. Since, in the present application, the order payment service is not executed through a web page, but only an application program specified in the terminal is needed to execute the order payment service, the terminal may only carry the order identifier (i.e., the service identifier) in each order payment parameter in the web page returned to the terminal, and return the web page to the terminal. Wherein, the web page returned to the terminal may be a payment routing page since the server receives the web order payment request.
In addition, in order to enable the application program specified in the terminal to execute the order payment service, besides carrying the service identifier in the service parameter in a webpage, the server may also carry a code for invoking the specified application program in the webpage, so that when the terminal runs the webpage, the code is loaded to invoke the specified application program to execute the service, wherein the code includes but is not limited to JavaScript code. Specifically, the code carried in the webpage page may include an identifier of an application program to be invoked, so as to invoke the specified application program.
Continuing with the above example, assume that payment server a determines the order payment parameters required to perform the order payment service based on the request to invoke the web order payment page, as shown in table 1.
TABLE 1
The payment server a first carries the order number shown in table 1 and the JavaScript code for calling the payment application in the payment routing page, and returns the order number and the JavaScript code to the terminal. The payment routing page returned is shown in fig. 2.
Fig. 2 is a schematic diagram of a payment routing page returned by a server to a terminal according to an embodiment of the present application, where the diagram includes: the payment is completed and the webpage is used for paying, wherein the operation option of 'payment completed' enables the user to obtain a payment result by clicking the operation option after completing payment. The "pay using web page" option enables a user who does not wish to or cannot use the payment application to continue staying in the browser by clicking the operation option, and complete payment through the payment web page sent by the payment server a to the browser.
Further, assuming that a payment application (i.e., a designated application program) is installed in the mobile phone, after the browser runs the payment routing page and loads the JavaScript code carried therein, a call instruction is also sent to the payment application, so that the payment application is called.
S103: and receiving a service execution request which is sent by the application program and corresponds to the webpage service request.
In the embodiment of the application, after the specified application program is invoked, a service execution request carrying a service identifier may be sent according to the service identifier carried in the web page, where the service execution request carrying the service identifier is a service execution request corresponding to the web service request. The service execution request described in the present application refers to a service execution request provided by the server and transmitted by a non-browser application installed in the terminal. The specified application program may specifically be a client program.
In the present application, since a default login account (i.e., an account that automatically logs in when an application is started) generally exists in all applications that need to log in an account, when the designated application is invoked, the designated application also logs in the default account, and then a service can be executed through the account.
Continuing with the above example, assuming that the default login account of the payment application is account ii, then the payment server a may receive the order payment transaction execution request sent by the payment application based on account ii.
S104: and executing the service according to the service execution request.
Continuing with the above example, since the payment server a receives the order payment service execution request sent by the payment application based on the account ii, and the order payment service execution request also carries the order identifier, the complete order payment parameters shown in table 1 can be determined through the order identifier, and the payment service is executed using the account ii according to the complete order payment parameters.
By the method, after receiving the webpage service request sent by the terminal, the server wakes up the appointed application program through the webpage returned to the terminal, enables the appointed application program to send the service execution request corresponding to the webpage service request, and finally executes the service according to the service execution request. Compared with the existing method, in the method provided by the application, the application program can automatically log in the default account, so that the account logging operation of the user when executing the webpage service request can be avoided, and the user operation is more convenient. Moreover, since the types of operations that can be executed in the specified application are more than those of the web page displayed by the browser (for example, fingerprint identification that cannot be supported in the web page of the browser can be realized by the payment application), the service execution method described in the present application is also more flexible and secure. Therefore, the method provided by the application can facilitate user operation, ensure safer service execution and improve service execution efficiency when aiming at the webpage service execution request initiated by the browser webpage.
Further, in practical applications, when the server executes the service through step S104, it is impractical to execute the service only according to the service identifier, and it needs to execute the service according to the complete service parameters, so before executing the service, the server may specifically parse the complete service parameters (including the service identifier) after receiving the web service request sent by the terminal through step S101, and store the complete service parameters in the session based on which the web service request is received. For convenience of description, a session on which the server receives the web page service request is referred to as a session corresponding to the service identifier, that is, after the server parses a complete service parameter according to the web page service request, the session on which the web page service request is received can be regarded as a session corresponding to the service identifier, and the determined service parameter is stored in the session corresponding to the service identifier.
Subsequently, because the web page returned to the terminal by the server does not carry complete service parameters, but only carries the service identifier, when the terminal runs the web page and invokes a corresponding application program, the service identifier carried in the web page can be transferred to the application program, and the application program sends a service execution request carrying the service identifier to the server. After receiving the service execution request, the server can determine a session corresponding to the service identifier according to the service identifier carried in the service execution request, extract a complete service parameter from the determined session, and execute the service according to the extracted service parameter.
Specifically, when the server executes the service according to the extracted complete service parameter, the complete service parameter may be returned to the application program, the application program may display the complete service parameter to enable the user to confirm, after the user confirms, the application program may send confirmation information to the server, and the server executes the service according to the service parameter.
In addition, after the application program sends the confirmation information to the server, the server may jump back to the interface of the browser after executing the service, and at this time, the web page displayed by the browser is the web page returned by the server to the terminal in step S102, and when the web page is the web page shown in fig. 2, the user may click the operation option of "payment completed" shown in fig. 2, so that the browser sends the query information for querying the service result to the server, and displays the service execution result page returned by the server, so that the user may determine the service execution result of the web service execution request initiated by the browser in step S101.
Further, in addition to the method for obtaining the service result by clicking the operation option of "payment completed" by the user, in the present application, the browser may further send the service result query information for the web service request to the server by running the web page received in step S102, and after the server executes the service according to the service execution request in step S104, the query result may be returned for the service result query information, so that the browser may actively obtain the query information for the service result. The terminal may send the service result query information to the server at a fixed frequency, or send the service result query information to the server at a preset time point, specifically send the service result query information to the server in what manner, and the application is not limited in detail.
Based on the service execution process shown in fig. 1, another service execution process is also provided in the embodiment of the present application, as shown in fig. 3.
Fig. 3 is a service execution process provided in the embodiment of the present application, which specifically includes the following steps:
s301: and sending a webpage service request to the server.
In the embodiment of the present application, a browser in a terminal or an application having a browser kernel sends a web service request to a server, and the following description will be given by taking the browser as an example. The web page service request is a web page service request sent to a server in a web page form through a browser of the terminal, and the web page service request is used for calling a web page for executing corresponding services to the server.
In addition, because the web page service request is usually a service request initiated by the browser through the third-party platform, that is, when the user logs in an account of the third-party platform on the browser and initiates the web page service request to the server through the account, the server receives the web page service request sent by the browser through the third-party platform. Therefore, the browser can specifically send the web service request to the server through the third-party platform.
S302: and receiving the webpage returned by the server according to the webpage service request.
In this embodiment of the application, after receiving the web page service request, the server may determine the service parameter by analyzing the web page service request, and the service parameter includes the service identifier, and then the server returns the web page carrying the service identifier to the browser that sent the web page service request in step S301. Wherein, the service parameter may include, in addition to the service identifier: type of service, service attributes, etc.
In addition, because the browser is a web service request sent to the server through the third-party platform, the browser can also receive a web page with a service identifier returned by the server through the third-party platform.
S303: and calling a designated application program by operating the webpage, so that the application program sends a service execution request corresponding to the webpage service request to the server, and the server executes service according to the service execution request.
In the embodiment of the application, after the browser receives a webpage returned by a server, the browser loads a JavaScript code carried in the webpage by running the webpage, invokes a designated application program to execute a service, and transmits a service identifier carried in the webpage to the designated application program, so that the designated application program sends a service execution request to the server according to the service identifier.
Fig. 4 is a detailed flowchart of service execution provided in the embodiment of the present application, including the following steps:
s401: the browser sends a webpage service request to the server;
s402: the server determines each service parameter according to the webpage service request and stores each service parameter in a session corresponding to the service identifier;
s403: the server returns a webpage carrying the service identifier to the browser;
s404: the browser calls a designated application program through the webpage and transmits the service identifier to the application program;
s405: the application program sends a service execution request carrying the service identifier to the server according to the service identifier;
s406: the server determines a corresponding session through a service identifier in the service execution request and extracts service parameters;
s407: the server returns the complete service parameters to the application program;
s408: the application program displays the complete service parameters, so that the user can confirm the complete service parameters, and a determination result of the user is sent to the server;
s409: after receiving the user determination result, the server executes the service according to the complete service parameters;
s410: and after the server executes the service, sending a service execution result to the browser.
Based on the same idea as the method shown in fig. 1, an embodiment of the present application further provides a service execution device, as shown in fig. 5.
Fig. 5 is a schematic structural diagram of a service execution device provided in an embodiment of the present application, which specifically includes:
a first receiving module 501, configured to receive a web service request sent by a terminal;
a returning module 502, configured to return a web page to the terminal according to the web service request, so that the terminal invokes a specified application program through the web page;
a second receiving module 503, configured to receive a service execution request sent by the application program and corresponding to the web service request;
an executing module 504, configured to execute a service according to the service execution request.
The returning module 502 is specifically configured to determine a service parameter according to the web page service request, where the service parameter includes a service identifier, and return a web page carrying the service identifier to the terminal;
the second receiving module 503 is specifically configured to receive a service execution request corresponding to the web service request, which is sent by the application program according to the service identifier.
The execution module 504 is further configured to, before executing a service according to the service request, take a session based on which the web service request is received as a session corresponding to the service identifier, and store the determined service parameter in the session corresponding to the service identifier;
the execution module 504 is specifically configured to determine a session corresponding to the service identifier according to the service identifier carried in the service execution request, extract a service parameter from the determined session, and execute a service according to the extracted service parameter.
The first receiving module 501 is specifically configured to receive a web service request sent by the terminal through a third-party platform;
the returning module 502 is specifically configured to return a web page to the terminal through the third-party platform according to the web service request.
The device further comprises:
a result providing module 505, configured to receive service result query information sent by the terminal and directed to the web service request, and return a query result to the service result query information after the executing module 504 executes a service according to the service execution request.
Specifically, the service execution device shown in fig. 5 may be located in a single server, or a system composed of a plurality of servers.
Based on the same idea as the method shown in fig. 3, an embodiment of the present application further provides a service execution device, as shown in fig. 6.
Fig. 6 is a schematic structural diagram of a service execution device according to an embodiment of the present application, which specifically includes:
a sending module 601, configured to send a web service request to a server;
a receiving module 602, configured to receive a webpage page returned by the server according to the webpage service request;
the call execution module 603 is configured to call a designated application program by running the web page, so that the application program sends a service execution request corresponding to the web service request to the server, so that the server executes a service according to the service execution request.
The receiving module 602 is specifically configured to receive a webpage page with a service identifier, which is returned by the server according to the webpage service request;
the call execution module 603 is specifically configured to call a designated application program by running the web page, and transmit the service identifier to the application program, so that the application program sends a service execution request to the server according to the service identifier.
The sending module 601 is specifically configured to send a web service request to a server through a third-party platform;
the receiving module 602 is specifically configured to receive, by the third-party platform, a webpage page returned by the server according to the webpage service request.
The device further comprises:
the query module 604 is configured to send, by running the web page, service result query information for the web service request to the server, and receive a query result returned by the server for the service result query information, where the query result is returned for the service result query information after the server executes a service according to the service execution request.
Specifically, the service execution device shown in fig. 6 may be located in various terminals, specifically, in various terminals such as a mobile phone, a Personal Computer (PC), and a tablet computer.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.