Disclosure of Invention
In view of the above, an object of the present invention is to provide a request method and apparatus, which can flexibly use service capabilities of different channels, and facilitate management and maintenance in development.
The embodiment of the application provides a request processing method, which is applied to a multi-channel management server, wherein the multi-channel management server is used for providing service capacity management service aiming at multiple channel types for application in combination with a multi-channel management client; the method comprises the following steps:
receiving target instruction information sent by a multi-channel management client after an application client triggers a target service request;
requesting to acquire return information from a channel server corresponding to the channel type according to the channel type indicated by the target instruction information, pre-acquired channel parameter information and a parameter type automatically adapted for each piece of channel parameter information based on a parameter template;
and feeding back target service response information to the multi-channel management client based on the return information so that the multi-channel management client responds to the target service request according to the target service response information.
In some possible embodiments, in case the target service request is a login request: the receiving target instruction information sent by the multi-channel management client after the application client triggers the target service request comprises the following steps:
receiving the target instruction information which is sent by a multi-channel management client and contains login token information and channel type information after an application client triggers a login request, wherein the login token information is a return value of the channel server obtained after the multi-channel management client initiates the login request to the channel server;
the requesting a channel server corresponding to the channel type to acquire return information corresponding to the target service request includes:
sending a login verification request carrying the login token information to a channel server corresponding to the channel type so that the channel server returns user information after verifying the login token information;
the feeding back target service response information to the multi-channel management client comprises:
and feeding back the temporary bill provided by the multi-channel management server for logging to the multi-channel management client.
In some possible embodiments, after feeding back the target service response information to the multi-channel management client based on the return information, the method further includes:
receiving login authentication information sent by an application server, and authenticating the login authentication information;
and after the verification is passed, sending the user information to the application server.
In some possible embodiments, the temporary ticket and the signature information are included in the login verification information;
the verifying the login verification information includes:
and verifying whether the temporary ticket is a previously distributed temporary ticket or not, and verifying whether the signature information is correct or not based on a secret key pre-distributed to the application.
In some possible embodiments, in case the target service request is a payment request:
the receiving target instruction information sent by the multi-channel management client after the application client triggers the target service request comprises the following steps:
receiving payment information sent by a multi-channel management client after a payment request is triggered by an application client;
the requesting a channel server corresponding to the channel type to acquire return information corresponding to the target service request includes:
requesting channel order information corresponding to the payment information from a channel server corresponding to the channel type; the channel order information comprises order information related to the channel type;
the feeding back target service response information to the multi-channel management client comprises:
generating transit order information for payment according to the channel order information; the transit order information comprises the channel order information and multi-channel management order information, and the multi-channel management order information comprises order information related to the multi-channel management server;
and feeding back the transit order information to the multi-channel management client so that the multi-channel management client initiates a payment process to the channel server based on the transit order information.
In some possible embodiments, after feeding back the target service response information to the multi-channel management client based on the return information, the method further includes:
receiving a payment result sent by the channel server, and verifying the payment result;
and after the verification is passed, sending the payment result to the application server so that the application server can verify the payment result.
In some possible embodiments, the automatically adapting the parameter type for each of the channel parameter information based on the parameter template includes:
determining attribute information of each channel parameter information corresponding to the channel type according to a preset attribute type;
and determining the parameter type information of each channel parameter information according to the attribute information corresponding to each channel parameter information and the parameter template.
In some possible embodiments, the method further comprises the step of generating the parameter template:
acquiring at least one piece of initial channel parameter information used when an application client of a reference application accesses the channel server and parameter type information corresponding to each piece of initial channel parameter information;
determining attribute information of each initial channel parameter information according to a preset attribute type;
and generating the parameter template according to the parameter type information and the attribute information of each initial channel parameter information.
In some possible embodiments, after generating the parameter template, the method further comprises:
determining parameter type information corresponding to the parameter information of each channel according to the generated parameter template;
simulating a client end accessed to the channel server to initiate a login request to the channel server according to each channel parameter information and the corresponding parameter type information;
determining whether first return information of the channel server is abnormal;
and if the first returned information is abnormal, determining that the parameter template configuration is wrong.
In some possible embodiments, after determining whether the first return information of the channel server is abnormal, the method further comprises:
if the first returned information is not abnormal, initiating a login verification request to the channel server according to the first returned information, the channel parameter information and the parameter template;
determining whether second return information of the channel server is abnormal;
and if the second returned information is abnormal, determining that the parameter template configuration is wrong.
The embodiment of the application also provides another request processing method, which is applied to a multi-channel management client, wherein the multi-channel management client is used for providing service capacity management service aiming at multiple channel types for application in combination with a multi-channel management server; the method comprises the following steps:
receiving a target service request sent by an application client, and determining target instruction information corresponding to the target service request;
sending the target instruction information to the multi-channel management server, wherein the target instruction information is used for requesting the multi-channel management server to acquire return information from a channel server corresponding to the channel type according to the channel type indicated in the target instruction information, the pre-acquired channel parameter information and the parameter type automatically adapted to each channel parameter information based on a parameter template;
and receiving target service response information fed back by the multi-channel management server based on the return information, and responding the target service request according to the target service response information.
In some possible embodiments, in case the target service request is a login request:
the returned information is the user information returned to the multi-channel management server by the channel server after verifying the login verification information carried in the login verification request sent by the multi-channel management server;
the determining target instruction information corresponding to the target service request includes:
according to the channel type indicated by the target service request, calling a login interface of a channel server corresponding to the channel type to acquire target instruction information comprising login token information and channel type information;
the receiving of the target service response information fed back by the multi-channel management server includes:
receiving a temporary bill provided by the multi-channel management server for logging in and fed back by the multi-channel management server.
In some possible embodiments, responding to the target service request according to the target service response information includes:
and sending the temporary bill to the application client so that the application client can send the temporary bill to an application server corresponding to the application client.
In some possible embodiments, in case the target service request is a payment request:
the return information comprises channel order information which is provided by the channel server and corresponds to the payment information;
the determining of the target instruction information corresponding to the target service request includes:
determining payment information carried by the payment request;
the receiving of the target service response information fed back by the multi-channel management server includes:
receiving transit order information which is fed back by the multi-channel management server and is generated according to the channel order information and used for payment; the transit order information comprises the channel order information and multi-channel management order information, and the multi-channel management order information comprises order information related to the multi-channel management server.
In some possible embodiments, the responding to the target service request according to the target service response information includes:
calling a payment interface of the channel server according to the multi-channel management order information in the transit order information, initiating a payment process to the channel server according to the channel order information in the transit order information, and acquiring a payment result returned by the channel server;
and sending the payment result to the application client.
The embodiment of the application also provides a request processing device which is used for the multi-channel management server, wherein the multi-channel management server is used for combining with the multi-channel management client to provide service capacity management service aiming at various channel types for the application; the device comprises:
the receiving module is used for receiving target instruction information sent by the multi-channel management client after the application client triggers the target service request;
the request module is used for requesting to acquire return information from a channel server corresponding to the channel type according to the channel type indicated by the target instruction information, the pre-acquired channel parameter information and the parameter type automatically adapted to each channel parameter information based on the parameter template;
and the feedback module is used for feeding back target service response information to the multi-channel management client based on the return information so that the multi-channel management client can respond to the target service request according to the target service response information.
In some possible embodiments, in case the target service request is a login request: the receiving module is specifically configured to:
receiving the target instruction information which is sent by a multi-channel management client and contains login token information and channel type information after an application client triggers a login request, wherein the login token information is a return value of the channel server obtained after the multi-channel management client initiates the login request to the channel server;
the request module, when requesting to obtain the return information corresponding to the target service request from the channel server corresponding to the channel type, is specifically configured to:
sending a login verification request carrying the login token information to a channel server corresponding to the channel type so that the channel server can return user information after verifying the login token information;
when feeding back the target service response information to the multi-channel management client, the feedback module is specifically configured to:
and feeding back the temporary bill provided by the multi-channel management server for logging to the multi-channel management client.
In some possible embodiments, the apparatus further comprises a first verification module for, after feeding back target service response information to the multi-channel management client based on the return information:
receiving login authentication information sent by an application server, and authenticating the login authentication information;
and after the verification is passed, sending the user information to the application server.
In some possible embodiments, the login verification information includes the temporary ticket and signature information;
when the first authentication module authenticates the login authentication information, the first authentication module is specifically configured to:
and verifying whether the temporary ticket is a previously distributed temporary ticket or not, and verifying whether the signature information is correct or not based on a secret key pre-distributed to the application.
In some possible embodiments, in case the target service request is a payment request:
the receiving module, when receiving target instruction information sent by the multi-channel management client after the application client triggers the target service request, is specifically configured to:
receiving payment information sent by a multi-channel management client after an application client triggers a payment request;
the request module, when requesting to obtain the return information corresponding to the target service request from the channel server corresponding to the channel type, is specifically configured to:
requesting channel order information corresponding to the payment information from a channel server corresponding to the channel type; the channel order information comprises order information related to the channel type;
when feeding back the target service response information to the multi-channel management client, the feedback module is specifically configured to:
generating transit order information for payment according to the channel order information; the transit order information comprises the channel order information and multi-channel management order information, wherein the multi-channel management order information comprises order information related to the multi-channel management server;
and feeding back the transit order information to the multi-channel management client so that the multi-channel management client initiates a payment process to the channel server based on the transit order information.
In some possible embodiments, the apparatus further comprises a second verification module for, after feeding back the target service response information to the multi-channel management client based on the return information:
receiving a payment result sent by the channel server, and verifying the payment result;
and after the verification is passed, sending the payment result to the application server so that the application server can verify the payment result.
In some possible embodiments, the request module, when automatically adapting a parameter type for each of the channel parameter information based on a parameter template, is specifically configured to:
determining attribute information of each channel parameter information corresponding to the channel type according to a preset attribute type;
and determining the parameter type information of each channel parameter information according to the attribute information corresponding to each channel parameter information and the parameter template.
In some possible embodiments, the apparatus further comprises a parameter template generation module configured to:
acquiring at least one piece of initial channel parameter information used when an application client of a reference application accesses the channel server and parameter type information corresponding to each piece of initial channel parameter information;
determining attribute information of each initial channel parameter information according to a preset attribute type;
and generating the parameter template according to the parameter type information and the attribute information of each initial channel parameter information.
In some possible embodiments, the apparatus further comprises a parameter template testing module, the parameter template testing module is configured to:
determining parameter type information corresponding to the parameter information of each channel according to the generated parameter template;
simulating a client end accessed to the channel server to initiate a login request to the channel server according to each channel parameter information and the corresponding parameter type information;
determining whether first return information of the channel server is abnormal;
and if the first returned information is abnormal, determining that the parameter template configuration is wrong.
In some possible embodiments, the parameter template testing module is further configured to:
if the first returned information is not abnormal, initiating a login verification request to the channel server according to the first returned information, the channel parameter information and the parameter template;
determining whether second return information of the channel server is abnormal;
and if the second returned information is abnormal, determining that the parameter template configuration is wrong.
The embodiment of the application also provides a request processing device which is used for the multi-channel management client, wherein the multi-channel management client is used for combining with the multi-channel management server and providing service capacity management service aiming at various channel types for the application; the device comprises:
the system comprises a determining module, a sending module and a receiving module, wherein the determining module is used for receiving a target service request sent by an application client and determining target instruction information corresponding to the target service request;
a sending module, configured to send the target instruction information to the multi-channel management server, where the target instruction information is used for the multi-channel management server to request, according to a channel type indicated in the target instruction information, pre-acquired channel parameter information, and a parameter type automatically adapted to each piece of the channel parameter information based on a parameter template, a channel server corresponding to the channel type to acquire return information;
and the response module is used for receiving target service response information fed back by the multi-channel management server based on the return information and responding the target service request according to the target service response information.
In some possible embodiments, in case the target service request is a login request:
the returned information is the user information returned to the multi-channel management server by the channel server after verifying the login verification information carried in the login verification request sent by the multi-channel management server;
when determining the target instruction information corresponding to the target service request, the determining module is specifically configured to:
according to the channel type indicated by the target service request, calling a login interface of a channel server corresponding to the channel type to acquire target instruction information comprising login token information and channel type information;
when receiving the target service response information fed back by the multi-channel management server, the response module is specifically configured to:
receiving a temporary bill provided by the multi-channel management server for logging in and fed back by the multi-channel management server.
In some possible embodiments, when responding to the target service request according to the target service response information, the response module is specifically configured to:
and sending the temporary bill to the application client so that the application client can send the temporary bill to an application server corresponding to the application client.
In some possible embodiments, in case the target service request is a payment request:
the return information comprises channel order information which is provided by the channel server and corresponds to the payment information;
when determining the target instruction information corresponding to the target service request, the determining module is specifically configured to:
determining payment information carried by the payment request;
when receiving the target service response information fed back by the multi-channel management server, the response module is specifically configured to:
receiving transit order information for payment, which is fed back by the multi-channel management server and generated according to the channel order information; the transit order information comprises the channel order information and multi-channel management order information, and the multi-channel management order information comprises order information related to the multi-channel management server.
In some possible embodiments, when responding to the target service request according to the target service response information, the response module is specifically configured to:
calling a payment interface of the channel server according to the multi-channel management order information in the transit order information, initiating a payment process to the channel server according to the channel order information in the transit order information, and acquiring a payment result returned by the channel server;
and sending the payment result to the application client.
An embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the request processing method as described above.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the request processing method as described above.
According to the request processing method and device provided by the embodiment of the application, a multi-channel management server firstly receives target instruction information sent by a multi-channel management client after an application client triggers a target service request; then, requesting to acquire return information from a channel server corresponding to the channel type according to the channel type indicated by the target instruction information, the pre-acquired channel parameter information and the parameter type automatically adapted to each channel parameter information based on a parameter template; and finally, feeding back target service response information to the multi-channel management client based on the return information so that the multi-channel management client can respond to the target service request according to the target service response information. The application uniformly manages a plurality of channels to which the application needs to be accessed by arranging the multi-channel management server and the multi-channel management client, can flexibly use the service capacities of different channels, and facilitates the management and maintenance in development; in addition, the multi-channel management server introduces a parameter template to automatically adapt to the parameter types, so that the development difficulty of parameter type configuration of application developers aiming at different channels is reduced.
In order to make the aforementioned objects, features and advantages of the present application comprehensible, preferred embodiments accompanied with figures are described in detail below.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. Every other embodiment that can be obtained by a person skilled in the art without making creative efforts based on the embodiments of the present application falls within the protection scope of the present application.
The applications running on the intelligent terminal need to be published on various channels, and the channels can provide downloading and updating services of the applications and can also provide login and payment services. Generally, when the application is released in a channel, a service interface of the channel needs to be accessed. Because the types of the channels are various and the access parameters of each channel are different from each other, the provider of the application needs to access different types of channel servers through the SDKs of different channels, access setting is performed one by one for each type of channel, configuration needs to be performed one by one when updating and maintaining the channel access parameters, and the maintenance complexity is high.
Based on this, the embodiment of the application provides a request processing system, so that the service capabilities of different channels can be flexibly used, and the management and maintenance in development are facilitated.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a request processing system according to an embodiment of the present disclosure. As shown in fig. 1, a request processing system provided in an embodiment of the present application includes an application client, an application server, a multi-channel management client, a multi-channel management server, and a channel server.
The application client can communicate with the application server and the multi-channel management client; the multi-channel management client-side can communicate with the multi-channel management server and can also communicate with the channel server; the application server may also communicate with a multi-channel management server.
The multi-channel management client can be integrated in the application client, the number of the channel servers can be multiple, and each channel server corresponds to one channel type. The multi-channel management server is combined with the multi-channel management client, and can provide service capacity management service aiming at multiple channel types for the application.
Based on the request processing system, the embodiment of the application also provides a request processing method. Referring to fig. 2, fig. 2 is a flowchart of a request processing method according to the present embodiment. As shown in fig. 2, a request processing method provided in the embodiment of the present application includes:
s201, an application client responds to a target service trigger operation and sends a target service request to a multi-channel management client, wherein the target service request carries a channel type corresponding to the application client.
In this step, when the application client detects a target service triggering operation input by a user, a target service request may be sent to the multi-channel management client, where the target service request may carry an identity of the application client, a channel type corresponding to the application client, a type of the target service, specific content of the target service, and the like.
The type of the target service may include services requiring interaction with the channel server, such as login and payment.
S202, the multi-channel management client receives a target service request sent by the application client and determines target instruction information corresponding to the target service request.
In this step, after receiving the target service request, the multi-channel management client may determine target instruction information according to the target service request, where the target instruction information may include an identity identifier of the application client, a channel type corresponding to the application client, a type of the target service, specific content of the target service, token information, and the like, and the target instruction information is used for enabling the multi-channel management server to request information return from the channel server according to the target instruction information. The content of the target instruction information corresponding to different types of target services may be different.
And S203, the multi-channel management client sends the target instruction information to the multi-channel management server.
S204, after receiving target instruction information sent by the multi-channel management client, the multi-channel management server requests a channel server corresponding to the channel type to acquire return information according to the channel type indicated by the target instruction information, the pre-acquired channel parameter information and the parameter type automatically adapted for each channel parameter information based on the parameter template.
In this step, after receiving the target instruction information, the multi-channel management server may request the channel server corresponding to the channel type to acquire the return information corresponding to the target service request according to the channel type indicated by the target instruction information, the pre-acquired channel parameter information, and the parameter type automatically adapted to each channel parameter information based on the parameter template.
Here, the channel parameter information acquired in advance is parameter information required by the application calling channel server; the channel parameter information may be acquired by the multi-channel management server when the multi-channel management server first accesses the channel server.
Specifically, the parameter template may include a correspondence between parameter type information and attribute information of the channel parameter information, and the channel parameter information having different parameter type information has different attribute information.
In some embodiments, when the multi-channel management server requests the channel server for information return, a service port of the channel server needs to be called, and automatically adapting the parameter types for each piece of channel parameter information based on the parameter template may specifically include:
determining attribute information of each channel parameter information corresponding to the channel type according to a preset attribute type;
and determining the parameter type information of each channel parameter information according to the attribute information corresponding to each channel parameter information and the parameter template.
The parameter template is determined according to initial channel parameter information, the initial channel parameter information and the channel parameter information are the same kind of parameter information, the corresponding relation between the attribute information of the initial channel parameter information and the parameter type information contained in the parameter template can be directly applied to the parameter type of the channel parameter information needed by calling a service port of a channel server and the attribute information corresponding to the channel parameter information, the attribute information of the channel parameter information can comprise information such as the length, the character type, the parameter name, the parameter number and the like of parameters, the channel parameter information needed by calling the service port is different due to different port configurations of different types of channel servers, the channel parameter information is different and different from each other, and the characteristics of each channel parameter information are unique, so the type information of the channel parameter information can be determined according to the attribute information of the channel parameter information, and the channel parameter information can be used according to the type information.
In this step, the attribute information corresponding to each attribute type of the channel parameter information may be determined according to the preset attribute type, such as determining the length, parameter name, and the like of each channel parameter information. After the attribute information is determined, the parameter type information corresponding to the determined attribute information can be determined from the parameter template, and the parameter type information is used as the parameter type information of the channel parameter information.
The types of the channel parameter information can comprise types of AppID, appKey, appSecret, CPID and the like, and the types of the channel parameter information required for accessing different types of channel servers are also different.
In this step, the channel parameter information may be parameter information requested in advance from the channel server, or may be parameter information requested in real time when the channel server is called, and the channel parameter information is a parameter value of a parameter required for calling a service interface of the channel server.
Since the values of parameters required by different applications may change each time a service interface of a channel server is called, and the values of the parameters may also change after the service interface is updated and maintained, but the types of the required parameters are inconvenient, it is necessary to identify parameter type information of channel parameter information returned by the channel server, generate a parameter template by the initial channel parameter information acquired when the channel server is accessed for the first time and the parameter type information corresponding to the initial channel parameter information, and when channel parameter information is requested again, determine the parameter type information of each channel parameter information according to the parameter template, and use the channel parameter information according to the parameter type information.
For example, the parameter template may be a character string of the form "a =1, a, b", where a denotes parameter type information, and 1, a, b are attribute information of channel parameter information corresponding to the type information, respectively.
Further, in some possible embodiments, the parameter template may be generated by:
acquiring at least one piece of initial channel parameter information used when an application client of a reference application accesses the channel server and parameter type information corresponding to each piece of initial channel parameter information;
determining attribute information of each initial channel parameter information according to a preset attribute type;
and generating the parameter template according to the parameter type information and the attribute information of each initial channel parameter information.
In this step, after acquiring at least one piece of initial parameter information and parameter type information corresponding to each piece of test parameter information required by the application client of the reference application to access the channel server, the multi-channel management server may generate a parameter template according to a correspondence between the parameter type information and attribute information of the initial channel parameter information.
The reference application may be an application that needs to access a channel server corresponding to a channel type, and the initial channel parameter information used when accessing the channel server is consistent with the attribute information and the parameter type information of the parameter information needed by the current application, and the specific parameter values are different.
In some possible embodiments, after generating the parameter template, the method further comprises:
determining parameter type information corresponding to the parameter information of each channel according to the generated parameter template;
simulating a client end accessed to the channel server to initiate a login request to the channel server according to each channel parameter information and the corresponding parameter type information;
determining whether first return information of the channel server is abnormal or not;
and if the first returned information is abnormal, determining that the parameter template configuration is wrong.
In the step, after a client terminal of the simulated access channel server initiates a login request to the channel server, whether first return information of the channel server is correct login token information or not can be determined, if the first return information is correct, the parameter template configuration can be determined to be normal, and if the first return information is incorrect, the parameter template configuration can be determined to be abnormal.
The client accessing the channel server may be a multi-channel management client or a dedicated client for testing.
Here, the manner of determining whether the first return information of the channel server is correct login token information may be to determine whether the returned information is login token information or to determine whether the first return information is identical to the previously stored return information according to the format of the first return information.
In some possible embodiments, after determining whether the first return information of the channel server is abnormal, the method further comprises:
if the first returned information is not abnormal, initiating a login verification request to the channel server according to the first returned information, the channel parameter information and the parameter template;
determining whether second return information of the channel server is abnormal;
and if the second returned information is abnormal, determining that the parameter template configuration is wrong.
The second returned information may be user information returned by the channel server, and if the user information is correct user information, it may be determined that the configuration of the parameter template is normal and correct.
In this step, after the parameter template is generated, the multi-channel management server may detect the generated parameter template, test the access channel server using the generated parameter template, and determine whether the parameter template has a configuration error according to the return information of the channel server.
S205, the channel server responds to the request of the multi-channel management server and sends the return information corresponding to the target service request requested by the multi-channel management server to the multi-channel management server.
In this step, after receiving the target instruction information, the channel server may return information corresponding to the target service request according to the target service request in the target instruction information, for example, if the target service request is a login request, user information corresponding to the login request may be returned, and if the target service request is a payment request, channel order information corresponding to the payment request may be returned.
S206, the multi-channel management server feeds back target service response information to the multi-channel management client based on the return information.
In this step, after the multi-channel management server receives the return information, it may generate target service response information according to the return information, and send the target service response information to the multi-channel management client.
The target service response information is determined according to the return information, and the target service response information generated by different return information is different.
S207, the multi-channel management client receives the target service response information fed back by the multi-channel management server, and responds to the target service request according to the target service response information.
In this step, after receiving the target service response message, the multi-channel management client may perform further communication and data processing with at least one of the application client, the multi-channel management server, and the channel server according to the content of the target service response message, respond to the target service request, and perform the target service on the application.
Referring to fig. 3, fig. 3 is a flowchart of a request processing method according to another embodiment of the present application. As shown in fig. 3, when the target service request is a login request, the request processing method provided in the embodiment of the present application includes:
step 1, in the step, an application client (game client) responds to a login service triggering operation and sends a login service request to a multi-channel management client (GSDK client), wherein the login service request carries a channel type corresponding to the application client.
And 2, the multi-channel management client calls a login interface of a channel server corresponding to the channel type according to the channel type indicated by the target service request to acquire the target instruction information comprising login token information and channel type information.
The login token information may be token information such as a verification code and a temporary password, and may be set to be valid within several minutes currently.
Step 3, the multi-channel management client sends the target instruction information to a multi-channel management server (GSDK server); the multi-channel management server sends the target instruction information to a channel server according to the channel type carried in the target instruction information, the channel parameter information acquired in advance and the parameter type automatically adapted for each channel parameter information based on a parameter template; the channel server verifies the login token information in the target instruction information, verifies whether the received login token information is the login token information returned to the multi-channel management client in the step 2 and whether the login token information is within the valid time limit, and returns the user information corresponding to the login request to the multi-channel management server after the verification is passed; after receiving the user information, the multi-channel management server generates login service response information with a temporary ticket (access _ token) for login and sends the login service response information to the multi-channel management client; and the multi-channel management client sends the login service response information to the application client.
The user information may include information such as an identity, a nickname, and a head portrait of the user.
Step 4, the application client sends the received login service response information to an application server (game server) corresponding to the application client; after receiving the login service response information, the game server generates signature information corresponding to the channel type according to the channel type indicated by the login response information, and sends login verification information to the multi-channel management server; the login verification information comprises signature information and a temporary bill; after receiving the login verification information, the multi-channel management server verifies the login verification information, verifies whether the temporary bill is a previously distributed temporary bill, verifies whether the signature information is correct based on a key pre-distributed to the application, and sends user information to the application server after the verification is passed; and after receiving the user information, the application server completes the login process initiated by the application client according to the user information.
Specifically, the application server may perform key-value pair sorting on the temporary bill, the unique identifier assigned to the application server by the multi-channel management server, the request time, and other information, perform a hash algorithm on the key assigned to the application to generate a signature, send the signature information to the multi-channel management server through an http request, and verify whether the signature information is correct by using the key by the multi-channel management server.
After the application server receives the user information, the role information corresponding to the user information can be determined, the role information is returned to the application client, the application client is made to complete login, and after the login, the user can perform role creation or directly enter the game world operation.
The login verification information comprises a temporary bill, and also comprises information such as an identity identifier, a user identity identifier, request time and the like of an application client, the information can be verified simultaneously when verification is carried out, an effective time can be set for the temporary bill, and the temporary bill is invalid and cannot pass the verification if the preset effective time is exceeded.
Referring to fig. 4, fig. 4 is a flowchart of a request processing method according to another embodiment of the present application. As shown in fig. 4, when the target service request is a payment request, a request processing method provided in an embodiment of the present application includes:
step 1, an application client (game client) responds to payment service triggering operation and sends a payment service request to a multi-channel management client (GSDK client), wherein the payment service request carries a channel type corresponding to the application client.
Step 2, the multi-channel management client sends payment information carrying the payment service request to a multi-channel management server (GSDK server); after receiving payment information, the multi-channel management server requests a channel server corresponding to the channel type to acquire channel order information corresponding to the payment information according to the channel type indicated by the payment information, a pre-acquired channel parameter type and a parameter type automatically adapted to each channel parameter information based on a parameter template; the channel server responds to the request of the multi-channel management server, generates channel order information according to the payment information and sends the channel order information to the multi-channel management server; the channel order information comprises order information related to the channel type; the multi-channel management server generates transfer order information for payment according to channel order information returned by the channel server and sends the transfer order information to the multi-channel management client, wherein the transfer order information comprises the channel order information and the multi-channel management order information, and the multi-channel management order information comprises order information related to the multi-channel management server.
The channel order information may include a first commodity identifier and/or a first order identifier set by the channel server, a commodity name, a purchase quantity, order creation time, a commodity price, and the like; the transit order information may include a second item identification and/or a second order identification set by the multichannel management server, and a commodity name, a purchase quantity, an order creation time, a commodity price, and the like.
Step 3, after receiving the transit order information, the multi-channel management client calls a payment interface of the channel server according to the multi-channel management order information in the transit order information, then carries out payment according to the channel order information and obtains a payment result returned by the channel server; and after receiving the payment result, the multi-channel management client sends the payment result to the application client.
The payment result may include channel order information, whether payment is successful, an identity of the channel server, and other information.
Step 4, after the payment is finished, the channel server sends the payment result to the multi-channel management server, the multi-channel management server verifies the payment result according to the identity of the channel server carried by the payment result, and after the verification is passed, the payment result is sent to an application server (game server); and after the application server receives the payment result, verifying the payment result, and after the verification is passed, issuing the virtual article indicated in the payment result to the application client.
In this step, the multi-channel management server may verify the payment result through a key previously provided to the application by the channel server and an order signature manner of the channel server.
In the request processing method provided by the embodiment of the application, the multi-channel management server firstly receives target instruction information sent by the multi-channel management client after the application client triggers a target service request; then, according to the channel type indicated by the target instruction information, the pre-acquired channel parameter information and the parameter type automatically adapted for each channel parameter information based on a parameter template, requesting a channel server corresponding to the channel type to acquire return information; and finally, feeding back target service response information to the multi-channel management client based on the return information so that the multi-channel management client can respond to the target service request according to the target service response information. The application carries out unified management on a plurality of channels to which the application needs to be accessed by arranging the multi-channel management server and the multi-channel management client, can flexibly use the service capacities of different channels, and is convenient for management and maintenance in development; in addition, the multi-channel management server introduces a parameter template to automatically adapt to the parameter types, so that the development difficulty of an application developer for configuring the parameter types for different channels is reduced.
Referring to fig. 5, fig. 5 is a diagram illustrating a request processing apparatus according to an embodiment of the present disclosure. As shown in fig. 5, the request processing apparatus 500 is configured to be used in a multi-channel management server, where the multi-channel management server is configured to provide a service capability management service for multiple channel types for an application in conjunction with a multi-channel management client; the request processing device 500 comprises:
a receiving module 510, configured to receive target instruction information sent by a multi-channel management client after an application client triggers a target service request;
a request module 520, configured to request a channel server corresponding to a channel type to acquire return information according to the channel type indicated by the target instruction information, pre-acquired channel parameter information, and a parameter type automatically adapted to each piece of the channel parameter information based on a parameter template;
a feedback module 530, configured to feed back target service response information to the multi-channel management client based on the return information, so that the multi-channel management client responds to the target service request according to the target service response information.
In some possible embodiments, in case the target service request is a login request: the receiving module 510 is specifically configured to:
receiving the target instruction information which is sent by a multi-channel management client and contains login token information and channel type information after an application client triggers a login request, wherein the login token information is a return value of the channel server acquired after the multi-channel management client initiates the login request to the channel server;
when requesting to obtain the return information corresponding to the target service request from the channel server corresponding to the channel type, the requesting module 520 is specifically configured to:
sending a login verification request carrying the login token information to a channel server corresponding to the channel type so that the channel server returns user information after verifying the login token information;
when feeding back the target service response information to the multi-channel management client, the feedback module 530 is specifically configured to:
and feeding back the temporary bill provided by the multi-channel management server for logging to the multi-channel management client.
In some possible embodiments, the request processing apparatus 500 further comprises a first authentication module 540, the first authentication module 540 is configured to, after feeding back the target service response information to the multichannel management client based on the return information:
receiving login authentication information sent by an application server, and authenticating the login authentication information;
and after the verification is passed, sending the user information to the application server.
In some possible embodiments, the temporary ticket and the signature information are included in the login verification information;
when the first authentication module 540 authenticates the login authentication information, it is specifically configured to:
and verifying whether the temporary ticket is a previously distributed temporary ticket or not, and verifying whether the signature information is correct or not based on a secret key which is distributed to the application in advance.
In some possible embodiments, in case the target service request is a payment request:
the receiving module 510, when receiving target instruction information sent by the multi-channel management client after the application client triggers the target service request, is specifically configured to:
receiving payment information sent by a multi-channel management client after an application client triggers a payment request;
when requesting to obtain the return information corresponding to the target service request from the channel server corresponding to the channel type, the requesting module 520 is specifically configured to:
requesting channel order information corresponding to the payment information from a channel server corresponding to the channel type; the channel order information comprises order information related to the channel type;
the feedback module 530 is specifically configured to, when feeding back the target service response information to the multi-channel management client:
generating transit order information for payment according to the channel order information; the transit order information comprises the channel order information and multi-channel management order information, and the multi-channel management order information comprises order information related to the multi-channel management server;
and feeding back the transit order information to the multi-channel management client so that the multi-channel management client initiates a payment process to the channel server based on the transit order information.
In some possible embodiments, the request processing device 500 further comprises a second verification module 550, the second verification module 550 is configured to, after feeding back the target service response information to the multichannel management client based on the return information:
receiving a payment result sent by the channel server, and verifying the payment result;
and after the verification is passed, sending the payment result to the application server so that the application server can verify the payment result.
In some possible embodiments, when automatically adapting the parameter type for each of the channel parameter information based on the parameter template, the requesting module 520 is specifically configured to:
determining attribute information of each channel parameter information corresponding to the channel type according to a preset attribute type;
and determining the parameter type information of each channel parameter information according to the attribute information corresponding to each channel parameter information and the parameter template.
In some possible embodiments, the request processing apparatus 500 further includes a parameter template generating module 560, and the parameter template generating module 560 is configured to:
acquiring at least one piece of initial channel parameter information used when an application client of a reference application accesses the channel server and parameter type information corresponding to each piece of initial channel parameter information;
determining attribute information of each initial channel parameter information according to a preset attribute type;
and generating the parameter template according to the parameter type information and the attribute information of each initial channel parameter information.
In some possible embodiments, the request processing apparatus 500 further includes a parameter template testing module 570, where the parameter template testing module 570 is configured to:
determining parameter type information corresponding to the parameter information of each channel according to the generated parameter template;
simulating a client end accessed to the channel server to initiate a login request to the channel server according to each channel parameter information and the corresponding parameter type information;
determining whether first return information of the channel server is abnormal;
and if the first returned information is abnormal, determining that the parameter template configuration is wrong.
In some possible embodiments, the parameter template testing module 570 is further configured to:
if the first returned information is not abnormal, initiating a login verification request to the channel server according to the first returned information, the channel parameter information and the parameter template;
determining whether second return information of the channel server is abnormal;
and if the second returned information is abnormal, determining that the parameter template configuration is wrong.
Referring to fig. 6, fig. 6 is a diagram illustrating another request processing apparatus according to an embodiment of the present disclosure. As shown in fig. 6, the request processing apparatus 600 is configured for a multi-channel management client, and the multi-channel management client is configured to provide a service capability management service for multiple channel types for an application in conjunction with a multi-channel management server; the method comprises the following steps:
a determining module 610, configured to receive a target service request sent by an application client, and determine target instruction information corresponding to the target service request;
a sending module 620, configured to send the target instruction information to the multi-channel management server, where the target instruction information is used for the multi-channel management server to request, according to the channel type indicated in the target instruction information, pre-obtained channel parameter information, and a parameter type automatically adapted for each channel parameter information based on a parameter template, a channel server corresponding to the channel type to obtain return information;
a response module 630, configured to receive target service response information fed back by the multi-channel management server based on the return information, and respond to the target service request according to the target service response information.
In some possible embodiments, in case the target service request is a login request:
the returned information is the user information returned to the multi-channel management server after the channel server verifies the login verification information carried in the login verification request sent by the multi-channel management server;
when determining the target instruction information corresponding to the target service request, the determining module 610 is specifically configured to:
according to the channel type indicated by the target service request, calling a login interface of a channel server corresponding to the channel type to acquire target instruction information comprising login token information and channel type information;
when receiving the target service response information fed back by the multi-channel management server, the response module 630 is specifically configured to:
receiving a temporary bill provided by the multi-channel management server for logging in and fed back by the multi-channel management server.
In some possible embodiments, when responding to the target service request according to the target service response information, the response module 630 is specifically configured to:
and sending the temporary bill to the application client so that the application client can send the temporary bill to an application server corresponding to the application client.
In some possible embodiments, in case the target service request is a payment request:
the return information comprises channel order information which is provided by the channel server and corresponds to the payment information;
when determining the target instruction information corresponding to the target service request, the determining module 610 is specifically configured to:
determining payment information carried by the payment request;
when receiving the target service response information fed back by the multi-channel management server, the response module 630 is specifically configured to:
receiving transit order information for payment, which is fed back by the multi-channel management server and generated according to the channel order information; the transit order information comprises the channel order information and multi-channel management order information, and the multi-channel management order information comprises order information related to the multi-channel management server.
In some possible embodiments, when responding to the target service request according to the target service response information, the response module 630 is specifically configured to:
calling a payment interface of the channel server according to the multi-channel management order information in the transit order information, initiating a payment process to the channel server according to the channel order information in the transit order information, and acquiring a payment result returned by the channel server;
and sending the payment result to the application client.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 7, the electronic device 700 includes a processor 710, a memory 720, and a bus 730.
The memory 720 stores machine-readable instructions executable by the processor 710, when the electronic device 700 runs, the processor 710 communicates with the memory 720 through the bus 730, and when the machine-readable instructions are executed by the processor 710, the steps of the request processing method in the method embodiments shown in fig. 2, fig. 3, and fig. 4 may be executed.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the step of the request processing method in the method embodiments shown in fig. 2, fig. 3, and fig. 4 may be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in software functional units and sold or used as a stand-alone product, may be stored in a non-transitory computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.