Cross-payment Hub transaction processing method, system, device and medium

By converting cross-payment Hub transactions into transactions within multiple payment hubs, forming a transaction chain, locking and transferring transaction funds, it solves the scalability issues of the blockchain system and the complexity of cross-payment hub transaction processing, and improves the efficiency of multi-party payments. Convenience.

CN118586904APending Publication Date: 2024-09-03GUANGDONG UNIVERSITY OF FOREIGN STUDIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410708280.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

The existing blockchain system has poor scalability and cannot effectively handle cross-payment hub transactions, resulting in limited application of blockchain in multi-party payments.

Method used

By converting cross-payment hub transactions into multiple intra-payment hub transactions, a transaction chain is formed, and the relationship between the sender and receiver of each intra-payment hub transaction in the transaction chain is used to lock and transfer transaction funds to ensure that transaction funds are transferred at the same time. It is carried out within a payment hub to realize the processing of cross-payment hub transactions.

Benefits of technology

It improves the convenience of multi-party payment on the blockchain, expands the payment scope of the payment hub, extends from transactions within the same payment hub to transactions between different payment hubs, and solves the problem of blockchain scalability and cross-payment hub transaction processing. complexity issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118586904A
    Figure CN118586904A
Patent Text Reader

Abstract

The invention discloses a method for processing a cross-payment Hub transaction. The method comprises the following steps of: converting the cross-payment Hub transaction of two transaction parties belonging to different payment Hubs into an in-payment Hub transaction of two transaction parties belonging to the same payment Hub; according to the transaction fund sent by the sender to the receiver in the cross-payment Hub transaction, locking the transaction fund in the available fund of the sender in the transaction in each payment Hub, and determining whether the available fund of the sender in the transaction in each payment Hub meets the transaction fund according to the locking result of the transaction fund; if the available funds of the sender in all the payment Hub transactions meet the transaction funds, respectively sending the transaction funds locked in each payment Hub transaction to a corresponding receiver; and if the available fund of the transaction sender in any payment Hub in all the transactions in the payment Hub does not meet the transaction fund, returning the locked transaction fund to the sender in the transaction in the corresponding payment Hub.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of distributed computing technology, and in particular to a method, system, device and medium for processing cross-payment hub transactions. Background Art

[0002] At present, blockchain is developing rapidly and gradually penetrating into various fields of economic development, becoming an important means to promote the development of the digital economy. All sectors of society are unprecedentedly enthusiastic about blockchain technology, as well as digital cryptocurrencies and distributed applications derived from blockchain technology. Blockchain has the characteristics of decentralization, immutability, transparency and openness, which can subvert and improve the centralized systems of many traditional industries. However, the scalability of existing blockchain systems is poor because their consistency protocols involve all nodes, each node needs to verify and store all transactions, and each consensus message needs to be broadcast throughout the blockchain network. Therefore, in order to promote the application of blockchain technology and enable blockchain to become a viable alternative to centralized systems, the scalability problem of blockchain must be solved.

[0003] Payment channels are a promising way to solve the scalability problem of blockchain. The two parties to a transaction open a payment channel through an on-chain transaction and freely conduct off-chain transactions. When a dispute occurs or the channel is closed, they can redeem their legal funds through on-chain transactions. The two-party payment channel can be expanded into a multi-party payment channel (PH-Payment Hub), which in turn supports multi-user transactions. Connecting payment hubs can build a large payment hub network. There are two types of transactions in the payment hub network: transactions within the payment hub and transactions across payment hubs. The former means that the two parties to the transaction are neighbors, and the latter means that the two parties to the transaction belong to different payment hubs. However, current research focuses on the design of a single payment hub, only considering the transaction mechanism within the hub, and does not discuss the processing of cross-hub transactions. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, system, device and medium for processing cross-payment hub transactions, which can realize cross-payment hub transactions.

[0005] To solve the above technical problems, an embodiment of the present application provides a method for processing cross-payment Hub transactions, comprising the following steps:

[0006] Convert the cross-payment hub transaction between two transaction parties in different payment hubs into a payment hub transaction between two transaction parties in the same payment hub; there are multiple transactions within the payment hub, forming a transaction chain, the head and tail of the transaction chain are the sender and receiver of the cross-payment hub transaction respectively, and the receiver of each payment hub transaction is the sender of the next payment hub transaction;

[0007] According to the transaction funds that the sender in the cross-payment hub transaction wants to send to the receiver, the transaction funds are locked in the available funds of the sender in each payment hub transaction, and the locking result of the transaction funds is used to determine whether the available funds of the sender in each payment hub transaction meet the transaction funds;

[0008] If the available funds of the sender in all transactions within the payment hub meet the transaction funds, the transaction funds locked in each transaction within the payment hub will be sent to the corresponding receiver respectively;

[0009] If the available funds of the sender of any payment hub transaction among all payment hub transactions do not meet the transaction funds, the locked transaction funds will be returned to the sender of the corresponding payment hub transaction.

[0010] In some optional embodiments, the processing of the cross-payment hub transaction includes: a pre-submission part, a settlement part, and a submission part;

[0011] In the pre-submission part, according to the transaction funds to be sent by the sender in the cross-payment hub transaction to the receiver, the transaction funds are locked in the available funds of the sender in each payment hub transaction, and whether the pre-submission of each payment hub transaction is successful is determined by the locking result of the transaction funds;

[0012] In the settlement part, the sender and the receiver of all transactions in the payment hub exchange the pre-submission results of their corresponding transactions in the payment hub. If all transactions in the payment hub are pre-submitted successfully, the available funds of the sender in all transactions in the payment hub meet the transaction funds. If any transaction in the payment hub fails to be pre-submitted, it is confirmed that the available funds of the sender of the transaction in the payment hub do not meet the transaction funds.

[0013] In the submission part, if it is confirmed that the available funds of the sender in all payment hub transactions meet the transaction funds, the transaction funds locked in each payment hub transaction will be sent to the corresponding recipient respectively. If it is confirmed that the available funds of the sender of any payment hub transaction among all payment hub transactions do not meet the transaction funds, the locked transaction funds will be returned to the sender in the corresponding payment hub transaction.

[0014] In some optional embodiments, the pre-commitment part includes: a first transaction stage and a first consensus stage;

[0015] In the first transaction stage, the sender, receiver and preset leader in each transaction in the payment hub obtain a transaction sequence number with a three-party signature that characterizes the transaction generated in the payment hub, and the transaction funds are locked in the available funds of the sender in each transaction in the payment hub through the transaction sequence number;

[0016] In the first consensus stage, the fund status of the sender and receiver in each transaction within the payment hub is updated according to the transaction funds locked in the sender's available funds in each transaction within the payment hub.

[0017] In some optional embodiments, in the settlement part, the sender and the receiver of all payment hub transactions send the pre-submission results of their respective corresponding payment hub transactions to the receiver of the cross-payment hub transaction, and the receiver of the cross-payment hub transaction constructs a submission certificate based on the pre-submission results of all payment hub transactions, and sends the submission certificate to the sender and the receiver of each payment hub transaction, so that the sender and the receiver of each payment hub transaction can obtain the pre-submission results of all payment hub transactions.

[0018] In some optional embodiments, the submission portion includes: a second transaction phase and a second consensus phase;

[0019] In the second transaction stage, the receiver in each payment hub transaction sends information indicating that the payment hub transaction is not completed to the sender through the leader. According to the information returned by the sender whether to confirm the completion of the transaction, the transaction funds locked in each payment hub transaction are sent to the corresponding receiver, or the locked transaction funds are returned to the sender in the corresponding payment hub transaction;

[0020] In the second consensus stage, the fund status of the sender and receiver in each transaction within the payment hub is updated based on the transaction funds sent to the receiver in each transaction within the payment hub, or the transaction funds returned to the sender in the transaction within the payment hub.

[0021] In some optional embodiments, the method further includes:

[0022] In the submission part, the transaction funds locked in the available funds of the sender in each transaction within the payment hub and the submission certificate sent by the receiver of the cross-payment hub transaction are verified. If the transaction funds are locked successfully and the submission certificate is valid, the transaction funds locked in each transaction within the payment hub will be sent to the corresponding receiver respectively.

[0023] In some optional embodiments, the method further includes:

[0024] In the submission part, if the transaction funds in any transaction within the payment hub are not locked successfully, or the sender and receiver in any transaction within the payment hub do not obtain the submission certificate sent by the receiver of the cross-payment hub transaction within the preset time, the locked transaction funds will be returned to the sender in the corresponding transaction within the payment hub.

[0025] The embodiment of the present application also provides a system for processing cross-payment hub transactions, including:

[0026] The transaction conversion module is used to convert cross-payment hub transactions between two transaction parties in different payment hubs into transactions within the same payment hub between two transaction parties. There are multiple transactions within the payment hub, forming a transaction chain. The head and tail of the transaction chain are the sender and receiver of the cross-payment hub transaction, respectively. The receiver of each transaction within the payment hub is the sender of the next transaction within the payment hub.

[0027] The transaction detection module is used to lock the transaction funds in the available funds of the sender in each payment hub transaction according to the transaction funds to be sent by the sender to the receiver in the cross-payment hub transaction, and determine whether the available funds of the sender in each payment hub transaction meet the transaction funds through the locking result of the transaction funds;

[0028] The transaction execution module is used to send the locked transaction funds in each payment hub transaction to the corresponding receiver when the available funds of the sender in all payment hub transactions meet the transaction funds; when the available funds of the sender of any payment hub transaction in all payment hub transactions do not meet the transaction funds, the locked transaction funds are returned to the sender in the corresponding payment hub transaction.

[0029] An embodiment of the present application also provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned cross-payment hub transaction processing method.

[0030] An embodiment of the present application also provides a computer-readable storage medium storing a computer program, which implements the above-mentioned method for processing cross-payment Hub transactions when executed by a processor.

[0031] The method for processing cross-payment hub transactions provided in the embodiments of the present application has at least the following beneficial effects:

[0032] In this application, cross-payment hub transactions (transactions between parties belonging to different payment hubs) are converted into transactions within the payment hub (transactions between parties belonging to the same payment hub), and there are multiple transactions within the payment hub, forming a transaction chain, the head and tail of the transaction chain are the sender and receiver of the cross-payment hub transaction, and the receiver of each transaction within the payment hub in the transaction chain is also the sender of the next transaction within the payment hub. For example, A and Z belong to different payment hubs, and the transaction A->Z (cross-payment hub transaction) is converted into A->B->C->Z (multiple payment hub transactions). A and B belong to the same payment hub, B and C also belong to the same payment hub, and C also belongs to the same payment hub as Z. B is both the receiver of the transaction A->B within the payment hub and the sender of the transaction B->C within the payment hub, and so on.

[0033] At this time, the processing of cross-payment Hub transactions is realized by processing these multiple payment Hub transactions separately. First, according to the transaction funds that the sender in the cross-payment Hub transaction wants to send to the receiver, the transaction funds are locked in the available funds of the sender in each payment Hub transaction. The locking result of the transaction funds can be used to determine whether the available funds of the sender in each payment Hub transaction meet the transaction funds. Since the transaction funds can only be traded in the same payment Hub, when the available funds of the senders in all payment Hub transactions meet the transaction funds and each payment Hub transaction in the transaction chain is successful, the transaction funds can be transferred from the sender of the cross-payment Hub transaction to the receiver through the transaction chain, that is, the cross-payment transaction can be successful, and the transaction funds locked in each payment Hub transaction will be sent to the corresponding receiver respectively. If the available funds of the sender of any payment hub transaction in all payment hub transactions do not meet the transaction funds, that is, one payment hub transaction in the transaction chain fails, the transaction funds transfer process in the transaction chain will be interrupted and cannot be transferred from the sender of the cross-payment hub transaction to the receiver. The cross-payment transaction will fail, and the transaction funds locked in each payment hub transaction will be returned to the corresponding sender.

[0034] Based on this, this application implements the processing of cross-payment Hub transactions (which can be successful transactions or failed transactions), expands the payment scope of the payment Hub, and expands from transactions within the same payment Hub to transactions between different payment Hubs, thereby improving the convenience of blockchain multi-party payments. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] One or more embodiments are exemplarily described by the pictures in the corresponding drawings, and these exemplary descriptions do not constitute limitations on the embodiments.

[0036] Figure 1 It is a flowchart of a method for processing cross-payment Hub transactions provided according to an embodiment of the present application;

[0037] Figure 2 This is a schematic diagram of node capital changes provided according to an embodiment of the present application;

[0038] Figure 3 This is a schematic diagram of node information interaction in a cross-payment Hub transaction provided according to an embodiment of the present application. Figure 1 ;

[0039] Figure 4 This is a schematic diagram of node information interaction in a cross-payment Hub transaction provided according to an embodiment of the present application. Figure 2 ;

[0040] Figure 5 is a schematic diagram of a system for processing cross-payment hub transactions provided according to an embodiment of the present application;

[0041] Figure 6 It is a structural diagram of a computer device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not be construed as any limitation, and the various embodiments can be combined and referenced with each other under the premise of no contradiction.

[0043] An embodiment of the present application relates to a method for processing cross-payment Hub transactions. The implementation details of the method for processing cross-payment Hub transactions of this embodiment are specifically described below. The following content is only the implementation details provided for easy understanding and is not necessary for implementing this solution.

[0044] The specific process of the cross-payment Hub transaction processing method of this embodiment can be as follows: Figure 1 As shown, including:

[0045] Step 101, converting the cross-payment hub transaction between two transaction parties in different payment hubs into an intra-payment hub transaction between two transaction parties in the same payment hub; wherein there are multiple intra-payment hub transactions, forming a transaction chain, the head and the tail of the transaction chain are respectively the sender and the receiver of the cross-payment hub transaction, and the receiver of each intra-payment hub transaction is the sender of the next intra-payment hub transaction.

[0046] Specifically, the funds of each node in the transaction within the payment hub are uniformly managed by the smart contract of the payment hub. The transfer of funds of the node during the transaction requires the consensus of the members within the payment hub, and the cross-hub transaction processing is relatively complicated, because the funds of the nodes belonging to different payment hubs are managed by different smart contracts. The transfer of funds requires not only the consent of the members within the payment hub, but also the consent of the nodes in other payment hubs participating in the transaction. Therefore, a cross-payment hub transaction can be regarded as multiple transactions within the payment hub. This embodiment converts the cross-payment hub transaction of two transaction parties (including the sender and the receiver) in different payment hubs into multiple transactions within the payment hub of two transaction parties (including the sender and the receiver) in the same payment hub. These multiple transactions within the payment hub form a transaction chain. The head and tail of the transaction chain are the sender and receiver of the cross-payment hub transaction respectively. The receiver of each transaction within the payment hub is the sender of the next transaction within the payment hub. For example, node A and node Z belong to different payment hubs. If node A and node Z want to trade with each other, the transaction between node A and node Z, that is, the cross-payment hub transaction A->Z is converted to A->B->C->Z. Among them, if node A and node B belong to the same payment hub, then A->B is a payment hub transaction; if node B and node C belong to the same payment hub, then B->C is a payment hub transaction; if node C and node Z belong to the same payment hub, then C->Z is a payment hub transaction. In this way, the cross-payment hub transaction between two transaction parties in different payment hubs - node A and node Z - is converted into multiple payment hub transactions in the same payment hub, namely, the payment hub transaction between node A and node B, the payment hub transaction between node B and node C, and the payment hub transaction between node C and node Z. The head and tail of the transaction chain A->B->C->Z formed by these transactions within the payment hub are the sender of the cross-payment hub transaction - node A and the receiver - node Z. The receiver of each transaction within the payment hub is the sender of the next transaction within the payment hub, that is, node B is both the receiver of the transaction A->B within the payment hub and the sender of the transaction B->C within the payment hub, and node C is both the receiver of the transaction B->C within the payment hub and the sender of the transaction C->Z within the payment hub. Therefore, the transaction between node A and node Z can be realized through the transaction chain A->B->C->Z.

[0047] Step 102, according to the transaction funds that the sender in the cross-payment hub transaction wants to send to the receiver, the transaction funds are locked in the available funds of the sender in each transaction within the payment hub, and the locking result of the transaction funds is used to determine whether the available funds of the sender in each transaction within the payment hub meet the transaction funds.

[0048] Specifically, for the transaction A->B within the payment hub, according to the transaction funds that node A wants to send to node Z, the available funds in node A of A->B are locked. If the locking is successful, it means that the available funds of node A meet the transaction funds. If the locking fails, it means that the available funds of node A do not meet the transaction funds. The processing methods for other transactions B->C and C->Z within the payment hub are similar and will not be repeated here.

[0049] Step 103: If the available funds of the sender in all payment hub transactions satisfy the transaction funds, the locked transaction funds in each payment hub transaction are sent to the corresponding recipient respectively; if the available funds of the sender of any payment hub transaction in all payment hub transactions do not satisfy the transaction funds, the locked transaction funds are returned to the sender in the corresponding payment hub transaction.

[0050] Specifically, if the available funds of the sender in all transactions within the payment hub meet the transaction funds, the transaction funds locked in node A will be sent to node B, the transaction funds locked in node B will be sent to node C, and the transaction funds locked in node C will be sent to node Z, and the transaction funds will be transferred from node A to node Z through node B and node C, thereby realizing the cross-payment hub transaction between node A and node Z. If the available funds of the sender of any transaction within the payment hub among all transactions within the payment hub do not meet the transaction funds, for example, the transaction funds of transactions A->B and C->Z within the payment hub are locked successfully, but the transaction funds of node B in the transaction B->C within the payment hub do not meet the available funds of node B, and the transaction funds lock fails. At this time, the transaction funds cannot be sent to node C through node B, and the transaction chain has been disconnected. Then, the transaction funds of node A locked in the transaction A->B within the payment hub will be returned to node A, and the transaction funds of node C locked in the transaction C->Z within the payment hub will be returned to node C.

[0051] In this embodiment, cross-payment Hub transactions (transactions between transaction parties belonging to different payment Hubs) are converted into transactions within the payment Hub (transactions between transaction parties belonging to the same payment Hub), and there are multiple transactions within the payment Hub, forming a transaction chain. The processing of cross-payment Hub transactions is achieved by processing these multiple transactions within the payment Hub separately. First, according to the transaction funds to be sent by the sender in the cross-payment Hub transaction to the receiver, the transaction funds are locked in the available funds of the sender in each transaction within the payment Hub. The locking result of the transaction funds can be used to determine whether the available funds of the sender in each transaction within the payment Hub meet the transaction funds. Since the transaction funds can only be traded within the same payment Hub, when the available funds of the senders in all transactions within the payment Hub meet the transaction funds and each transaction within the payment Hub in the transaction chain is successful, the transaction funds can be transferred from the sender of the cross-payment Hub transaction to the receiver through the transaction chain, that is, the cross-payment transaction can be successful. Then, the transaction funds locked in each transaction within the payment Hub are sent to the corresponding receiver respectively. If the available funds of the sender of any payment hub transaction in all payment hub transactions do not meet the transaction funds, that is, a payment hub transaction in the transaction chain fails, the transaction funds transfer process in the transaction chain will be interrupted, and it cannot be transferred from the sender of the cross-payment hub transaction to the receiver. The cross-payment transaction will fail, and the transaction funds locked in each payment hub transaction will be returned to the corresponding sender. Based on this, the processing of cross-payment hub transactions (which can be successful transactions or failed transactions) is realized in this embodiment, and the payment scope of the payment hub is expanded from transactions within the same payment hub to transactions between different payment hubs, thereby improving the convenience of blockchain multi-party payments.

[0052] In some embodiments, the processing process of the cross-payment Hub transaction described in the present application includes: a pre-submission part, a settlement part, and a submission part. In the pre-submission part, according to the transaction funds that the sender in the cross-payment Hub transaction wants to send to the receiver, the transaction funds are locked in the available funds of the sender in each payment Hub transaction, and the locking result of the transaction funds is used to determine whether each payment Hub transaction is pre-submitted successfully. In the settlement part, the sender and the receiver in all payment Hub transactions exchange the pre-submission results of their corresponding payment Hub transactions. If all payment Hub transactions are pre-submitted successfully, then the available funds of the sender in all payment Hub transactions meet the transaction funds. If the pre-submission of any payment Hub transaction in all payment Hub transactions fails, it is confirmed that the available funds of the sender of the payment Hub transaction do not meet the transaction funds. In the submission part, if it is confirmed that the available funds of the sender in all payment hub transactions meet the transaction funds, the locked transaction funds in each payment hub transaction will be sent to the corresponding receiver respectively. If it is confirmed that the available funds of the sender of any payment hub transaction in all payment hub transactions do not meet the transaction funds, the locked transaction funds will be returned to the sender in the corresponding payment hub transaction. It can be seen that for cross-payment hub transactions, a two-submission mechanism (pre-submission and submission) is used to ensure atomicity. Atomicity means that the fund status of all nodes in the transaction chain is updated, or the fund status of no node is updated.

[0053] Among them, the first of the two submission mechanisms is a pre-submission about locking transaction funds, and the second is a submission to confirm the arrival of transaction funds. The pre-submission part includes: the first transaction stage and the first consensus stage. In the first transaction stage, the sender, receiver and preset leader in each payment hub transaction obtain a transaction sequence number with a three-party signature to represent the transaction generated in the payment hub, and the transaction sequence number is used to lock the transaction funds in the available funds of the sender in each payment hub transaction; in the first consensus stage, according to the transaction funds locked in the available funds of the sender in each payment hub transaction, the fund status of the sender and receiver in each payment hub transaction is updated. Once the consensus is reached, the pre-submission part ends. The submission part includes: the second transaction stage and the second consensus stage. In the second transaction stage, the receiver in each payment hub transaction sends information to the sender through the leader to indicate that the payment hub transaction is not completed. According to the information returned by the sender to confirm whether the transaction is completed, the transaction funds locked in each payment hub transaction are sent to the corresponding receiver, or the locked transaction funds are returned to the sender in the corresponding payment hub transaction; in the second consensus stage, the fund status of the sender and receiver in each payment hub transaction is updated according to the transaction funds sent to the receiver in each payment hub transaction, or the transaction funds returned to the sender in the payment hub transaction.

[0054] As for the settlement part, the sender and receiver of all transactions within the payment hub will send the pre-submission results of their corresponding transactions within the payment hub to the receiver of the cross-payment hub transaction. The receiver of the cross-payment hub transaction will construct a submission certificate based on the pre-submission results of all transactions within the payment hub, and send the submission certificate to the sender and receiver of each transaction within the payment hub, so that the sender and receiver of each transaction within the payment hub can obtain the pre-submission results of all transactions within the payment hub.

[0055] In one example, in the submission part, the transaction funds locked in the available funds of the sender in each payment hub transaction and the submission voucher sent by the receiver of the cross-payment hub transaction are verified. If the transaction funds are successfully locked and the submission voucher is valid, the transaction funds locked in each payment hub transaction are sent to the corresponding receiver. If the transaction funds in any payment hub transaction are not successfully locked, or the sender and receiver in any payment hub transaction do not obtain the submission voucher sent by the receiver of the cross-payment hub transaction within the preset time, the locked transaction funds will be returned to the sender in the corresponding payment hub transaction.

[0056] That is, the transaction participants verify the validity of the submission certificate received, and decide whether to submit the transaction based on the success or failure of each payment hub to lock the funds. If the certificate shows that the senders of all sub-transactions have successfully locked the funds, the locked funds are released and transferred to the recipient's account. If the sender of a sub-transaction fails to successfully lock the funds or the submission certificate is not received within the timeout period, the locked funds will be returned to the sender's account. For malicious nodes, the consistency of funds in the smart contract address corresponding to the payment hub before and after the transaction is limited. After the payment is completed, the node funds are as follows: Figure 2 shown.

[0057] The following is a specific example of how to process the cross-payment Hub transaction:

[0058] Assume that the sender of a cross-payment hub transaction is I, the receiver is T, the transfer amount is x, and the sending path (i.e., transaction chain) is (I, Pi, Pj, T). A cross-payment hub transaction can be converted into multiple transactions within a payment hub, and the processing of a transaction within a payment hub also includes: pre-submission part, settlement part, and submission part. Among them, the pre-submission part occurs in one epoch, the settlement part can be regarded as information interaction between payment hubs, and the submission part occurs in another epoch. An epoch includes three stages: leader selection stage, transaction stage, and consensus stage. The leader is a node other than the sender and receiver in a payment hub. In the following description, we only focus on the transaction stage and consensus stage, assuming that the leader has been selected at the beginning of the epoch.

[0059] First, define the fund status of different nodes in the process of cross-payment Hub transactions, as shown in Table 1, where direct transactions represent general transactions within the payment Hub, and indirect transactions represent transactions within the payment Hub converted from cross-payment Hub transactions:

[0060] Table 1

[0061] symbol meaning <![CDATA[IAB i ]]> Pi's available funds at the start of the epoch <![CDATA[IUB i ]]> Pi's unavailable funds at the start of epoch <![CDATA[IUS i ]]> Funds sent in Pi in uncommitted indirect transactions at the start of the epoch <![CDATA[TS i ]]> Funds Pi tried to send <![CDATA[VS i ]]> Funds sent by Pi in valid transactions <![CDATA[VIS i ]]> Funds sent by Pi in a valid indirect transaction <![CDATA[PRD i ]]> Pre-commitment part, funds received by Pi from direct transactions <![CDATA[PRI i ]]> Pre-commitment part, funds received by Pi from indirect transactions <![CDATA[UTA i ]]> Submitted part, unavailable funds pre-used by Pi <![CDATA[CSI i ]]> Submit section, Pi funds sent from indirect transactions <![CDATA[CRI i ]]> Submit part, funds received by Pi from indirect transactions <![CDATA[RFR i ]]> Funds returned by the recipient received by Pi <![CDATA[RTS i ]]> Pi wants to return the sender's funds

[0062] Pre-submission section:

[0063] Taking a payment hub transaction, i.e. an indirect transaction (sender Pi, receiver Pj) as an example, the processing flow of pre-submitting part of the cross-hub transaction is introduced.

[0064] In the transaction phase, if the sender Pi wants to initiate a transaction, it must first request a transaction id from the leader Pl. In addition, the leader needs to store funds variables in different states for each user in order to verify and submit transactions. Table 1 gives the balance information saved by the leader for the user.

[0065] (1) Pi sends a message to the leader<txidreq>To request Txid.

[0066] (2) When the leader receives the message from the sender requesting the transaction ID (Txid) <txidreq>, will check the validity of the message, including the validity of the signature and whether there is a risk of double spending. To avoid the risk of double spending, the protocol requires that the total amount of funds that the sender attempts to send in this epoch cannot be higher than its initial available funds. The leader guarantees the following inequality to avoid the risk of double spending:

[0067] x≤IABi-TSi

[0068] If there is no risk of double spending, the leader supports Pi to transfer x coins to Pj, and replies to Pi with a transaction id (Txid), attaches his own signature, and then updates the local attempted transfer funds TSi of Pi, TSi = TSi + x.

[0069] (3) After receiving Txid, Pi sends <txidreq>Message to Pj to seek his opinion on this transaction.

[0070] (4) Once Pj receives the transaction request from Pi, it will verify the Txid from the leader. If the Txid is valid, it will sign the transaction and reply to Pi.

[0071] (5) Once Pi receives the full transaction signed by three parties from Pj, it immediately sends the full transaction <tx>Leader. At this point, sender Pi, receiver Pj, and leader Pl all have a complete version of the transaction. During the transaction phase, Pi can use all available balances as he wishes.

[0072] In the consensus phase, consensus is reached on the results of valid transactions processed in this epoch. <tx>, will cause changes in the available balance AB of the sender Pi and the sent funds US in the uncommitted indirect transaction, and will also cause changes in the unavailable funds UB of the receiver Pj, while general direct transactions will only cause changes in the available balance AB of the sender and the receiver. The leader calculates the balance of each member and the Merkle tree root of the member's transactions, builds the epoch end state, and coordinates the members in the Hub to reach a consensus on the state. The corresponding epoch will produce a consensus result, which is called the pre-commit result for cross-Hub transactions.

[0073] Settlement part:

[0074] The cross-payment Hub transaction with a transaction chain of (I, Pi, Pj, T) contains three indirect transactions. Taking the participant Pi as an example, it involves two indirect transactions in the corresponding cross-payment Hub transaction, one as the receiver role and the other as the sender role. Here, Pi is used as an example to illustrate what the intermediate node needs to do after the pre-submission part.

[0075] like Figure 3 As shown, after the pre-submission part, the participant needs to promptly inform the receiver T of the cross-payment Hub transaction whether the pre-submission result is successful or failed. Pi sends a message <precommit>Similarly, senders I and Pj of cross-payment Hub transactions also construct their <precommit>message and sends it to T. After receiving the indirect transaction pre-submission result sent by the participant, T uses it to construct the submission certificate <commitcert>, and then sent to the previous hop on the transaction chain. <commitcert>After the message is sent, participants will determine whether the cross-payment Hub transaction can be successfully submitted based on the message content (i.e., the pre-submission results sent by each participant). The judgment is based on the following:

[0076] (1) Participants can <commitcert>The message restores a path from I to T transaction.

[0077] (2) All indirect transactions belonging to the same cross-payment hub transaction are pre-submitted successfully.

[0078] If the judgment is passed, it means that the indirect transaction can be submitted. Finally, if the submission certificate is valid, the participant sends a signature with his own signature. <commitcert>The message is sent to the previous hop. The operations of other participants in the settlement phase are similar to the above process and will not be repeated.

[0079] Submission section:

[0080] In the submission part, the protocol still processes indirect transactions in the transaction phase and the consensus phase. Before completing the indirect transaction, the sender and receiver of the transaction will retain the complete version of the transaction, that is, the transaction version after the pre-submission phase. After the settlement part, the participants will settle the transaction according to the <commitcert>The message determines whether a transfer or refund is completed for an indirect transaction.

[0081] During the transaction phase, Figure 4 As shown, Pj is based on the received <commitcert>, send the full transaction <ctxreq>To the leader, when the leader receives <ctxreq>When sending a message, it is necessary to ensure that the current unavailable funds amount of Pj cannot be less than x. The leader updates UTAj=UTAj+x and notifies the sender Pi of the message. When participant Pi receives the transaction, the participant will verify <ctxreq>Validity of the message. If the transaction is valid, the sender and receiver agree on the next processing of the indirect transaction. Pi replies with his signature to the leader. Once the reply with Pi's signature is received, the leader notifies Pj. The leader receives a valid transaction and updates the participant's fund status based on whether the transaction completes the transfer or refunds.

[0082] (1) Indirect transaction submission, the leader updates the participant's fund status:

[0083] For Pj, update the variable CRIj, that is, the transfer received by Pj from the indirect transaction in the submission part, that is, CRIj=CRIj+x.

[0084] For Pi, update CSIi, that is, in the submission part, the funds sent by Pi in the indirect transaction, that is, CSIi=CSIi+x.

[0085] (2) Indirect transaction refund: the leader updates the participants’ financial status:

[0086] For Pj, update RTSj, that is, in the submission part, Pj will return the funds to the sender, RTSj=RTSj+x.

[0087] For Pi, update RFRi, that is, the refund received by Pi in the submission part, RFRi = RFRi + x.

[0088] In the consensus phase, indirect transactions complete the transfer or refund in the consensus phase of the submission part, and the results of the transaction will be reflected in the end state of the epoch. In fact, the consensus phase is to reach a consensus on the transactions processed in the entire epoch, which requires the cooperation of all members in the payment hub. The result state of the transaction executed in the epoch is represented as state(e).

[0089] State(e)=(e, AB(e), T(e), UB(e), e(e))

[0090] State(e) contains the balance information of all participants in the epoch and the corresponding transaction Merkle tree root. AB(e) and UB(e) are the sets of the current available balance and unavailable balance of the participants, respectively. Available balance is the funds confirmed to belong to the participant and can be used in the next transaction. Unavailable balance refers to funds that have not yet been confirmed and cannot be used in the next epoch. When calculating the node balance, the AB(e) of the sender in a direct transaction will decrease, and the AB(e) of the corresponding receiver will increase. For an indirect transaction, the AB(e) value of the sender decreases and the UB(e) value of the receiver increases. In addition, US(e) records the amount of funds sent by each participant in the indirect transaction that has not yet been submitted. The following takes Pi as an example to illustrate how to calculate the balance of the node based on the variables updated in the transaction stage.

