CN110852744A - Method, device, terminal equipment and medium for switching transaction channels - Google Patents
Method, device, terminal equipment and medium for switching transaction channels Download PDFInfo
- Publication number
- CN110852744A CN110852744A CN201910948177.7A CN201910948177A CN110852744A CN 110852744 A CN110852744 A CN 110852744A CN 201910948177 A CN201910948177 A CN 201910948177A CN 110852744 A CN110852744 A CN 110852744A
- Authority
- CN
- China
- Prior art keywords
- transaction
- server
- information
- transaction server
- alternative
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/40—Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
- G06Q20/405—Establishing or using transaction specific rules
Abstract
The application is applicable to the technical field of electronic payment, and provides a method, a device, a terminal device and a medium for switching transaction channels, wherein the method for switching transaction channels comprises the steps of inquiring information of an alternative transaction server from a preset database when a transaction task is sent to a default transaction server through a first transaction channel and first information for describing failure of transaction operation returned by the default transaction server is received, determining the alternative transaction server, creating a second transaction channel between the alternative transaction server and the alternative transaction server, and sending the transaction task to the alternative transaction server through the second transaction channel, so that when the first transaction channel between the alternative transaction server and the default transaction server cannot execute the transaction task to finish the transaction operation, the second transaction channel between the alternative transaction server and the alternative transaction server is switched to execute the transaction task to finish the transaction operation, and omission of the transaction task caused by invalidation of the transaction channel between the alternative transaction server and the default transaction server is avoided, the efficiency of electronic transactions is improved.
Description
Technical Field
The present application belongs to the field of electronic payment technologies, and in particular, to a method and an apparatus for switching a transaction channel, a terminal device, and a computer-readable storage medium.
Background
With the increasing popularity of mobile terminals, electronic payment and receipt are also widely used in various scenarios. For example, during a transaction to purchase goods, a consumer may pay by scanning a merchant's checkout two-dimensional code.
Most of the existing payment modes are payment tasks initiated by a consumer through a terminal, for example, the consumer scans a collection two-dimensional code by using the terminal, then sends a payment request to a proxy server of a proxy party providing a payment channel, and the proxy server sends a transaction task to a bank server with transaction authority according to the payment request. However, if the bank server fails to perform the transaction operation between the proxy server and the bank server, the proxy server does not send the transaction task to the bank server any more, which results in failure of the transaction. Therefore, the problem of low transaction efficiency exists in the existing electronic payment and receipt scheme.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a terminal device and a computer-readable storage medium for switching a transaction channel, so as to solve the problem of low transaction efficiency in the existing electronic payment and receipt scheme.
A first aspect of an embodiment of the present application provides a method for switching a transaction channel, including:
generating a transaction task based on the received payment request;
a first transaction channel between the first transaction channel and a default transaction server is established according to a preset transaction strategy;
the transaction task is sent to the default transaction server through the first transaction channel, and the default transaction server is used for performing transaction operation according to the transaction task;
if first information returned by the default transaction server is received, identifying the default transaction server as a fault server, wherein the first information is used for describing transaction operation failure;
inquiring information of the alternative transaction server from a preset database;
creating a second transaction channel between the transaction server and the alternative transaction server according to the alternative transaction server information;
the transaction task is sent to the alternative transaction server through the second transaction channel, and the alternative transaction server is used for performing transaction operation according to the transaction task;
and if second information returned by the alternative transaction server is received, returning payment success information to the payment terminal, wherein the second information is used for describing the success of transaction operation.
Further, the method for switching transaction channels further includes:
acquiring information of a payee;
generating a payee identification corresponding to the payee information;
sending the payee information to a transaction server cluster;
receiving default transaction server information and alternative transaction server information returned by the transaction server cluster according to the payee information;
and storing the payee identification, the default transaction server information and the alternative transaction server information in a preset database in an associated manner.
Further, the payment request carries an identifier of a payee, an identifier of a payer, an identifier of a payment application, and an identifier of a payment method.
Further, the generating a transaction task based on the received payment request includes:
and packaging the payee identification, the payer identification, the payment application identification and the payment mode identification carried in the payment request according to a preset information packaging format to obtain the transaction task.
Further, the creating a first transaction channel with the default transaction server according to the preset transaction policy includes:
determining default transaction server information from the preset database according to the payee identification carried in the payment request;
determining a first task interface of the default transaction server according to the default transaction server information;
and calling the first task interface to create the first transaction channel.
Further, the querying the alternative transaction server information from the preset database includes:
and determining the information of the alternative transaction server from a preset database according to the identifier of the payee.
Further, the creating a second transaction channel with the alternative transaction server according to the alternative transaction server information includes: determining a second task interface of the alternative transaction server according to the alternative transaction server information;
and calling the second task interface to create the second transaction channel.
A second aspect of an embodiment of the present application provides an apparatus for switching a transaction channel, including:
a task generating unit for generating a transaction task based on the received payment request;
the first creating unit is used for creating a first transaction channel between the first creating unit and a default transaction server according to a preset transaction strategy;
the first sending unit is used for sending the transaction task to the default transaction server through the first transaction channel, and the default transaction server is used for performing transaction operation according to the transaction task;
the first identification unit is used for identifying the default transaction server as a fault server if first information returned by the default transaction server is received, wherein the first information is used for describing transaction operation failure;
the query unit is used for querying alternative transaction server information from a preset database;
the second creating unit is used for creating a second transaction channel between the second creating unit and the alternative transaction server according to the alternative transaction server information;
the second sending unit is used for sending the transaction task to the alternative transaction server through the second transaction channel, and the alternative transaction server is used for performing transaction operation according to the transaction task;
and the information returning unit is used for returning payment success information to the payment terminal if second information returned by the alternative transaction server is received, wherein the second information is used for describing the success of transaction operation.
Further, the device for switching transaction channels further comprises:
an acquisition unit for acquiring payee information;
an identifier generating unit configured to generate a payee identifier corresponding to the payee information;
the third sending unit is used for sending the payee information to the transaction server cluster;
the first receiving unit is used for receiving default transaction server information and alternative transaction server information returned by the transaction server cluster according to the payee information;
and the storage unit is used for storing the payee identification, the default transaction server information and the alternative transaction server information into a preset database in an associated manner.
Further, the payment request carries an identifier of a payee, an identifier of a payer, an identifier of a payment application, and an identifier of a payment method.
Further, the task generating unit is specifically configured to package the payee identifier, the payer identifier, the payment application identifier, and the payment method identifier, which are carried in the payment request, according to a preset information packaging format, so as to obtain the transaction task.
Further, the first creating unit is specifically configured to determine default transaction server information from the preset database according to the payee identifier carried in the payment request; determining a first task interface of the default transaction server according to the default transaction server information; and calling the first task interface to create the first transaction channel.
Further, the query unit is specifically configured to determine, according to the payee identifier, alternative transaction server information from a preset database.
Further, the second creating unit is specifically configured to determine a second task interface of the alternative transaction server according to the alternative transaction server information; and calling the second task interface to create the second transaction channel.
A third aspect of the embodiments of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the terminal device, where the processor implements the steps of the method for switching transaction channels provided by the first aspect when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method for switching transaction channels provided by the first aspect.
The method, the device, the terminal equipment and the computer readable storage medium for switching the transaction channel provided by the embodiment of the application have the following beneficial effects that:
the method for switching transaction channels provided by the embodiment of the application generates a transaction task according to a payment request sent by a payment terminal, creates a first transaction channel between the transaction task and a default transaction server according to a preset transaction strategy, identifies the default transaction server as a fault server when the transaction task is sent to the default transaction server through the first transaction channel and first information for describing failure of transaction operation returned by the default transaction server is received, queries information of an alternative transaction server from a preset database, determines the alternative transaction server, creates a second transaction channel between the alternative transaction server and the second transaction channel, sends the transaction task to the alternative transaction server through the second transaction channel, and returns successful payment information to the payment terminal when the transaction operation is completed according to the transaction task through the alternative transaction server, when the first transaction channel between the first transaction channel and the default transaction server can not execute the transaction task to complete the transaction operation, the second transaction channel between the first transaction channel and the alternative transaction server is switched to execute the transaction task to complete the transaction operation, so that the omission of the transaction task is avoided, and the stability and the transaction efficiency of the electronic transaction are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an implementation of a method for switching a transaction channel according to an embodiment of the present application;
fig. 2 is a flowchart illustrating an implementation of a method for switching a transaction channel according to another embodiment of the present application;
fig. 3 is a flowchart illustrating an implementation of a method for switching transaction channels according to yet another embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of an apparatus for switching a transaction channel according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a terminal device according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In all embodiments of the present application, the execution subject of the method for switching the transaction channel is a proxy server, and the proxy server is a server that provides technical support for electronic transactions for a payee, such as a merchant, and may include a computer or other existing terminal device. The agent is an intermediate node between the payee and an organization with electronic transaction qualification, such as a bank, and provides technical service for the electronic transaction. The payee applies for the electronic transaction function to the agent, namely applies for the transaction authority to the agent server, and the agent server and the bank server perform data interaction, thereby realizing the electronic transaction operation.
It should be noted that, in the electronic transaction process, when the payment terminal performs payment through the payment application, the payment request is sent to the proxy server by scanning the payment two-dimensional code, the proxy server generates a payment task according to the payment request, and sends the payment task to the transaction server, that is, the bank server, to perform transaction operation, and the process of performing transaction operation by the transaction server needs to perform authority authentication of a payer with a server corresponding to the payment application.
Referring to fig. 1, fig. 1 is a flowchart illustrating an implementation of a method for switching a transaction channel according to an embodiment of the present disclosure.
The method for switching transaction channels as shown in fig. 1 comprises the following steps:
s11: a transaction task is generated based on the received payment request.
In S11, the payment request is a request sent by the payment terminal to initiate payment of the resource at the time of the transaction. The payment terminal is a payment terminal, that is, a party paying to a payee in the transaction process, for example, the payee is a merchant, and the payment terminal is a payment terminal of a consumer. The payment request carries a payee identifier assigned by the proxy server to the payee (merchant), and the payee identifier is used for distinguishing different payees.
In all embodiments of the application, the payment request carries the payer identifier, and the proxy server generates the transaction task according to the payee identifier and the payer identifier carried in the payment request.
It should be noted that the proxy server does not execute the transaction task itself, but sends the transaction task to the banking server with transaction qualification for processing, that is, to the transaction server for processing.
In practical applications, the proxy server needs to establish a communication link with the transaction server in order to send the transaction task to the transaction server for processing.
S12: and a first transaction channel between the transaction server and a default transaction server is established according to a preset transaction strategy.
In S12, a preset transaction policy is used to describe the determination rule of the default transaction server, and a method for the proxy server to construct a first transaction channel with the default transaction server.
In this embodiment, a plurality of transaction servers can execute transaction tasks, the transaction servers form a transaction server cluster, the proxy server can determine a target transaction server cluster from the transaction server cluster according to a payee identifier carried in the payment request, the target transaction server cluster includes a default transaction server and an alternative transaction server, the payee performs transaction authority provision in the default transaction server and the alternative transaction server, and the default transaction server or the alternative transaction server performs transaction operations on the transaction tasks related to the payee.
S13: and sending the transaction task to the default transaction server through the first transaction channel, wherein the default transaction server is used for performing transaction operation according to the transaction task.
It should be noted that the determination rule of the default transaction server described in the preset transaction policy may be that any transaction server is randomly selected from the target transaction server cluster as the default server, or a transaction server for which the payee first performs transaction authority provision is selected as the default transaction server.
In practical application, if the transaction servers in the target transaction server cluster have different performances and transaction policies, the transaction server with superior performance and simple policy can be identified as the default transaction server according to practical situations.
In all embodiments of the present application, a first transaction channel between the default transaction server and the proxy server is configured with a corresponding data transmission protocol, where the data transmission protocol is different from a data transmission protocol between the proxy server and another interaction terminal, and specifically may include an encoding protocol and a decoding protocol for a transaction task. And after the default transaction server receives the transaction task sent by the proxy server through the first transaction channel, analyzing the transaction task and performing transaction operation according to an analysis result.
It can be understood that the default transaction server performs the transaction operation by analyzing the transaction task and according to the analysis result, and when the transaction operation is completed, the transaction success information can be returned to the proxy server through the first transaction channel, and then the proxy server returns the transaction success information to the payment terminal. When the transaction operation fails, the default transaction server is not suitable for executing the transaction task at present, so the default transaction server returns first information for describing the failure of the transaction operation to the proxy server.
S14: and if first information returned by the default transaction server is received, identifying the default transaction server as a fault server, wherein the first information is used for describing transaction operation failure.
In S14, the default transaction server is identified as a failure server, specifically, the failure identifier may be configured to the default transaction server information in the preset database, and then the default transaction server corresponding to the default transaction server information is disabled when the transaction task is retransmitted.
S15: and inquiring the alternative transaction server information from a preset database.
In S15, the information in the preset database is used to describe the corresponding relationship between the payee identifier, the default transaction server information, and the alternative transaction server information. The alternative transaction server information is used for distinguishing the default transaction server from the alternative transaction server, that is, the proxy server can distinguish the default transaction server from the alternative transaction server according to the alternative transaction server information, and further construct a transaction channel different from the first transaction channel.
S16: and creating a second transaction channel with the alternative transaction server according to the alternative transaction server information.
In S16, the proxy server constructs a second transaction channel with the alternative transaction server, and the second transaction channel is configured with another corresponding data transmission protocol that is different from the data transmission protocol between the proxy server and the other interaction terminals, and is also different from the data transmission protocol of the first transaction channel.
S17: and sending the transaction task to the alternative transaction server through the second transaction channel, wherein the alternative transaction server is used for performing transaction operation according to the transaction task.
In this embodiment, after receiving the transaction task sent by the proxy server through the second transaction channel, the alternative transaction server analyzes the transaction task and performs a transaction operation according to an analysis result.
It can be understood that, the alternative transaction server performs the transaction operation by parsing the transaction task and according to the parsing result, and when the transaction operation is completed, the alternative transaction server may return second information describing that the transaction operation is successful.
S18: and if second information returned by the alternative transaction server is received, returning payment success information to the payment terminal, wherein the second information is used for describing the success of transaction operation.
In S18, the second information is used to describe that the alternative transaction server has completed the transaction operation according to the transaction task, and the proxy server sends the second information to the payment terminal after receiving the second information, so that the second information can be displayed on the payment terminal, and the payer can know that the transaction is completed.
As can be seen from the above, in the method for switching transaction channels provided in this embodiment, a transaction task is generated according to a payment request sent by a payment terminal, a first transaction channel between the transaction task and a default transaction server is created according to a preset transaction policy, when the transaction task is sent to the default transaction server through the first transaction channel and first information for describing failure of transaction operation returned by the default transaction server is received, the default transaction server is identified as a faulty server, information of an alternative transaction server is queried from a preset database, a second transaction channel between the candidate transaction server and the alternative transaction server is created by determining the alternative transaction server, the transaction task is sent to the alternative transaction server through the second transaction channel, and when the transaction operation is completed according to the transaction task through the alternative transaction server, successful payment information is returned to the payment terminal, when the first transaction channel between the first transaction channel and the default transaction server can not execute the transaction task to complete the transaction operation, the second transaction channel between the first transaction channel and the alternative transaction server is switched to execute the transaction task to complete the transaction operation, so that the omission of the transaction task is avoided, and the stability and the transaction efficiency of the electronic transaction are improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating an implementation of a method for switching a transaction channel according to another embodiment of the present application. With respect to the embodiment corresponding to fig. 1, the payment method provided by this embodiment further includes S21 after step S15. The details are as follows:
s21: and if third information returned by the alternative transaction server is received, identifying the alternative transaction server as the fault server, wherein the third information is used for describing transaction operation failure.
In S21, the third information is used to describe that the alternative trading server fails to perform the trading operation according to the trading task.
In this embodiment, the alternative transaction server is identified as a failure server, and specifically, a failure identifier may be configured to the alternative transaction server information in the preset database, so that the alternative transaction server corresponding to the alternative transaction server information is disabled when the alternative transaction server information is re-queried and the transaction task is re-sent.
It should be noted that, in order to avoid that the alternative transaction server repeatedly performs transaction operation according to the transaction task when the proxy server retransmits the transaction task, the alternative transaction server is identified as a failed server, and then when the proxy server re-searches the alternative transaction server and retransmits the transaction task, the phenomenon that the failed server re-processes the transaction task and fails does not occur.
It is to be understood that, after identifying the alternative transaction server as the failed server in S21 and querying the alternative transaction server information from the preset database, the loop is formed by returning to S15.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a method for switching a transaction channel according to still another embodiment of the present application. Compared with the corresponding embodiment of fig. 1 or fig. 2, the payment method provided by the present embodiment further includes S31 to S35 before step S11. The details are as follows:
s31: and acquiring payee information.
S32: and generating a payee identification corresponding to the payee information.
S33: and sending the information of the payee to a transaction server cluster.
S34: and receiving default transaction server information and alternative transaction server information returned by the transaction server cluster according to the payee information.
S35: and storing the payee identification, the default transaction server information and the alternative transaction server information in a preset database in an associated manner.
In the present embodiment, the payee information is information describing the payee's collection quality, for example, a collection account of the payee, a license of the payee, information of a payee's legal person, and the like. The payee identification is a unique identification configured for the payee by the proxy server and is used for distinguishing and identifying the payee by the proxy server.
The transaction server cluster is a set of all transaction servers providing task interfaces for the proxy servers, that is, the proxy servers can establish communication links with each transaction server through the task interfaces of each transaction server in the transaction server cluster, that is, a transaction channel for transmitting transaction tasks is established.
The details of how to obtain payee information may include, but are not limited to, the following two scenarios.
Scene 1: when an account opening request sent by a collection terminal is received, collecting party information is obtained, and a collecting party identifier corresponding to the collecting party information is generated.
For example, the payee sends an account opening request to the proxy server through the payee terminal, the account opening request is used for requesting the proxy to provide the electronic transaction service for the payee through the proxy server, and the proxy server acquires payee information according to the account opening request and generates a payee identifier corresponding to the payee information.
Scene 2: and when a preset instruction for opening an account is received, acquiring payee information and generating a payee identifier corresponding to the payee information.
For example, when detecting that an account opening list in the target database is updated, the proxy server triggers a preset instruction for opening an account, acquires the account opening list from the target database, acquires payee information from the account opening list, and generates a payee identifier corresponding to the payee information.
In practical applications, since the agent acts as a service party for electronic transactions, the agent needs to interface the payee and the transaction task executor.
For example, when a payee applies for an electronic payment service to an agent, payee information is sent to the agent, the agent generates a payee identifier according to the payment information, and issues a two-dimensional code carrying the payee identifier to the payee, and the payer may send a payment request to the agent by scanning the two-dimensional code.
In this embodiment, the proxy server sends the payee information to the transaction servers in the transaction server cluster, and after the transaction server stores the payee information, the transaction server returns information of completing auditing of the payee, default transaction server information and alternative transaction server information to the proxy server, where the default transaction server information and the alternative transaction server information are respectively a task interface of the default transaction server and a task interface of the alternative transaction server.
It should be noted that the proxy server may send payee information to the transaction server cluster based on the number of payees or the amount of payees. For example, as the number of payee strokes of the payee increases and the amount of money collected increases, the proxy server sends payee information to a larger number of transaction servers. Because the order of the agent server sending the payee information to the transaction server cluster is provided, the first transaction server receiving the payee information is a default transaction server, and the other transaction servers are alternative transaction servers. After receiving the default transaction server information and the alternative transaction server information, the proxy server stores the payee identifier, the default transaction server information and the alternative transaction server information in a preset database in an associated manner, that is, the information in the preset database is used for describing the corresponding relationship among the payee identifier, the default transaction server information and the alternative transaction server information, or the information in the preset database is used for describing the corresponding relationship among the payee identifier, the task interface of the default transaction server and the task interface of the alternative transaction server.
When the preset database in the proxy server is configured, the transaction operation can be carried out by receiving the payment request sent by the payment terminal. That is, after the execution of S31-S35, S11-S18 are executed again.
S11: a transaction task is generated based on the received payment request.
As a possible implementation manner of this embodiment, the payment request at least carries an identifier of a payee, an identifier of a payer, an identifier of a payment application, and an identifier of a payment method.
As a possible implementation manner of this embodiment, S11 specifically includes:
and packaging the payee identification, the payer identification, the payment application identification and the payment mode identification carried in the payment request according to a preset information packaging format to obtain the transaction task.
In this embodiment, the preset information encapsulation format is used to describe a message format obtained by encapsulating the information carried in the payment request. The payee identification, the payer identification, the payment application identification and the payment mode identification are respectively represented by different character strings, and the character strings are spliced according to a certain rule sequence to obtain the character strings for representing the transaction tasks.
It should be noted that, because the transaction task is obtained by packaging based on the payee identifier, payer identifier, payment application identifier, and payment method identifier, the transaction task is used to describe that the payer to which the payer identifier is directed makes a payment to the payee corresponding to the payee identifier through the payment method in the payment application.
S12: and a first transaction channel between the transaction server and a default transaction server is established according to a preset transaction strategy.
As a possible implementation manner of this embodiment, S12 specifically includes:
determining default transaction server information from the preset database according to the payee identification carried in the payment request; determining a first task interface of the default transaction server according to the default transaction server information; and calling the first task interface to create the first transaction channel.
In this embodiment, the information in the preset database is used to describe a corresponding relationship between the payee identifier, the task interface of the default transaction server, and the task interface of the alternative transaction server, so that after the proxy server receives the payment request, the task interface of the default transaction server is queried from the preset database according to the payee identifier carried in the payment request, and then a first transaction channel is established with the default transaction server by calling the task interface of the default transaction server, so that the transaction task is sent to the default transaction server through the first transaction channel.
S13: and sending the transaction task to the default transaction server through the first transaction channel, wherein the default transaction server is used for performing transaction operation according to the transaction task.
It should be noted that all transaction servers in the transaction server cluster are bank transaction servers with electronic transaction qualification. The default transaction server information is a task interface address which is opened outwards by the default transaction server, a first transaction channel is constructed between the task interface address and the default transaction server, the transaction task is sent to the default transaction server through the first transaction channel, and the default transaction server carries out transaction operation according to the transaction task.
S14: and if first information returned by the default transaction server is received, identifying the default transaction server as a fault server, wherein the first information is used for describing transaction operation failure.
In this embodiment, when an interruption or a failure occurs during the transaction operation performed by the default transaction server according to the transaction task, the transaction operation is terminated, and first information describing the failure of the transaction operation is returned to the proxy server.
S15: and inquiring the alternative transaction server information from a preset database.
As a possible implementation manner of this embodiment, S15 specifically includes:
and determining the information of the alternative transaction server from a preset database according to the identifier of the payee.
In this embodiment, the default transaction server is identified as a failure server, and a failure identifier, for example, a disabling identifier, may be configured in the preset database for the default transaction server information, so that when the transaction task is retransmitted, the default transaction server corresponding to the default transaction server information is disabled.
It should be noted that, since the information in the preset database is used to describe the corresponding relationship between the payee identifier, the default transaction server information, and the alternative transaction server information, the alternative transaction server information may be determined from the preset database according to the payee identifier.
S16: and creating a second transaction channel with the alternative transaction server according to the alternative transaction server information.
As a possible implementation manner of this embodiment, S16 specifically includes:
determining a second task interface of the alternative transaction server according to the alternative transaction server information; and calling the second task interface to create a second transaction channel.
In this embodiment, after the proxy server determines the task interface of the alternative transaction server according to the alternative transaction server information, the second transaction channel between the proxy server and the alternative transaction server is established by calling the task interface, and then the transaction task is sent to the default transaction server through the second transaction channel, where the transaction task is a transaction task corresponding to an incomplete transaction operation of the default transaction server.
S17: and sending the transaction task to the alternative transaction server through the second transaction channel, wherein the alternative transaction server is used for performing transaction operation according to the transaction task.
S18: and if second information returned by the alternative transaction server is received, returning payment success information to the payment terminal, wherein the second information is used for describing the success of transaction operation.
It can be understood that, when the transaction operation is performed by the default transaction server according to the transaction task, the transaction operation is terminated, which indicates that the default transaction server is not suitable for executing the transaction task currently, so that the transaction task can be transmitted by selecting the alternative transaction server and creating a new transaction channel with the alternative transaction server, and the alternative transaction server performs the transaction operation according to the transaction task, thereby realizing that the alternative transaction server is selected to execute the transaction task when the default transaction server cannot process the transaction task, and avoiding the phenomenon that the transaction task is unsuccessfully executed due to the failure of the default transaction server, so that the loss is caused to the payee due to the unsuccessful transaction operation.
As can be seen from the above, in the method for switching transaction channels provided in this embodiment, a transaction task is generated according to a payment request sent by a payment terminal, a first transaction channel between the transaction task and a default transaction server is created according to a preset transaction policy, when the transaction task is sent to the default transaction server through the first transaction channel and first information for describing failure of transaction operation returned by the default transaction server is received, the default transaction server is identified as a faulty server, information of an alternative transaction server is queried from a preset database, a second transaction channel between the candidate transaction server and the alternative transaction server is created by determining the alternative transaction server, the transaction task is sent to the alternative transaction server through the second transaction channel, and when the transaction operation is completed according to the transaction task through the alternative transaction server, successful payment information is returned to the payment terminal, when the first transaction channel between the first transaction channel and the default transaction server can not execute the transaction task to complete the transaction operation, the second transaction channel between the first transaction channel and the alternative transaction server is switched to execute the transaction task to complete the transaction operation, so that the omission of the transaction task is avoided, and the stability and the transaction efficiency of the electronic transaction are improved.
In addition, the payee identification, the default transaction server information and the alternative transaction server information are stored in the preset database in an associated manner, so that data in the preset database can be used for describing the corresponding relationship among the payee identification, the default transaction server information and the alternative transaction server information, and no matter a first transaction channel between the payee identification and the default transaction access right or a second transaction channel between the payee identification and the alternative transaction server is constructed, the task interface addresses of the default transaction server and the alternative transaction server can be determined from the preset database according to the payee identification, and the efficiency of constructing the transaction channel and the efficiency of transaction operation are improved.
Referring to fig. 4, fig. 4 is a block diagram illustrating a structure of a device for switching a transaction channel according to an embodiment of the present disclosure. The device in this embodiment includes units for performing the steps in the embodiments corresponding to fig. 1 to 3. Please refer to fig. 1 to 3 and fig. 1 to 3 for the corresponding embodiments. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 4, an apparatus 400 for switching a transaction channel includes: a task generating unit 401, a first creating unit 402, a first sending unit 403, a first identifying unit 404, an inquiring unit 405, a second creating unit 406, a second sending unit 407, and an information returning unit 408. Wherein:
a task generating unit 401, configured to generate a transaction task based on the received payment request.
A first creating unit 402, configured to create a first transaction channel with a default transaction server according to a preset transaction policy.
A first sending unit 403, configured to send the transaction task to the default transaction server through the first transaction channel, where the default transaction server is configured to perform a transaction operation according to the transaction task.
A first identifying unit 404, configured to identify the default transaction server as a failed server if first information returned by the default transaction server is received, where the first information is used to describe a failure of a transaction operation;
the query unit 405 is configured to query the alternative transaction server information from a preset database.
A second creating unit 406, configured to create a second transaction channel with the alternative transaction server according to the alternative transaction server information.
A second sending unit 407, configured to send the transaction task to the alternative transaction server through the second transaction channel, where the alternative transaction server is configured to perform a transaction operation according to the transaction task.
An information returning unit 408, configured to return payment success information to the payment terminal if second information returned by the alternative transaction server is received, where the second information is used to describe that the transaction operation is successful.
As an embodiment of the present application, the apparatus 400 for switching transaction channels further includes:
the obtaining unit 409 is configured to obtain payee information.
An identifier generating unit 410, configured to generate a payee identifier corresponding to the payee information.
A third sending unit 411, configured to send the payee information to the transaction server cluster.
A first receiving unit 412, configured to receive default transaction server information and alternative transaction server information returned by the transaction server cluster according to the payee information.
A storage unit 413, configured to store the payee identifier, the default transaction server information, and the alternative transaction server information in a preset database in an associated manner.
As an embodiment of the present application, the payment request at least carries an identifier of a payee, an identifier of a payer, an identifier of a payment application, and an identifier of a payment method.
As an embodiment of the present application, the task generating unit 401 is specifically configured to package the payee identifier, the payer identifier, the payment application identifier, and the payment method identifier, which are carried in the payment request, according to a preset information package format, so as to obtain the transaction task.
As an embodiment of the present application, the first creating unit 402 is specifically configured to determine default transaction server information from the preset database according to the payee identifier carried in the payment request; determining a first task interface of the default transaction server according to the default transaction server information; and calling the first task interface to create the first transaction channel.
As an embodiment of the present application, the query unit 405 is specifically configured to determine, according to the payee identifier, alternative transaction server information from a preset database.
As an embodiment of the present application, the apparatus 400 for switching transaction channels further includes:
a second identifying unit 414, configured to identify the alternative transaction server as the failed server if third information returned by the alternative transaction server is received, where the third information is used to describe a failure of transaction operation.
As an embodiment of the present application, the second constructing unit 406 is specifically configured to determine a second task interface of the alternative transaction server according to the alternative transaction server information; and calling the second task interface to create the second transaction channel.
As can be seen from the above, in the scheme provided in this embodiment, a transaction task is generated according to a payment request sent by a payment terminal, a first transaction channel between the transaction task and a default transaction server is created according to a preset transaction policy, when the transaction task is sent to the default transaction server through the first transaction channel, and first information for describing failure of transaction operation returned by the default transaction server is received, the default transaction server is identified as a failure server, information of an alternative transaction server is queried from a preset database, a second transaction channel between the alternative transaction server and the alternative transaction server is created by determining the alternative transaction server, and the transaction task is sent to the alternative transaction server through the second transaction channel, and when the transaction operation is completed according to the transaction task through the alternative transaction server, successful payment information is returned to the payment terminal, so that the first transaction channel between the transaction server and the default transaction server cannot execute the transaction task to complete the transaction operation When the transaction operation is finished, the transaction operation is executed by switching to the second transaction channel between the second transaction channel and the alternative transaction server, so that the omission of the transaction task is avoided, and the stability and the transaction efficiency of the electronic transaction are improved.
In addition, the payee identification, the default transaction server information and the alternative transaction server information are stored in the preset database in an associated manner, so that data in the preset database can be used for describing the corresponding relationship among the payee identification, the default transaction server information and the alternative transaction server information, and no matter a first transaction channel between the payee identification and the default transaction access right or a second transaction channel between the payee identification and the alternative transaction server is constructed, the task interface addresses of the default transaction server and the alternative transaction server can be determined from the preset database according to the payee identification, and the efficiency of constructing the transaction channel and the efficiency of transaction operation are improved.
Fig. 5 is a block diagram of a terminal device according to another embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: a processor 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processor 50, such as a program of a method of switching a transaction channel. The processor 50 executes the computer program 52 to implement the steps of the above-mentioned embodiments of the method for switching transaction channels, such as S11 to S18 shown in fig. 1. Alternatively, when the processor 50 executes the computer program 52, the functions of the units in the embodiment corresponding to fig. 4, for example, the functions of the units 401 to 408 shown in fig. 4, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 5, which is not repeated herein.
Illustratively, the computer program 52 may be divided into one or more units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into a task generating unit, a first creating unit, a first sending unit, a first identifying unit, an inquiring unit, a second creating unit, a second sending unit, and an information returning unit, and the specific functions of the units are as described above.
The terminal device may include, but is not limited to, a processor 50, a memory 51. Those skilled in the art will appreciate that fig. 5 is merely an example of a terminal device 5 and does not constitute a limitation of terminal device 5 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing the computer program and other programs and data required by the terminal device. The memory 51 may also be used to temporarily store data that has been output or is to be output.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.
Claims (10)
1. A method for switching transaction channels, comprising:
generating a transaction task based on the received payment request;
a first transaction channel between the first transaction channel and a default transaction server is established according to a preset transaction strategy;
the transaction task is sent to the default transaction server through the first transaction channel, and the default transaction server is used for performing transaction operation according to the transaction task;
if first information returned by the default transaction server is received, identifying the default transaction server as a fault server, wherein the first information is used for describing transaction operation failure;
inquiring information of the alternative transaction server from a preset database;
creating a second transaction channel between the transaction server and the alternative transaction server according to the alternative transaction server information;
the transaction task is sent to the alternative transaction server through the second transaction channel, and the alternative transaction server is used for performing transaction operation according to the transaction task;
and if second information returned by the alternative transaction server is received, returning payment success information to the payment terminal, wherein the second information is used for describing the success of transaction operation.
2. The method for switching transaction channels according to claim 1, further comprising:
acquiring information of a payee;
generating a payee identification corresponding to the payee information;
sending the payee information to a transaction server cluster;
receiving default transaction server information and alternative transaction server information returned by the transaction server cluster according to the payee information;
and storing the payee identification, the default transaction server information and the alternative transaction server information in a preset database in an associated manner.
3. The method for switching transaction channels according to claim 2, wherein the payment request carries an identifier of a payee, an identifier of a payer, an identifier of a payment application, and an identifier of a payment method.
4. The method of switching transaction channels of claim 3, wherein generating a transaction task based on the received payment request comprises:
and packaging the payee identification, the payer identification, the payment application identification and the payment mode identification carried in the payment request according to a preset information packaging format to obtain the transaction task.
5. The method for switching transaction channels according to claim 3, wherein the creating of the first transaction channel with the default transaction server according to the preset transaction policy comprises:
determining default transaction server information from the preset database according to the payee identification carried in the payment request;
determining a first task interface of the default transaction server according to the default transaction server information;
and calling the first task interface to create the first transaction channel.
6. The method for switching transaction channels according to claim 3, wherein the querying the alternative transaction server information from the preset database comprises:
and determining the information of the alternative transaction server from a preset database according to the identifier of the payee.
7. The method for switching transaction channels according to any one of claims 1 to 6, wherein the creating a second transaction channel with an alternative transaction server according to the alternative transaction server information comprises:
determining a second task interface of the alternative transaction server according to the alternative transaction server information;
and calling the second task interface to create the second transaction channel.
8. An apparatus for switching a transaction channel, comprising:
a task generating unit for generating a transaction task based on the received payment request;
the first creating unit is used for creating a first transaction channel between the first creating unit and a default transaction server according to a preset transaction strategy;
the first sending unit is used for sending the transaction task to the default transaction server through the first transaction channel, and the default transaction server is used for performing transaction operation according to the transaction task;
the first identification unit is used for identifying the default transaction server as a fault server if first information returned by the default transaction server is received, wherein the first information is used for describing transaction operation failure;
the query unit is used for querying alternative transaction server information from a preset database;
the second creating unit is used for creating a second transaction channel between the second creating unit and the alternative transaction server according to the alternative transaction server information;
the second sending unit is used for sending the transaction task to the alternative transaction server through the second transaction channel, and the alternative transaction server is used for performing transaction operation according to the transaction task;
and the information returning unit is used for returning payment success information to the payment terminal if second information returned by the alternative transaction server is received, wherein the second information is used for describing the success of transaction operation.
9. A terminal device, characterized in that the terminal device comprises a memory, a processor and a computer program stored in the memory and executable on the terminal device, the processor implementing the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910948177.7A CN110852744A (en) | 2019-10-08 | 2019-10-08 | Method, device, terminal equipment and medium for switching transaction channels |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910948177.7A CN110852744A (en) | 2019-10-08 | 2019-10-08 | Method, device, terminal equipment and medium for switching transaction channels |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110852744A true CN110852744A (en) | 2020-02-28 |
Family
ID=69597451
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910948177.7A Pending CN110852744A (en) | 2019-10-08 | 2019-10-08 | Method, device, terminal equipment and medium for switching transaction channels |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110852744A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022267395A1 (en) * | 2021-06-21 | 2022-12-29 | 深圳前海微众银行股份有限公司 | Payment request processing method and system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102867252A (en) * | 2012-09-14 | 2013-01-09 | 东莞宇龙通信科技有限公司 | Payment server and payment channel acquisition method |
US20170213204A1 (en) * | 2016-01-25 | 2017-07-27 | Freelancer Technology Pty Limited | Adaptive gateway switching system |
WO2017136308A1 (en) * | 2016-02-06 | 2017-08-10 | Mastercard International Incorporated | Method and system for secondary authorization processing |
CN107886328A (en) * | 2017-11-23 | 2018-04-06 | 上海壹账通金融科技有限公司 | Transaction processing method, device, computer equipment and storage medium |
CN109784929A (en) * | 2019-01-24 | 2019-05-21 | 鑫涌算力信息科技(上海)有限公司 | The transfer of payment channel failure and recovery system, method and terminal |
CN110175830A (en) * | 2019-05-22 | 2019-08-27 | 深圳乐信软件技术有限公司 | Management method, device, server and the storage medium of trading channel |
-
2019
- 2019-10-08 CN CN201910948177.7A patent/CN110852744A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102867252A (en) * | 2012-09-14 | 2013-01-09 | 东莞宇龙通信科技有限公司 | Payment server and payment channel acquisition method |
US20170213204A1 (en) * | 2016-01-25 | 2017-07-27 | Freelancer Technology Pty Limited | Adaptive gateway switching system |
WO2017136308A1 (en) * | 2016-02-06 | 2017-08-10 | Mastercard International Incorporated | Method and system for secondary authorization processing |
CN107886328A (en) * | 2017-11-23 | 2018-04-06 | 上海壹账通金融科技有限公司 | Transaction processing method, device, computer equipment and storage medium |
CN109784929A (en) * | 2019-01-24 | 2019-05-21 | 鑫涌算力信息科技(上海)有限公司 | The transfer of payment channel failure and recovery system, method and terminal |
CN110175830A (en) * | 2019-05-22 | 2019-08-27 | 深圳乐信软件技术有限公司 | Management method, device, server and the storage medium of trading channel |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2022267395A1 (en) * | 2021-06-21 | 2022-12-29 | 深圳前海微众银行股份有限公司 | Payment request processing method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108846659B (en) | Block chain-based transfer method and device and storage medium | |
CN105512881B (en) | A kind of method and terminal for completing payment based on two dimensional code | |
US10387856B2 (en) | Online payment method, system, and apparatus | |
WO2020258846A1 (en) | Method and apparatus for sending certifiable messages across chains | |
CN111163129B (en) | Resource processing method and device based on cross-link network | |
KR102136945B1 (en) | Service implementation method, device and system based on FIX protocol | |
CN109582655B (en) | Method and device for positioning system log and computer readable storage medium | |
CN105577602A (en) | Data pushing method and data pushing device based on open application programming interface | |
CN112087502B (en) | Method, device and equipment for processing request and storage medium | |
CN110602214B (en) | Evidence storing and processing method, device, equipment and medium of judicial chain | |
CN113409047B (en) | Data processing method, device and equipment based on block chain and readable storage medium | |
CN106686111A (en) | Payment method and system and intermediate server | |
CN110599155A (en) | Payment method and payment system | |
CN110839029A (en) | Micro-service registration method and device | |
CN110675159A (en) | Financial market transaction advance risk control method and system and electronic equipment | |
CN110400217A (en) | The regular changing process method and device of intelligent contract | |
CN110852744A (en) | Method, device, terminal equipment and medium for switching transaction channels | |
CN112288577A (en) | Transaction processing method and device for distributed service, electronic equipment and medium | |
WO2013087016A1 (en) | Safety information transfer system, device and method based on extended parameter set | |
CN108512889B (en) | Application response pushing method based on HTTP and proxy server | |
CN110660466A (en) | Personal health data chaining method and system of Internet of things by combining block chains | |
CN114092093A (en) | Block chain transaction processing method and device, electronic equipment and readable medium | |
CN113987598A (en) | Block migration method and device | |
CN111273970B (en) | Calling method, device, system, medium and electronic equipment of intelligent contract | |
CN108848061B (en) | User information transmission method and terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |