CN114092074A - Channel routing-based transaction method and device, computer equipment and storage medium - Google Patents
Channel routing-based transaction method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN114092074A CN114092074A CN202111167938.9A CN202111167938A CN114092074A CN 114092074 A CN114092074 A CN 114092074A CN 202111167938 A CN202111167938 A CN 202111167938A CN 114092074 A CN114092074 A CN 114092074A
- Authority
- CN
- China
- Prior art keywords
- target
- channel
- transaction
- routing
- payment channel
- 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/02—Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
- G06Q20/027—Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP] involving a payment switch or gateway
-
- 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
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- General Business, Economics & Management (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Finance (AREA)
- Computer Security & Cryptography (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Technology Law (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application relates to the field of business process optimization, and the transaction request is sent to an independent target payment channel through a channel gateway for transaction processing, so that the influence of coupling among a plurality of payment channels on a payment system can be avoided, and the stability of the payment system is improved. To a channel routing based transaction method, apparatus, computer device and storage medium, the method comprising: when a transaction request of a client is received, determining a target payment channel corresponding to the transaction request according to a routing strategy list; determining a workflow corresponding to a target payment channel; based on the execution strategy, sequentially executing the working nodes in the workflow, sending the transaction request to a target payment channel through a channel gateway, and performing transaction processing on the transaction request by the target payment channel; and when the workflow execution is finished, sending a node execution result corresponding to the last working node to the client. In addition, the application also relates to a block chain technology, and the routing strategy list can be stored in the block chain.
Description
Technical Field
The present application relates to the field of business process optimization, and in particular, to a channel routing-based transaction method, device, computer device, and storage medium.
Background
The channel route is used as a core module of the payment system and bears key services such as payment placing, payment, transfer, clearing and the like. The channel route comprises a payment mode, a target mechanism and a payment channel. Due to the importance of channel routing, the design of payment channels is particularly important.
In the early design stage of most payment systems, only compatible existing docking payment channels are considered for the payment system to be on-line as soon as possible. With the development of business, more and more payment channels are provided for later docking. Existing solutions merge the interfacing of multiple payment channels into one module, resulting in coupling between multiple payment channels. When a certain payment channel is abnormal, the transaction is accumulated, and then compensation processing logic is executed; as the accumulated transaction data is continuously increased, and the payment channel cannot be recovered in a short time, the stability of the payment system is reduced. In addition, cluster avalanches are easily caused, which may cause all payment channels to be affected, rendering the whole payment system unusable, thereby reducing the stability of the payment system.
Therefore, how to improve the stability of the payment system becomes an urgent problem to be solved.
Disclosure of Invention
The application provides a channel routing-based transaction method, a channel routing-based transaction device, a computer device and a storage medium, a workflow corresponding to a target payment channel is executed by determining the target payment channel corresponding to a transaction request, the transaction request is sent to an independent target payment channel through a channel gateway for transaction processing, the influence of coupling among a plurality of payment channels on a payment system can be avoided, and the stability of the payment system is improved.
In a first aspect, the present application provides a channel routing-based transaction method, including:
when a transaction request of a client is received, determining a target payment channel corresponding to the transaction request according to a preset routing strategy list;
determining a workflow corresponding to the target payment channel, wherein the workflow comprises at least one work node;
sequentially executing the working nodes in the workflow based on a preset execution strategy, sending the transaction request to the target payment channel through a preset channel gateway, and performing transaction processing on the transaction request by the target payment channel;
and when the workflow execution is finished, sending a node execution result corresponding to the last working node to the client, wherein the node execution result is determined according to a transaction processing result of the target payment channel.
In a second aspect, the present application further provides a channel routing-based transaction apparatus, the apparatus including:
the payment channel determining module is used for determining a target payment channel corresponding to a transaction request according to a preset routing strategy list when the transaction request of a client is received;
the workflow determining module is used for determining a workflow corresponding to the target payment channel, and the workflow comprises at least one work node;
the working node execution module is used for sequentially executing the working nodes in the workflow based on a preset execution strategy, sending the transaction request to the target payment channel through a preset channel gateway, and carrying out transaction processing on the transaction request by the target payment channel;
and the node execution result sending module is used for sending a node execution result corresponding to the last working node to the client when the workflow execution is finished, wherein the node execution result is determined according to the transaction processing result of the target payment channel.
In a third aspect, the present application further provides a computer device comprising a memory and a processor;
the memory for storing a computer program;
the processor is configured to execute the computer program and to implement the channel routing-based transaction method as described above when executing the computer program.
In a fourth aspect, the present application also provides a computer-readable storage medium storing a computer program which, when executed by a processor, causes the processor to implement the channel routing-based transaction method as described above.
The application discloses a channel routing-based transaction method, a channel routing-based transaction device, a computer device and a storage medium, wherein when a transaction request of a client is received, a target payment channel corresponding to the transaction request is determined according to a preset routing strategy list, so that a proper target payment channel can be matched according to configuration information and priority of a routing strategy; by determining the workflow corresponding to the target payment channel, the subsequent workflow can be executed in sequence, and the transaction request is sent to the target payment channel through the preset channel gateway for service processing, so that the problem generated in the service processing process can be quickly and accurately positioned; the method has the advantages that the working nodes in the workflow are sequentially executed based on the preset execution strategy, the transaction request is sent to the target payment channel through the preset channel gateway, the transaction request can be sent to the independent target payment channel through the channel gateway for transaction processing, the influence of the coupling among a plurality of payment channels on the payment system is avoided, and the stability of the payment system is improved; by sending the node execution result corresponding to the last working node to the client when the workflow execution is finished, the processing result of the transaction request can be timely fed back to the client because the node execution result corresponding to the last working node reflects the processing result of the transaction request.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are 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 creative efforts.
Fig. 1 is a schematic flow chart of a channel routing-based transaction method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of a substep of determining a target payment channel provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a workflow provided by an embodiment of the present application;
FIG. 4 is a schematic flow chart diagram of a substep of sending a transaction request to a target payment channel provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of a transaction request sent to a target payment channel according to an embodiment of the present disclosure;
fig. 6 is a schematic block diagram of a transaction apparatus based on channel routing according to an embodiment of the present application;
fig. 7 is a schematic block diagram of a structure of a computer device according to an embodiment of the present application.
Detailed Description
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 some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
The embodiment of the application provides a channel routing-based transaction method, a channel routing-based transaction device, computer equipment and a storage medium. The channel routing-based transaction method can be applied to a server, a workflow corresponding to a target payment channel is executed by determining the target payment channel corresponding to a transaction request, the transaction request is sent to the independent target payment channel through a channel gateway for transaction processing, the influence of coupling among a plurality of payment channels on a payment system can be avoided, and the stability of the payment system is improved.
The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
As shown in fig. 1, the channel routing-based trading method includes steps S10 through S40.
And step S10, when a transaction request of the client is received, determining a target payment channel corresponding to the transaction request according to a preset routing strategy list.
It should be noted that, in the embodiment of the present application, the channel routing-based transaction method may be applied to a channel routing system on a server. The channel routing system can receive a transaction request sent by a client and determine a target payment channel corresponding to the transaction request; then, executing a workflow corresponding to the target payment channel, and sending a transaction request to the target payment channel through a preset channel gateway for transaction processing; and finally, acquiring an execution result of the workflow and sending the execution result to the client.
The client may be an electronic device such as a smart phone, a tablet computer, a notebook computer, and a desktop computer. Wherein the client is provided with a trading system.
For example, a user may initiate a transaction request through a transaction system in a client, the transaction system sends the transaction request to a server, and a channel routing system sends the transaction request to a target payment channel through a preset channel gateway for transaction processing.
In some embodiments, when a transaction request of a client is received, the server may determine a target payment channel corresponding to the transaction request according to a preset routing policy list.
Illustratively, the transaction request may include transaction information. The transaction information may include, but is not limited to, a user name, a bank card balance, a transfer-in card number, a transfer-out card number, a transaction amount, and the like.
When a transaction request of a client is received, a target payment channel corresponding to the transaction request is determined according to a preset routing strategy list, so that the transaction request can be matched with a proper target payment channel according to configuration information and priority of routing strategies.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a substep of determining a target payment channel according to an embodiment of the present application, which may specifically include the following steps S101 to S104.
And step S101, based on the priority corresponding to each routing strategy in the routing strategy list, sequentially taking the corresponding routing strategies as candidate routing strategies according to the priority sequence.
Illustratively, the routing policy list includes at least one routing policy and priority and configuration information corresponding to each routing policy. For example, the routing policies in the routing policy list may include a white list routing policy, a transaction amount routing policy, and the like, and other routing policies may also be added according to actual needs.
For example, the priority corresponding to each routing policy may be preset; for example, the white list routing policy has a priority of i and the transaction amount routing policy has a priority of ii. The priority is used for determining the arrangement sequence of the payment channels in the routing strategy list.
For example, the configuration information corresponding to each routing policy may be set according to actual conditions. For example, the configuration information of the white list routing policy is "Alice"; the configuration information of the transaction amount routing strategy is 0-1000 yuan.
The routing policy list may be stored in a local database or a local disk. To further ensure the privacy and security of the routing policy list, the routing policy list may be stored in a node of a block chain.
It should be noted that in the prior art, there is a large amount of hard coding in the conventional routing strategy. With the increase of routing strategies, the maintenance of codes is more difficult, and the routing strategies have mutual influence. When one of the routing policies is modified, the execution results of the other routing policies are affected. In the embodiment of the application, each routing strategy corresponds to one piece of configuration information by configuring the routing strategies; different routing strategies can be processed by a single routing strategy processing class, so that the mutual influence among different routing strategies can be avoided.
For example, the corresponding routing policies may be sequentially used as candidate routing policies in the order of priority. For example, a white list routing strategy of a priority level I is used as a candidate routing strategy, and configuration information of the candidate routing strategy is matched with transaction information; and if the matching fails, taking the transaction amount routing strategy of the priority level II as a candidate routing strategy, returning to execute the step of matching the configuration information of the candidate routing strategy with the transaction information until the matching of the last routing strategy in the routing strategy list is completed.
And step S102, matching the configuration information of the candidate routing strategy with the transaction information.
It should be noted that, in the embodiment of the present application, a routing policy processing class may be defined, and the configuration information of the routing policy and the transaction information are subjected to matching processing; so that different routing strategies do not affect each other. Wherein, the routing policy processing class may be FlowRouteService.
Matching configuration information of the candidate routing policies with transaction information may include, for example: executing a routing strategy processing class, and judging whether the transaction information is the same as the configuration information or whether the transaction information is in the range of the configuration information; if the transaction information is different from the configuration information or the transaction information is not in the range of the configuration information, judging that the transaction information is not matched with the configuration information; and if the transaction information is the same as the configuration information or the transaction information is in the range of the configuration information, judging that the transaction information is matched with the configuration information.
Step S103, if the matching is successful, determining the candidate routing strategy as a target routing strategy, and determining a payment channel corresponding to the configuration information of the target routing strategy as the target payment channel based on the corresponding relation between preset configuration information and the payment channel.
The payment channel may include, but is not limited to, unions, payees, wechat, and the like.
For example, when the transaction information is "transaction user name: alice; transaction amount: 500 yuan, if the configuration information of the white list routing policy is 'Alice', it may be determined that the transaction information matches the configuration information of the white list routing policy. At this time, the whitelist routing policy may be determined as the target routing policy.
For example, when the transaction information is "transaction user name: alice; transaction amount: 500 yuan', and when the configuration information of the white list routing policy is "Lucy", it may be determined that the transaction information does not match the configuration information of the white list routing policy. The transaction amount routing policy of priority ii may then be used as a candidate routing policy. If the configuration information of the transaction amount routing policy is '0-1000 yuan', it may be determined that the transaction information matches the configuration information of the transaction amount routing policy. At this time, the transaction amount routing policy may be determined as the target routing policy.
For example, after the target routing policy is determined, the payment channel corresponding to the configuration information of the target routing policy may be determined as the target payment channel based on a corresponding relationship between preset configuration information and the payment channel. It should be noted that, in the embodiment of the present application, an association relationship between the configuration information and the payment channel may be predefined. For example, the configuration information of the white list routing policy is associated with payment channel 1; the configuration information of the transaction amount routing policy is associated with the payment channel 2.
For example, if the payment channel corresponding to the configuration information of the target routing policy is payment channel 1, it may be determined that the target payment channel is payment channel 1.
For another example, if the payment channel corresponding to the configuration information of the target routing policy is payment channel 2, it may be determined that the target payment channel is payment channel 2.
And step S104, if the matching fails, determining a preset payment channel as the target payment channel.
It is understood that a failure to match means that there is no match between the configuration information of any candidate routing policy in the routing policy list and the transaction information.
For example, when the configuration information of all candidate routing policies in the routing policy list fails to match the transaction information, the preset payment channel may be determined as the target payment channel.
It should be noted that, in the embodiment of the present application, a payment channel may be predefined, and when a target payment channel corresponding to a transaction request cannot be determined according to priority and configuration information of a routing policy, the payment channel may be determined as the target payment channel. Thus, situations in which the transaction request does not match the target payment channel can be avoided.
Step S20, determining a workflow corresponding to the target payment channel, wherein the workflow comprises at least one work node.
It should be noted that, in the embodiment of the present application, a corresponding workflow may be configured in advance for each payment channel, and the workflow and the payment channel are stored in a corresponding association manner. It is to be understood that workflow refers to the workflow of processing transaction requests.
Referring to fig. 3, fig. 3 is a schematic diagram of a workflow according to an embodiment of the present disclosure. As shown in FIG. 3, a workflow includes at least one worker node; for example, a workflow may include worker node a, worker node B, worker node C, and worker node D, among others.
In some embodiments, the workflow corresponding to the target payment channel may be determined based on a preset correspondence between workflows and payment channels.
By determining the workflow corresponding to the target payment channel, the subsequent workflow can sequentially execute the working nodes in the workflow, and the transaction request is sent to the target payment channel through the preset channel gateway for service processing, so that the problem generated in the service processing process can be quickly and accurately positioned.
And step S30, sequentially executing the working nodes in the workflow based on a preset execution strategy, sending the transaction request to the target payment channel through a preset channel gateway, and carrying out transaction processing on the transaction request by the target payment channel.
It should be noted that the preset channel gateway is an interface for providing services to the outside. In the embodiment of the application, the channel gateway can be in butt joint with the plurality of payment channels, and the transaction request is sent to the corresponding target payment channel through the channel gateway to perform transaction processing, so that the influence of the coupling among the plurality of payment channels on the payment system can be avoided, and the stability of the payment system is improved.
In some embodiments, sequentially executing the work nodes in the workflow based on a preset execution policy, and before sending the transaction request to the target payment channel through a preset channel gateway, may further include: and determining a target context corresponding to the workflow according to the transaction request and the initial context corresponding to the workflow, wherein the target context comprises transaction task data corresponding to each working node.
It is understood that a Context (Context) refers to a container or environment that provides information or functionality. In an embodiment of the present application, the initial context includes an association relationship between work nodes in the workflow.
Illustratively, determining a target context corresponding to the workflow based on the transaction request and the initial context includes: acquiring transaction task data corresponding to each working node from the transaction request according to the operation type corresponding to each working node; and adding the transaction task data corresponding to each working node to the initial context to obtain a target context.
It should be noted that different working nodes perform different operation types. The operation type may include, but is not limited to, a username verification operation, a balance verification operation, a transfer operation, a query operation, and the like. For example, the operation type corresponding to the working node a is a user name check operation; the operation type corresponding to the working node B is balance check operation; the operation type corresponding to the working node C is transfer operation; and the operation type corresponding to the working node D is a transfer inquiry operation.
For example, the transaction task data corresponding to each work node may be extracted from the transaction request according to the operation type corresponding to each work node. For example, for the working node a, since the operation type corresponding to the working node a is the user name check operation, the user name in the transaction request may be used as the transaction task data of the working node a. For another example, for the working node B, since the operation type corresponding to the working node B is a balance check operation, the balance of the bank card in the transaction request may be used as the transaction task data of the working node B.
For example, after obtaining the transaction task data corresponding to each work node, the transaction task data corresponding to each work node may be added to the initial context to obtain the target context.
It should be noted that, since the initial context includes the association relationship between the work nodes, the transaction task data corresponding to each work node may be stored in the position corresponding to each work node in the initial context. In the embodiment of the application, transaction task data corresponding to each working node is added to the initial context; when the working nodes are executed, the transaction task data corresponding to each working node can be obtained through the target context.
Referring to fig. 4, fig. 4 is a schematic flowchart illustrating a sub-step of sending a transaction request to a target payment channel according to an embodiment of the present application, which may specifically include the following steps S301 to S305.
Step S301, taking a first working node of the workflow as a target working node, sending the target context to the target working node, calling the target working node to extract target transaction task data according to the target context, and sending the target transaction task data to the target payment channel through the channel gateway, wherein the target transaction task data is transaction task data corresponding to the target working node.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a transaction request being sent to a target payment channel according to an embodiment of the present disclosure. As shown in fig. 5, the first work node of the workflow may be taken as the target work node, for example, work node a is taken as the target work node; and then, sending the target context to the working node A, and calling the working node A to extract target transaction task data according to the target context. For example, the working node a may extract corresponding transaction task data from the target context as target transaction task data and transmit the target transaction task data to the target payment channel through the channel gateway.
For example, if the target payment channel is the payment channel 1, the work node may send the target transaction task data to the payment channel 1 through the channel gateway, and the payment channel 1 performs transaction processing on the target transaction task data.
Step S302, determining a node execution result corresponding to the target working node according to the transaction processing result of the target payment channel.
For example, after the target transaction task data is subjected to transaction processing, the target payment channel may return a transaction processing result to the target work node through the channel gateway. The transaction processing result may include, among other things, a transaction processing status and a transaction return value. Where the transaction processing status may be success, failure, in-process, or abnormal.
For example, the transaction processing result returned by the target payment channel may be determined as a node execution result corresponding to the target work node. For example, when the transaction processing status is "successful", it may be determined that the node execution result corresponding to the target work node is "successful". For another example, when the transaction processing state is "in process", the node execution result corresponding to the target work node may be determined to be "in process".
Step S303, if the node execution result meets a preset first condition, taking the next working node as a new target working node, returning to execute the steps of sending the target context to the target working node, calling the target working node to extract target transaction task data according to the target context, and sending the target transaction task data to the target payment channel through the channel gateway until the last working node in the workflow is called.
Illustratively, the preset first condition may be "success".
For example, when the node execution result is "successful", the next working node, for example, working B, may be taken as a new target working node. And then, sending the target context to a target working node, calling the target working node to extract target transaction task data according to the target context, and sending the target transaction task data to a target payment channel through a channel gateway.
In some embodiments, when the target context is sent to the target work node, the target context may be updated according to the current node execution result and the transaction return value to obtain an updated target context; and then sending the updated target context to the target work node.
For example, for the working node D, after the working node C is called, the transaction return value to be returned by the target payment channel may be the transaction identification number; at this time, the transaction identification number and the node execution result corresponding to the working node C can be updated to the target context, so that the working node D queries the transfer result according to the transaction identification number.
The updated target context is sent to the target working node according to the updated target context updated according to the current node execution result and the transaction return value, so that the target working node can extract the latest transaction task data according to the updated target context, and transaction errors are avoided.
And step S304, if the node execution result meets a preset second condition, performing compensation processing on the target working node based on a preset compensation strategy.
Illustratively, the preset second condition may be "in process". When the node execution result is "in process", the compensation process may be performed on the target working node based on a preset compensation policy.
It should be noted that the compensation processing refers to repeatedly calling the target work node, and sending the target transaction task data to the target payment channel through the channel gateway. At this time, the target payment channel needs to support idempotent.
Illustratively, the step of calling the target work node and sending the target transaction task data to the target payment channel through the channel gateway may be performed until the number of calling is greater than the preset number. The preset times can be set according to actual conditions, and specific numerical values are not limited herein.
Step S305, if the node execution result meets a preset third condition, stopping invoking the work node in the workflow.
Illustratively, the preset third condition may be a "failure" or an "exception". And when the execution result of the node is 'failure' or 'abnormal', stopping calling the working node in the workflow. At this time, the node execution result may be sent to the client.
In some embodiments, sequentially executing the work nodes in the workflow based on a preset execution policy, and sending the transaction request to the target payment channel through a preset channel gateway may further include: and when an alternative response message returned by the channel gateway is received, performing compensation processing on the working node, wherein the alternative response message is generated by the channel gateway when the target payment channel is determined to be abnormal.
It should be noted that, in the embodiment of the present application, the channel gateway may not only transmit the transaction processing result of the target payment channel to the target work node, but also actively detect whether the target payment channel is abnormal. For example, when the channel gateway does not receive a transaction processing result returned by the target payment channel within a preset time, determining that the target payment channel is abnormal; at this time, the channel gateway may generate an alternative response message and send the alternative response message to the target working node.
The transparent transmission means that the channel gateway is only responsible for transmitting the transaction processing result to be transmitted to the destination node, and meanwhile, the transmission quality is ensured, and the transmitted transaction processing result is not processed.
It can be understood that, in the prior art, when a payment channel determines that a target payment channel is abnormal, the payment channel generally continues to wait until the target payment channel returns an abnormal result which cannot be processed, so that transaction data accumulation occurs, and the risk of avalanche of the payment system is increased. In the embodiment of the application, compensation processing is performed on the working node according to the processable alternative response message returned by the channel gateway, so that when the target payment channel is detected to be abnormal, the compensation processing is quickly executed, accumulation of transaction data is avoided, and the risk of avalanche of the payment system can be reduced.
And step S40, when the workflow execution is finished, sending a node execution result corresponding to the last work node to the client, wherein the node execution result is determined according to the transaction processing result of the target payment channel.
It should be noted that when the result of completing invoking all or some of the work nodes in the workflow satisfies the preset third condition, it may be determined that the workflow execution is finished.
Illustratively, when the workflow execution is finished, the node execution result corresponding to the last work node is sent to the client. For example, when all the work nodes in the workflow are called, the node execution result corresponding to the last work node may be sent to the client; at this time, the node execution result may be "success" to indicate that the transaction is successful. For another example, when the node execution result of the working node a is "failure", the node execution result "failure" may be sent to the client.
By sending the node execution result corresponding to the last working node to the client when the workflow execution is finished, the processing result of the transaction request can be timely fed back to the client because the node execution result corresponding to the last working node reflects the processing result of the transaction request.
In the embodiment of the application, the operator can also perform routing policy adding operation and payment channel access operation on the channel routing system according to actual requirements. The following will describe in detail how to add a routing policy and access a payment channel, respectively.
In some embodiments, when a routing policy configuration operation is detected, determining configuration information and priority corresponding to a newly added routing policy according to the routing policy configuration operation; and adding the configuration information and the priority corresponding to the newly added routing strategy and the newly added routing strategy to a routing strategy list.
It should be noted that, an operator may perform a routing policy configuration operation on the channel routing system according to a service requirement. Illustratively, a routing strategy can be newly added; of course, the routing policies in the routing policy list may also be deleted or modified. For example, the operator may modify configuration information and/or priorities of the routing policies in the routing policy list.
Illustratively, the newly added routing policy may be a traffic routing policy. The configuration information corresponding to the traffic routing policy may be 50%, and is used to indicate that 50% of traffic is routed to the payment channel corresponding to the configuration information.
For example, the priority corresponding to the newly added routing policy may be iii, which means that the newly added routing policy is executed after the routing policy of priority ii.
The configuration information and the priority corresponding to the newly added routing strategy are determined according to the routing strategy configuration operation, and the configuration information and the priority corresponding to the newly added routing strategy are added to the routing strategy list, so that the new routing strategy is conveniently added, the codes of the existing routing strategy are not required to be modified, the influence on the existing routing strategy can be avoided, and the stability of the payment system is improved.
In some embodiments, when a payment channel configuration operation is detected, configuring a newly added workflow corresponding to the newly added payment channel, channel type information and a gateway routing forwarding mapping table according to the payment channel configuration operation; and storing the newly added payment channel and the newly added workflow in a correlation manner, and updating the channel type information and the gateway routing forwarding mapping table to the channel gateway.
It should be noted that, when a new payment channel needs to be accessed to the channel routing system, an operator may configure a new workflow, channel type information, and a gateway routing forwarding mapping table corresponding to the new payment channel. The gateway routing forwarding mapping table may include: the working node calls the mapping relation between the access parameters of the channel gateway and the parameters of the payment channel called by the channel gateway; the channel gateway calls an interface domain name, a uniform resource locator, a request type, an interface authentication encryption mode and the like of the payment channel.
In addition, when the new payment channel is accessed, a firewall in a transmission path between the channel gateway and the new payment channel needs to be opened. The specific wall opening operation is not limited herein. For example, firstly, an architecture change request is initiated by an open-wall initiator, and then, auditing is performed by the associated parties of each system; after the audit is passed, the wall opening initiator can initiate a wall opening application; and then, the security personnel carries out evaluation, after the evaluation is passed, the wall opening personnel carries out firewall strategy issuing, and finally, the operation and maintenance personnel verify whether the firewall strategy passes or not.
For example, if the new payment channel is the payment channel 3, when configuring the new workflow of the payment channel 3, the workflows of other payment channels may be used as the new workflow, for example, the workflow of the payment channel 1 is used as the new workflow of the payment channel 3; then, according to the actual situation, the operations of deleting, adjusting the sequence, adding and the like can be performed on the work nodes in the newly added workflow.
For example, a new payment channel may be stored in association with a new workflow. Therefore, when the target payment channel corresponding to the transaction request is the new payment channel, the workflow corresponding to the new payment channel can be determined based on the preset corresponding relation between the payment channel and the workflow.
For example, the channel type information and gateway route forwarding mapping table may be updated to the channel gateway. Therefore, the channel gateway can realize the calling of the newly added payment channel according to the channel type information and the gateway routing forwarding mapping table.
By storing the newly added payment channel and the newly added workflow in a related manner and updating the channel type information and gateway route forwarding mapping table to the channel gateway, the method can realize convenient and quick access to the new payment channel, improve the access efficiency of the payment channel and reduce the access cost of the payment channel.
In the channel routing-based transaction method provided by the embodiment, when a transaction request of a client is received, a target payment channel corresponding to the transaction request is determined according to a preset routing policy list, so that the transaction request can be matched with a proper target payment channel according to configuration information and priority of a routing policy; by determining the workflow corresponding to the target payment channel, the subsequent workflow can be executed in sequence, and the transaction request is sent to the target payment channel through the preset channel gateway for service processing, so that the problem generated in the service processing process can be quickly and accurately positioned; compensation processing is carried out on the working node according to the processable alternative response message returned by the channel gateway, so that when the abnormity of the target payment channel is detected, the compensation processing is quickly executed, the accumulation of transaction data is avoided, and the risk of the avalanche of the payment system can be reduced; when the workflow execution is finished, the node execution result corresponding to the last working node is sent to the client, and the node execution result corresponding to the last working node reflects the processing result of the transaction request, so that the processing result of the transaction request can be fed back to the client in time; the configuration information and the priority corresponding to the newly added routing strategy are determined according to the routing strategy configuration operation, and the configuration information and the priority corresponding to the newly added routing strategy are added to the routing strategy list, so that the new routing strategy is conveniently added, the codes of the existing routing strategy are not required to be modified, the influence on the existing routing strategy can be avoided, and the stability of the payment system is further improved; by storing the newly added payment channel and the newly added workflow in a related manner and updating the channel type information and gateway route forwarding mapping table to the channel gateway, the method can realize convenient and quick access to the new payment channel, improve the access efficiency of the payment channel and reduce the access cost of the payment channel.
Referring to fig. 6, fig. 6 is a schematic block diagram of a channel routing-based transaction apparatus 1000 according to an embodiment of the present application, which is configured to execute the channel routing-based transaction method. Wherein, the transaction device based on channel routing can be configured in the server.
As shown in fig. 6, the channel routing-based transaction apparatus 1000 includes: a payment channel determination module 1001, a workflow determination module 1002, a work node execution module 1003, and a node execution result transmission module 1004.
The payment channel determining module 1001 is configured to determine, when a transaction request of a client is received, a target payment channel corresponding to the transaction request according to a preset routing policy list.
A workflow determining module 1002, configured to determine a workflow corresponding to the target payment channel, where the workflow includes at least one work node.
And the working node executing module 1003 is configured to sequentially execute the working nodes in the workflow based on a preset executing policy, send the transaction request to the target payment channel through a preset channel gateway, and perform transaction processing on the transaction request through the target payment channel.
A node execution result sending module 1004, configured to send, when the workflow execution is finished, a node execution result corresponding to the last work node to the client, where the node execution result is determined according to a transaction processing result of the target payment channel.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 7.
Referring to fig. 7, fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present disclosure.
Referring to fig. 7, the computer device includes a processor and a memory connected by a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by the processor, causes the processor to perform any of the channel routing based transaction methods.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
when a transaction request of a client is received, determining a target payment channel corresponding to the transaction request according to a preset routing strategy list; determining a workflow corresponding to the target payment channel, wherein the workflow comprises at least one work node; sequentially executing the working nodes in the workflow based on a preset execution strategy, sending the transaction request to the target payment channel through a preset channel gateway, and performing transaction processing on the transaction request by the target payment channel; and when the workflow execution is finished, sending a node execution result corresponding to the last working node to the client, wherein the node execution result is determined according to a transaction processing result of the target payment channel.
In one embodiment, the routing policy list includes at least one routing policy and priority and configuration information corresponding to each routing policy, and the transaction request includes transaction information; the processor is used for realizing that when the target payment channel corresponding to the transaction request is determined according to a preset routing strategy list, the target payment channel is determined as follows:
based on the priority corresponding to each routing strategy in the routing strategy list, sequentially taking the corresponding routing strategies as candidate routing strategies according to the priority sequence; matching the configuration information of the candidate routing strategy with the transaction information; if the matching is successful, determining the candidate routing strategy as a target routing strategy, and determining a payment channel corresponding to the configuration information of the target routing strategy as the target payment channel based on the corresponding relation between preset configuration information and the payment channel; and if the matching fails, determining a preset payment channel as the target payment channel.
In one embodiment, the processor is configured to, before implementing that based on a preset execution policy, sequentially execute the work nodes in the workflow and send the transaction request to the target payment channel through a preset channel gateway, implement:
and determining a target context corresponding to the workflow according to the transaction request and the initial context corresponding to the workflow, wherein the target context comprises transaction task data corresponding to each work node.
In one embodiment, the processor, when implementing that based on a preset execution policy, sequentially executes the work nodes in the workflow and sends the transaction request to the target payment channel through a preset channel gateway, is configured to implement:
taking a first working node of the workflow as a target working node, sending the target context to the target working node, calling the target working node to extract target transaction task data according to the target context, and sending the target transaction task data to the target payment channel through the channel gateway, wherein the target transaction task data are transaction task data corresponding to the target working node; determining a node execution result corresponding to the target working node according to a transaction processing result of the target payment channel; if the node execution result meets a preset first condition, taking the next working node as a new target working node, returning to execute the steps of sending the target context to the target working node, calling the target working node to extract target transaction task data according to the target context, and sending the target transaction task data to the target payment channel through the channel gateway until the last working node in the workflow is called; if the node execution result meets a preset second condition, performing compensation processing on the target working node based on a preset compensation strategy; and if the node execution result meets a preset third condition, stopping calling the working nodes in the workflow.
In one embodiment, the processor, in implementing determining a target context corresponding to the workflow based on the transaction request and the initial context, is configured to implement:
acquiring transaction task data corresponding to each working node from the transaction request according to the operation type corresponding to each working node; and adding the transaction task data corresponding to each working node to the initial context to obtain the target context.
In one embodiment, when the processor implements that the work nodes in the workflow are sequentially executed based on a preset execution policy and the transaction request is sent to the target payment channel through a preset channel gateway, the processor is further configured to implement:
and when an alternative response message returned by the channel gateway is received, performing compensation processing on the working node, wherein the alternative response message is generated by the channel gateway when the target payment channel is determined to be abnormal.
In one embodiment, the processor is further configured to implement:
when the routing strategy configuration operation is detected, determining configuration information and priority corresponding to the newly added routing strategy according to the routing strategy configuration operation; and adding the configuration information and the priority corresponding to the newly added routing strategy and the newly added routing strategy to the routing strategy list.
In one embodiment, the processor is further configured to implement:
when the payment channel configuration operation is detected, configuring a newly added workflow corresponding to a newly added payment channel, channel type information and a gateway routing forwarding mapping table according to the payment channel configuration operation; and storing the newly added payment channel and the newly added workflow in a correlation manner, and updating the channel type information and the gateway routing forwarding mapping table to the channel gateway.
The embodiment of the application also provides a computer readable storage medium, the computer readable storage medium stores a computer program, the computer program comprises program instructions, and the processor executes the program instructions to realize any channel routing-based transaction method provided by the embodiment of the application.
For example, the program is loaded by a processor and may perform the following steps:
when a transaction request of a client is received, determining a target payment channel corresponding to the transaction request according to a preset routing strategy list; determining a workflow corresponding to the target payment channel, wherein the workflow comprises at least one work node; sequentially executing the working nodes in the workflow based on a preset execution strategy, sending the transaction request to the target payment channel through a preset channel gateway, and performing transaction processing on the transaction request by the target payment channel; and when the workflow execution is finished, sending a node execution result corresponding to the last working node to the client, wherein the node execution result is determined according to a transaction processing result of the target payment channel.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital Card (SD Card), a Flash memory Card (Flash Card), and the like provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
1. A channel routing-based transaction method, comprising:
when a transaction request of a client is received, determining a target payment channel corresponding to the transaction request according to a preset routing strategy list;
determining a workflow corresponding to the target payment channel, wherein the workflow comprises at least one work node;
sequentially executing the working nodes in the workflow based on a preset execution strategy, sending the transaction request to the target payment channel through a preset channel gateway, and performing transaction processing on the transaction request by the target payment channel;
and when the workflow execution is finished, sending a node execution result corresponding to the last working node to the client, wherein the node execution result is determined according to a transaction processing result of the target payment channel.
2. The channel routing-based trading method of claim 1, wherein the routing policy list comprises at least one routing policy and priority and configuration information corresponding to each routing policy, and the trading request comprises trading information; the determining a target payment channel corresponding to the transaction request according to a preset routing policy list comprises:
based on the priority corresponding to each routing strategy in the routing strategy list, sequentially taking the corresponding routing strategies as candidate routing strategies according to the priority sequence;
matching the configuration information of the candidate routing strategy with the transaction information;
if the matching is successful, determining the candidate routing strategy as a target routing strategy, and determining a payment channel corresponding to the configuration information of the target routing strategy as the target payment channel based on the corresponding relation between preset configuration information and the payment channel;
and if the matching fails, determining a preset payment channel as the target payment channel.
3. The channel routing-based transaction method according to claim 1, wherein the workflow is executed in turn based on a preset execution policy, and before the transaction request is sent to the target payment channel through a preset channel gateway, further comprising:
determining a target context corresponding to the workflow according to the transaction request and an initial context corresponding to the workflow, wherein the target context comprises transaction task data corresponding to each work node;
based on a preset execution strategy, sequentially executing the working nodes in the workflow, and sending the transaction request to the target payment channel through a preset channel gateway, wherein the method comprises the following steps:
taking a first working node of the workflow as a target working node, sending the target context to the target working node, calling the target working node to extract target transaction task data according to the target context, and sending the target transaction task data to the target payment channel through the channel gateway, wherein the target transaction task data are transaction task data corresponding to the target working node;
determining a node execution result corresponding to the target working node according to a transaction processing result of the target payment channel;
if the node execution result meets a preset first condition, taking the next working node as a new target working node, returning to execute the steps of sending the target context to the target working node, calling the target working node to extract target transaction task data according to the target context, and sending the target transaction task data to the target payment channel through the channel gateway until the last working node in the workflow is called;
if the node execution result meets a preset second condition, performing compensation processing on the target working node based on a preset compensation strategy;
and if the node execution result meets a preset third condition, stopping calling the working nodes in the workflow.
4. The channel routing-based transaction method of claim 3, wherein the determining a target context corresponding to the workflow according to the transaction request and the initial context comprises:
acquiring transaction task data corresponding to each working node from the transaction request according to the operation type corresponding to each working node;
and adding the transaction task data corresponding to each working node to the initial context to obtain the target context.
5. The channel routing-based transaction method of claim 3, wherein the working nodes in the workflow are sequentially executed based on a preset execution policy, and the transaction request is sent to the target payment channel through a preset channel gateway, further comprising:
and when an alternative response message returned by the channel gateway is received, performing compensation processing on the working node, wherein the alternative response message is generated by the channel gateway when the target payment channel is determined to be abnormal.
6. The channel routing-based transaction method of any one of claims 1-5, further comprising:
when the routing strategy configuration operation is detected, determining configuration information and priority corresponding to the newly added routing strategy according to the routing strategy configuration operation;
and adding the configuration information and the priority corresponding to the newly added routing strategy and the newly added routing strategy to the routing strategy list.
7. The channel routing-based transaction method of any of claims 1-5, further comprising:
when the payment channel configuration operation is detected, configuring a newly added workflow corresponding to a newly added payment channel, channel type information and a gateway routing forwarding mapping table according to the payment channel configuration operation;
and storing the newly added payment channel and the newly added workflow in a correlation manner, and updating the channel type information and the gateway routing forwarding mapping table to the channel gateway.
8. A channel routing-based transaction apparatus, comprising:
the payment channel determining module is used for determining a target payment channel corresponding to a transaction request according to a preset routing strategy list when the transaction request of a client is received;
the workflow determining module is used for determining a workflow corresponding to the target payment channel, and the workflow comprises at least one work node;
the working node execution module is used for sequentially executing the working nodes in the workflow based on a preset execution strategy, sending the transaction request to the target payment channel through a preset channel gateway, and carrying out transaction processing on the transaction request by the target payment channel;
and the node execution result sending module is used for sending a node execution result corresponding to the last working node to the client when the workflow execution is finished, wherein the node execution result is determined according to the transaction processing result of the target payment channel.
9. A computer device, wherein the computer device comprises a memory and a processor;
the memory for storing a computer program;
the processor for executing the computer program and when executing the computer program implementing the channel routing based transaction method according to any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the channel routing-based transaction method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111167938.9A CN114092074A (en) | 2021-09-30 | 2021-09-30 | Channel routing-based transaction method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111167938.9A CN114092074A (en) | 2021-09-30 | 2021-09-30 | Channel routing-based transaction method and device, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114092074A true CN114092074A (en) | 2022-02-25 |
Family
ID=80296573
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111167938.9A Pending CN114092074A (en) | 2021-09-30 | 2021-09-30 | Channel routing-based transaction method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114092074A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117675681A (en) * | 2023-12-08 | 2024-03-08 | 广州易云信息技术有限公司 | Multi-channel routing policy management method and device and electronic equipment |
-
2021
- 2021-09-30 CN CN202111167938.9A patent/CN114092074A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117675681A (en) * | 2023-12-08 | 2024-03-08 | 广州易云信息技术有限公司 | Multi-channel routing policy management method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110232565B (en) | Resource clearing method, device, computer equipment and storage medium | |
CN109214818B (en) | Cross-chain transaction method and device | |
US20180113752A1 (en) | Inter-ledger messaging in a blockchain | |
CN110599174B (en) | Block chain information processing method and related equipment | |
CN110569251A (en) | Data processing method, related equipment and computer readable storage medium | |
CN111382164B (en) | Service processing method based on block chain network | |
CN112446786A (en) | Abnormal transaction processing method and device, electronic equipment and readable storage medium | |
CN110533419B (en) | Block chain-based sharing method, device and server of wind control model | |
CN110084600B (en) | Processing and verifying method, device, equipment and medium for resolution transaction request | |
CN113807960A (en) | Cross-link processing method, device and system between heterogeneous chains and electronic equipment | |
CN110602234B (en) | Block chain network node management method, device, equipment and storage medium | |
CN111782456B (en) | Anomaly detection method, device, computer equipment and storage medium | |
CN111260475A (en) | Data processing method, block chain node point equipment and storage medium | |
CN109586946B (en) | Exception handling method and device and computer readable storage medium | |
CN114092074A (en) | Channel routing-based transaction method and device, computer equipment and storage medium | |
CN113781230A (en) | Transaction processing method and device based on block chain | |
US11816714B2 (en) | Service verification method and apparatus | |
CN112506590A (en) | Interface calling method and device and electronic equipment | |
CN111506784B (en) | Asset creditor matching method, device, computer equipment and storage medium | |
CN115098528A (en) | Service processing method and device, electronic equipment and computer readable storage medium | |
CN111866171B (en) | Message processing method, device, electronic equipment and medium | |
JP5636394B2 (en) | Information processing apparatus, information processing method, and program | |
CN114328731A (en) | Information processing method, device, electronic equipment and storage medium | |
US20150006347A1 (en) | Asset inventory system | |
JP2017167842A (en) | Transaction control system and transaction control method |
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 |