[0091] ABi=IABi-VSi+PRDi+CRIi+RFRi

[0092] UBi=IUBi+PRIi-CRIi-RTSi

[0093] USi=IUSi+VSIi-CSIi-RFRi

[0094] In addition to calculating the balance status of members in the payment hub at the end of the epoch, the leader will also calculate the Merkle root Ti of each member's transaction. The leader first sorts the transactions by epoch id as the primary keyword, then sorts by transaction id as the secondary keyword, and finally uses the hash values ​​of all transactions related to the node as leaf nodes in order to calculate the Merkle root.

[0095] ∑AB(e)+UB(e)=CAB

[0096] ∑US(e)=∑UB(e)

[0097] The consensus phase is initiated by the leader, who calculates the state State(e) at the end of this epoch, collects the signatures of the participants on the end state, and finally broadcasts the state confirmation to all members in the payment hub. When Pi receives the state State(e) sent by the leader, it verifies whether the balance state and Merkle tree root calculated locally are consistent with those calculated by the leader. In addition, the user needs to verify whether the equations ∑AB(e)+UB(e)=CAB and ∑US(e)=∑UB(e) hold. The equation ∑AB(e)+UB(e)=CAB ensures that the sum of the available balance and the unavailable balance of all members in the end state of the epoch should be equal to the total amount of funds in the smart contract address ("CAB" represents the total amount of funds in the smart contract address). The balance of the contract address account is public on the chain and is known to any node, so this formula ensures that the coins in the contract address will not be generated or disappeared. For indirect transactions that have not yet been submitted, the amount of funds involved in these transactions should be equal to the sum of the unavailable funds of all members. The equation ∑US(e)=∑UB(e) is used to meet this guarantee. After State(e) is verified, Pi replies with its signature to the leader. Once the leader collects the signatures of all members, it will construct a state confirmation message containing state(e) and the signatures of all members and broadcast it to the members in the payment hub to complete the consensus phase. After the consensus phase, each member correctly records the balance changes of other members, which means that the transaction processing is completed.

[0098] The step division of the above methods is only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0099] Another embodiment of the present application relates to a processing system for cross-payment Hub transactions. The implementation details of the processing system for cross-payment Hub transactions of this embodiment are specifically described below. The following content is only for the convenience of understanding the implementation details provided, and is not necessary for the implementation of this solution. The schematic diagram of the processing system for cross-payment Hub transactions of this embodiment can be as follows Figure 5 As shown, it includes: a transaction conversion module 501, a transaction detection module 502 and a transaction execution module 503.

[0100] Specifically, the transaction conversion module 501 is used to convert a cross-payment hub transaction between two transaction parties in different payment hubs into an intra-payment hub transaction between two transaction parties in the same payment hub; wherein there are multiple intra-payment hub transactions, forming a transaction chain, the head and the tail of the transaction chain are respectively the sender and the receiver of the cross-payment hub transaction, and the receiver of each intra-payment hub transaction is the sender of the next intra-payment hub transaction.

[0101] The transaction detection module 502 is used to lock the transaction funds in the available funds of the sender in each transaction within the payment hub according to the transaction funds to be sent by the sender in the cross-payment hub transaction to the receiver, and determine whether the available funds of the sender in each transaction within the payment hub meet the transaction funds through the locking result of the transaction funds.

[0102] The transaction execution module 503 is used to send the locked transaction funds in each payment hub transaction to the corresponding recipient when the available funds of the sender in all payment hub transactions meet the transaction funds; when the available funds of the sender of any payment hub transaction among all payment hub transactions do not meet the transaction funds, send the locked transaction funds to the sender in the corresponding payment hub transaction.

[0103] It is not difficult to find that this embodiment is a system embodiment corresponding to the above method embodiment, and this embodiment can be implemented in conjunction with the above method embodiment. The relevant technical details and technical effects mentioned in the above embodiment are still valid in this embodiment, and in order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.

[0104] It is worth mentioning that all modules involved in this embodiment are logic modules. In practical applications, a logic unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of this application, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by this application, but this does not mean that there are no other units in this embodiment.

[0105] Another embodiment of the present application relates to a computer device, such as Figure 6 As shown, it includes: at least one processor 601; and a memory 602 that is communicatively connected to the at least one processor 601; wherein the memory 602 stores instructions that can be executed by the at least one processor 601, and the instructions are executed by the at least one processor 601 so that the at least one processor 601 can execute the processing method of the cross-payment Hub transaction in the above-mentioned embodiments.

[0106] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0107] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0108] Another embodiment of the present application relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.

[0109] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as: ROM), random access memory (Random Access Memory, referred to as: RAM), disk or optical disk and other media that can store program codes.

[0110] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present application.< / ctxreq> < / ctxreq> < / ctxreq> < / commitcert> < / commitcert> < / commitcert> < / commitcert> < / commitcert> < / commitcert> < / precommit> < / precommit> < / tx> < / tx> < / txidreq> < / txidreq> < / txidreq>

Claims

1. A method for processing cross-payment Hub transactions, characterized in that: The method comprises: Convert the cross-payment hub transaction between two transaction parties in different payment hubs into a payment hub transaction between two transaction parties in the same payment hub; there are multiple transactions within the payment hub, forming a transaction chain, the head and tail of the transaction chain are the sender and receiver of the cross-payment hub transaction respectively, and the receiver of each payment hub transaction is the sender of the next payment hub transaction; According to the transaction funds that the sender in the cross-payment hub transaction wants to send to the receiver, the transaction funds are locked in the available funds of the sender in each payment hub transaction, and the locking result of the transaction funds is used to determine whether the available funds of the sender in each payment hub transaction meet the transaction funds; If the available funds of the sender in all transactions within the payment hub meet the transaction funds, the transaction funds locked in each transaction within the payment hub will be sent to the corresponding receiver respectively; If the available funds of the sender of any payment hub transaction among all payment hub transactions do not meet the transaction funds, the locked transaction funds will be returned to the sender of the corresponding payment hub transaction.

2. The method for processing cross-payment Hub transactions according to claim 1, characterized in that: The processing process of the cross-payment Hub transaction includes: a pre-submission part, a settlement part, and a submission part; In the pre-submission part, according to the transaction funds to be sent by the sender in the cross-payment hub transaction to the receiver, the transaction funds are locked in the available funds of the sender in each payment hub transaction, and whether the pre-submission of each payment hub transaction is successful is determined by the locking result of the transaction funds; In the settlement part, the sender and the receiver of all transactions in the payment hub exchange the pre-submission results of their corresponding transactions in the payment hub. If all transactions in the payment hub are pre-submitted successfully, the available funds of the sender in all transactions in the payment hub meet the transaction funds. If any transaction in the payment hub fails to be pre-submitted, it is confirmed that the available funds of the sender of the transaction in the payment hub do not meet the transaction funds. In the submission part, if it is confirmed that the available funds of the sender in all payment hub transactions meet the transaction funds, the transaction funds locked in each payment hub transaction will be sent to the corresponding recipient respectively. If it is confirmed that the available funds of the sender of any payment hub transaction among all payment hub transactions do not meet the transaction funds, the locked transaction funds will be returned to the sender in the corresponding payment hub transaction.

3. The method for processing cross-payment Hub transactions according to claim 2, characterized in that: The pre-submission part includes: a first transaction stage and a first consensus stage; In the first transaction stage, the sender, receiver and preset leader in each transaction in the payment hub obtain a transaction sequence number with a three-party signature that characterizes the transaction generated in the payment hub, and the transaction funds are locked in the available funds of the sender in each transaction in the payment hub through the transaction sequence number; In the first consensus stage, the fund status of the sender and receiver in each transaction within the payment hub is updated according to the transaction funds locked in the sender's available funds in each transaction within the payment hub.

4. The method for processing cross-payment Hub transactions according to claim 2, characterized in that: In the settlement part, the sender and receiver of all payment hub transactions send the pre-submission results of their corresponding payment hub transactions to the receiver of the cross-payment hub transaction. The receiver of the cross-payment hub transaction constructs a submission certificate based on the pre-submission results of all payment hub transactions, and sends the submission certificate to the sender and receiver of each payment hub transaction, so that the sender and receiver of each payment hub transaction can obtain the pre-submission results of all payment hub transactions.

5. The method for processing cross-payment Hub transactions according to claim 2, characterized in that: The submission part includes: a second transaction phase and a second consensus phase; In the second transaction stage, the receiver in each payment hub transaction sends information indicating that the payment hub transaction is not completed to the sender through the leader. According to the information returned by the sender whether to confirm the completion of the transaction, the transaction funds locked in each payment hub transaction are sent to the corresponding receiver, or the locked transaction funds are returned to the sender in the corresponding payment hub transaction; In the second consensus stage, the fund status of the sender and receiver in each transaction within the payment hub is updated based on the transaction funds sent to the receiver in each transaction within the payment hub, or the transaction funds returned to the sender in the transaction within the payment hub.

6. The method for processing cross-payment Hub transactions according to claim 4, characterized in that: The method further comprises: In the submission part, the transaction funds locked in the available funds of the sender in each transaction within the payment hub and the submission certificate sent by the receiver of the cross-payment hub transaction are verified. If the transaction funds are locked successfully and the submission certificate is valid, the transaction funds locked in each transaction within the payment hub will be sent to the corresponding receiver respectively.

7. The method for processing cross-payment Hub transactions according to claim 6, characterized in that: The method further comprises: In the submission part, if the transaction funds in any transaction within the payment hub are not locked successfully, or the sender and receiver in any transaction within the payment hub do not obtain the submission certificate sent by the receiver of the cross-payment hub transaction within the preset time, the locked transaction funds will be returned to the sender in the corresponding transaction within the payment hub.

8. A system for processing transactions across payment hubs, characterized in that: The system comprises: The transaction conversion module is used to convert a cross-payment hub transaction between two transaction parties in different payment hubs into a payment hub transaction between two transaction parties in the same payment hub; wherein there are multiple transactions within the payment hub, forming a transaction chain, the head and tail of the transaction chain are the sender and receiver of the cross-payment hub transaction respectively, and the receiver of each payment hub transaction is the sender of the next payment hub transaction; The transaction detection module is used to lock the transaction funds in the available funds of the sender in each payment hub transaction according to the transaction funds to be sent by the sender to the receiver in the cross-payment hub transaction, and determine whether the available funds of the sender in each payment hub transaction meet the transaction funds through the locking result of the transaction funds; The transaction execution module is used to send the locked transaction funds in each payment hub transaction to the corresponding receiver when the available funds of the sender in all payment hub transactions meet the transaction funds; when the available funds of the sender of any payment hub transaction in all payment hub transactions do not meet the transaction funds, the locked transaction funds are returned to the sender in the corresponding payment hub transaction.

9. A computer device, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the processing method for cross-payment Hub transactions as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for processing cross-payment Hub transactions as described in any one of claims 1 to 7 is implemented.